diff options
author | Jan Mercl <0xjnml@gmail.com> | 2017-07-08 17:10:53 +0200 |
---|---|---|
committer | Jan Mercl <0xjnml@gmail.com> | 2017-07-08 17:10:53 +0200 |
commit | 4becaacb9775939bdb8891d8c00e30d22b2ff447 (patch) | |
tree | f40dd34845a5d2486ea0ecd060f306e6d615ad60 | |
parent | a46bafc8c8bdbf52b6880b4183651971650d0881 (diff) |
Regenerate Linux/amd64 using latest CCGO.
modified: generator.go
modified: internal/bin/bin_linux_amd64.go
modified: internal/mptest/mptest_linux_amd64.go
modified: internal/threadtest1/threadtest1_linux_amd64.go
modified: internal/threadtest2/threadtest2_linux_amd64.go
modified: internal/threadtest3/threadtest3_linux_amd64.go
modified: internal/threadtest4/threadtest4_linux_amd64.go
-rw-r--r-- | generator.go | 44 | ||||
-rw-r--r-- | internal/bin/bin_linux_amd64.go | 55628 | ||||
-rw-r--r-- | internal/mptest/mptest_linux_amd64.go | 743 | ||||
-rw-r--r-- | internal/threadtest1/threadtest1_linux_amd64.go | 159 | ||||
-rw-r--r-- | internal/threadtest2/threadtest2_linux_amd64.go | 58 | ||||
-rw-r--r-- | internal/threadtest3/threadtest3_linux_amd64.go | 3183 | ||||
-rw-r--r-- | internal/threadtest4/threadtest4_linux_amd64.go | 253 |
7 files changed, 32885 insertions, 27183 deletions
diff --git a/generator.go b/generator.go index e699f47..7401cee 100644 --- a/generator.go +++ b/generator.go @@ -56,8 +56,9 @@ const ( %s */ +// Package sqlite is an in-process implementation of a self-contained, +// serverless, zero-configuration, transactional SQL database engine. (Work In Progress) %s - package bin import ( @@ -82,8 +83,8 @@ func Xsqlite3PendingByte() int32 { return _sqlite3PendingByte } prologueTest = `// Code generated by ccgo. DO NOT EDIT. +// %s %s - package main import ( @@ -356,7 +357,6 @@ func header(f string) []byte { var s scanner.Scanner s.Init(token.NewFileSet().AddFile(f, -1, len(b)), b, nil, scanner.ScanComments) var buf buffer.Bytes - fmt.Fprintf(&buf, "/* %s */", filepath.Base(f)) for { _, tok, lit := s.Scan() switch tok { @@ -370,24 +370,18 @@ func header(f string) []byte { } func tidyComment(s string) string { - if strings.HasPrefix(s, "/*") { - s = s[len("/*") : len(s)-len("*/")] - } - a := strings.Split(strings.TrimSpace(s), "\n") - for i, v := range a { - if strings.HasPrefix(v, "** ") { - a[i] = a[i][len("** "):] - continue + switch { + case strings.HasPrefix(s, "/*"): + a := strings.Split("/"+s[1:len(s)-1], "\n") + for i, v := range a { + a[i] = "// " + v } - - if v == "**" { - a[i] = "" - } - } - for i, v := range a { - a[i] = strings.TrimSpace(v) + return strings.Join(a, "\n") + "/\n" + case strings.HasPrefix(s, "//"): + return "// " + s[2:] + "\n" + default: + panic("internal error") } - return "// " + strings.Join(a, "\n// ") + "\n" } func tidyComments(b []byte) string { @@ -430,7 +424,7 @@ func sqlite() { log.Fatal(err) } - fmt.Fprintf(&b, prologueSqlite, lic, tidyComments(header(sqlite3))) + fmt.Fprintf(&b, prologueSqlite, lic, strings.TrimSpace(tidyComments(header(sqlite3)))) macros(&b, asta[0]) b.Write(src) b2, err := format.Source(b.Bytes()) @@ -472,7 +466,7 @@ func mpTest() { ) var b bytes.Buffer - fmt.Fprintf(&b, prologueTest, tidyComments(header(test))) + fmt.Fprintf(&b, prologueTest, tag, strings.TrimSpace(tidyComments(header(test)))) b.Write(src) b2, err := format.Source(b.Bytes()) if err != nil { @@ -518,7 +512,7 @@ func threadTest1() { ) var b bytes.Buffer - fmt.Fprintf(&b, prologueTest, tidyComments(header(test))) + fmt.Fprintf(&b, prologueTest, tag, strings.TrimSpace(tidyComments(header(test)))) b.Write(src) b2, err := format.Source(b.Bytes()) if err != nil { @@ -563,7 +557,7 @@ func threadTest2() { ) var b bytes.Buffer - fmt.Fprintf(&b, prologueTest, tidyComments(header(test))) + fmt.Fprintf(&b, prologueTest, tag, strings.TrimSpace(tidyComments(header(test)))) b.Write(src) b2, err := format.Source(b.Bytes()) if err != nil { @@ -610,7 +604,7 @@ func threadTest3() { ) var b bytes.Buffer - fmt.Fprintf(&b, prologueTest, tidyComments(header(test))) + fmt.Fprintf(&b, prologueTest, tag, strings.TrimSpace(tidyComments(header(test)))) b.Write(src) b2, err := format.Source(b.Bytes()) if err != nil { @@ -655,7 +649,7 @@ func threadTest4() { ) var b bytes.Buffer - fmt.Fprintf(&b, prologueTest, tidyComments(header(test))) + fmt.Fprintf(&b, prologueTest, tag, strings.TrimSpace(tidyComments(header(test)))) b.Write(src) b2, err := format.Source(b.Bytes()) if err != nil { diff --git a/internal/bin/bin_linux_amd64.go b/internal/bin/bin_linux_amd64.go index 1b1e0cc..090f815 100644 --- a/internal/bin/bin_linux_amd64.go +++ b/internal/bin/bin_linux_amd64.go @@ -30,27 +30,27 @@ uncontaminated with licensed code from other projects. */ -// sqlite3.c - -// ***************************************************************************** -// This file is an amalgamation of many separate C source files from SQLite -// version 3.19.3. By combining all the individual C code files into this -// single large file, the entire code can be compiled as a single translation -// unit. This allows many compilers to do optimizations that would not be -// possible if the files were compiled separately. Performance improvements -// of 5% or more are commonly seen when SQLite is compiled as a single -// translation unit. -// -// This file is all you need to compile SQLite. To use SQLite in other -// programs, you need this file and the "sqlite3.h" header file that defines -// the programming interface to the SQLite library. (If you do not have -// the "sqlite3.h" header file at hand, you will find a copy embedded within -// the text of this file. Search for "Begin file sqlite3.h" to find the start -// of the embedded sqlite3.h header file.) Additional code files may be needed -// if you want a wrapper to interface SQLite with your choice of programming -// language. The code for the "sqlite3" command-line shell is also in a -// separate file. This file contains only code for the core SQLite library. - +// Package sqlite is an in-process implementation of a self-contained, +// serverless, zero-configuration, transactional SQL database engine. (Work In Progress) +// /****************************************************************************** +// ** This file is an amalgamation of many separate C source files from SQLite +// ** version 3.19.3. By combining all the individual C code files into this +// ** single large file, the entire code can be compiled as a single translation +// ** unit. This allows many compilers to do optimizations that would not be +// ** possible if the files were compiled separately. Performance improvements +// ** of 5% or more are commonly seen when SQLite is compiled as a single +// ** translation unit. +// ** +// ** This file is all you need to compile SQLite. To use SQLite in other +// ** programs, you need this file and the "sqlite3.h" header file that defines +// ** the programming interface to the SQLite library. (If you do not have +// ** the "sqlite3.h" header file at hand, you will find a copy embedded within +// ** the text of this file. Search for "Begin file sqlite3.h" to find the start +// ** of the embedded sqlite3.h header file.) Additional code files may be needed +// ** if you want a wrapper to interface SQLite with your choice of programming +// ** language. The code for the "sqlite3" command-line shell is also in a +// ** separate file. This file contains only code for the core SQLite library. +// */ package bin import ( @@ -632,13 +632,13 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { @@ -650,14 +650,17 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { func _use(tls *crt.TLS, _ int32, args ...interface{}) { } -// Execute SQL code. Return one of the SQLITE_ success/failure -// codes. Also write an error message into memory obtained from -// malloc() and make *pzErrMsg point to that message. -// -// If the SQL is a query, then for each row in the query result -// the xCallback() function is called. pArg becomes the first -// argument to xCallback(). If xCallback=NULL then no callback -// is invoked, even for queries. +// C comment +// /* +// ** Execute SQL code. Return one of the SQLITE_ success/failure +// ** codes. Also write an error message into memory obtained from +// ** malloc() and make *pzErrMsg point to that message. +// ** +// ** If the SQL is a query, then for each row in the query result +// ** the xCallback() function is called. pArg becomes the first +// ** argument to xCallback(). If xCallback=NULL then no callback +// ** is invoked, even for queries. +// */ func Xsqlite3_exec(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _xCallback func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, _pArg unsafe.Pointer, _pzErrMsg **int8) (r0 int32) { var _rc, _callbackIsInit, _1_nCol, _4_i, _14_nErrMsg int32 var _zLeftover *int8 @@ -675,7 +678,7 @@ func Xsqlite3_exec(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _xCallback func(*cr Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _sqlite3Error(tls, _db, i32(0)) _2: - if _rc != i32(0) || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == 0 { + if _rc != i32(0) || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) == 0 { goto _exec_out } _1_azVals = nil @@ -698,7 +701,7 @@ _2: _1_nCol = Xsqlite3_column_count(tls, _pStmt) _10: _rc = Xsqlite3_step(tls, _pStmt) - if _xCallback == nil || i32(100) != _rc && (i32(101) != _rc || _callbackIsInit != 0 || ((_db.X6)&i32(256)) == 0) { + if _xCallback == nil || i32(100) != _rc && (i32(101) != _rc || _callbackIsInit != 0 || (_db.X6&i32(256)) == 0) { goto _16 } if _callbackIsInit != 0 { @@ -713,9 +716,9 @@ _19: if _4_i >= _1_nCol { goto _22 } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 8*uintptr(_4_i))) = Xsqlite3_column_name(tls, _pStmt, _4_i) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azCols)) + 8*uintptr(_4_i))) = Xsqlite3_column_name(tls, _pStmt, _4_i) func() { - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 8*uintptr(_4_i)))) == nil { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azCols)) + 8*uintptr(_4_i)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_execØ00__func__Ø000))), unsafe.Pointer(str(121))) crt.X__builtin_abort(tls) } @@ -728,21 +731,21 @@ _17: if _rc != i32(100) { goto _25 } - _1_azVals = (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 8*uintptr(_1_nCol))) + _1_azVals = (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azCols)) + 8*uintptr(_1_nCol))) _4_i = i32(0) _26: if _4_i >= _1_nCol { goto _29 } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 8*uintptr(_4_i))) = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, _4_i))) - if ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 8*uintptr(_4_i)))) == nil) && (Xsqlite3_column_type(tls, _pStmt, _4_i) != i32(5)) { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_azVals)) + 8*uintptr(_4_i))) = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, _4_i))) + if ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_azVals)) + 8*uintptr(_4_i)))) == nil) && (Xsqlite3_column_type(tls, _pStmt, _4_i) != i32(5)) { _sqlite3OomFault(tls, _db) goto _exec_out } _4_i += 1 goto _26 _29: - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 8*uintptr(_4_i))) = nil + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_azVals)) + 8*uintptr(_4_i))) = nil _25: if _xCallback(tls, _pArg, _1_nCol, _1_azVals, _azCols) != 0 { _rc = i32(4) @@ -759,7 +762,7 @@ _16: _pStmt = nil _zSql = _zLeftover _34: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))))))) & i32(1)) != 0 { *(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1) goto _34 } @@ -767,14 +770,14 @@ _34: _33: goto _10 _11: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_azCols)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols)) _azCols = nil goto _2 _exec_out: if _pStmt != nil { _sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_azCols)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_azCols)) _rc = _sqlite3ApiExit(tls, _db, _rc) if _rc == i32(0) || _pzErrMsg == nil { goto _38 @@ -782,7 +785,7 @@ _exec_out: _14_nErrMsg = i32(1) + _sqlite3Strlen30(tls, Xsqlite3_errmsg(tls, _db)) *_pzErrMsg = (*int8)(_sqlite3Malloc(tls, uint64(_14_nErrMsg))) if (*_pzErrMsg) != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(*_pzErrMsg), (unsafe.Pointer)(Xsqlite3_errmsg(tls, _db)), uint64(_14_nErrMsg)) + crt.Xmemcpy(tls, unsafe.Pointer(*_pzErrMsg), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)), uint64(_14_nErrMsg)) goto _40 } _rc = _sqlite3NomemError(tls, i32(111233)) @@ -795,7 +798,7 @@ _38: } _42: func() { - if (_rc & (_db.X11)) != _rc { + if (_rc & _db.X11) != _rc { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111240), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_execØ00__func__Ø000))), unsafe.Pointer(str(134))) crt.X__builtin_abort(tls) } @@ -804,18 +807,21 @@ _42: return _rc } -// Check to make sure we have a valid db pointer. This test is not -// foolproof but it does provide some measure of protection against -// misuse of the interface such as passing in db pointers that are -// NULL or which have been previously closed. If this routine returns -// 1 it means that the db pointer is valid and 0 if it should not be -// dereferenced for any reason. The calling function should invoke -// SQLITE_MISUSE immediately. -// -// sqlite3SafetyCheckOk() requires that the db pointer be valid for -// use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to -// open properly and is not fit for general use but which can be -// used as an argument to sqlite3_errmsg() or sqlite3_close(). +// C comment +// /* +// ** Check to make sure we have a valid db pointer. This test is not +// ** foolproof but it does provide some measure of protection against +// ** misuse of the interface such as passing in db pointers that are +// ** NULL or which have been previously closed. If this routine returns +// ** 1 it means that the db pointer is valid and 0 if it should not be +// ** dereferenced for any reason. The calling function should invoke +// ** SQLITE_MISUSE immediately. +// ** +// ** sqlite3SafetyCheckOk() requires that the db pointer be valid for +// ** use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to +// ** open properly and is not fit for general use but which can be +// ** used as an argument to sqlite3_errmsg() or sqlite3_close(). +// */ func _sqlite3SafetyCheckOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _magic uint32 if _db == nil { @@ -835,17 +841,23 @@ _1: return i32(1) } -// Log an error that is an API call on a connection pointer that should -// not have been used. The "type" of connection pointer is given as the -// argument. The zType is a word like "NULL" or "closed" or "invalid". +// C comment +// /* +// ** Log an error that is an API call on a connection pointer that should +// ** not have been used. The "type" of connection pointer is given as the +// ** argument. The zType is a word like "NULL" or "closed" or "invalid". +// */ func _logBadConnection(tls *crt.TLS, _zType *int8) { Xsqlite3_log(tls, i32(21), str(169), unsafe.Pointer(_zType)) } -// Format and write a message to the log if logging is enabled. +// C comment +// /* +// ** Format and write a message to the log if logging is enabled. +// */ func Xsqlite3_log(tls *crt.TLS, _iErrCode int32, _zFormat *int8, args ...interface{}) { var _ap []interface{} - if (_sqlite3Config.X35) != nil { + if _sqlite3Config.X35 != nil { _ap = args _renderLogMsg(tls, _iErrCode, _zFormat, _ap) _ap = nil @@ -858,51 +870,60 @@ func init() { _sqlite3Config = TSqlite3Config{X0: i32(1), X1: i32(1), X2: i32(1), X3: i32(1), X4: i32(1), X5: i32(2147483646), X6: i32(0), X7: i32(1200), X8: i32(100), X9: i32(65536), X10: Xsqlite3_mem_methods{}, X11: Xsqlite3_mutex_methods{}, X12: Xsqlite3_pcache_methods2{}, X13: nil, X14: i32(0), X15: i32(0), X16: i32(0), X17: i64(0), X18: i64(2147418112), X19: nil, X20: i32(0), X21: i32(0), X22: nil, X23: i32(0), X24: i32(20), X25: i32(0), X26: i32(0), X27: u32(250), X28: i32(0), X29: i32(0), X30: i32(0), X31: i32(0), X32: i32(0), X33: i32(0), X34: nil, X35: nil, X36: nil, X37: nil, X38: i32(0), X39: i32(2147483646)} } -// This is the routine that actually formats the sqlite3_log() message. -// We house it in a separate routine from sqlite3_log() to avoid using -// stack space on small-stack systems when logging is disabled. -// -// sqlite3_log() must render into a static buffer. It cannot dynamically -// allocate memory because it might be called while the memory allocator -// mutex is held. -// -// sqlite3VXPrintf() might ask for *temporary* memory allocations for -// certain format characters (%q) or for very large precisions or widths. -// Care must be taken that any sqlite3_log() calls that occur while the -// memory mutex is held do not use these mechanisms. +// C comment +// /* +// ** This is the routine that actually formats the sqlite3_log() message. +// ** We house it in a separate routine from sqlite3_log() to avoid using +// ** stack space on small-stack systems when logging is disabled. +// ** +// ** sqlite3_log() must render into a static buffer. It cannot dynamically +// ** allocate memory because it might be called while the memory allocator +// ** mutex is held. +// ** +// ** sqlite3VXPrintf() might ask for *temporary* memory allocations for +// ** certain format characters (%q) or for very large precisions or widths. +// ** Care must be taken that any sqlite3_log() calls that occur while the +// ** memory mutex is held do not use these mechanisms. +// */ func _renderLogMsg(tls *crt.TLS, _iErrCode int32, _zFormat *int8, _ap []interface{}) { var _acc XStrAccum var _zMsg [210]int8 _sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zMsg)), int32(u64(210)), i32(0)) _sqlite3VXPrintf(tls, &_acc, _zFormat, _ap) - (_sqlite3Config.X35)(tls, _sqlite3Config.X36, _iErrCode, _sqlite3StrAccumFinish(tls, &_acc)) + _sqlite3Config.X35(tls, _sqlite3Config.X36, _iErrCode, _sqlite3StrAccumFinish(tls, &_acc)) _ = _acc _ = _zMsg } -// Initialize a string accumulator. -// -// p: The accumulator to be initialized. -// db: Pointer to a database connection. May be NULL. Lookaside -// memory is used if not NULL. db->mallocFailed is set appropriately -// when not NULL. -// zBase: An initial buffer. May be NULL in which case the initial buffer -// is malloced. -// n: Size of zBase in bytes. If total space requirements never exceed -// n then no memory allocations ever occur. -// mx: Maximum number of bytes to accumulate. If mx==0 then no memory -// allocations will ever occur. +// C comment +// /* +// ** Initialize a string accumulator. +// ** +// ** p: The accumulator to be initialized. +// ** db: Pointer to a database connection. May be NULL. Lookaside +// ** memory is used if not NULL. db->mallocFailed is set appropriately +// ** when not NULL. +// ** zBase: An initial buffer. May be NULL in which case the initial buffer +// ** is malloced. +// ** n: Size of zBase in bytes. If total space requirements never exceed +// ** n then no memory allocations ever occur. +// ** mx: Maximum number of bytes to accumulate. If mx==0 then no memory +// ** allocations will ever occur. +// */ func _sqlite3StrAccumInit(tls *crt.TLS, _p *XStrAccum, _db *Xsqlite3, _zBase *int8, _n int32, _mx int32) { - *(**int8)(unsafe.Pointer(&(_p.X2))) = store0((**int8)(unsafe.Pointer(&(_p.X1))), _zBase) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db - *(*uint32)(unsafe.Pointer(&(_p.X3))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_n) - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(_mx) - *(*uint8)(unsafe.Pointer(&(_p.X6))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_p.X7))) = uint8(i32(0)) -} - -// Render a string given by "fmt" into the StrAccum object. + *(**int8)(unsafe.Pointer(&_p.X2)) = store0((**int8)(unsafe.Pointer(&_p.X1)), _zBase) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _db + *(*uint32)(unsafe.Pointer(&_p.X3)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(_n) + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(_mx) + *(*uint8)(unsafe.Pointer(&_p.X6)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X7)) = uint8(i32(0)) +} + +// C comment +// /* +// ** Render a string given by "fmt" into the StrAccum object. +// */ func _sqlite3VXPrintf(tls *crt.TLS, _pAccum *XStrAccum, _fmt *int8, _ap []interface{}) { var _c, _precision, _length, _idx, _width, _nOut, _exp, _e2, _nsd, _49_x, _54_nn, _54_ix, _96_i, _96_nPad, _110_i, _110_j, _110_k, _110_n, _110_isnull, _110_needQuote, _120_k int32 var _29_v int64 @@ -1092,15 +1113,15 @@ _46: _49: _flag_long = uint8(i32(0)) _51: - _infop = (*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo)) + 6*uintptr(i32(0)))) + _infop = (*Xet_info)(unsafe.Pointer(uintptr(unsafe.Pointer(&_fmtinfo)) + 6*uintptr(i32(0)))) _xtype = uint8(i32(17)) _idx = i32(0) _52: if _idx >= i32(23) { goto _55 } - if _c == int32((*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo))+6*uintptr(_idx))).X0) { - _infop = (*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo)) + 6*uintptr(_idx))) + if _c == int32((*Xet_info)(unsafe.Pointer(uintptr(unsafe.Pointer(&_fmtinfo))+6*uintptr(_idx))).X0) { + _infop = (*Xet_info)(unsafe.Pointer(uintptr(unsafe.Pointer(&_fmtinfo)) + 6*uintptr(_idx))) _xtype = _infop.X3 goto _55 } @@ -1226,7 +1247,7 @@ _87: } _nOut = int32(_47_n) _98: - _bufpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_nOut-i32(1)))) + _bufpt = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_nOut-i32(1)))) if int32(_xtype) != i32(15) { goto _100 } @@ -1234,18 +1255,18 @@ _98: if (_49_x >= i32(4)) || (((_longvalue / uint64(i32(10))) % uint64(i32(10))) == uint64(i32(1))) { _49_x = i32(0) } - *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr((_49_x*i32(2))+i32(1)))) - *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr(_49_x*i32(2)))) + *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr((_49_x*i32(2))+i32(1)))) + *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr(_49_x*i32(2)))) _100: - _51_cset = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aDigits)) + 1*uintptr(_infop.X4))) + _51_cset = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aDigits)) + 1*uintptr(_infop.X4))) _51_base = _infop.X1 _103: - *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_51_cset)) + 1*uintptr(_longvalue%uint64(_51_base)))) + *preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_51_cset)) + 1*uintptr(_longvalue%uint64(_51_base)))) _longvalue = _longvalue / uint64(_51_base) if _longvalue > uint64(i32(0)) { goto _103 } - _length = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)) + _length = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)) _104: if _precision > _length { *preInc0(&_bufpt, -1) = int8(i32(48)) @@ -1259,7 +1280,7 @@ _104: _54_ix = ((_length - i32(1)) % i32(3)) + i32(1) { p := &_bufpt - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_54_nn))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(_54_nn))) sink0(*p) } _idx = i32(0) @@ -1267,10 +1288,10 @@ _107: if _54_nn <= i32(0) { goto _110 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_idx))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_idx+_54_nn))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_idx))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_idx+_54_nn))) _54_ix -= 1 if _54_ix == i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(preInc1(&_idx, 1)))) = int8(_cThousand) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(preInc1(&_idx, 1)))) = int8(_cThousand) _54_nn -= 1 _54_ix = i32(3) } @@ -1281,10 +1302,10 @@ _106: if _prefix != 0 { *preInc0(&_bufpt, -1) = _prefix } - if _flag_alternateform == 0 || (_infop.X5) == 0 { + if _flag_alternateform == 0 || _infop.X5 == 0 { goto _114 } - _57_pre = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPrefix)) + 1*uintptr(_infop.X5))) + _57_pre = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPrefix)) + 1*uintptr(_infop.X5))) _115: if int32(store3(&_57_x, *_57_pre)) == i32(0) { goto _118 @@ -1294,7 +1315,7 @@ _115: goto _115 _118: _114: - _length = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)) + _length = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)) goto _119 _62: if _bArgList != 0 { @@ -1414,8 +1435,8 @@ _144: } if _exp > i32(350) { _bufpt = (*int8)(unsafe.Pointer(&_buf)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = _prefix - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_buf))))+uintptr(bool2int(int32(_prefix) != i32(0)))))), (unsafe.Pointer)(str(245)), uint64(i32(4))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(i32(0)))) = _prefix + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_buf))))+uintptr(bool2int(int32(_prefix) != i32(0)))))), unsafe.Pointer(str(245)), uint64(i32(4))) _length = i32(3) + bool2int(int32(_prefix) != i32(0)) goto _119 } @@ -1520,7 +1541,7 @@ _173: *func() *int32 { _precision -= 1; return &_e2 }() += 1 goto _173 _176: - if postInc1(&_precision, int32(-1)) > i32(0) { + if postInc1(&_precision, -1) > i32(0) { *postInc0(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd) goto _176 } @@ -1528,7 +1549,7 @@ _176: goto _182 } _183: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(-1))))) == i32(48) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(i32(-1))))) == i32(48) { *preInc0(&_bufpt, -1) = int8(i32(0)) goto _183 } @@ -1538,7 +1559,7 @@ _183: crt.X__builtin_abort(tls) } }() - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(-1))))) != i32(46) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(i32(-1))))) != i32(46) { goto _187 } if _flag_altform2 != 0 { @@ -1552,7 +1573,7 @@ _182: if int32(_xtype) != i32(2) { goto _190 } - *postInc0(&_bufpt, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aDigits)) + 1*uintptr(_infop.X4))) + *postInc0(&_bufpt, 1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aDigits)) + 1*uintptr(_infop.X4))) if _exp < i32(0) { *postInc0(&_bufpt, 1) = int8(i32(45)) _exp = -_exp @@ -1583,14 +1604,14 @@ _197: if _96_i < _96_nPad { goto _200 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_96_i))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_96_i-_96_nPad))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_96_i))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_96_i-_96_nPad))) _96_i -= 1 goto _197 _200: _96_i = bool2int(int32(_prefix) != i32(0)) _201: - if postInc1(&_96_nPad, int32(-1)) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_96_i, int32(1))))) = int8(i32(48)) + if postInc1(&_96_nPad, -1) != 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(postInc1(&_96_i, 1)))) = int8(i32(48)) goto _201 } _length = _width @@ -1603,7 +1624,7 @@ _65: _length = store1(&_width, i32(0)) goto _119 _66: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = int8(i32(37)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(i32(0)))) = int8(i32(37)) _bufpt = (*int8)(unsafe.Pointer(&_buf)) _length = i32(1) goto _119 @@ -1612,7 +1633,7 @@ _67: _bufpt = _getTextArg(tls, _pArgList) _c = func() int32 { if _bufpt != nil { - return int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(0))))) + return int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(i32(0))))) } return i32(0) }() @@ -1635,7 +1656,7 @@ _207: _sqlite3AppendChar(tls, _pAccum, _precision-i32(1), int8(_c)) _208: _length = i32(1) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = int8(_c) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(i32(0)))) = int8(_c) _bufpt = (*int8)(unsafe.Pointer(&_buf)) goto _119 _68: @@ -1659,7 +1680,7 @@ _215: } _length = i32(0) _217: - if _length >= _precision || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_length)))) == 0 { + if _length >= _precision || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_length)))) == 0 { goto _221 } _length += 1 @@ -1695,7 +1716,7 @@ _226: _110_k = _precision _110_i = store1(&_110_n, i32(0)) _230: - if _110_k == i32(0) || int32(store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_110_escarg)) + 1*uintptr(_110_i))))) == i32(0) { + if _110_k == i32(0) || int32(store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_110_escarg)) + 1*uintptr(_110_i))))) == i32(0) { goto _234 } if int32(_110_ch) == int32(_110_q) { @@ -1724,7 +1745,7 @@ _237: _239: _110_j = i32(0) if _110_needQuote != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_q + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(postInc1(&_110_j, 1)))) = _110_q } _110_k = _110_i _110_i = i32(0) @@ -1732,17 +1753,17 @@ _241: if _110_i >= _110_k { goto _244 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_110_escarg)) + 1*uintptr(_110_i)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(postInc1(&_110_j, 1)))) = store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_110_escarg)) + 1*uintptr(_110_i)))) if int32(_110_ch) == int32(_110_q) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_ch + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(postInc1(&_110_j, 1)))) = _110_ch } _110_i += 1 goto _241 _244: if _110_needQuote != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_q + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(postInc1(&_110_j, 1)))) = _110_q } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_110_j))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_bufpt)) + 1*uintptr(_110_j))) = int8(i32(0)) _length = _110_j goto _119 _73: @@ -1756,7 +1777,7 @@ _73: crt.X__builtin_abort(tls) } }() - if (_118_pToken != nil) && ((_118_pToken.X1) != 0) { + if (_118_pToken != nil) && (_118_pToken.X1 != 0) { _sqlite3StrAccumAppend(tls, _pAccum, _118_pToken.X0, int32(_118_pToken.X1)) } _length = store1(&_width, i32(0)) @@ -1767,7 +1788,7 @@ _74: } _120_pSrc = (*XSrcList)(crt.VAPointer(&_ap)) _120_k = crt.VAInt32(&_ap) - _120_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_120_pSrc.X2))))) + 112*uintptr(_120_k))) + _120_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_120_pSrc.X2)))) + 112*uintptr(_120_k))) func() { if int32(_bArgList) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25786), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(279))) @@ -1775,12 +1796,12 @@ _74: } }() func() { - if _120_k < i32(0) || _120_k >= (_120_pSrc.X0) { + if _120_k < i32(0) || _120_k >= _120_pSrc.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25787), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(291))) crt.X__builtin_abort(tls) } }() - if (_120_pItem.X1) != nil { + if _120_pItem.X1 != nil { _sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.X1) _sqlite3StrAccumAppend(tls, _pAccum, str(312), i32(1)) } @@ -1816,7 +1837,7 @@ _261: _sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length) _264: if _zExtra != nil { - _sqlite3DbFree(tls, (*Xsqlite3)(_pAccum.X0), (unsafe.Pointer)(_zExtra)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pAccum.X0), unsafe.Pointer(_zExtra)) _zExtra = nil } *(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1) @@ -1826,8 +1847,11 @@ _5: _ = _buf } -// Append N bytes of text from z to the StrAccum object. Increase the -// size of the memory allocation for StrAccum if necessary. +// C comment +// /* +// ** Append N bytes of text from z to the StrAccum object. Increase the +// ** size of the memory allocation for StrAccum if necessary. +// */ func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) { func() { if _z == nil && _N != i32(0) { @@ -1836,7 +1860,7 @@ func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) { } }() func() { - if (_p.X2) == nil && (_p.X3) != uint32(i32(0)) && (_p.X6) == 0 { + if _p.X2 == nil && _p.X3 != uint32(i32(0)) && _p.X6 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25913), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(344))) crt.X__builtin_abort(tls) } @@ -1848,28 +1872,28 @@ func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) { } }() func() { - if int32(_p.X6) != i32(0) && (_p.X4) != uint32(i32(0)) { + if int32(_p.X6) != i32(0) && _p.X4 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25915), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(391))) crt.X__builtin_abort(tls) } }() - if ((_p.X3) + uint32(_N)) >= (_p.X4) { + if (_p.X3 + uint32(_N)) >= _p.X4 { _enlargeAndAppend(tls, _p, _z, _N) goto _14 } if _N != 0 { func() { - if (_p.X2) == nil { + if _p.X2 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(422))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) + uint32(_N) sink5(*p) } - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2))+1*uintptr((_p.X3)-uint32(_N))))), (unsafe.Pointer)(_z), uint64(_N)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2))+1*uintptr(_p.X3-uint32(_N))))), unsafe.Pointer(_z), uint64(_N)) } _14: } @@ -1880,35 +1904,41 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StrAccumAppendØ00__func__Ø000[0], str(431), 22) } -// The StrAccum "p" is not large enough to accept N new bytes of z[]. -// So enlarge if first, then do the append. -// -// This is a helper routine to sqlite3StrAccumAppend() that does special-case -// work (enlarging the buffer) using tail recursion, so that the -// sqlite3StrAccumAppend() routine can use fast calling semantics. +// C comment +// /* +// ** The StrAccum "p" is not large enough to accept N new bytes of z[]. +// ** So enlarge if first, then do the append. +// ** +// ** This is a helper routine to sqlite3StrAccumAppend() that does special-case +// ** work (enlarging the buffer) using tail recursion, so that the +// ** sqlite3StrAccumAppend() routine can use fast calling semantics. +// */ func _enlargeAndAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) { _N = _sqlite3StrAccumEnlarge(tls, _p, _N) if _N > i32(0) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2))+1*uintptr(_p.X3)))), (unsafe.Pointer)(_z), uint64(_N)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2))+1*uintptr(_p.X3)))), unsafe.Pointer(_z), uint64(_N)) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) + uint32(_N) sink5(*p) } } func() { - if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) { + if ((_p.X2 == nil) || (_p.X2 == _p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25904), unsafe.Pointer((*int8)(unsafe.Pointer(&_enlargeAndAppendØ00__func__Ø000))), unsafe.Pointer(str(453))) crt.X__builtin_abort(tls) } }() } -// Enlarge the memory allocation on a StrAccum object so that it is -// able to accept at least N more bytes of text. -// -// Return the number of bytes of text that StrAccum is able to accept -// after the attempted enlargement. The value returned might be zero. +// C comment +// /* +// ** Enlarge the memory allocation on a StrAccum object so that it is +// ** able to accept at least N more bytes of text. +// ** +// ** Return the number of bytes of text that StrAccum is able to accept +// ** after the attempted enlargement. The value returned might be zero. +// */ func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) { var _3_szNew int64 var _zNew, _3_zOld *int8 @@ -1918,23 +1948,23 @@ func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_p.X6) != 0 { + if _p.X6 != 0 { return i32(0) } - if (_p.X5) == uint32(i32(0)) { - _N = int32(((_p.X4) - (_p.X3)) - uint32(i32(1))) + if _p.X5 == uint32(i32(0)) { + _N = int32((_p.X4 - _p.X3) - uint32(i32(1))) _setStrAccumError(tls, _p, uint8(i32(2))) return _N } _3_zOld = func() *int8 { if (int32(_p.X7) & i32(4)) != i32(0) { - return (_p.X2) + return _p.X2 } return nil }() _3_szNew = int64(_p.X3) func() { - if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) { + if ((_p.X2 == nil) || (_p.X2 == _p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25844), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000))), unsafe.Pointer(str(453))) crt.X__builtin_abort(tls) } @@ -1956,29 +1986,29 @@ func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) { _setStrAccumError(tls, _p, uint8(i32(2))) return i32(0) } - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(int32(_3_szNew)) - if (*Xsqlite3)(_p.X0) != nil { - _zNew = (*int8)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_3_zOld), uint64(_p.X4))) + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(int32(_3_szNew)) + if _p.X0 != nil { + _zNew = (*int8)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_3_zOld), uint64(_p.X4))) goto _14 } - _zNew = (*int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_3_zOld), uint64(_p.X4))) + _zNew = (*int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_3_zOld), uint64(_p.X4))) _14: if _zNew == nil { goto _15 } func() { - if (_p.X2) == nil && (_p.X3) != uint32(i32(0)) { + if _p.X2 == nil && _p.X3 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000))), unsafe.Pointer(str(534))) crt.X__builtin_abort(tls) } }() - if ((int32(_p.X7) & i32(4)) == i32(0)) && ((_p.X3) > uint32(i32(0))) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_p.X2), uint64(_p.X3)) + if ((int32(_p.X7) & i32(4)) == i32(0)) && (_p.X3 > uint32(i32(0))) { + crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_p.X2), uint64(_p.X3)) } - *(**int8)(unsafe.Pointer(&(_p.X2))) = _zNew - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_zNew))) + *(**int8)(unsafe.Pointer(&_p.X2)) = _zNew + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(_sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_zNew))) { - p := (*uint8)(unsafe.Pointer(&(_p.X7))) + p := (*uint8)(unsafe.Pointer(&_p.X7)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } @@ -1998,7 +2028,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StrAccumEnlargeØ00__func__Ø000[0], str(561), 23) } -// Set the StrAccum object to an error mode. +// C comment +// /* +// ** Set the StrAccum object to an error mode. +// */ func _setStrAccumError(tls *crt.TLS, _p *XStrAccum, _eError uint8) { func() { if int32(_eError) != i32(1) && int32(_eError) != i32(2) { @@ -2006,8 +2039,8 @@ func _setStrAccumError(tls *crt.TLS, _p *XStrAccum, _eError uint8) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_p.X6))) = _eError - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X6)) = _eError + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(i32(0)) } var _setStrAccumErrorØ00__func__Ø000 [17]int8 @@ -2016,23 +2049,26 @@ func init() { crt.Xstrncpy(nil, &_setStrAccumErrorØ00__func__Ø000[0], str(634), 17) } -// Reset an StrAccum string. Reclaim all malloced memory. +// C comment +// /* +// ** Reset an StrAccum string. Reclaim all malloced memory. +// */ func _sqlite3StrAccumReset(tls *crt.TLS, _p *XStrAccum) { func() { - if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) { + if ((_p.X2 == nil) || (_p.X2 == _p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25964), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumResetØ00__func__Ø000))), unsafe.Pointer(str(453))) crt.X__builtin_abort(tls) } }() if (int32(_p.X7) & i32(4)) != i32(0) { - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X2)) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_p.X2)) { - p := (*uint8)(unsafe.Pointer(&(_p.X7))) + p := (*uint8)(unsafe.Pointer(&_p.X7)) *p = uint8(int32(*p) & i32(-5)) sink2(*p) } } - *(**int8)(unsafe.Pointer(&(_p.X2))) = nil + *(**int8)(unsafe.Pointer(&_p.X2)) = nil } var _sqlite3StrAccumResetØ00__func__Ø000 [21]int8 @@ -2053,20 +2089,22 @@ func _sqlite3DbFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) { } } -// The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are -// intended for use inside assert() statements. +// C comment +// /* +// ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +// ** intended for use inside assert() statements. +// */ func Xsqlite3_mutex_held(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { func() { - if _p != nil && (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X7)}))) == nil { + if _p != nil && ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X7) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_heldØ00__func__Ø000))), unsafe.Pointer(str(711))) crt.X__builtin_abort(tls) } }() - return bool2int((_p == nil) || (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X7)})))(tls, _p) != 0) + return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X7 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }()(tls, _p) != 0) } var _sqlite3_mutex_heldØ00__func__Ø000 [19]int8 @@ -2081,9 +2119,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DbFreeØ00__func__Ø000[0], str(775), 14) } -// Free memory that might be associated with a particular database -// connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op. -// The sqlite3DbFreeNN(D,X) version requires that X be non-NULL. +// C comment +// /* +// ** Free memory that might be associated with a particular database +// ** connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op. +// ** The sqlite3DbFreeNN(D,X) version requires that X be non-NULL. +// */ func _sqlite3DbFreeNN(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) { var _3_pBuf *Xsqlite3_file func() { @@ -2101,16 +2142,16 @@ func _sqlite3DbFreeNN(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) { if _db == nil { goto _5 } - if (_db.X79) != nil { + if _db.X79 != nil { _measureAllocationSize(tls, _db, _p) return } if _isLookaside(tls, _db, _p) != 0 { _3_pBuf = (*Xsqlite3_file)(_p) - crt.Xmemset(tls, _p, i32(170), uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1)) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pBuf.X0))))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = _3_pBuf - *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X3))) -= 1 + crt.Xmemset(tls, _p, i32(170), uint64((*t7)(unsafe.Pointer(&_db.X58)).X1)) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pBuf.X0)))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&_db.X58)).X6) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X6))))) = _3_pBuf + *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X3))) -= 1 return } _5: @@ -2131,8 +2172,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DbFreeNNØ00__func__Ø000[0], str(847), 16) } -// Add the size of memory allocation "p" to the count in -// *db->pnBytesFreed. +// C comment +// /* +// ** Add the size of memory allocation "p" to the count in +// ** *db->pnBytesFreed. +// */ func _measureAllocationSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) { { p := _db.X79 @@ -2159,7 +2203,7 @@ func _sqlite3DbMallocSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 in i32(0) i32(0) _5: - return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p) + return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X3)(tls, _p) _3: func() { @@ -2168,7 +2212,7 @@ _3: crt.X__builtin_abort(tls) } }() - return int32((*t7)(unsafe.Pointer(&(_db.X58))).X1) + return int32((*t7)(unsafe.Pointer(&_db.X58)).X1) } var _sqlite3DbMallocSizeØ00__func__Ø000 [20]int8 @@ -2178,43 +2222,48 @@ func init() { } func _isLookaside(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) { - return bool2int((uint64(crt.P2U(_p)) >= uint64(crt.P2U((*t7)(unsafe.Pointer(&(_db.X58))).X7))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U((*t7)(unsafe.Pointer(&(_db.X58))).X8)))) + return bool2int((uint64(crt.P2U(_p)) >= uint64(crt.P2U((*t7)(unsafe.Pointer(&_db.X58)).X7))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U((*t7)(unsafe.Pointer(&_db.X58)).X8)))) } -// Free memory previously obtained from sqlite3Malloc(). +// C comment +// /* +// ** Free memory previously obtained from sqlite3Malloc(). +// */ func Xsqlite3_free(tls *crt.TLS, _p unsafe.Pointer) { if _p == nil { return } i32(0) i32(0) - if (_sqlite3Config.X0) != 0 { + if _sqlite3Config.X0 != 0 { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _sqlite3StatusDown(tls, i32(0), _sqlite3MallocSize(tls, _p)) _sqlite3StatusDown(tls, i32(9), i32(1)) - ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p) + ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X1)(tls, _p) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) goto _2 } - ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p) + ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X1)(tls, _p) _2: } -// Obtain the mutex p. If some other thread already has the mutex, block -// until it can be obtained. +// C comment +// /* +// ** Obtain the mutex p. If some other thread already has the mutex, block +// ** until it can be obtained. +// */ func Xsqlite3_mutex_enter(tls *crt.TLS, _p *Xsqlite3_mutex) { if _p != nil { func() { - if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X4)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22865), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_enterØ00__func__Ø000))), unsafe.Pointer(str(913))) crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X4)})))(tls, _p) + func() func(*crt.TLS, *Xsqlite3_mutex) { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X4 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }()(tls, _p) } } @@ -2241,7 +2290,7 @@ func _sqlite3StatusDown(tls *crt.TLS, _op int32, _N int32) { }() func() { if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_statMutex)) + 1*uintptr(_op)))) != 0 { return _sqlite3Pcache1Mutex(tls) } return _sqlite3MallocMutex(tls) @@ -2257,7 +2306,7 @@ func _sqlite3StatusDown(tls *crt.TLS, _op int32, _N int32) { } }() { - p := (*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) + p := (*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) *p = (*p) - int64(_N) sink6(*p) } @@ -2275,45 +2324,56 @@ func init() { _statMutex = [10]int8{0, 1, 1, 0, 0, 0, 0, 1, 0, 0} } -// Return the global mutex used by this PCACHE implementation. The -// sqlite3_status() routine needs access to this mutex. +// C comment +// /* +// ** Return the global mutex used by this PCACHE implementation. The +// ** sqlite3_status() routine needs access to this mutex. +// */ func _sqlite3Pcache1Mutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) { return (*Xsqlite3_mutex)(_pcache1_g.X9) } var _pcache1_g TPCacheGlobal -// Return the memory allocator mutex. sqlite3_status() needs it. +// C comment +// /* +// ** Return the memory allocator mutex. sqlite3_status() needs it. +// */ func _sqlite3MallocMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) { return (*Xsqlite3_mutex)(_mem0.X0) } var _sqlite3Stat Tsqlite3StatType -// Return the size of a memory allocation previously obtained from -// sqlite3Malloc() or sqlite3_malloc(). +// C comment +// /* +// ** Return the size of a memory allocation previously obtained from +// ** sqlite3Malloc() or sqlite3_malloc(). +// */ func _sqlite3MallocSize(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) { i32(0) - return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p) + return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X3)(tls, _p) } -// The sqlite3_mutex_leave() routine exits a mutex that was previously -// entered by the same thread. The behavior is undefined if the mutex -// is not currently entered. If a NULL pointer is passed as an argument -// this function is a no-op. +// C comment +// /* +// ** The sqlite3_mutex_leave() routine exits a mutex that was previously +// ** entered by the same thread. The behavior is undefined if the mutex +// ** is not currently entered. If a NULL pointer is passed as an argument +// ** this function is a no-op. +// */ func Xsqlite3_mutex_leave(tls *crt.TLS, _p *Xsqlite3_mutex) { if _p != nil { func() { - if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X6)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X6) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_leaveØ00__func__Ø000))), unsafe.Pointer(str(1143))) crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X6)})))(tls, _p) + func() func(*crt.TLS, *Xsqlite3_mutex) { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X6 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }()(tls, _p) } } @@ -2323,8 +2383,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_mutex_leaveØ00__func__Ø000[0], str(1181), 20) } -// Resize the block of memory pointed to by p to n bytes. If the -// resize fails, set the mallocFailed flag in the connection object. +// C comment +// /* +// ** Resize the block of memory pointed to by p to n bytes. If the +// ** resize fails, set the mallocFailed flag in the connection object. +// */ func _sqlite3DbRealloc(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) { func() { if _db == nil { @@ -2341,7 +2404,7 @@ func _sqlite3DbRealloc(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64 crt.X__builtin_abort(tls) } }() - if _isLookaside(tls, _db, _p) != 0 && (_n <= uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1)) { + if _isLookaside(tls, _db, _p) != 0 && (_n <= uint64((*t7)(unsafe.Pointer(&_db.X58)).X1)) { return _p } return _dbReallocFinish(tls, _db, _p, _n) @@ -2368,12 +2431,12 @@ func _sqlite3DbMallocRawNN(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Po } }() func() { - if (_db.X79) != nil { + if _db.X79 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24866), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000))), unsafe.Pointer(str(1224))) crt.X__builtin_abort(tls) } }() - if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) != uint32(i32(0)) { + if ((*t7)(unsafe.Pointer(&_db.X58)).X0) != uint32(i32(0)) { goto _6 } func() { @@ -2382,26 +2445,26 @@ func _sqlite3DbMallocRawNN(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Po crt.X__builtin_abort(tls) } }() - if _n > uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(1)))) += 1 + if _n > uint64((*t7)(unsafe.Pointer(&_db.X58)).X1) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X5))))) + 4*uintptr(i32(1)))) += 1 goto _12 } - if store8(&_pBuf, (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6)) == nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(2)))) += 1 + if store8(&_pBuf, (*Xsqlite3_file)((*t7)(unsafe.Pointer(&_db.X58)).X6)) == nil { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X5))))) + 4*uintptr(i32(2)))) += 1 goto _12 } - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = (*Xsqlite3_file)(_pBuf.X0) - *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X3))) += 1 - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(0)))) += 1 - if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) > ((*t7)(unsafe.Pointer(&(_db.X58))).X4) { - *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X4))) = (*t7)(unsafe.Pointer(&(_db.X58))).X3 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X6))))) = (*Xsqlite3_file)(_pBuf.X0) + *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X3))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X5))))) + 4*uintptr(i32(0)))) += 1 + if ((*t7)(unsafe.Pointer(&_db.X58)).X3) > ((*t7)(unsafe.Pointer(&_db.X58)).X4) { + *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X4))) = (*t7)(unsafe.Pointer(&_db.X58)).X3 } - return (unsafe.Pointer)(_pBuf) + return unsafe.Pointer(_pBuf) _12: goto _15 _6: - if (_db.X17) != 0 { + if _db.X17 != 0 { return nil } _15: @@ -2414,8 +2477,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DbMallocRawNNØ00__func__Ø000[0], str(1264), 21) } -// Finish the work of sqlite3DbMallocRawNN for the unusual and -// slower case when the allocation cannot be fulfilled using lookaside. +// C comment +// /* Finish the work of sqlite3DbMallocRawNN for the unusual and +// ** slower case when the allocation cannot be fulfilled using lookaside. +// */ func _dbMallocRawFinish(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) { var _p unsafe.Pointer func() { @@ -2437,21 +2502,24 @@ func init() { crt.Xstrncpy(nil, &_dbMallocRawFinishØ00__func__Ø000[0], str(1285), 18) } -// Allocate memory. This routine is like sqlite3_malloc() except that it -// assumes the memory subsystem has already been initialized. +// C comment +// /* +// ** Allocate memory. This routine is like sqlite3_malloc() except that it +// ** assumes the memory subsystem has already been initialized. +// */ func _sqlite3Malloc(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) { var _p unsafe.Pointer if (_n == uint64(i32(0))) || (_n >= uint64(i32(2147483392))) { _p = nil goto _4 } - if (_sqlite3Config.X0) != 0 { + if _sqlite3Config.X0 != 0 { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _mallocWithAlarm(tls, int32(_n), &_p) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) goto _4 } - _p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)(tls, int32(_n)) + _p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X0)(tls, int32(_n)) _4: func() { if (int64((uintptr(unsafe.Pointer((*int8)(_p)))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { @@ -2462,8 +2530,11 @@ _4: return _p } -// Do a memory allocation with statistics and alarms. Assume the -// lock is already held. +// C comment +// /* +// ** Do a memory allocation with statistics and alarms. Assume the +// ** lock is already held. +// */ func _mallocWithAlarm(tls *crt.TLS, _n int32, _pp *unsafe.Pointer) { var _nFull int32 var _1_nUsed int64 @@ -2480,21 +2551,21 @@ func _mallocWithAlarm(tls *crt.TLS, _n int32, _pp *unsafe.Pointer) { crt.X__builtin_abort(tls) } }() - _nFull = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, _n) + _nFull = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X4)(tls, _n) _sqlite3StatusHighwater(tls, i32(5), _n) - if (_mem0.X1) <= int64(i32(0)) { + if _mem0.X1 <= int64(i32(0)) { goto _4 } _1_nUsed = _sqlite3StatusValue(tls, i32(0)) - if _1_nUsed >= ((_mem0.X1) - int64(_nFull)) { - *(*int32)(unsafe.Pointer(&(_mem0.X5))) = i32(1) + if _1_nUsed >= (_mem0.X1 - int64(_nFull)) { + *(*int32)(unsafe.Pointer(&_mem0.X5)) = i32(1) _sqlite3MallocAlarm(tls, _nFull) goto _6 } - *(*int32)(unsafe.Pointer(&(_mem0.X5))) = i32(0) + *(*int32)(unsafe.Pointer(&_mem0.X5)) = i32(0) _6: _4: - _p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)(tls, _nFull) + _p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X0)(tls, _nFull) if _p != nil { _nFull = _sqlite3MallocSize(tls, _p) _sqlite3StatusUp(tls, i32(0), _nFull) @@ -2509,8 +2580,11 @@ func init() { crt.Xstrncpy(nil, &_mallocWithAlarmØ00__func__Ø000[0], str(1362), 16) } -// Adjust the highwater mark if necessary. -// The caller must hold the appropriate mutex. +// C comment +// /* +// ** Adjust the highwater mark if necessary. +// ** The caller must hold the appropriate mutex. +// */ func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) { var _newValue int64 func() { @@ -2534,7 +2608,7 @@ func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) { }() func() { if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_statMutex)) + 1*uintptr(_op)))) != 0 { return _sqlite3Pcache1Mutex(tls) } return _sqlite3MallocMutex(tls) @@ -2549,8 +2623,8 @@ func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) { crt.X__builtin_abort(tls) } }() - if _newValue > (*(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op)))) { - *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op))) = _newValue + if _newValue > (*(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op)))) { + *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op))) = _newValue } } @@ -2560,8 +2634,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StatusHighwaterØ00__func__Ø000[0], str(1517), 23) } -// Return the current value of a status parameter. The caller must -// be holding the appropriate mutex. +// C comment +// /* +// ** Return the current value of a status parameter. The caller must +// ** be holding the appropriate mutex. +// */ func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) { func() { if _op < i32(0) || _op >= i32(10) { @@ -2577,7 +2654,7 @@ func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) { }() func() { if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_statMutex)) + 1*uintptr(_op)))) != 0 { return _sqlite3Pcache1Mutex(tls) } return _sqlite3MallocMutex(tls) @@ -2586,7 +2663,7 @@ func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) { crt.X__builtin_abort(tls) } }() - return *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) + return *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) } var _sqlite3StatusValueØ00__func__Ø000 [19]int8 @@ -2595,9 +2672,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StatusValueØ00__func__Ø000[0], str(1540), 19) } -// Trigger the alarm +// C comment +// /* +// ** Trigger the alarm +// */ func _sqlite3MallocAlarm(tls *crt.TLS, _nByte int32) { - if (_mem0.X1) <= int64(i32(0)) { + if _mem0.X1 <= int64(i32(0)) { return } Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) @@ -2605,22 +2685,28 @@ func _sqlite3MallocAlarm(tls *crt.TLS, _nByte int32) { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) } -// Attempt to release up to n bytes of non-essential memory currently -// held by SQLite. An example of non-essential memory is memory used to -// cache database pages that are not currently in use. +// C comment +// /* +// ** Attempt to release up to n bytes of non-essential memory currently +// ** held by SQLite. An example of non-essential memory is memory used to +// ** cache database pages that are not currently in use. +// */ func Xsqlite3_release_memory(tls *crt.TLS, _n int32) (r0 int32) { return i32(0) } -// Add N to the value of a status record. The caller must hold the -// appropriate mutex. (Locking is checked by assert()). -// -// The StatusUp() routine can accept positive or negative values for N. -// The value of N is added to the current status value and the high-water -// mark is adjusted if necessary. -// -// The StatusDown() routine lowers the current value by N. The highwater -// mark is unchanged. N must be non-negative for StatusDown(). +// C comment +// /* +// ** Add N to the value of a status record. The caller must hold the +// ** appropriate mutex. (Locking is checked by assert()). +// ** +// ** The StatusUp() routine can accept positive or negative values for N. +// ** The value of N is added to the current status value and the high-water +// ** mark is adjusted if necessary. +// ** +// ** The StatusDown() routine lowers the current value by N. The highwater +// ** mark is unchanged. N must be non-negative for StatusDown(). +// */ func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) { func() { if _op < i32(0) || _op >= i32(10) { @@ -2636,7 +2722,7 @@ func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) { }() func() { if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_statMutex)) + 1*uintptr(_op)))) != 0 { return _sqlite3Pcache1Mutex(tls) } return _sqlite3MallocMutex(tls) @@ -2646,12 +2732,12 @@ func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) { } }() { - p := (*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) + p := (*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) *p = (*p) + int64(_N) sink6(*p) } - if (*(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op)))) > (*(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op)))) { - *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op))) = *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) + if (*(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op)))) > (*(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op)))) { + *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op))) = *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) } } @@ -2667,19 +2753,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MallocØ00__func__Ø000[0], str(1575), 14) } -// Call this routine to record the fact that an OOM (out-of-memory) error -// has happened. This routine will set db->mallocFailed, and also -// temporarily disable the lookaside memory allocator and interrupt -// any running VDBEs. +// C comment +// /* +// ** Call this routine to record the fact that an OOM (out-of-memory) error +// ** has happened. This routine will set db->mallocFailed, and also +// ** temporarily disable the lookaside memory allocator and interrupt +// ** any running VDBEs. +// */ func _sqlite3OomFault(tls *crt.TLS, _db *Xsqlite3) { if int32(_db.X17) != i32(0) || int32(_db.X18) != i32(0) { goto _1 } - *(*uint8)(unsafe.Pointer(&(_db.X17))) = uint8(i32(1)) - if (_db.X37) > i32(0) { - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(1) + *(*uint8)(unsafe.Pointer(&_db.X17)) = uint8(i32(1)) + if _db.X37 > i32(0) { + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(1) } - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1 + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) += 1 _1: } @@ -2706,7 +2795,7 @@ func _dbReallocFinish(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) } _pNew = _sqlite3DbMallocRawNN(tls, _db, _n) if _pNew != nil { - crt.Xmemcpy(tls, _pNew, _p, uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1)) + crt.Xmemcpy(tls, _pNew, _p, uint64((*t7)(unsafe.Pointer(&_db.X58)).X1)) _sqlite3DbFree(tls, _db, _p) } goto _7 @@ -2735,42 +2824,45 @@ func Xsqlite3_realloc64(tls *crt.TLS, _pOld unsafe.Pointer, _n uint64) (r0 unsaf return _sqlite3Realloc(tls, _pOld, _n) } -// Initialize SQLite. -// -// This routine must be called to initialize the memory allocation, -// VFS, and mutex subsystems prior to doing any serious work with -// SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT -// this routine will be called automatically by key routines such as -// sqlite3_open(). -// -// This routine is a no-op except on its very first call for the process, -// or for the first call after a call to sqlite3_shutdown. -// -// The first thread to call this routine runs the initialization to -// completion. If subsequent threads call this routine before the first -// thread has finished the initialization process, then the subsequent -// threads must block until the first thread finishes with the initialization. -// -// The first thread might call this routine recursively. Recursive -// calls to this routine should not block, of course. Otherwise the -// initialization process would never complete. -// -// Let X be the first thread to enter this routine. Let Y be some other -// thread. Then while the initial invocation of this routine by X is -// incomplete, it is required that: -// -// * Calls to this routine from Y must block until the outer-most -// call by X completes. -// -// * Recursive calls to this routine from thread X return immediately -// without blocking. +// C comment +// /* +// ** Initialize SQLite. +// ** +// ** This routine must be called to initialize the memory allocation, +// ** VFS, and mutex subsystems prior to doing any serious work with +// ** SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT +// ** this routine will be called automatically by key routines such as +// ** sqlite3_open(). +// ** +// ** This routine is a no-op except on its very first call for the process, +// ** or for the first call after a call to sqlite3_shutdown. +// ** +// ** The first thread to call this routine runs the initialization to +// ** completion. If subsequent threads call this routine before the first +// ** thread has finished the initialization process, then the subsequent +// ** threads must block until the first thread finishes with the initialization. +// ** +// ** The first thread might call this routine recursively. Recursive +// ** calls to this routine should not block, of course. Otherwise the +// ** initialization process would never complete. +// ** +// ** Let X be the first thread to enter this routine. Let Y be some other +// ** thread. Then while the initial invocation of this routine by X is +// ** incomplete, it is required that: +// ** +// ** * Calls to this routine from Y must block until the outer-most +// ** call by X completes. +// ** +// ** * Recursive calls to this routine from thread X return immediately +// ** without blocking. +// */ func Xsqlite3_initialize(tls *crt.TLS) (r0 int32) { var _rc int32 var _12_x uint64 var _12_y float64 var _pMaster *Xsqlite3_mutex i32(0) - if (_sqlite3Config.X28) != 0 { + if _sqlite3Config.X28 != 0 { return i32(0) } _rc = _sqlite3MutexInit(tls) @@ -2779,69 +2871,69 @@ func Xsqlite3_initialize(tls *crt.TLS) (r0 int32) { } _pMaster = _sqlite3MutexAlloc(tls, i32(2)) Xsqlite3_mutex_enter(tls, _pMaster) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X30))) = i32(1) - if (_sqlite3Config.X31) == 0 { + *(*int32)(unsafe.Pointer(&_sqlite3Config.X30)) = i32(1) + if _sqlite3Config.X31 == 0 { _rc = _sqlite3MallocInit(tls) } if _rc != i32(0) { goto _3 } - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X31))) = i32(1) - if (*Xsqlite3_mutex)(_sqlite3Config.X34) != nil { + *(*int32)(unsafe.Pointer(&_sqlite3Config.X31)) = i32(1) + if _sqlite3Config.X34 != nil { goto _4 } - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X34))))) = _sqlite3MutexAlloc(tls, i32(1)) - if (_sqlite3Config.X1) != 0 && ((*Xsqlite3_mutex)(_sqlite3Config.X34) == nil) { + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X34)))) = _sqlite3MutexAlloc(tls, i32(1)) + if _sqlite3Config.X1 != 0 && (_sqlite3Config.X34 == nil) { _rc = _sqlite3NomemError(tls, i32(140658)) } _4: _3: if _rc == i32(0) { - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X33))) += 1 + *(*int32)(unsafe.Pointer(&_sqlite3Config.X33)) += 1 } Xsqlite3_mutex_leave(tls, _pMaster) if _rc != i32(0) { return _rc } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34)) - if (_sqlite3Config.X28) != i32(0) || (_sqlite3Config.X29) != i32(0) { + if _sqlite3Config.X28 != i32(0) || _sqlite3Config.X29 != i32(0) { goto _10 } - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X29))) = i32(1) - crt.Xmemset(tls, (unsafe.Pointer)(&_sqlite3BuiltinFunctions), i32(0), u64(184)) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X29)) = i32(1) + crt.Xmemset(tls, unsafe.Pointer(&_sqlite3BuiltinFunctions), i32(0), u64(184)) _sqlite3RegisterBuiltinFunctions(tls) - if (_sqlite3Config.X32) == i32(0) { + if _sqlite3Config.X32 == i32(0) { _rc = _sqlite3PcacheInitialize(tls) } if _rc == i32(0) { - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X32))) = i32(1) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X32)) = i32(1) _rc = _sqlite3OsInit(tls) } if _rc == i32(0) { _sqlite3PCacheBufferSetup(tls, _sqlite3Config.X22, _sqlite3Config.X23, _sqlite3Config.X24) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X28))) = i32(1) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X28)) = i32(1) } - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X29))) = i32(0) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X29)) = i32(0) _10: Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34)) Xsqlite3_mutex_enter(tls, _pMaster) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X33))) -= 1 - if (_sqlite3Config.X33) <= i32(0) { + *(*int32)(unsafe.Pointer(&_sqlite3Config.X33)) -= 1 + if _sqlite3Config.X33 <= i32(0) { func() { - if (_sqlite3Config.X33) != i32(0) { + if _sqlite3Config.X33 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140723), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000))), unsafe.Pointer(str(1605))) crt.X__builtin_abort(tls) } }() Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34)) - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X34))))) = nil + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X34)))) = nil } Xsqlite3_mutex_leave(tls, _pMaster) if _rc == i32(0) { _12_x = u64(9223372036854775807) i32(0) i32(0) - crt.Xmemcpy(tls, (unsafe.Pointer)(&_12_y), (unsafe.Pointer)(&_12_x), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer(&_12_y), unsafe.Pointer(&_12_x), uint64(i32(8))) func() { if _sqlite3IsNaN(tls, _12_y) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000))), unsafe.Pointer(str(1642))) @@ -2855,55 +2947,63 @@ _10: panic(0) } -// Initialize the mutex system. +// C comment +// /* +// ** Initialize the mutex system. +// */ func _sqlite3MutexInit(tls *crt.TLS) (r0 int32) { var _rc int32 var _1_pFrom, _1_pTo *Xsqlite3_mutex_methods _rc = i32(0) - if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) != nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X2) != nil { goto _0 } - _1_pTo = (*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))) - if (_sqlite3Config.X1) != 0 { + _1_pTo = (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)) + if _sqlite3Config.X1 != 0 { _1_pFrom = _sqlite3DefaultMutex(tls) goto _2 } _1_pFrom = _sqlite3NoopMutex(tls) _2: - *(*func(*crt.TLS) int32)(unsafe.Pointer(&(_1_pTo.X0))) = _1_pFrom.X0 - *(*func(*crt.TLS) int32)(unsafe.Pointer(&(_1_pTo.X1))) = _1_pFrom.X1 - *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X3))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_1_pFrom.X3)})) - *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X4))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_1_pFrom.X4)})) - *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X5))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_1_pFrom.X5)})) - *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X6))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_1_pFrom.X6)})) - *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X7))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_1_pFrom.X7)})) - *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X8))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_1_pFrom.X8)})) + *(*func(*crt.TLS) int32)(unsafe.Pointer(&_1_pTo.X0)) = _1_pFrom.X0 + *(*func(*crt.TLS) int32)(unsafe.Pointer(&_1_pTo.X1)) = _1_pFrom.X1 + *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_1_pTo.X3)))) = func() func(*crt.TLS, *Xsqlite3_mutex) { + v := _1_pFrom.X3 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_1_pTo.X4)))) = func() func(*crt.TLS, *Xsqlite3_mutex) { + v := _1_pFrom.X4 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_1_pTo.X5)))) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := _1_pFrom.X5 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_1_pTo.X6)))) = func() func(*crt.TLS, *Xsqlite3_mutex) { + v := _1_pFrom.X6 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_1_pTo.X7)))) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := _1_pFrom.X7 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_1_pTo.X8)))) = func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := _1_pFrom.X8 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }() _sqlite3MemoryBarrier(tls) - *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer((*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&(_1_pTo.X2))))) = *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{(_1_pFrom.X2)})) + *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer((*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&_1_pTo.X2)))) = func() func(*crt.TLS, int32) *Xsqlite3_mutex { + v := _1_pFrom.X2 + return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v)) + }() _0: func() { - if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X0) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MutexInitØ00__func__Ø000))), unsafe.Pointer(str(1658))) crt.X__builtin_abort(tls) } }() - _rc = ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X0)(tls) + _rc = ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X0)(tls) _mutexIsInit = i32(1) bug20530(_mutexIsInit) return _rc @@ -2933,7 +3033,10 @@ func init() { }{_pthreadMutexNotheld}))} } -// Initialize and deinitialize the mutex subsystem. +// C comment +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ func _pthreadMutexInit(tls *crt.TLS) (r0 int32) { return i32(0) } @@ -2942,52 +3045,55 @@ func _pthreadMutexEnd(tls *crt.TLS) (r0 int32) { return i32(0) } -// The sqlite3_mutex_alloc() routine allocates a new -// mutex and returns a pointer to it. If it returns NULL -// that means that a mutex could not be allocated. SQLite -// will unwind its stack and return an error. The argument -// to sqlite3_mutex_alloc() is one of these integer constants: -// -// <ul> -// <li> SQLITE_MUTEX_FAST -// <li> SQLITE_MUTEX_RECURSIVE -// <li> SQLITE_MUTEX_STATIC_MASTER -// <li> SQLITE_MUTEX_STATIC_MEM -// <li> SQLITE_MUTEX_STATIC_OPEN -// <li> SQLITE_MUTEX_STATIC_PRNG -// <li> SQLITE_MUTEX_STATIC_LRU -// <li> SQLITE_MUTEX_STATIC_PMEM -// <li> SQLITE_MUTEX_STATIC_APP1 -// <li> SQLITE_MUTEX_STATIC_APP2 -// <li> SQLITE_MUTEX_STATIC_APP3 -// <li> SQLITE_MUTEX_STATIC_VFS1 -// <li> SQLITE_MUTEX_STATIC_VFS2 -// <li> SQLITE_MUTEX_STATIC_VFS3 -// </ul> -// -// The first two constants cause sqlite3_mutex_alloc() to create -// a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -// is used but not necessarily so when SQLITE_MUTEX_FAST is used. -// The mutex implementation does not need to make a distinction -// between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -// not want to. But SQLite will only request a recursive mutex in -// cases where it really needs one. If a faster non-recursive mutex -// implementation is available on the host platform, the mutex subsystem -// might return such a mutex in response to SQLITE_MUTEX_FAST. -// -// The other allowed parameters to sqlite3_mutex_alloc() each return -// a pointer to a static preexisting mutex. Six static mutexes are -// used by the current version of SQLite. Future versions of SQLite -// may add additional static mutexes. Static mutexes are for internal -// use by SQLite only. Applications that use SQLite mutexes should -// use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or -// SQLITE_MUTEX_RECURSIVE. -// -// Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST -// or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -// returns a different mutex on every call. But for the static -// mutex types, the same mutex is returned on every call that has -// the same type number. +// C comment +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// ** <ul> +// ** <li> SQLITE_MUTEX_FAST +// ** <li> SQLITE_MUTEX_RECURSIVE +// ** <li> SQLITE_MUTEX_STATIC_MASTER +// ** <li> SQLITE_MUTEX_STATIC_MEM +// ** <li> SQLITE_MUTEX_STATIC_OPEN +// ** <li> SQLITE_MUTEX_STATIC_PRNG +// ** <li> SQLITE_MUTEX_STATIC_LRU +// ** <li> SQLITE_MUTEX_STATIC_PMEM +// ** <li> SQLITE_MUTEX_STATIC_APP1 +// ** <li> SQLITE_MUTEX_STATIC_APP2 +// ** <li> SQLITE_MUTEX_STATIC_APP3 +// ** <li> SQLITE_MUTEX_STATIC_VFS1 +// ** <li> SQLITE_MUTEX_STATIC_VFS2 +// ** <li> SQLITE_MUTEX_STATIC_VFS3 +// ** </ul> +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ func _pthreadMutexAlloc(tls *crt.TLS, _iType int32) (r0 *Xsqlite3_mutex) { var _3_recursiveAttr crt.Xpthread_mutexattr_t var _p *Xsqlite3_mutex @@ -3005,14 +3111,14 @@ _1: if _p != nil { crt.Xpthread_mutexattr_init(tls, &_3_recursiveAttr) crt.Xpthread_mutexattr_settype(tls, &_3_recursiveAttr, i32(1)) - crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))), &_3_recursiveAttr) + crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0)), &_3_recursiveAttr) crt.Xpthread_mutexattr_destroy(tls, &_3_recursiveAttr) } goto _5 _2: _p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, u64(64))) if _p != nil { - crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))), nil) + crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0)), nil) } goto _5 _3: @@ -3020,11 +3126,11 @@ _3: _sqlite3MisuseError(tls, i32(23329)) return nil } - _p = (*Xsqlite3_mutex)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pthreadMutexAllocØ00staticMutexesØ001)) + 64*uintptr(_iType-i32(2)))) + _p = (*Xsqlite3_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pthreadMutexAllocØ00staticMutexesØ001)) + 64*uintptr(_iType-i32(2)))) goto _5 _5: if _p != nil { - *(*int32)(unsafe.Pointer(&(_p.X1))) = _iType + *(*int32)(unsafe.Pointer(&_p.X1)) = _iType } return _p @@ -3045,42 +3151,50 @@ func _sqlite3MisuseError(tls *crt.TLS, _lineno int32) (r0 int32) { return _reportError(tls, i32(21), _lineno, str(1695)) } -// The following routines are substitutes for constants SQLITE_CORRUPT, -// SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error -// constants. They serve two purposes: -// -// 1. Serve as a convenient place to set a breakpoint in a debugger -// to detect when version error conditions occurs. -// -// 2. Invoke sqlite3_log() to provide the source code location where -// a low-level error is first detected. +// C comment +// /* +// ** The following routines are substitutes for constants SQLITE_CORRUPT, +// ** SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error +// ** constants. They serve two purposes: +// ** +// ** 1. Serve as a convenient place to set a breakpoint in a debugger +// ** to detect when version error conditions occurs. +// ** +// ** 2. Invoke sqlite3_log() to provide the source code location where +// ** a low-level error is first detected. +// */ func _reportError(tls *crt.TLS, _iErr int32, _lineno int32, _zType *int8) (r0 int32) { Xsqlite3_log(tls, _iErr, str(1702), unsafe.Pointer(_zType), _lineno, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(20))+uintptr(unsafe.Pointer(Xsqlite3_sourceid(tls))))))) return _iErr } -// IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a -// pointer to a string constant whose value is the same as the -// SQLITE_SOURCE_ID C preprocessor macro. +// C comment +// /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a +// ** pointer to a string constant whose value is the same as the +// ** SQLITE_SOURCE_ID C preprocessor macro. +// */ func Xsqlite3_sourceid(tls *crt.TLS) (r0 *int8) { return str(1727) } var _pthreadMutexAllocØ00staticMutexesØ001 [12]Xsqlite3_mutex -// This routine deallocates a previously -// allocated mutex. SQLite is careful to deallocate every -// mutex that it allocates. +// C comment +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ func _pthreadMutexFree(tls *crt.TLS, _p *Xsqlite3_mutex) { func() { - if (_p.X2) != i32(0) { + if _p.X2 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23350), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexFreeØ00__func__Ø000))), unsafe.Pointer(str(1812))) crt.X__builtin_abort(tls) } }() - if ((_p.X1) == i32(0)) || ((_p.X1) == i32(1)) { - crt.Xpthread_mutex_destroy(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0)))) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + if (_p.X1 == i32(0)) || (_p.X1 == i32(1)) { + crt.Xpthread_mutex_destroy(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0))) + Xsqlite3_free(tls, unsafe.Pointer(_p)) goto _4 } _sqlite3MisuseError(tls, i32(23360)) @@ -3093,38 +3207,41 @@ func init() { crt.Xstrncpy(nil, &_pthreadMutexFreeØ00__func__Ø000[0], str(1823), 17) } -// The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -// to enter a mutex. If another thread is already within the mutex, -// sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -// SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK -// upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can -// be entered multiple times by the same thread. In such cases the, -// mutex must be exited an equal number of times before another thread -// can enter. If the same thread tries to enter any other kind of mutex -// more than once, the behavior is undefined. +// C comment +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ func _pthreadMutexEnter(tls *crt.TLS, _p *Xsqlite3_mutex) { func() { - if (_p.X1) != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 { + if _p.X1 != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23377), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(1840))) crt.X__builtin_abort(tls) } }() - crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0)))) + crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0))) func() { - if (_p.X2) <= i32(0) && (_p.X3) != uint64(i32(0)) { + if _p.X2 <= i32(0) && _p.X3 != uint64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23406), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(1896))) crt.X__builtin_abort(tls) } }() - *(*uint64)(unsafe.Pointer(&(_p.X3))) = crt.Xpthread_self(tls) - *(*int32)(unsafe.Pointer(&(_p.X2))) += 1 - if (_p.X4) != 0 { + *(*uint64)(unsafe.Pointer(&_p.X3)) = crt.Xpthread_self(tls) + *(*int32)(unsafe.Pointer(&_p.X2)) += 1 + if _p.X4 != 0 { crt.Xprintf(tls, str(1921), unsafe.Pointer(_p), _p.X4, _p.X2) } } func _pthreadMutexNotheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { - return bool2int(((_p.X2) == i32(0)) || (crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) == i32(0))) + return bool2int((_p.X2 == i32(0)) || (crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) == i32(0))) } var _pthreadMutexEnterØ00__func__Ø000 [18]int8 @@ -3136,20 +3253,20 @@ func init() { func _pthreadMutexTry(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { var _rc int32 func() { - if (_p.X1) != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 { + if _p.X1 != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23420), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexTryØ00__func__Ø000))), unsafe.Pointer(str(1840))) crt.X__builtin_abort(tls) } }() - if crt.Xpthread_mutex_trylock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0)))) == i32(0) { - *(*uint64)(unsafe.Pointer(&(_p.X3))) = crt.Xpthread_self(tls) - *(*int32)(unsafe.Pointer(&(_p.X2))) += 1 + if crt.Xpthread_mutex_trylock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0))) == i32(0) { + *(*uint64)(unsafe.Pointer(&_p.X3)) = crt.Xpthread_self(tls) + *(*int32)(unsafe.Pointer(&_p.X2)) += 1 _rc = i32(0) goto _4 } _rc = i32(5) _4: - if (_rc == i32(0)) && (_p.X4) != 0 { + if (_rc == i32(0)) && _p.X4 != 0 { crt.Xprintf(tls, str(1921), unsafe.Pointer(_p), _p.X4, _p.X2) } return _rc @@ -3161,10 +3278,13 @@ func init() { crt.Xstrncpy(nil, &_pthreadMutexTryØ00__func__Ø000[0], str(1973), 16) } -// The sqlite3_mutex_leave() routine exits a mutex that was -// previously entered by the same thread. The behavior -// is undefined if the mutex is not currently entered or -// is not currently allocated. SQLite will never do either. +// C comment +// /* +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. +// */ func _pthreadMutexLeave(tls *crt.TLS, _p *Xsqlite3_mutex) { func() { if _pthreadMutexHeld(tls, _p) == 0 { @@ -3172,24 +3292,24 @@ func _pthreadMutexLeave(tls *crt.TLS, _p *Xsqlite3_mutex) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X2))) -= 1 - if (_p.X2) == i32(0) { - *(*uint64)(unsafe.Pointer(&(_p.X3))) = uint64(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X2)) -= 1 + if _p.X2 == i32(0) { + *(*uint64)(unsafe.Pointer(&_p.X3)) = uint64(i32(0)) } func() { - if (_p.X2) != i32(0) && (_p.X1) != i32(1) { + if _p.X2 != i32(0) && _p.X1 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23481), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(2009))) crt.X__builtin_abort(tls) } }() - crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0)))) - if (_p.X4) != 0 { + crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&_p.X0))) + if _p.X4 != 0 { crt.Xprintf(tls, str(2053), unsafe.Pointer(_p), _p.X4, _p.X2) } } func _pthreadMutexHeld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { - return bool2int(((_p.X2) != i32(0)) && crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) != 0) + return bool2int((_p.X2 != i32(0)) && crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) != 0) } var _pthreadMutexLeaveØ00__func__Ø000 [18]int8 @@ -3222,7 +3342,10 @@ func init() { }{_debugMutexNotheld}))} } -// Initialize and deinitialize the mutex subsystem. +// C comment +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ func _debugMutexInit(tls *crt.TLS) (r0 int32) { return i32(0) } @@ -3231,9 +3354,12 @@ func _debugMutexEnd(tls *crt.TLS) (r0 int32) { return i32(0) } -// The sqlite3_mutex_alloc() routine allocates a new -// mutex and returns a pointer to it. If it returns NULL -// that means that a mutex could not be allocated. +// C comment +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. +// */ func _debugMutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { var _pNew *Xsqlite3_debug_mutex _pNew = nil @@ -3249,8 +3375,8 @@ func _debugMutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { _1: _pNew = (*Xsqlite3_debug_mutex)(_sqlite3Malloc(tls, u64(8))) if _pNew != nil { - *(*int32)(unsafe.Pointer(&(_pNew.X0))) = _id - *(*int32)(unsafe.Pointer(&(_pNew.X1))) = i32(0) + *(*int32)(unsafe.Pointer(&_pNew.X0)) = _id + *(*int32)(unsafe.Pointer(&_pNew.X1)) = i32(0) } goto _5 _3: @@ -3258,8 +3384,8 @@ _3: _sqlite3MisuseError(tls, i32(23039)) return nil } - _pNew = (*Xsqlite3_debug_mutex)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_debugMutexAllocØ00aStaticØ001)) + 8*uintptr(_id-i32(2)))) - *(*int32)(unsafe.Pointer(&(_pNew.X0))) = _id + _pNew = (*Xsqlite3_debug_mutex)(unsafe.Pointer(uintptr(unsafe.Pointer(&_debugMutexAllocØ00aStaticØ001)) + 8*uintptr(_id-i32(2)))) + *(*int32)(unsafe.Pointer(&_pNew.X0)) = _id goto _5 _5: return (*Xsqlite3_mutex)(unsafe.Pointer(_pNew)) @@ -3267,18 +3393,21 @@ _5: var _debugMutexAllocØ00aStaticØ001 [12]Xsqlite3_debug_mutex -// This routine deallocates a previously allocated mutex. +// C comment +// /* +// ** This routine deallocates a previously allocated mutex. +// */ func _debugMutexFree(tls *crt.TLS, _pX *Xsqlite3_mutex) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) func() { - if (_p.X1) != i32(0) { + if _p.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23056), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexFreeØ00__func__Ø000))), unsafe.Pointer(str(2105))) crt.X__builtin_abort(tls) } }() - if ((_p.X0) == i32(1)) || ((_p.X0) == i32(0)) { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + if (_p.X0 == i32(1)) || (_p.X0 == i32(0)) { + Xsqlite3_free(tls, unsafe.Pointer(_p)) goto _4 } _sqlite3MisuseError(tls, i32(23061)) @@ -3291,31 +3420,34 @@ func init() { crt.Xstrncpy(nil, &_debugMutexFreeØ00__func__Ø000[0], str(2115), 15) } -// The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -// to enter a mutex. If another thread is already within the mutex, -// sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -// SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK -// upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can -// be entered multiple times by the same thread. In such cases the, -// mutex must be exited an equal number of times before another thread -// can enter. If the same thread tries to enter any other kind of mutex -// more than once, the behavior is undefined. +// C comment +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ func _debugMutexEnter(tls *crt.TLS, _pX *Xsqlite3_mutex) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) func() { - if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { + if _p.X0 != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23079), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(2130))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X1))) += 1 + *(*int32)(unsafe.Pointer(&_p.X1)) += 1 } func _debugMutexNotheld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) - return bool2int((_p == nil) || ((_p.X1) == i32(0))) + return bool2int((_p == nil) || (_p.X1 == i32(0))) } var _debugMutexEnterØ00__func__Ø000 [16]int8 @@ -3328,12 +3460,12 @@ func _debugMutexTry(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) func() { - if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { + if _p.X0 != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23084), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexTryØ00__func__Ø000))), unsafe.Pointer(str(2130))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X1))) += 1 + *(*int32)(unsafe.Pointer(&_p.X1)) += 1 return i32(0) } @@ -3343,10 +3475,13 @@ func init() { crt.Xstrncpy(nil, &_debugMutexTryØ00__func__Ø000[0], str(2201), 14) } -// The sqlite3_mutex_leave() routine exits a mutex that was -// previously entered by the same thread. The behavior -// is undefined if the mutex is not currently entered or -// is not currently allocated. SQLite will never do either. +// C comment +// /* +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. +// */ func _debugMutexLeave(tls *crt.TLS, _pX *Xsqlite3_mutex) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) @@ -3356,21 +3491,24 @@ func _debugMutexLeave(tls *crt.TLS, _pX *Xsqlite3_mutex) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X1))) -= 1 + *(*int32)(unsafe.Pointer(&_p.X1)) -= 1 func() { - if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { + if _p.X0 != i32(1) && _debugMutexNotheld(tls, _pX) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23099), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(2130))) crt.X__builtin_abort(tls) } }() } -// The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are -// intended for use inside assert() statements. +// C comment +// /* +// ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +// ** intended for use inside assert() statements. +// */ func _debugMutexHeld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) { var _p *Xsqlite3_debug_mutex _p = (*Xsqlite3_debug_mutex)(unsafe.Pointer(_pX)) - return bool2int((_p == nil) || ((_p.X1) > i32(0))) + return bool2int((_p == nil) || (_p.X1 > i32(0))) } var _debugMutexLeaveØ00__func__Ø000 [16]int8 @@ -3379,9 +3517,12 @@ func init() { crt.Xstrncpy(nil, &_debugMutexLeaveØ00__func__Ø000[0], str(2234), 16) } -// Try to provide a memory barrier operation, needed for initialization -// and also for the implementation of xShmBarrier in the VFS in cases -// where SQLite is compiled without mutexes. +// C comment +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ func _sqlite3MemoryBarrier(tls *crt.TLS) { } @@ -3394,7 +3535,7 @@ func init() { var _mutexIsInit int32 func _sqlite3MutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { - if (_sqlite3Config.X1) == 0 { + if _sqlite3Config.X1 == 0 { return nil } func() { @@ -3404,16 +3545,15 @@ func _sqlite3MutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { } }() func() { - if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X2) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22845), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000))), unsafe.Pointer(str(2292))) crt.X__builtin_abort(tls) } }() - return (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)})))(tls, _id) + return func() func(*crt.TLS, int32) *Xsqlite3_mutex { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X2 + return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v)) + }()(tls, _id) } var _sqlite3MutexAllocØ00__func__Ø000 [18]int8 @@ -3422,79 +3562,88 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MutexAllocØ00__func__Ø000[0], str(2330), 18) } -// Initialize the memory allocation subsystem. +// C comment +// /* +// ** Initialize the memory allocation subsystem. +// */ func _sqlite3MallocInit(tls *crt.TLS) (r0 int32) { var _rc, _2_i, _2_n, _2_sz int32 var _2_pSlot *Xsqlite3_file if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, int32) unsafe.Pointer }{nil})) { _sqlite3MemSetDefault(tls) } - crt.Xmemset(tls, (unsafe.Pointer)(&_mem0), i32(0), u64(40)) - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X0))))) = _sqlite3MutexAlloc(tls, i32(3)) - if (_sqlite3Config.X19) == nil || (_sqlite3Config.X20) < i32(100) || (_sqlite3Config.X21) <= i32(0) { + crt.Xmemset(tls, unsafe.Pointer(&_mem0), i32(0), u64(40)) + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem0.X0)))) = _sqlite3MutexAlloc(tls, i32(3)) + if _sqlite3Config.X19 == nil || _sqlite3Config.X20 < i32(100) || _sqlite3Config.X21 <= i32(0) { goto _3 } - _2_sz = (_sqlite3Config.X20) & i32(-8) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = _2_sz + _2_sz = _sqlite3Config.X20 & i32(-8) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X20)) = _2_sz _2_pSlot = (*Xsqlite3_file)(_sqlite3Config.X19) _2_n = _sqlite3Config.X21 - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = _2_pSlot - *(*uint32)(unsafe.Pointer(&(_mem0.X4))) = uint32(_2_n) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem0.X3)))) = _2_pSlot + *(*uint32)(unsafe.Pointer(&_mem0.X4)) = uint32(_2_n) _2_i = i32(0) _4: if _2_i >= (_2_n - i32(1)) { goto _7 } - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = (*Xsqlite3_file)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_sz) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_2_pSlot)))))))) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pSlot.X0)))) = (*Xsqlite3_file)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_sz) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_2_pSlot)))))))) _2_pSlot = (*Xsqlite3_file)(_2_pSlot.X0) _2_i += 1 goto _4 _7: - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = nil - *(*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X2))) = (unsafe.Pointer)((*Xsqlite3_file)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pSlot)) + 8*uintptr(i32(1))))) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pSlot.X0)))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_mem0.X2)) = unsafe.Pointer((*Xsqlite3_file)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pSlot)) + 8*uintptr(i32(1))))) goto _8 _3: - *(*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X2))) = nil - *(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X19))) = nil - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = i32(0) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X21))) = i32(0) + *(*unsafe.Pointer)(unsafe.Pointer(&_mem0.X2)) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X19)) = nil + *(*int32)(unsafe.Pointer(&_sqlite3Config.X20)) = i32(0) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X21)) = i32(0) _8: - if ((_sqlite3Config.X22 == nil) || ((_sqlite3Config.X23) < i32(512))) || ((_sqlite3Config.X24) <= i32(0)) { - *(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X22))) = nil - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X23))) = i32(0) + if ((_sqlite3Config.X22 == nil) || (_sqlite3Config.X23 < i32(512))) || (_sqlite3Config.X24 <= i32(0)) { + *(*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X22)) = nil + *(*int32)(unsafe.Pointer(&_sqlite3Config.X23)) = i32(0) } - _rc = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X5)(tls, (*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X7) + _rc = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X5)(tls, (*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X7) if _rc != i32(0) { - crt.Xmemset(tls, (unsafe.Pointer)(&_mem0), i32(0), u64(40)) + crt.Xmemset(tls, unsafe.Pointer(&_mem0), i32(0), u64(40)) } return _rc } -// This routine is the only routine in this file with external linkage. -// -// Populate the low-level memory allocation function pointers in -// sqlite3GlobalConfig.m with pointers to the routines in this file. +// C comment +// /* +// ** This routine is the only routine in this file with external linkage. +// ** +// ** Populate the low-level memory allocation function pointers in +// ** sqlite3GlobalConfig.m with pointers to the routines in this file. +// */ func _sqlite3MemSetDefault(tls *crt.TLS) { Xsqlite3_config(tls, i32(4), unsafe.Pointer(&_sqlite3MemSetDefaultØ00defaultMethodsØ001)) } -// This API allows applications to modify the global configuration of -// the SQLite library at run-time. -// -// This routine should only be called when there are no outstanding -// database connections or memory allocations. This routine is not -// threadsafe. Failure to heed these warnings can lead to unpredictable -// behavior. +// C comment +// /* +// ** This API allows applications to modify the global configuration of +// ** the SQLite library at run-time. +// ** +// ** This routine should only be called when there are no outstanding +// ** database connections or memory allocations. This routine is not +// ** threadsafe. Failure to heed these warnings can lead to unpredictable +// ** behavior. +// */ func Xsqlite3_config(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) { var _rc int32 var _22_szMmap, _22_mxMmap int64 var _ap []interface{} _rc = i32(0) - if (_sqlite3Config.X28) != 0 { + if _sqlite3Config.X28 != 0 { return _sqlite3MisuseError(tls, i32(140829)) } _ap = args @@ -3548,30 +3697,30 @@ func Xsqlite3_config(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) { } _2: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(0) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(0) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X1)) = i32(0) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X2)) = i32(0) goto _25 _3: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(1) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(0) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X1)) = i32(1) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X2)) = i32(0) goto _25 _4: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(1) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(1) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X1)) = i32(1) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X2)) = i32(1) goto _25 _5: - *(*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))) = *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) + *(*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)) = *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) goto _25 _6: *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.X11 goto _25 _7: - *(*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))) = *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) + *(*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)) = *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) goto _25 _8: if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, int32) unsafe.Pointer }{nil})) { _sqlite3MemSetDefault(tls) @@ -3579,17 +3728,17 @@ _8: *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.X10 goto _25 _9: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X0))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X0)) = crt.VAInt32(&_ap) goto _25 _10: - *(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X19))) = crt.VAPointer(&_ap) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = crt.VAInt32(&_ap) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X21))) = crt.VAInt32(&_ap) + *(*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X19)) = crt.VAPointer(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X20)) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X21)) = crt.VAInt32(&_ap) goto _25 _11: - *(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X22))) = crt.VAPointer(&_ap) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X23))) = crt.VAInt32(&_ap) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X24))) = crt.VAInt32(&_ap) + *(*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X22)) = crt.VAPointer(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X23)) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X24)) = crt.VAInt32(&_ap) goto _25 _12: *(*int32)(crt.VAPointer(&_ap)) = (_sqlite3HeaderSizeBtree(tls) + _sqlite3HeaderSizePcache(tls)) + _sqlite3HeaderSizePcache1(tls) @@ -3600,12 +3749,12 @@ _14: _rc = i32(1) goto _25 _15: - *(*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))) = *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) + *(*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)) = *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) goto _25 _16: if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 }{nil})) { _sqlite3PCacheSetDefault(tls) @@ -3613,18 +3762,18 @@ _16: *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) = _sqlite3Config.X12 goto _25 _17: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X7))) = crt.VAInt32(&_ap) - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X8))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X7)) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X8)) = crt.VAInt32(&_ap) goto _25 _18: - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_sqlite3Config.X35))) = crt.VAOther(&_ap).(func(*crt.TLS, unsafe.Pointer, int32, *int8)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X36))) = crt.VAPointer(&_ap) + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&_sqlite3Config.X35)) = crt.VAOther(&_ap).(func(*crt.TLS, unsafe.Pointer, int32, *int8)) + *(*unsafe.Pointer)(unsafe.Pointer(&_sqlite3Config.X36)) = crt.VAPointer(&_ap) goto _25 _19: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X3))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X3)) = crt.VAInt32(&_ap) goto _25 _20: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X4))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X4)) = crt.VAInt32(&_ap) goto _25 _21: _22_szMmap = crt.VAInt64(&_ap) @@ -3638,14 +3787,14 @@ _21: if _22_szMmap > _22_mxMmap { _22_szMmap = _22_mxMmap } - *(*int64)(unsafe.Pointer(&(_sqlite3Config.X18))) = _22_mxMmap - *(*int64)(unsafe.Pointer(&(_sqlite3Config.X17))) = _22_szMmap + *(*int64)(unsafe.Pointer(&_sqlite3Config.X18)) = _22_mxMmap + *(*int64)(unsafe.Pointer(&_sqlite3Config.X17)) = _22_szMmap goto _25 _22: - *(*uint32)(unsafe.Pointer(&(_sqlite3Config.X27))) = crt.VAUint32(&_ap) + *(*uint32)(unsafe.Pointer(&_sqlite3Config.X27)) = crt.VAUint32(&_ap) goto _25 _23: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X9))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X9)) = crt.VAInt32(&_ap) goto _25 _24: _rc = i32(1) @@ -3655,25 +3804,37 @@ _25: return _rc } -// Return the size of the header added to each page by this module. +// C comment +// /* +// ** Return the size of the header added to each page by this module. +// */ func _sqlite3HeaderSizeBtree(tls *crt.TLS) (r0 int32) { return int32(u64(136)) } -// Return the size of the header added by this middleware layer -// in the page-cache hierarchy. +// C comment +// /* +// ** Return the size of the header added by this middleware layer +// ** in the page-cache hierarchy. +// */ func _sqlite3HeaderSizePcache(tls *crt.TLS) (r0 int32) { return int32(u64(72)) } -// Return the size of the header on each page of this PCACHE implementation. +// C comment +// /* +// ** Return the size of the header on each page of this PCACHE implementation. +// */ func _sqlite3HeaderSizePcache1(tls *crt.TLS) (r0 int32) { return int32(u64(56)) } -// This function is called during initialization (sqlite3_initialize()) to -// install the default pluggable cache module, assuming the user has not -// already provided an alternative. +// C comment +// /* +// ** This function is called during initialization (sqlite3_initialize()) to +// ** install the default pluggable cache module, assuming the user has not +// ** already provided an alternative. +// */ func _sqlite3PCacheSetDefault(tls *crt.TLS) { Xsqlite3_config(tls, i32(18), unsafe.Pointer(&_sqlite3PCacheSetDefaultØ00defaultMethodsØ001)) } @@ -3690,28 +3851,31 @@ func init() { }{_pcache1Rekey})), X10: _pcache1Truncate, X11: _pcache1Destroy, X12: _pcache1Shrink} } -// Implementation of the sqlite3_pcache.xInit method. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xInit method. +// */ func _pcache1Init(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) { func() { - if (_pcache1_g.X1) != i32(0) { + if _pcache1_g.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45688), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1InitØ00__func__Ø000))), unsafe.Pointer(str(2348))) crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_pcache1_g), i32(0), u64(144)) - *(*int32)(unsafe.Pointer(&(_pcache1_g.X2))) = bool2int((_sqlite3Config.X22 == nil) || ((_sqlite3Config.X1) > i32(0))) - if (_sqlite3Config.X1) != 0 { - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X0))))) = _sqlite3MutexAlloc(tls, i32(6)) - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X9))))) = _sqlite3MutexAlloc(tls, i32(7)) + crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), i32(0), u64(144)) + *(*int32)(unsafe.Pointer(&_pcache1_g.X2)) = bool2int((_sqlite3Config.X22 == nil) || (_sqlite3Config.X1 > i32(0))) + if _sqlite3Config.X1 != 0 { + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&_pcache1_g.X0)).X0))))) = _sqlite3MutexAlloc(tls, i32(6)) + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X9)))) = _sqlite3MutexAlloc(tls, i32(7)) } - if ((_pcache1_g.X2) != 0 && ((_sqlite3Config.X24) != i32(0))) && (_sqlite3Config.X22 == nil) { - *(*int32)(unsafe.Pointer(&(_pcache1_g.X3))) = _sqlite3Config.X24 + if (_pcache1_g.X2 != 0 && (_sqlite3Config.X24 != i32(0))) && (_sqlite3Config.X22 == nil) { + *(*int32)(unsafe.Pointer(&_pcache1_g.X3)) = _sqlite3Config.X24 goto _7 } - *(*int32)(unsafe.Pointer(&(_pcache1_g.X3))) = i32(0) + *(*int32)(unsafe.Pointer(&_pcache1_g.X3)) = i32(0) _7: - *(*uint32)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X3))) = uint32(i32(10)) - *(*int32)(unsafe.Pointer(&(_pcache1_g.X1))) = i32(1) + *(*uint32)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&_pcache1_g.X0)).X3))) = uint32(i32(10)) + *(*int32)(unsafe.Pointer(&_pcache1_g.X1)) = i32(1) return i32(0) } @@ -3721,17 +3885,20 @@ func init() { crt.Xstrncpy(nil, &_pcache1InitØ00__func__Ø000[0], str(2366), 12) } -// Implementation of the sqlite3_pcache.xShutdown method. -// Note that the static mutex allocated in xInit does -// not need to be freed. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xShutdown method. +// ** Note that the static mutex allocated in xInit does +// ** not need to be freed. +// */ func _pcache1Shutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) { func() { - if (_pcache1_g.X1) == i32(0) { + if _pcache1_g.X1 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45741), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ShutdownØ00__func__Ø000))), unsafe.Pointer(str(2378))) crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_pcache1_g), i32(0), u64(144)) + crt.Xmemset(tls, unsafe.Pointer(&_pcache1_g), i32(0), u64(144)) } var _pcache1ShutdownØ00__func__Ø000 [16]int8 @@ -3740,9 +3907,12 @@ func init() { crt.Xstrncpy(nil, &_pcache1ShutdownØ00__func__Ø000[0], str(2396), 16) } -// Implementation of the sqlite3_pcache.xCreate method. -// -// Allocate a new cache. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xCreate method. +// ** +// ** Allocate a new cache. +// */ func _pcache1Create(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32) (r0 unsafe.Pointer) { var _sz int32 var _pCache *XPCache1 @@ -3764,22 +3934,22 @@ func _pcache1Create(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int if _pCache == nil { goto _6 } - if (_pcache1_g.X2) != 0 { - _pGroup = (*XPGroup)(unsafe.Pointer((*XPCache1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache)) + 80*uintptr(i32(1)))))) - *(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = uint32(i32(10)) + if _pcache1_g.X2 != 0 { + _pGroup = (*XPGroup)(unsafe.Pointer((*XPCache1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache)) + 80*uintptr(i32(1)))))) + *(*uint32)(unsafe.Pointer(&_pGroup.X3)) = uint32(i32(10)) goto _8 } - _pGroup = (*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))) + _pGroup = (*XPGroup)(unsafe.Pointer(&_pcache1_g.X0)) _8: - if int32((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X4) == i32(0) { - *(*uint8)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X4))) = uint8(i32(1)) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8))))) = store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X7))))), (*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5)))) - } - *(**XPGroup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X0))))) = _pGroup - *(*int32)(unsafe.Pointer(&(_pCache.X1))) = _szPage - *(*int32)(unsafe.Pointer(&(_pCache.X2))) = _szExtra - *(*int32)(unsafe.Pointer(&(_pCache.X3))) = int32(uint64(_szPage+_szExtra) + u64(56)) - *(*int32)(unsafe.Pointer(&(_pCache.X4))) = func() int32 { + if int32((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X4) == i32(0) { + *(*uint8)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X4))) = uint8(i32(1)) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X8))))) = store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X7))))), (*XPgHdr1)(unsafe.Pointer(&_pGroup.X5))) + } + *(**XPGroup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X0)))) = _pGroup + *(*int32)(unsafe.Pointer(&_pCache.X1)) = _szPage + *(*int32)(unsafe.Pointer(&_pCache.X2)) = _szExtra + *(*int32)(unsafe.Pointer(&_pCache.X3)) = int32(uint64(_szPage+_szExtra) + u64(56)) + *(*int32)(unsafe.Pointer(&_pCache.X4)) = func() int32 { if _bPurgeable != 0 { return i32(1) } @@ -3793,13 +3963,13 @@ _8: }() _pcache1ResizeHash(tls, _pCache) if _bPurgeable != 0 { - *(*uint32)(unsafe.Pointer(&(_pCache.X5))) = uint32(i32(10)) + *(*uint32)(unsafe.Pointer(&_pCache.X5)) = uint32(i32(10)) { - p := (*uint32)(unsafe.Pointer(&(_pGroup.X2))) - *p = (*p) + (_pCache.X5) + p := (*uint32)(unsafe.Pointer(&_pGroup.X2)) + *p = (*p) + _pCache.X5 sink5(*p) } - *(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = ((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2) + *(*uint32)(unsafe.Pointer(&_pGroup.X3)) = (_pGroup.X1 + uint32(i32(10))) - _pGroup.X2 } func() { if (*Xsqlite3_mutex)(_pGroup.X0) != nil { @@ -3807,12 +3977,12 @@ _8: crt.X__builtin_abort(tls) } }() - if (_pCache.X11) == uint32(i32(0)) { - _pcache1Destroy(tls, (unsafe.Pointer)(_pCache)) + if _pCache.X11 == uint32(i32(0)) { + _pcache1Destroy(tls, unsafe.Pointer(_pCache)) _pCache = nil } _6: - return (unsafe.Pointer)(_pCache) + return unsafe.Pointer(_pCache) } var _pcache1CreateØ00__func__Ø000 [14]int8 @@ -3821,10 +3991,13 @@ func init() { crt.Xstrncpy(nil, &_pcache1CreateØ00__func__Ø000[0], str(2502), 14) } -// This function is used to resize the hash table used by the cache passed -// as the first argument. -// -// The PCache mutex must be held when this function is called. +// C comment +// /* +// ** This function is used to resize the hash table used by the cache passed +// ** as the first argument. +// ** +// ** The PCache mutex must be held when this function is called. +// */ func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) { var _nNew, _i, _6_h uint32 var _5_pPage, _5_pNext *XPgHdr1 @@ -3835,7 +4008,7 @@ func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) { crt.X__builtin_abort(tls) } }() - _nNew = (_p.X11) * uint32(i32(2)) + _nNew = _p.X11 * uint32(i32(2)) if _nNew < uint32(i32(256)) { _nNew = uint32(i32(256)) } @@ -3845,11 +4018,11 @@ func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) { crt.X__builtin_abort(tls) } }() - if (_p.X11) != 0 { + if _p.X11 != 0 { _sqlite3BeginBenignMalloc(tls) } _apNew = (**XPgHdr1)(_sqlite3MallocZero(tls, u64(8)*uint64(_nNew))) - if (_p.X11) != 0 { + if _p.X11 != 0 { _sqlite3EndBenignMalloc(tls) } func() { @@ -3863,24 +4036,24 @@ func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) { } _i = uint32(i32(0)) _10: - if _i >= (_p.X11) { + if _i >= _p.X11 { goto _13 } - _5_pNext = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X12)) + 8*uintptr(_i))) + _5_pNext = *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X12)) + 8*uintptr(_i))) _14: if store10(&_5_pPage, _5_pNext) != nil { - _6_h = (_5_pPage.X1) % _nNew + _6_h = _5_pPage.X1 % _nNew _5_pNext = (*XPgHdr1)(_5_pPage.X5) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apNew)) + 8*uintptr(_6_h))) - *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apNew)) + 8*uintptr(_6_h))) = _5_pPage + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pPage.X5)))) = *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_apNew)) + 8*uintptr(_6_h))) + *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_apNew)) + 8*uintptr(_6_h))) = _5_pPage goto _14 } _i += 1 goto _10 _13: - Xsqlite3_free(tls, (unsafe.Pointer)(_p.X12)) - *(***XPgHdr1)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _apNew - *(*uint32)(unsafe.Pointer(&(_p.X11))) = _nNew + Xsqlite3_free(tls, unsafe.Pointer(_p.X12)) + *(***XPgHdr1)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = _apNew + *(*uint32)(unsafe.Pointer(&_p.X11)) = _nNew _9: } @@ -3890,33 +4063,39 @@ func init() { crt.Xstrncpy(nil, &_pcache1ResizeHashØ00__func__Ø000[0], str(2575), 18) } -// This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that -// subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc() -// indicates that subsequent malloc failures are non-benign. +// C comment +// /* +// ** This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that +// ** subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc() +// ** indicates that subsequent malloc failures are non-benign. +// */ func _sqlite3BeginBenignMalloc(tls *crt.TLS) { - if (_sqlite3Hooks.X0) != nil { - (_sqlite3Hooks.X0)(tls) + if _sqlite3Hooks.X0 != nil { + _sqlite3Hooks.X0(tls) } } var _sqlite3Hooks TBenignMallocHooks func _sqlite3EndBenignMalloc(tls *crt.TLS) { - if (_sqlite3Hooks.X1) != nil { - (_sqlite3Hooks.X1)(tls) + if _sqlite3Hooks.X1 != nil { + _sqlite3Hooks.X1(tls) } } -// Implementation of the sqlite3_pcache.xDestroy method. -// -// Destroy a cache allocated using pcache1Create(). +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xDestroy method. +// ** +// ** Destroy a cache allocated using pcache1Create(). +// */ func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) { var _pCache *XPCache1 var _pGroup *XPGroup _pCache = (*XPCache1)(_p) _pGroup = (*XPGroup)(_pCache.X0) func() { - if (_pCache.X4) == 0 && ((_pCache.X6) != uint32(i32(0)) || (_pCache.X5) != uint32(i32(0))) { + if _pCache.X4 == 0 && (_pCache.X6 != uint32(i32(0)) || _pCache.X5 != uint32(i32(0))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46152), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2593))) crt.X__builtin_abort(tls) } @@ -3927,32 +4106,32 @@ func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) { crt.X__builtin_abort(tls) } }() - if (_pCache.X10) != 0 { + if _pCache.X10 != 0 { _pcache1TruncateUnsafe(tls, _pCache, uint32(i32(0))) } func() { - if (_pGroup.X1) < (_pCache.X6) { + if _pGroup.X1 < _pCache.X6 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46155), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2652))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_pGroup.X1))) - *p = (*p) - (_pCache.X6) + p := (*uint32)(unsafe.Pointer(&_pGroup.X1)) + *p = (*p) - _pCache.X6 sink5(*p) } func() { - if (_pGroup.X2) < (_pCache.X5) { + if _pGroup.X2 < _pCache.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46157), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2685))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_pGroup.X2))) - *p = (*p) - (_pCache.X5) + p := (*uint32)(unsafe.Pointer(&_pGroup.X2)) + *p = (*p) - _pCache.X5 sink5(*p) } - *(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = ((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2) + *(*uint32)(unsafe.Pointer(&_pGroup.X3)) = (_pGroup.X1 + uint32(i32(10))) - _pGroup.X2 _pcache1EnforceMaxPage(tls, _pCache) func() { if (*Xsqlite3_mutex)(_pGroup.X0) != nil { @@ -3961,8 +4140,8 @@ func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) { } }() Xsqlite3_free(tls, _pCache.X14) - Xsqlite3_free(tls, (unsafe.Pointer)(_pCache.X12)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pCache)) + Xsqlite3_free(tls, unsafe.Pointer(_pCache.X12)) + Xsqlite3_free(tls, unsafe.Pointer(_pCache)) } var _pcache1DestroyØ00__func__Ø000 [15]int8 @@ -3971,11 +4150,14 @@ func init() { crt.Xstrncpy(nil, &_pcache1DestroyØ00__func__Ø000[0], str(2718), 15) } -// Discard all pages from cache pCache with a page number (key value) -// greater than or equal to iLimit. Any pinned pages that meet this -// criteria are unpinned before they are discarded. -// -// The PCache mutex must be held when this function is called. +// C comment +// /* +// ** Discard all pages from cache pCache with a page number (key value) +// ** greater than or equal to iLimit. Any pinned pages that meet this +// ** criteria are unpinned before they are discarded. +// ** +// ** The PCache mutex must be held when this function is called. +// */ func _pcache1TruncateUnsafe(tls *crt.TLS, _pCache *XPCache1, _iLimit uint32) { var _nPage int32 var _h, _iStop uint32 @@ -3989,49 +4171,49 @@ func _pcache1TruncateUnsafe(tls *crt.TLS, _pCache *XPCache1, _iLimit uint32) { } }() func() { - if (_pCache.X8) < _iLimit { + if _pCache.X8 < _iLimit { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45642), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2775))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X11) <= uint32(i32(0)) { + if _pCache.X11 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45643), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2801))) crt.X__builtin_abort(tls) } }() - if ((_pCache.X8) - _iLimit) < (_pCache.X11) { - _h = _iLimit % (_pCache.X11) - _iStop = (_pCache.X8) % (_pCache.X11) + if (_pCache.X8 - _iLimit) < _pCache.X11 { + _h = _iLimit % _pCache.X11 + _iStop = _pCache.X8 % _pCache.X11 _nPage = i32(-10) goto _7 } - _h = (_pCache.X11) / uint32(i32(2)) + _h = _pCache.X11 / uint32(i32(2)) _iStop = _h - uint32(i32(1)) _7: func() { - if _h >= (_pCache.X11) { + if _h >= _pCache.X11 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45661), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2819))) crt.X__builtin_abort(tls) } }() - _3_pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_h))) + _3_pp = (**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_h))) _13: if store10(&_3_pPage, *_3_pp) == nil { goto _14 } - if (_3_pPage.X1) < _iLimit { + if _3_pPage.X1 < _iLimit { goto _15 } - *(*uint32)(unsafe.Pointer(&(_pCache.X10))) -= 1 + *(*uint32)(unsafe.Pointer(&_pCache.X10)) -= 1 *_3_pp = (*XPgHdr1)(_3_pPage.X5) - if (_3_pPage.X2) == 0 { + if _3_pPage.X2 == 0 { _pcache1PinPage(tls, _3_pPage) } _pcache1FreePage(tls, _3_pPage) goto _17 _15: - _3_pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pPage.X5))))) + _3_pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pPage.X5)))) if _nPage >= i32(0) { _nPage += 1 } @@ -4041,11 +4223,11 @@ _14: if _h == _iStop { goto _10 } - _h = (_h + uint32(i32(1))) % (_pCache.X11) + _h = (_h + uint32(i32(1))) % _pCache.X11 goto _7 _10: func() { - if _nPage >= i32(0) && (_pCache.X10) != uint32(_nPage) { + if _nPage >= i32(0) && _pCache.X10 != uint32(_nPage) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45677), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2835))) crt.X__builtin_abort(tls) } @@ -4058,11 +4240,14 @@ func init() { crt.Xstrncpy(nil, &_pcache1TruncateUnsafeØ00__func__Ø000[0], str(2877), 22) } -// This function is used internally to remove the page pPage from the -// PGroup LRU list, if is part of it. If pPage is not part of the PGroup -// LRU list, then this function is a no-op. -// -// The PGroup mutex must be held when this function is called. +// C comment +// /* +// ** This function is used internally to remove the page pPage from the +// ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup +// ** LRU list, then this function is a no-op. +// ** +// ** The PGroup mutex must be held when this function is called. +// */ func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) { var _pCache *XPCache1 func() { @@ -4079,13 +4264,13 @@ func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) { }() _pCache = (*XPCache1)(_pPage.X6) func() { - if (*XPgHdr1)(_pPage.X7) == nil { + if _pPage.X7 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45570), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2927))) crt.X__builtin_abort(tls) } }() func() { - if (*XPgHdr1)(_pPage.X8) == nil { + if _pPage.X8 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45571), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2943))) crt.X__builtin_abort(tls) } @@ -4098,9 +4283,9 @@ func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) { }() *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(_pPage.X8).X7))))) = (*XPgHdr1)(_pPage.X7) *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(_pPage.X7).X8))))) = (*XPgHdr1)(_pPage.X8) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))) = nil - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = nil - *(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1)) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X7)))) = nil + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X8)))) = nil + *(*uint8)(unsafe.Pointer(&_pPage.X2)) = uint8(i32(1)) func() { if int32(_pPage.X4) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45578), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2959))) @@ -4113,7 +4298,7 @@ func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) { crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pCache.X9))) -= 1 + *(*uint32)(unsafe.Pointer(&_pCache.X9)) -= 1 return _pPage } @@ -4123,7 +4308,10 @@ func init() { crt.Xstrncpy(nil, &_pcache1PinPageØ00__func__Ø000[0], str(3010), 15) } -// Free a page object allocated by pcache1AllocPage(). +// C comment +// /* +// ** Free a page object allocated by pcache1AllocPage(). +// */ func _pcache1FreePage(tls *crt.TLS, _p *XPgHdr1) { var _pCache *XPCache1 func() { @@ -4139,14 +4327,14 @@ func _pcache1FreePage(tls *crt.TLS, _p *XPgHdr1) { crt.X__builtin_abort(tls) } }() - if (_p.X3) != 0 { - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = (*XPgHdr1)(_pCache.X13) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = _p + if _p.X3 != 0 { + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X5)))) = (*XPgHdr1)(_pCache.X13) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X13)))) = _p goto _5 } - _pcache1Free(tls, (*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X0) + _pcache1Free(tls, (*Xsqlite3_pcache_page)(unsafe.Pointer(&_p.X0)).X0) _5: - if (_pCache.X4) != 0 { + if _pCache.X4 != 0 { *(*uint32)(unsafe.Pointer(&((*XPGroup)(_pCache.X0).X4))) -= 1 } } @@ -4157,7 +4345,10 @@ func init() { crt.Xstrncpy(nil, &_pcache1FreePageØ00__func__Ø000[0], str(3070), 16) } -// Free an allocated buffer obtained from pcache1Alloc(). +// C comment +// /* +// ** Free an allocated buffer obtained from pcache1Alloc(). +// */ func _pcache1Free(tls *crt.TLS, _p unsafe.Pointer) { var _3_nFreed int32 var _1_pSlot *Xsqlite3_file @@ -4168,12 +4359,12 @@ func _pcache1Free(tls *crt.TLS, _p unsafe.Pointer) { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9)) _sqlite3StatusDown(tls, i32(1), i32(1)) _1_pSlot = (*Xsqlite3_file)(_p) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pSlot.X0))))) = (*Xsqlite3_file)(_pcache1_g.X10) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = _1_pSlot - *(*int32)(unsafe.Pointer(&(_pcache1_g.X11))) += 1 - *(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = bool2int((_pcache1_g.X11) < (_pcache1_g.X6)) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pSlot.X0)))) = (*Xsqlite3_file)(_pcache1_g.X10) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X10)))) = _1_pSlot + *(*int32)(unsafe.Pointer(&_pcache1_g.X11)) += 1 + *(*int32)(unsafe.Pointer(&_pcache1_g.X12)) = bool2int(_pcache1_g.X11 < _pcache1_g.X6) func() { - if (_pcache1_g.X11) > (_pcache1_g.X5) { + if _pcache1_g.X11 > _pcache1_g.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45365), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FreeØ00__func__Ø000))), unsafe.Pointer(str(3086))) crt.X__builtin_abort(tls) } @@ -4197,8 +4388,11 @@ func init() { crt.Xstrncpy(nil, &_pcache1FreeØ00__func__Ø000[0], str(3119), 12) } -// If there are currently more than nMaxPage pages allocated, try -// to recycle pages to reduce the number allocated to nMaxPage. +// C comment +// /* +// ** If there are currently more than nMaxPage pages allocated, try +// ** to recycle pages to reduce the number allocated to nMaxPage. +// */ func _pcache1EnforceMaxPage(tls *crt.TLS, _pCache *XPCache1) { var _p *XPgHdr1 var _pGroup *XPGroup @@ -4210,7 +4404,7 @@ func _pcache1EnforceMaxPage(tls *crt.TLS, _pCache *XPCache1) { } }() _2: - if ((_pGroup.X4) > (_pGroup.X1)) && (int32(store10(&_p, (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8)).X4) == i32(0)) { + if (_pGroup.X4 > _pGroup.X1) && (int32(store10(&_p, (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X8)).X4) == i32(0)) { func() { if (*XPGroup)((*XPCache1)(_p.X6).X0) != _pGroup { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45617), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000))), unsafe.Pointer(str(3165))) @@ -4227,9 +4421,9 @@ _2: _pcache1RemoveFromHash(tls, _p, i32(1)) goto _2 } - if ((_pCache.X10) == uint32(i32(0))) && ((_pCache.X14) != nil) { + if (_pCache.X10 == uint32(i32(0))) && (_pCache.X14 != nil) { Xsqlite3_free(tls, _pCache.X14) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X14))) = (unsafe.Pointer)(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))), nil)) + *(*unsafe.Pointer)(unsafe.Pointer(&_pCache.X14)) = unsafe.Pointer(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X13)))), nil)) } } @@ -4239,11 +4433,14 @@ func init() { crt.Xstrncpy(nil, &_pcache1EnforceMaxPageØ00__func__Ø000[0], str(3206), 22) } -// Remove the page supplied as an argument from the hash table -// (PCache1.apHash structure) that it is currently stored in. -// Also free the page if freePage is true. -// -// The PGroup mutex must be held when this function is called. +// C comment +// /* +// ** Remove the page supplied as an argument from the hash table +// ** (PCache1.apHash structure) that it is currently stored in. +// ** Also free the page if freePage is true. +// ** +// ** The PGroup mutex must be held when this function is called. +// */ func _pcache1RemoveFromHash(tls *crt.TLS, _pPage *XPgHdr1, _freeFlag int32) { var _h uint32 var _pCache *XPCache1 @@ -4255,8 +4452,8 @@ func _pcache1RemoveFromHash(tls *crt.TLS, _pPage *XPgHdr1, _freeFlag int32) { crt.X__builtin_abort(tls) } }() - _h = (_pPage.X1) % (_pCache.X11) - _pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_h))) + _h = _pPage.X1 % _pCache.X11 + _pp = (**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_h))) _2: if (*_pp) == _pPage { goto _5 @@ -4265,7 +4462,7 @@ _2: goto _2 _5: *_pp = (*XPgHdr1)((*_pp).X5) - *(*uint32)(unsafe.Pointer(&(_pCache.X10))) -= 1 + *(*uint32)(unsafe.Pointer(&_pCache.X10)) -= 1 if _freeFlag != 0 { _pcache1FreePage(tls, _pPage) } @@ -4277,14 +4474,17 @@ func init() { crt.Xstrncpy(nil, &_pcache1RemoveFromHashØ00__func__Ø000[0], str(3228), 22) } -// Implementation of the sqlite3_pcache.xCachesize method. -// -// Configure the cache_size limit for a cache. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xCachesize method. +// ** +// ** Configure the cache_size limit for a cache. +// */ func _pcache1Cachesize(tls *crt.TLS, _p unsafe.Pointer, _nMax int32) { var _pCache *XPCache1 var _1_pGroup *XPGroup _pCache = (*XPCache1)(_p) - if (_pCache.X4) != 0 { + if _pCache.X4 != 0 { _1_pGroup = (*XPGroup)(_pCache.X0) func() { if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil { @@ -4293,13 +4493,13 @@ func _pcache1Cachesize(tls *crt.TLS, _p unsafe.Pointer, _nMax int32) { } }() { - p := (*uint32)(unsafe.Pointer(&(_1_pGroup.X1))) - *p = (*p) + (uint32(_nMax) - (_pCache.X6)) + p := (*uint32)(unsafe.Pointer(&_1_pGroup.X1)) + *p = (*p) + (uint32(_nMax) - _pCache.X6) sink5(*p) } - *(*uint32)(unsafe.Pointer(&(_1_pGroup.X3))) = ((_1_pGroup.X1) + uint32(i32(10))) - (_1_pGroup.X2) - *(*uint32)(unsafe.Pointer(&(_pCache.X6))) = uint32(_nMax) - *(*uint32)(unsafe.Pointer(&(_pCache.X7))) = ((_pCache.X6) * uint32(i32(9))) / uint32(i32(10)) + *(*uint32)(unsafe.Pointer(&_1_pGroup.X3)) = (_1_pGroup.X1 + uint32(i32(10))) - _1_pGroup.X2 + *(*uint32)(unsafe.Pointer(&_pCache.X6)) = uint32(_nMax) + *(*uint32)(unsafe.Pointer(&_pCache.X7)) = (_pCache.X6 * uint32(i32(9))) / uint32(i32(10)) _pcache1EnforceMaxPage(tls, _pCache) func() { if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil { @@ -4316,7 +4516,10 @@ func init() { crt.Xstrncpy(nil, &_pcache1CachesizeØ00__func__Ø000[0], str(3250), 17) } -// Implementation of the sqlite3_pcache.xPagecount method. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xPagecount method. +// */ func _pcache1Pagecount(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) { var _n int32 var _pCache *XPCache1 @@ -4348,31 +4551,31 @@ func _pcache1Fetch(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag in _pCache = (*XPCache1)(_p) i32(0) func() { - if (_pCache.X4) == 0 && _createFlag == i32(1) { + if _pCache.X4 == 0 && _createFlag == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46037), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3311))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X4) == 0 && (_pCache.X5) != uint32(i32(0)) { + if _pCache.X4 == 0 && _pCache.X5 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46038), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3347))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X4) != i32(0) && (_pCache.X5) != uint32(i32(10)) { + if _pCache.X4 != i32(0) && _pCache.X5 != uint32(i32(10)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46039), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3385))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X5) != uint32(i32(0)) && (_pCache.X4) == 0 { + if _pCache.X5 != uint32(i32(0)) && _pCache.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46040), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3427))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X11) <= uint32(i32(0)) { + if _pCache.X11 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46041), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3465))) crt.X__builtin_abort(tls) } @@ -4386,78 +4589,81 @@ func init() { crt.Xstrncpy(nil, &_pcache1FetchØ00__func__Ø000[0], str(3481), 13) } -// Implementation of the sqlite3_pcache.xFetch method. -// -// Fetch a page by key value. -// -// Whether or not a new page may be allocated by this function depends on -// the value of the createFlag argument. 0 means do not allocate a new -// page. 1 means allocate a new page if space is easily available. 2 -// means to try really hard to allocate a new page. -// -// For a non-purgeable cache (a cache used as the storage for an in-memory -// database) there is really no difference between createFlag 1 and 2. So -// the calling function (pcache.c) will never have a createFlag of 1 on -// a non-purgeable cache. -// -// There are three different approaches to obtaining space for a page, -// depending on the value of parameter createFlag (which may be 0, 1 or 2). -// -// 1. Regardless of the value of createFlag, the cache is searched for a -// copy of the requested page. If one is found, it is returned. -// -// 2. If createFlag==0 and the page is not already in the cache, NULL is -// returned. -// -// 3. If createFlag is 1, and the page is not already in the cache, then -// return NULL (do not allocate a new page) if any of the following -// conditions are true: -// -// (a) the number of pages pinned by the cache is greater than -// PCache1.nMax, or -// -// (b) the number of pages pinned by the cache is greater than -// the sum of nMax for all purgeable caches, less the sum of -// nMin for all other purgeable caches, or -// -// 4. If none of the first three conditions apply and the cache is marked -// as purgeable, and if one of the following is true: -// -// (a) The number of pages allocated for the cache is already -// PCache1.nMax, or -// -// (b) The number of pages allocated for all purgeable caches is -// already equal to or greater than the sum of nMax for all -// purgeable caches, -// -// (c) The system is under memory pressure and wants to avoid -// unnecessary pages cache entry allocations -// -// then attempt to recycle a page from the LRU list. If it is the right -// size, return the recycled buffer. Otherwise, free the buffer and -// proceed to step 5. -// -// 5. Otherwise, allocate and return a new page buffer. -// -// There are two versions of this routine. pcache1FetchWithMutex() is -// the general case. pcache1FetchNoMutex() is a faster implementation for -// the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper -// invokes the appropriate routine. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xFetch method. +// ** +// ** Fetch a page by key value. +// ** +// ** Whether or not a new page may be allocated by this function depends on +// ** the value of the createFlag argument. 0 means do not allocate a new +// ** page. 1 means allocate a new page if space is easily available. 2 +// ** means to try really hard to allocate a new page. +// ** +// ** For a non-purgeable cache (a cache used as the storage for an in-memory +// ** database) there is really no difference between createFlag 1 and 2. So +// ** the calling function (pcache.c) will never have a createFlag of 1 on +// ** a non-purgeable cache. +// ** +// ** There are three different approaches to obtaining space for a page, +// ** depending on the value of parameter createFlag (which may be 0, 1 or 2). +// ** +// ** 1. Regardless of the value of createFlag, the cache is searched for a +// ** copy of the requested page. If one is found, it is returned. +// ** +// ** 2. If createFlag==0 and the page is not already in the cache, NULL is +// ** returned. +// ** +// ** 3. If createFlag is 1, and the page is not already in the cache, then +// ** return NULL (do not allocate a new page) if any of the following +// ** conditions are true: +// ** +// ** (a) the number of pages pinned by the cache is greater than +// ** PCache1.nMax, or +// ** +// ** (b) the number of pages pinned by the cache is greater than +// ** the sum of nMax for all purgeable caches, less the sum of +// ** nMin for all other purgeable caches, or +// ** +// ** 4. If none of the first three conditions apply and the cache is marked +// ** as purgeable, and if one of the following is true: +// ** +// ** (a) The number of pages allocated for the cache is already +// ** PCache1.nMax, or +// ** +// ** (b) The number of pages allocated for all purgeable caches is +// ** already equal to or greater than the sum of nMax for all +// ** purgeable caches, +// ** +// ** (c) The system is under memory pressure and wants to avoid +// ** unnecessary pages cache entry allocations +// ** +// ** then attempt to recycle a page from the LRU list. If it is the right +// ** size, return the recycled buffer. Otherwise, free the buffer and +// ** proceed to step 5. +// ** +// ** 5. Otherwise, allocate and return a new page buffer. +// ** +// ** There are two versions of this routine. pcache1FetchWithMutex() is +// ** the general case. pcache1FetchNoMutex() is a faster implementation for +// ** the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper +// ** invokes the appropriate routine. +// */ func _pcache1FetchNoMutex(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) { var _pCache *XPCache1 var _pPage *XPgHdr1 _pCache = (*XPCache1)(_p) _pPage = nil - _pPage = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_iKey%(_pCache.X11)))) + _pPage = *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_iKey%_pCache.X11))) _0: - if (_pPage != nil) && ((_pPage.X1) != _iKey) { + if (_pPage != nil) && (_pPage.X1 != _iKey) { _pPage = (*XPgHdr1)(_pPage.X5) goto _0 } if _pPage == nil { goto _3 } - if (_pPage.X2) == 0 { + if _pPage.X2 == 0 { return _pcache1PinPage(tls, _pPage) } return _pPage @@ -4469,12 +4675,15 @@ _3: return nil } -// Implement steps 3, 4, and 5 of the pcache1Fetch() algorithm described -// in the header of the pcache1Fetch() procedure. -// -// This steps are broken out into a separate procedure because they are -// usually not needed, and by avoiding the stack initialization required -// for these steps, the main pcache1Fetch() procedure can run faster. +// C comment +// /* +// ** Implement steps 3, 4, and 5 of the pcache1Fetch() algorithm described +// ** in the header of the pcache1Fetch() procedure. +// ** +// ** This steps are broken out into a separate procedure because they are +// ** usually not needed, and by avoiding the stack initialization required +// ** for these steps, the main pcache1Fetch() procedure can run faster. +// */ func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) { var _nPinned, _6_h uint32 var _2_pOther *XPCache1 @@ -4483,40 +4692,40 @@ func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createF _pGroup = (*XPGroup)(_pCache.X0) _pPage = nil func() { - if (_pCache.X10) < (_pCache.X9) { + if _pCache.X10 < _pCache.X9 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45864), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3494))) crt.X__builtin_abort(tls) } }() - _nPinned = (_pCache.X10) - (_pCache.X9) + _nPinned = _pCache.X10 - _pCache.X9 func() { - if (_pGroup.X3) != (((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2)) { + if _pGroup.X3 != ((_pGroup.X1 + uint32(i32(10))) - _pGroup.X2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45866), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3531))) crt.X__builtin_abort(tls) } }() func() { - if (_pCache.X7) != (((_pCache.X6) * uint32(i32(9))) / uint32(i32(10))) { + if _pCache.X7 != ((_pCache.X6 * uint32(i32(9))) / uint32(i32(10))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45867), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3592))) crt.X__builtin_abort(tls) } }() - if (_createFlag == i32(1)) && (((_nPinned >= (_pGroup.X3)) || (_nPinned >= (_pCache.X7))) || (_pcache1UnderMemoryPressure(tls, _pCache) != 0 && ((_pCache.X9) < _nPinned))) { + if (_createFlag == i32(1)) && (((_nPinned >= _pGroup.X3) || (_nPinned >= _pCache.X7)) || (_pcache1UnderMemoryPressure(tls, _pCache) != 0 && (_pCache.X9 < _nPinned))) { return nil } - if (_pCache.X10) >= (_pCache.X11) { + if _pCache.X10 >= _pCache.X11 { _pcache1ResizeHash(tls, _pCache) } func() { - if (_pCache.X11) <= uint32(i32(0)) || (**XPgHdr1)(unsafe.Pointer(_pCache.X12)) == nil { + if _pCache.X11 <= uint32(i32(0)) || _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45877), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3628))) crt.X__builtin_abort(tls) } }() - if (_pCache.X4) == 0 || ((*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8).X4) != 0 || ((_pCache.X10)+uint32(i32(1))) < (_pCache.X6) && _pcache1UnderMemoryPressure(tls, _pCache) == 0 { + if _pCache.X4 == 0 || ((*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X8).X4) != 0 || (_pCache.X10+uint32(i32(1))) < _pCache.X6 && _pcache1UnderMemoryPressure(tls, _pCache) == 0 { goto _18 } - _pPage = (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8) + _pPage = (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X8) func() { if int32(_pPage.X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45886), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(2908))) @@ -4526,14 +4735,14 @@ func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createF _pcache1RemoveFromHash(tls, _pPage, i32(0)) _pcache1PinPage(tls, _pPage) _2_pOther = (*XPCache1)(_pPage.X6) - if (_2_pOther.X3) != (_pCache.X3) { + if _2_pOther.X3 != _pCache.X3 { _pcache1FreePage(tls, _pPage) _pPage = nil goto _22 } { - p := (*uint32)(unsafe.Pointer(&(_pGroup.X4))) - *p = (*p) - uint32((_2_pOther.X4)-(_pCache.X4)) + p := (*uint32)(unsafe.Pointer(&_pGroup.X4)) + *p = (*p) - uint32(_2_pOther.X4-_pCache.X4) sink5(*p) } _22: @@ -4544,18 +4753,18 @@ _18: if _pPage == nil { goto _24 } - _6_h = _iKey % (_pCache.X11) - *(*uint32)(unsafe.Pointer(&(_pCache.X10))) += 1 - *(*uint32)(unsafe.Pointer(&(_pPage.X1))) = _iKey - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_6_h))) - *(**XPCache1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X6))))) = _pCache - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = nil - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))) = nil - *(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1)) - *(*unsafe.Pointer)((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_pPage.X0))).X1) = nil - *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_6_h))) = _pPage - if _iKey > (_pCache.X8) { - *(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iKey + _6_h = _iKey % _pCache.X11 + *(*uint32)(unsafe.Pointer(&_pCache.X10)) += 1 + *(*uint32)(unsafe.Pointer(&_pPage.X1)) = _iKey + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X5)))) = *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_6_h))) + *(**XPCache1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X6)))) = _pCache + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X8)))) = nil + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X7)))) = nil + *(*uint8)(unsafe.Pointer(&_pPage.X2)) = uint8(i32(1)) + *(*unsafe.Pointer)((*Xsqlite3_pcache_page)(unsafe.Pointer(&_pPage.X0)).X1) = nil + *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_6_h))) = _pPage + if _iKey > _pCache.X8 { + *(*uint32)(unsafe.Pointer(&_pCache.X8)) = _iKey } _24: return _pPage @@ -4567,35 +4776,44 @@ func init() { crt.Xstrncpy(nil, &_pcache1FetchStage2Ø00__func__Ø000[0], str(3662), 19) } -// Return true if it desirable to avoid allocating a new page cache -// entry. -// -// If memory was allocated specifically to the page cache using -// SQLITE_CONFIG_PAGECACHE but that memory has all been used, then -// it is desirable to avoid allocating a new page cache entry because -// presumably SQLITE_CONFIG_PAGECACHE was suppose to be sufficient -// for all page cache needs and we should not need to spill the -// allocation onto the heap. -// -// Or, the heap is used for all page cache memory but the heap is -// under memory pressure, then again it is desirable to avoid -// allocating a new page cache entry in order to avoid stressing -// the heap even further. +// C comment +// /* +// ** Return true if it desirable to avoid allocating a new page cache +// ** entry. +// ** +// ** If memory was allocated specifically to the page cache using +// ** SQLITE_CONFIG_PAGECACHE but that memory has all been used, then +// ** it is desirable to avoid allocating a new page cache entry because +// ** presumably SQLITE_CONFIG_PAGECACHE was suppose to be sufficient +// ** for all page cache needs and we should not need to spill the +// ** allocation onto the heap. +// ** +// ** Or, the heap is used for all page cache memory but the heap is +// ** under memory pressure, then again it is desirable to avoid +// ** allocating a new page cache entry in order to avoid stressing +// ** the heap even further. +// */ func _pcache1UnderMemoryPressure(tls *crt.TLS, _pCache *XPCache1) (r0 int32) { - if (_pcache1_g.X5) != 0 && (((_pCache.X1) + (_pCache.X2)) <= (_pcache1_g.X4)) { + if _pcache1_g.X5 != 0 && ((_pCache.X1 + _pCache.X2) <= _pcache1_g.X4) { return _pcache1_g.X12 } return _sqlite3HeapNearlyFull(tls) } -// Return true if the heap is currently under memory pressure - in other -// words if the amount of heap used is close to the limit set by -// sqlite3_soft_heap_limit(). +// C comment +// /* +// ** Return true if the heap is currently under memory pressure - in other +// ** words if the amount of heap used is close to the limit set by +// ** sqlite3_soft_heap_limit(). +// */ func _sqlite3HeapNearlyFull(tls *crt.TLS) (r0 int32) { return _mem0.X5 } -// Allocate a new page object initially associated with cache pCache. +// C comment +// /* +// ** Allocate a new page object initially associated with cache pCache. +// */ func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 *XPgHdr1) { var _pPg unsafe.Pointer var _p *XPgHdr1 @@ -4606,10 +4824,10 @@ func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 crt.X__builtin_abort(tls) } }() - if ((*XPgHdr1)(_pCache.X13) != nil) || (((_pCache.X10) == uint32(i32(0))) && _pcache1InitBulk(tls, _pCache) != 0) { + if (_pCache.X13 != nil) || ((_pCache.X10 == uint32(i32(0))) && _pcache1InitBulk(tls, _pCache) != 0) { _p = (*XPgHdr1)(_pCache.X13) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = (*XPgHdr1)(_p.X5) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X13)))) = (*XPgHdr1)(_p.X5) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X5)))) = nil goto _5 } if _benignMalloc != 0 { @@ -4623,12 +4841,12 @@ func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 if _pPg == nil { return nil } - *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X0))) = _pPg - *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X1))) = (unsafe.Pointer)((*XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 56*uintptr(i32(1))))) - *(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&_p.X0)).X0))) = _pPg + *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&_p.X0)).X1))) = unsafe.Pointer((*XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 56*uintptr(i32(1))))) + *(*uint8)(unsafe.Pointer(&_p.X3)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X4)) = uint8(i32(0)) _5: - if (_pCache.X4) != 0 { + if _pCache.X4 != 0 { *(*uint32)(unsafe.Pointer(&((*XPGroup)(_pCache.X0).X4))) += 1 } return _p @@ -4640,21 +4858,24 @@ func init() { crt.Xstrncpy(nil, &_pcache1AllocPageØ00__func__Ø000[0], str(3681), 17) } -// Try to initialize the pCache->pFree and pCache->pBulk fields. Return -// true if pCache->pFree ends up containing one or more free pages. +// C comment +// /* +// ** Try to initialize the pCache->pFree and pCache->pBulk fields. Return +// ** true if pCache->pFree ends up containing one or more free pages. +// */ func _pcache1InitBulk(tls *crt.TLS, _pCache *XPCache1) (r0 int32) { var _4_nBulk int32 var _szBulk int64 var _zBulk *int8 var _5_pX *XPgHdr1 - if (_pcache1_g.X3) == i32(0) { + if _pcache1_g.X3 == i32(0) { return i32(0) } - if (_pCache.X6) < uint32(i32(3)) { + if _pCache.X6 < uint32(i32(3)) { return i32(0) } _sqlite3BeginBenignMalloc(tls) - if (_pcache1_g.X3) > i32(0) { + if _pcache1_g.X3 > i32(0) { _szBulk = int64(_pCache.X3) * int64(_pcache1_g.X3) goto _3 } @@ -4663,23 +4884,23 @@ _3: if _szBulk > (int64(_pCache.X3) * int64(_pCache.X6)) { _szBulk = int64(_pCache.X3) * int64(_pCache.X6) } - _zBulk = (*int8)(store11((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X14))), _sqlite3Malloc(tls, uint64(_szBulk)))) + _zBulk = (*int8)(store11((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X14)), _sqlite3Malloc(tls, uint64(_szBulk)))) _sqlite3EndBenignMalloc(tls) if _zBulk == nil { goto _5 } - _4_nBulk = _sqlite3MallocSize(tls, (unsafe.Pointer)(_zBulk)) / (_pCache.X3) + _4_nBulk = _sqlite3MallocSize(tls, unsafe.Pointer(_zBulk)) / _pCache.X3 _6: - _5_pX = (*XPgHdr1)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBulk)) + 1*uintptr(_pCache.X1))))) - *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_5_pX.X0))).X0))) = (unsafe.Pointer)(_zBulk) - *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_5_pX.X0))).X1))) = (unsafe.Pointer)((*XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_pX)) + 56*uintptr(i32(1))))) - *(*uint8)(unsafe.Pointer(&(_5_pX.X3))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_5_pX.X4))) = uint8(i32(0)) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pX.X5))))) = (*XPgHdr1)(_pCache.X13) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = _5_pX + _5_pX = (*XPgHdr1)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBulk)) + 1*uintptr(_pCache.X1))))) + *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&_5_pX.X0)).X0))) = unsafe.Pointer(_zBulk) + *(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&_5_pX.X0)).X1))) = unsafe.Pointer((*XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_pX)) + 56*uintptr(i32(1))))) + *(*uint8)(unsafe.Pointer(&_5_pX.X3)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_5_pX.X4)) = uint8(i32(0)) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pX.X5)))) = (*XPgHdr1)(_pCache.X13) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X13)))) = _5_pX { p := &_zBulk - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_pCache.X3))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_pCache.X3))) sink0(*p) } if preInc1(&_4_nBulk, -1) != 0 { @@ -4692,34 +4913,37 @@ _5: panic(0) } -// Malloc function used within this file to allocate space from the buffer -// configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no -// such buffer exists or there is no space left in it, this function falls -// back to sqlite3Malloc(). -// -// Multiple threads can run this routine at the same time. Global variables -// in pcache1 need to be protected via mutex. +// C comment +// /* +// ** Malloc function used within this file to allocate space from the buffer +// ** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no +// ** such buffer exists or there is no space left in it, this function falls +// ** back to sqlite3Malloc(). +// ** +// ** Multiple threads can run this routine at the same time. Global variables +// ** in pcache1 need to be protected via mutex. +// */ func _pcache1Alloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) { var _4_sz int32 var _p unsafe.Pointer _p = nil func() { - if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X0)) == 0 { + if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XPGroup)(unsafe.Pointer(&_pcache1_g.X0)).X0)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45318), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1AllocØ00__func__Ø000))), unsafe.Pointer(str(3698))) crt.X__builtin_abort(tls) } }() - if _nByte > (_pcache1_g.X4) { + if _nByte > _pcache1_g.X4 { goto _2 } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9)) _p = _pcache1_g.X10 if _p != nil { - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = (*Xsqlite3_file)((*Xsqlite3_file)(_pcache1_g.X10).X0) - *(*int32)(unsafe.Pointer(&(_pcache1_g.X11))) -= 1 - *(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = bool2int((_pcache1_g.X11) < (_pcache1_g.X6)) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X10)))) = (*Xsqlite3_file)((*Xsqlite3_file)(_pcache1_g.X10).X0) + *(*int32)(unsafe.Pointer(&_pcache1_g.X11)) -= 1 + *(*int32)(unsafe.Pointer(&_pcache1_g.X12)) = bool2int(_pcache1_g.X11 < _pcache1_g.X6) func() { - if (_pcache1_g.X11) < i32(0) { + if _pcache1_g.X11 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45326), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1AllocØ00__func__Ø000))), unsafe.Pointer(str(3739))) crt.X__builtin_abort(tls) } @@ -4746,16 +4970,15 @@ _6: func Xsqlite3_mutex_notheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { func() { - if _p != nil && (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X8)}))) == nil { + if _p != nil && ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X8) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_notheldØ00__func__Ø000))), unsafe.Pointer(str(3760))) crt.X__builtin_abort(tls) } }() - return bool2int((_p == nil) || (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X8)})))(tls, _p) != 0) + return bool2int((_p == nil) || func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X8 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }()(tls, _p) != 0) } var _sqlite3_mutex_notheldØ00__func__Ø000 [22]int8 @@ -4770,9 +4993,12 @@ func init() { crt.Xstrncpy(nil, &_pcache1AllocØ00__func__Ø000[0], str(3830), 13) } -// Implementation of the sqlite3_pcache.xUnpin method. -// -// Mark a page as unpinned (eligible for asynchronous recycling). +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xUnpin method. +// ** +// ** Mark a page as unpinned (eligible for asynchronous recycling). +// */ func _pcache1Unpin(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _reuseUnlikely int32) { var _pCache *XPCache1 var _pPage *XPgHdr1 @@ -4805,16 +5031,16 @@ func _pcache1Unpin(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, crt.X__builtin_abort(tls) } }() - if _reuseUnlikely != 0 || ((_pGroup.X4) > (_pGroup.X1)) { + if _reuseUnlikely != 0 || (_pGroup.X4 > _pGroup.X1) { _pcache1RemoveFromHash(tls, _pPage, i32(1)) goto _11 } - _2_ppFirst = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X7))))) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = (*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))) - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))), *_2_ppFirst).X8))))) = _pPage + _2_ppFirst = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)).X7))))) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X8)))) = (*XPgHdr1)(unsafe.Pointer(&_pGroup.X5)) + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X7)))), *_2_ppFirst).X8))))) = _pPage *_2_ppFirst = _pPage - *(*uint32)(unsafe.Pointer(&(_pCache.X9))) += 1 - *(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_pCache.X9)) += 1 + *(*uint8)(unsafe.Pointer(&_pPage.X2)) = uint8(i32(0)) _11: func() { if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil { @@ -4830,7 +5056,10 @@ func init() { crt.Xstrncpy(nil, &_pcache1UnpinØ00__func__Ø000[0], str(3925), 13) } -// Implementation of the sqlite3_pcache.xRekey method. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xRekey method. +// */ func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _iOld uint32, _iNew uint32) { var _h uint32 var _pCache *XPCache1 @@ -4839,7 +5068,7 @@ func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _pCache = (*XPCache1)(_p) _pPage = (*XPgHdr1)(unsafe.Pointer(_pPg)) func() { - if (_pPage.X1) != _iOld { + if _pPage.X1 != _iOld { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46104), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000))), unsafe.Pointer(str(3938))) crt.X__builtin_abort(tls) } @@ -4856,20 +5085,20 @@ func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, crt.X__builtin_abort(tls) } }() - _h = _iOld % (_pCache.X11) - _pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_h))) + _h = _iOld % _pCache.X11 + _pp = (**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_h))) _6: if (*_pp) != _pPage { _pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_pp).X5))))) goto _6 } *_pp = (*XPgHdr1)(_pPage.X5) - _h = _iNew % (_pCache.X11) - *(*uint32)(unsafe.Pointer(&(_pPage.X1))) = _iNew - *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_h))) - *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 8*uintptr(_h))) = _pPage - if _iNew > (_pCache.X8) { - *(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iNew + _h = _iNew % _pCache.X11 + *(*uint32)(unsafe.Pointer(&_pPage.X1)) = _iNew + *(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X5)))) = *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_h))) + *(**XPgHdr1)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCache.X12)) + 8*uintptr(_h))) = _pPage + if _iNew > _pCache.X8 { + *(*uint32)(unsafe.Pointer(&_pCache.X8)) = _iNew } func() { if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil { @@ -4885,11 +5114,14 @@ func init() { crt.Xstrncpy(nil, &_pcache1RekeyØ00__func__Ø000[0], str(3956), 13) } -// Implementation of the sqlite3_pcache.xTruncate method. -// -// Discard all unpinned pages in the cache with a page number equal to -// or greater than parameter iLimit. Any pinned pages with a page number -// equal to or greater than iLimit are implicitly unpinned. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xTruncate method. +// ** +// ** Discard all unpinned pages in the cache with a page number equal to +// ** or greater than parameter iLimit. Any pinned pages with a page number +// ** equal to or greater than iLimit are implicitly unpinned. +// */ func _pcache1Truncate(tls *crt.TLS, _p unsafe.Pointer, _iLimit uint32) { var _pCache *XPCache1 _pCache = (*XPCache1)(_p) @@ -4899,9 +5131,9 @@ func _pcache1Truncate(tls *crt.TLS, _p unsafe.Pointer, _iLimit uint32) { crt.X__builtin_abort(tls) } }() - if _iLimit <= (_pCache.X8) { + if _iLimit <= _pCache.X8 { _pcache1TruncateUnsafe(tls, _pCache, _iLimit) - *(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iLimit - uint32(i32(1)) + *(*uint32)(unsafe.Pointer(&_pCache.X8)) = _iLimit - uint32(i32(1)) } func() { if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil { @@ -4917,15 +5149,18 @@ func init() { crt.Xstrncpy(nil, &_pcache1TruncateØ00__func__Ø000[0], str(3969), 16) } -// Implementation of the sqlite3_pcache.xShrink method. -// -// Free up as much memory as possible. +// C comment +// /* +// ** Implementation of the sqlite3_pcache.xShrink method. +// ** +// ** Free up as much memory as possible. +// */ func _pcache1Shrink(tls *crt.TLS, _p unsafe.Pointer) { var _1_savedMaxPage int32 var _pCache *XPCache1 var _1_pGroup *XPGroup _pCache = (*XPCache1)(_p) - if (_pCache.X4) != 0 { + if _pCache.X4 != 0 { _1_pGroup = (*XPGroup)(_pCache.X0) func() { if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil { @@ -4934,9 +5169,9 @@ func _pcache1Shrink(tls *crt.TLS, _p unsafe.Pointer) { } }() _1_savedMaxPage = int32(_1_pGroup.X1) - *(*uint32)(unsafe.Pointer(&(_1_pGroup.X1))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_1_pGroup.X1)) = uint32(i32(0)) _pcache1EnforceMaxPage(tls, _pCache) - *(*uint32)(unsafe.Pointer(&(_1_pGroup.X1))) = uint32(_1_savedMaxPage) + *(*uint32)(unsafe.Pointer(&_1_pGroup.X1)) = uint32(_1_savedMaxPage) func() { if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45829), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000))), unsafe.Pointer(str(2483))) @@ -4958,12 +5193,15 @@ func init() { _sqlite3MemSetDefaultØ00defaultMethodsØ001 = Xsqlite3_mem_methods{X0: _sqlite3MemMalloc, X1: _sqlite3MemFree, X2: _sqlite3MemRealloc, X3: _sqlite3MemSize, X4: _sqlite3MemRoundup, X5: _sqlite3MemInit, X6: _sqlite3MemShutdown, X7: nil} } -// Like malloc(), but remember the size of the allocation -// so that we can find it later using sqlite3MemSize(). -// -// For this low-level routine, we are guaranteed that nByte>0 because -// cases of nByte<=0 will be intercepted and dealt with by higher level -// routines. +// C comment +// /* +// ** Like malloc(), but remember the size of the allocation +// ** so that we can find it later using sqlite3MemSize(). +// ** +// ** For this low-level routine, we are guaranteed that nByte>0 because +// ** cases of nByte<=0 will be intercepted and dealt with by higher level +// ** routines. +// */ func _sqlite3MemMalloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) { var _p unsafe.Pointer _p = crt.Xmalloc(tls, uint64(_nByte)) @@ -4973,24 +5211,30 @@ func _sqlite3MemMalloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) { return _p } -// Like free() but works for allocations obtained from sqlite3MemMalloc() -// or sqlite3MemRealloc(). -// -// For this low-level routine, we already know that pPrior!=0 since -// cases where pPrior==0 will have been intecepted and dealt with -// by higher-level routines. +// C comment +// /* +// ** Like free() but works for allocations obtained from sqlite3MemMalloc() +// ** or sqlite3MemRealloc(). +// ** +// ** For this low-level routine, we already know that pPrior!=0 since +// ** cases where pPrior==0 will have been intecepted and dealt with +// ** by higher-level routines. +// */ func _sqlite3MemFree(tls *crt.TLS, _pPrior unsafe.Pointer) { crt.Xfree(tls, _pPrior) } -// Like realloc(). Resize an allocation previously obtained from -// sqlite3MemMalloc(). -// -// For this low-level interface, we know that pPrior!=0. Cases where -// pPrior==0 while have been intercepted by higher-level routine and -// redirected to xMalloc. Similarly, we know that nByte>0 because -// cases where nByte<=0 will have been intercepted by higher-level -// routines and redirected to xFree. +// C comment +// /* +// ** Like realloc(). Resize an allocation previously obtained from +// ** sqlite3MemMalloc(). +// ** +// ** For this low-level interface, we know that pPrior!=0. Cases where +// ** pPrior==0 while have been intercepted by higher-level routine and +// ** redirected to xMalloc. Similarly, we know that nByte>0 because +// ** cases where nByte<=0 will have been intercepted by higher-level +// ** routines and redirected to xFree. +// */ func _sqlite3MemRealloc(tls *crt.TLS, _pPrior unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) { var _p unsafe.Pointer _p = crt.Xrealloc(tls, _pPrior, uint64(_nByte)) @@ -5000,8 +5244,11 @@ func _sqlite3MemRealloc(tls *crt.TLS, _pPrior unsafe.Pointer, _nByte int32) (r0 return _p } -// Report the allocated size of a prior return from xMalloc() -// or xRealloc(). +// C comment +// /* +// ** Report the allocated size of a prior return from xMalloc() +// ** or xRealloc(). +// */ func _sqlite3MemSize(tls *crt.TLS, _pPrior unsafe.Pointer) (r0 int32) { func() { if _pPrior == nil { @@ -5018,17 +5265,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MemSizeØ00__func__Ø000[0], str(4083), 15) } -// Round up a request size to the next valid allocation size. +// C comment +// /* +// ** Round up a request size to the next valid allocation size. +// */ func _sqlite3MemRoundup(tls *crt.TLS, _n int32) (r0 int32) { return (_n + i32(7)) & i32(-8) } -// Initialize this module. +// C comment +// /* +// ** Initialize this module. +// */ func _sqlite3MemInit(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) { return i32(0) } -// Deinitialize this module. +// C comment +// /* +// ** Deinitialize this module. +// */ func _sqlite3MemShutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) { } @@ -5038,23 +5294,32 @@ func _sqlite3NomemError(tls *crt.TLS, _lineno int32) (r0 int32) { var _sqlite3BuiltinFunctions XFuncDefHash -// All of the FuncDef structures in the aBuiltinFunc[] array above -// to the global function hash table. This occurs at start-time (as -// a consequence of calling sqlite3_initialize()). -// -// After this routine runs +// C comment +// /* +// ** All of the FuncDef structures in the aBuiltinFunc[] array above +// ** to the global function hash table. This occurs at start-time (as +// ** a consequence of calling sqlite3_initialize()). +// ** +// ** After this routine runs +// */ func _sqlite3RegisterBuiltinFunctions(tls *crt.TLS) { _sqlite3AlterFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001)), i32(60)) } -// Register built-in functions used to help implement ALTER TABLE +// C comment +// /* +// ** Register built-in functions used to help implement ALTER TABLE +// */ func _sqlite3AlterFunctions(tls *crt.TLS) { _sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001)), i32(3)) } -// Insert a new FuncDef into a FuncDefHash hash table. +// C comment +// /* +// ** Insert a new FuncDef into a FuncDefHash hash table. +// */ func _sqlite3InsertBuiltinFuncs(tls *crt.TLS, _aDef *XFuncDef, _nDef int32) { var _i, _1_nName, _1_h int32 var _1_zName *int8 @@ -5064,36 +5329,39 @@ _0: if _i >= _nDef { goto _3 } - _1_zName = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))).X6 + _1_zName = (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))).X6 _1_nName = _sqlite3Strlen30(tls, _1_zName) - _1_h = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zName)) + 1*uintptr(i32(0))))))))) + _1_nName) % i32(23) + _1_h = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zName)) + 1*uintptr(i32(0))))))))) + _1_nName) % i32(23) _1_pOther = _functionSearch(tls, _1_h, _1_zName) if _1_pOther != nil { func() { - if _1_pOther == (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef))+56*uintptr(_i))) || (*XFuncDef)(_1_pOther.X3) == (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef))+56*uintptr(_i))) { + if _1_pOther == (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef))+56*uintptr(_i))) || (*XFuncDef)(_1_pOther.X3) == (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef))+56*uintptr(_i))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104459), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertBuiltinFuncsØ00__func__Ø000))), unsafe.Pointer(str(4102))) crt.X__builtin_abort(tls) } }() - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))).X3))))) = (*XFuncDef)(_1_pOther.X3) - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pOther.X3))))) = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))) + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))).X3))))) = (*XFuncDef)(_1_pOther.X3) + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pOther.X3)))) = (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))) goto _8 } - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))).X3))))) = nil - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))).X7))))))) = *(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 8*uintptr(_1_h))) - *(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 8*uintptr(_1_h))) = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 56*uintptr(_i))) + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))).X3))))) = nil + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))).X7))))))) = *(**XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer((*[23]unsafe.Pointer)(unsafe.Pointer(&_sqlite3BuiltinFunctions.X0)))) + 8*uintptr(_1_h))) + *(**XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer((*[23]unsafe.Pointer)(unsafe.Pointer(&_sqlite3BuiltinFunctions.X0)))) + 8*uintptr(_1_h))) = (*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDef)) + 56*uintptr(_i))) _8: _i += 1 goto _0 _3: } -// Compute a string length that is limited to what can be stored in -// lower 30 bits of a 32-bit signed integer. -// -// The value returned will never be negative. Nor will it ever be greater -// than the actual length of the string. For very long strings (greater -// than 1GiB) the value returned might be less than the true string length. +// C comment +// /* +// ** Compute a string length that is limited to what can be stored in +// ** lower 30 bits of a 32-bit signed integer. +// ** +// ** The value returned will never be negative. Nor will it ever be greater +// ** than the actual length of the string. For very long strings (greater +// ** than 1GiB) the value returned might be less than the true string length. +// */ func _sqlite3Strlen30(tls *crt.TLS, _z *int8) (r0 int32) { if _z == nil { return i32(0) @@ -5107,11 +5375,14 @@ func init() { _sqlite3UpperToLower = [256]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255} } -// Search a FuncDefHash for a function with the given name. Return -// a pointer to the matching FuncDef if found, or 0 if there is no match. +// C comment +// /* +// ** Search a FuncDefHash for a function with the given name. Return +// ** a pointer to the matching FuncDef if found, or 0 if there is no match. +// */ func _functionSearch(tls *crt.TLS, _h int32, _zFunc *int8) (r0 *XFuncDef) { var _p *XFuncDef - _p = *(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 8*uintptr(_h))) + _p = *(**XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer((*[23]unsafe.Pointer)(unsafe.Pointer(&_sqlite3BuiltinFunctions.X0)))) + 8*uintptr(_h))) _0: if _p == nil { goto _3 @@ -5119,7 +5390,7 @@ _0: if _sqlite3StrICmp(tls, _p.X6, _zFunc) == i32(0) { return _p } - _p = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7)))))) + _p = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X7))))) goto _0 _3: return nil @@ -5131,7 +5402,7 @@ func _sqlite3StrICmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) { _a = (*uint8)(unsafe.Pointer(_zLeft)) _b = (*uint8)(unsafe.Pointer(_zRight)) _0: - _c = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b)))) + _c = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_b)))) if _c != 0 || (int32(*_a) == i32(0)) { goto _2 } @@ -5160,25 +5431,28 @@ func init() { }{_renameParentFunc})), X5: nil, X6: str(4214), X7: t12{}}} } -// This function is used by SQL generated to implement the -// ALTER TABLE command. The first argument is the text of a CREATE TABLE or -// CREATE INDEX command. The second is a table name. The table name in -// the CREATE TABLE or CREATE INDEX statement is replaced with the third -// argument and the result returned. Examples: -// -// sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def') -// -> 'CREATE TABLE def(a, b, c)' -// -// sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def') -// -> 'CREATE INDEX i ON def(a, b, c)' +// C comment +// /* +// ** This function is used by SQL generated to implement the +// ** ALTER TABLE command. The first argument is the text of a CREATE TABLE or +// ** CREATE INDEX command. The second is a table name. The table name in +// ** the CREATE TABLE or CREATE INDEX statement is replaced with the third +// ** argument and the result returned. Examples: +// ** +// ** sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def') +// ** -> 'CREATE TABLE def(a, b, c)' +// ** +// ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def') +// ** -> 'CREATE INDEX i ON def(a, b, c)' +// */ func _renameTableFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _token, _len int32 var _zRet *int8 var _zSql, _zTableName, _zCsr *uint8 var _tname XToken var _db *Xsqlite3 - _zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) _zCsr = _zSql _len = i32(0) _db = Xsqlite3_context_db_handle(tls, _context) @@ -5190,12 +5464,12 @@ _1: if (*_zCsr) == 0 { return } - *(**int8)(unsafe.Pointer(&(_tname.X0))) = (*int8)(unsafe.Pointer(_zCsr)) - *(*uint32)(unsafe.Pointer(&(_tname.X1))) = uint32(_len) + *(**int8)(unsafe.Pointer(&_tname.X0)) = (*int8)(unsafe.Pointer(_zCsr)) + *(*uint32)(unsafe.Pointer(&_tname.X1)) = uint32(_len) _3: { p := &_zCsr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_len))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_len))) sink13(*p) } _len = _sqlite3GetToken(tls, _zCsr, &_token) @@ -5212,9 +5486,10 @@ _3: goto _1 } _zRet = _sqlite3MPrintf(tls, _db, str(4241), int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_tname.X0))))-uintptr(unsafe.Pointer(_zSql)))/1)), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.X0))+uintptr(_tname.X1))))) - Xsqlite3_result_text(tls, _context, _zRet, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + Xsqlite3_result_text(tls, _context, _zRet, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _0: _ = _tname } @@ -5223,15 +5498,17 @@ func Xsqlite3_value_text(tls *crt.TLS, _pVal *XMem) (r0 *uint8) { return (*uint8)(_sqlite3ValueText(tls, _pVal, uint8(i32(1)))) } -// This function is only available internally, it is not part of the -// external API. It works in a similar way to sqlite3_value_text(), -// except the data returned is in the encoding specified by the second -// parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or -// SQLITE_UTF8. -// -// (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED. -// If that is the case, then the result must be aligned on an even byte -// boundary. +// C comment +// /* This function is only available internally, it is not part of the +// ** external API. It works in a similar way to sqlite3_value_text(), +// ** except the data returned is in the encoding specified by the second +// ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or +// ** SQLITE_UTF8. +// ** +// ** (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED. +// ** If that is the case, then the result must be aligned on an even byte +// ** boundary. +// */ func _sqlite3ValueText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) { if _pVal == nil { return nil @@ -5255,7 +5532,7 @@ func _sqlite3ValueText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer } }() if ((int32(_pVal.X1) & i32(514)) == i32(514)) && (int32(_pVal.X2) == int32(_enc)) { - return (unsafe.Pointer)(_pVal.X5) + return unsafe.Pointer(_pVal.X5) } if (int32(_pVal.X1) & i32(1)) != 0 { return nil @@ -5269,9 +5546,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ValueTextØ00__func__Ø000[0], str(4370), 17) } -// The pVal argument is known to be a value other than NULL. -// Convert it into a string with encoding enc and return a pointer -// to a zero-terminated version of that string. +// C comment +// /* +// ** The pVal argument is known to be a value other than NULL. +// ** Convert it into a string with encoding enc and return a pointer +// ** to a zero-terminated version of that string. +// */ func _valueToText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) { func() { if _pVal == nil { @@ -5315,7 +5595,7 @@ func _valueToText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) { return nil } { - p := (*uint16)(unsafe.Pointer(&(_pVal.X1))) + p := (*uint16)(unsafe.Pointer(&_pVal.X1)) *p = uint16(int32(*p) | i32(2)) sink14(*p) } @@ -5353,7 +5633,7 @@ _21: } }() if int32(_pVal.X2) == (int32(_enc) & i32(-9)) { - return (unsafe.Pointer)(_pVal.X5) + return unsafe.Pointer(_pVal.X5) } return nil } @@ -5390,21 +5670,21 @@ func _sqlite3VdbeMemExpandBlob(tls *crt.TLS, _pMem *XMem) (r0 int32) { crt.X__builtin_abort(tls) } }() - _nByte = (_pMem.X4) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + _nByte = _pMem.X4 + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) if _nByte <= i32(0) { _nByte = i32(1) } if _sqlite3VdbeMemGrow(tls, _pMem, _nByte, i32(1)) != 0 { return _sqlite3NomemError(tls, i32(69934)) } - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5))+1*uintptr(_pMem.X4)))), i32(0), uint64(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5))+1*uintptr(_pMem.X4)))), i32(0), uint64(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))))) { - p := (*int32)(unsafe.Pointer(&(_pMem.X4))) - *p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + p := (*int32)(unsafe.Pointer(&_pMem.X4)) + *p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) sink1(*p) } { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-16897)) sink14(*p) } @@ -5417,13 +5697,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemExpandBlobØ00__func__Ø000[0], str(4718), 25) } -// Make sure pMem->z points to a writable allocation of at least -// min(n,32) bytes. -// -// If the bPreserve argument is true, then copy of the content of -// pMem->z into the new allocation. pMem must be either a string or -// blob if bPreserve is true. If bPreserve is false, any prior content -// in pMem->z is discarded. +// C comment +// /* +// ** Make sure pMem->z points to a writable allocation of at least +// ** min(n,32) bytes. +// ** +// ** If the bPreserve argument is true, then copy of the content of +// ** pMem->z into the new allocation. pMem must be either a string or +// ** blob if bPreserve is true. If bPreserve is false, any prior content +// ** in pMem->z is discarded. +// */ func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) (r0 int32) { func() { if _sqlite3VdbeCheckMemInvariants(tls, _pMem) == 0 { @@ -5444,7 +5727,7 @@ func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) } }() func() { - if (_pMem.X7) != i32(0) && (_pMem.X7) != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) { + if _pMem.X7 != i32(0) && _pMem.X7 != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X6)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69831), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4826))) crt.X__builtin_abort(tls) } @@ -5452,25 +5735,25 @@ func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) if _n < i32(32) { _n = i32(32) } - if (_bPreserve != 0 && ((_pMem.X7) > i32(0))) && ((_pMem.X5) == (_pMem.X6)) { - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = store0((**int8)(unsafe.Pointer(&(_pMem.X6))), (*int8)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X5), uint64(_n)))) + if (_bPreserve != 0 && (_pMem.X7 > i32(0))) && (_pMem.X5 == _pMem.X6) { + *(**int8)(unsafe.Pointer(&_pMem.X5)) = store0((**int8)(unsafe.Pointer(&_pMem.X6)), (*int8)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X5), uint64(_n)))) _bPreserve = i32(0) goto _14 } - if (_pMem.X7) > i32(0) { - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) + if _pMem.X7 > i32(0) { + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X6)) } - *(**int8)(unsafe.Pointer(&(_pMem.X6))) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.X9), uint64(_n))) + *(**int8)(unsafe.Pointer(&_pMem.X6)) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.X9), uint64(_n))) _14: - if (_pMem.X6) == nil { + if _pMem.X6 == nil { _sqlite3VdbeMemSetNull(tls, _pMem) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = nil + *(*int32)(unsafe.Pointer(&_pMem.X7)) = i32(0) return _sqlite3NomemError(tls, i32(69845)) } - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) - if (_bPreserve != 0 && ((_pMem.X5) != nil)) && func() int32 { - if (_pMem.X5) != (_pMem.X6) { + *(*int32)(unsafe.Pointer(&_pMem.X7)) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X6)) + if (_bPreserve != 0 && (_pMem.X5 != nil)) && func() int32 { + if _pMem.X5 != _pMem.X6 { return i32(1) } return func() int32 { @@ -5479,45 +5762,49 @@ _14: return i32(0) }() }() != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem.X6), (unsafe.Pointer)(_pMem.X5), uint64(_pMem.X4)) + crt.Xmemcpy(tls, unsafe.Pointer(_pMem.X6), unsafe.Pointer(_pMem.X5), uint64(_pMem.X4)) } if (int32(_pMem.X1) & i32(1024)) != i32(0) { func() { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(_pMem.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_pMem.X10})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) }{nil})) || *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(_pMem.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_pMem.X10})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4910))) crt.X__builtin_abort(tls) } }() - (_pMem.X10)(tls, (unsafe.Pointer)(_pMem.X5)) + _pMem.X10(tls, unsafe.Pointer(_pMem.X5)) } - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = _pMem.X6 + *(**int8)(unsafe.Pointer(&_pMem.X5)) = _pMem.X6 { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-7169)) sink14(*p) } return i32(0) } -// Check invariants on a Mem object. -// -// This routine is intended for use inside of assert() statements, like -// this: assert( sqlite3VdbeCheckMemInvariants(pMem) ); +// C comment +// /* +// ** Check invariants on a Mem object. +// ** +// ** This routine is intended for use inside of assert() statements, like +// ** this: assert( sqlite3VdbeCheckMemInvariants(pMem) ); +// */ func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) { func() { if (int32(_p.X1)&i32(1024)) != i32(0) && *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_p.X10})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) }{nil})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69733), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(4954))) @@ -5525,7 +5812,7 @@ func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) { } }() func() { - if (int32(_p.X1)&i32(1024)) != i32(0) && (_p.X7) != i32(0) { + if (int32(_p.X1)&i32(1024)) != i32(0) && _p.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(4992))) crt.X__builtin_abort(tls) } @@ -5543,15 +5830,15 @@ func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) { } }() func() { - if (_p.X7) != i32(0) && (_p.X7) != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X9), (unsafe.Pointer)(_p.X6)) { + if _p.X7 != i32(0) && _p.X7 != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X9), unsafe.Pointer(_p.X6)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(5166))) crt.X__builtin_abort(tls) } }() - if (int32(_p.X1)&i32(18)) != 0 && ((_p.X4) > i32(0)) { + if (int32(_p.X1)&i32(18)) != 0 && (_p.X4 > i32(0)) { func() { if (((func() int32 { - if ((_p.X7) > i32(0)) && ((_p.X5) == (_p.X6)) { + if (_p.X7 > i32(0)) && (_p.X5 == _p.X6) { return i32(1) } return i32(0) @@ -5591,8 +5878,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemGrowØ00__func__Ø000[0], str(5422), 19) } -// Attempt to reallocate p. If the reallocation fails, then free p -// and set the mallocFailed flag in the database connection. +// C comment +// /* +// ** Attempt to reallocate p. If the reallocation fails, then free p +// ** and set the mallocFailed flag in the database connection. +// */ func _sqlite3DbReallocOrFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) { var _pNew unsafe.Pointer _pNew = _sqlite3DbRealloc(tls, _db, _p, _n) @@ -5602,26 +5892,29 @@ func _sqlite3DbReallocOrFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n return _pNew } -// Allocate memory, either lookaside (if possible) or heap. -// If the allocation fails, set the mallocFailed flag in -// the connection pointer. -// -// If db!=0 and db->mallocFailed is true (indicating a prior malloc -// failure on the same database connection) then always return 0. -// Hence for a particular database connection, once malloc starts -// failing, it fails consistently until mallocFailed is reset. -// This is an important assumption. There are many places in the -// code that do things like this: -// -// int *a = (int*)sqlite3DbMallocRaw(db, 100); -// int *b = (int*)sqlite3DbMallocRaw(db, 200); -// if( b ) a[10] = 9; -// -// In other words, if a subsequent malloc (ex: "b") worked, it is assumed -// that all prior mallocs (ex: "a") worked too. -// -// The sqlite3MallocRawNN() variant guarantees that the "db" parameter is -// not a NULL pointer. +// C comment +// /* +// ** Allocate memory, either lookaside (if possible) or heap. +// ** If the allocation fails, set the mallocFailed flag in +// ** the connection pointer. +// ** +// ** If db!=0 and db->mallocFailed is true (indicating a prior malloc +// ** failure on the same database connection) then always return 0. +// ** Hence for a particular database connection, once malloc starts +// ** failing, it fails consistently until mallocFailed is reset. +// ** This is an important assumption. There are many places in the +// ** code that do things like this: +// ** +// ** int *a = (int*)sqlite3DbMallocRaw(db, 100); +// ** int *b = (int*)sqlite3DbMallocRaw(db, 200); +// ** if( b ) a[10] = 9; +// ** +// ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed +// ** that all prior mallocs (ex: "a") worked too. +// ** +// ** The sqlite3MallocRawNN() variant guarantees that the "db" parameter is +// ** not a NULL pointer. +// */ func _sqlite3DbMallocRaw(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) { var _p unsafe.Pointer if _db != nil { @@ -5631,32 +5924,38 @@ func _sqlite3DbMallocRaw(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Poin return _p } -// Delete any previous value and set the value stored in *pMem to NULL. -// -// This routine calls the Mem.xDel destructor to dispose of values that -// require the destructor. But it preserves the Mem.zMalloc memory allocation. -// To free all resources, use sqlite3VdbeMemRelease(), which both calls this -// routine to invoke the destructor and deallocates Mem.zMalloc. -// -// Use this routine to reset the Mem prior to insert a new value. -// -// Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it. +// C comment +// /* +// ** Delete any previous value and set the value stored in *pMem to NULL. +// ** +// ** This routine calls the Mem.xDel destructor to dispose of values that +// ** require the destructor. But it preserves the Mem.zMalloc memory allocation. +// ** To free all resources, use sqlite3VdbeMemRelease(), which both calls this +// ** routine to invoke the destructor and deallocates Mem.zMalloc. +// ** +// ** Use this routine to reset the Mem prior to insert a new value. +// ** +// ** Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it. +// */ func _sqlite3VdbeMemSetNull(tls *crt.TLS, _pMem *XMem) { if (int32(_pMem.X1) & i32(9312)) != i32(0) { _vdbeMemClearExternAndSetNull(tls, _pMem) goto _1 } - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(1)) _1: } -// If the memory cell contains a value that must be freed by -// invoking the external callback in Mem.xDel, then this routine -// will free that value. It also sets Mem.flags to MEM_Null. -// -// This is a helper routine for sqlite3VdbeMemSetNull() and -// for sqlite3VdbeMemRelease(). Use those other routines as the -// entry point for releasing Mem resources. +// C comment +// /* +// ** If the memory cell contains a value that must be freed by +// ** invoking the external callback in Mem.xDel, then this routine +// ** will free that value. It also sets Mem.flags to MEM_Null. +// ** +// ** This is a helper routine for sqlite3VdbeMemSetNull() and +// ** for sqlite3VdbeMemRelease(). Use those other routines as the +// ** entry point for releasing Mem resources. +// */ func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) { var _4_pFrame *XVdbeFrame func() { @@ -5672,7 +5971,7 @@ func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) { } }() if (int32(_p.X1) & i32(8192)) != 0 { - _sqlite3VdbeMemFinalize(tls, _p, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))) + _sqlite3VdbeMemFinalize(tls, _p, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0)))))) func() { if (int32(_p.X1) & i32(8192)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70068), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5504))) @@ -5690,33 +5989,34 @@ func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) { func() { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_p.X10})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) || *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) || *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_p.X10})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) }{nil})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70073), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5553))) crt.X__builtin_abort(tls) } }() - (_p.X10)(tls, (unsafe.Pointer)(_p.X5)) + _p.X10(tls, unsafe.Pointer(_p.X5)) goto _17 } if (int32(_p.X1) & i32(32)) != 0 { - _sqlite3RowSetClear(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))) + _sqlite3RowSetClear(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0)))))) goto _17 } if (int32(_p.X1) & i32(64)) != 0 { - _4_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pFrame.X1))))) = (*XVdbeFrame)((*TVdbe)(_4_pFrame.X0).X39) + _4_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pFrame.X1)))) = (*XVdbeFrame)((*TVdbe)(_4_pFrame.X0).X39) *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_4_pFrame.X0).X39))))) = _4_pFrame } _17: - *(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_p.X1)) = uint16(i32(1)) } var _vdbeMemClearExternAndSetNullØ00__func__Ø000 [29]int8 @@ -5725,21 +6025,22 @@ func init() { crt.Xstrncpy(nil, &_vdbeMemClearExternAndSetNullØ00__func__Ø000[0], str(5591), 29) } -// Memory cell pMem contains the context of an aggregate function. -// This routine calls the finalize method for that function. The -// result of the aggregate is stored back into pMem. -// -// Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK -// otherwise. +// C comment +// /* +// ** Memory cell pMem contains the context of an aggregate function. +// ** This routine calls the finalize method for that function. The +// ** result of the aggregate is stored back into pMem. +// ** +// ** Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK +// ** otherwise. +// */ func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 int32) { var _rc int32 var _1_ctx Xsqlite3_context var _1_t XMem _rc = i32(0) if func() int32 { - if (_pFunc != nil) && ((*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_pFunc.X5)}))) != nil) { + if (_pFunc != nil) && (_pFunc.X5 != nil) { return i32(1) } return func() int32 { @@ -5751,7 +6052,7 @@ func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 in goto _3 } func() { - if (int32(_pMem.X1)&i32(1)) == i32(0) && _pFunc != (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) { + if (int32(_pMem.X1)&i32(1)) == i32(0) && _pFunc != (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70036), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(5620))) crt.X__builtin_abort(tls) } @@ -5762,26 +6063,27 @@ func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 in crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_1_ctx), i32(0), u64(56)) - crt.Xmemset(tls, (unsafe.Pointer)(&_1_t), i32(0), u64(72)) - *(*uint16)(unsafe.Pointer(&(_1_t.X1))) = uint16(i32(1)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_t.X9))))) = (*Xsqlite3)(_pMem.X9) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X0))))) = &_1_t - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X2))))) = _pMem - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X1))))) = _pFunc - (*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_pFunc.X5)})))(tls, &_1_ctx) + crt.Xmemset(tls, unsafe.Pointer(&_1_ctx), i32(0), u64(56)) + crt.Xmemset(tls, unsafe.Pointer(&_1_t), i32(0), u64(72)) + *(*uint16)(unsafe.Pointer(&_1_t.X1)) = uint16(i32(1)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_t.X9)))) = (*Xsqlite3)(_pMem.X9) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_ctx.X0)))) = &_1_t + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_ctx.X2)))) = _pMem + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_ctx.X1)))) = _pFunc + func() func(*crt.TLS, *Xsqlite3_context) { + v := _pFunc.X5 + return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v)) + }()(tls, &_1_ctx) func() { if (int32(_pMem.X1) & i32(1024)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(5671))) crt.X__builtin_abort(tls) } }() - if (_pMem.X7) > i32(0) { - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) + if _pMem.X7 > i32(0) { + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X6)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem), (unsafe.Pointer)(&_1_t), u64(72)) + crt.Xmemcpy(tls, unsafe.Pointer(_pMem), unsafe.Pointer(&_1_t), u64(72)) _rc = _1_ctx.X5 _3: return _rc @@ -5797,9 +6099,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemFinalizeØ00__func__Ø000[0], str(5698), 23) } -// Deallocate all chunks from a RowSet. This frees all memory that -// the RowSet has allocated over its lifetime. This routine is -// the destructor for the RowSet. +// C comment +// /* +// ** Deallocate all chunks from a RowSet. This frees all memory that +// ** the RowSet has allocated over its lifetime. This routine is +// ** the destructor for the RowSet. +// */ func _sqlite3RowSetClear(tls *crt.TLS, _p *XRowSet) { var _pChunk, _pNextChunk *TRowSetChunk _pChunk = (*TRowSetChunk)(_p.X0) @@ -5808,29 +6113,32 @@ _0: goto _3 } _pNextChunk = (*TRowSetChunk)(_pChunk.X0) - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X1), (unsafe.Pointer)(_pChunk)) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X1), unsafe.Pointer(_pChunk)) _pChunk = _pNextChunk goto _0 _3: - *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil - *(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(i32(0)) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil - *(*uint16)(unsafe.Pointer(&(_p.X7))) = uint16(i32(1)) -} - -// If pMem is an object with a valid string representation, this routine -// ensures the internal encoding for the string representation is -// 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE. -// -// If pMem is not a string object, or the encoding of the string -// representation is already stored using the requested encoding, then this -// routine is a no-op. -// -// SQLITE_OK is returned if the conversion is successful (or not required). -// SQLITE_NOMEM may be returned if a malloc() fails during conversion -// between formats. + *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = nil + *(*uint16)(unsafe.Pointer(&_p.X6)) = uint16(i32(0)) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X5)))) = nil + *(*uint16)(unsafe.Pointer(&_p.X7)) = uint16(i32(1)) +} + +// C comment +// /* +// ** If pMem is an object with a valid string representation, this routine +// ** ensures the internal encoding for the string representation is +// ** 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE. +// ** +// ** If pMem is not a string object, or the encoding of the string +// ** representation is already stored using the requested encoding, then this +// ** routine is a no-op. +// ** +// ** SQLITE_OK is returned if the conversion is successful (or not required). +// ** SQLITE_NOMEM may be returned if a malloc() fails during conversion +// ** between formats. +// */ func _sqlite3VdbeChangeEncoding(tls *crt.TLS, _pMem *XMem, _desiredEnc int32) (r0 int32) { var _rc int32 func() { @@ -5882,9 +6190,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeChangeEncodingØ00__func__Ø000[0], str(5920), 26) } -// This routine transforms the internal text encoding used by pMem to -// desiredEnc. It is an error if the string is already of the desired -// encoding, or if *pMem does not contain a string value. +// C comment +// /* +// ** This routine transforms the internal text encoding used by pMem to +// ** desiredEnc. It is an error if the string is already of the desired +// ** encoding, or if *pMem does not contain a string value. +// */ func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 int32) { var _len, _1_rc, _28_c2, _37_c2 int32 var _c uint32 @@ -5915,7 +6226,7 @@ func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 } }() func() { - if (_pMem.X4) < i32(0) { + if _pMem.X4 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6001))) crt.X__builtin_abort(tls) } @@ -5934,7 +6245,7 @@ func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 return _sqlite3NomemError(tls, i32(27357)) } _zIn = (*uint8)(unsafe.Pointer(_pMem.X5)) - _zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr((_pMem.X4)&i32(-2)))) + _zTerm = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(_pMem.X4&i32(-2)))) _16: if crt.P2U(unsafe.Pointer(_zIn)) < crt.P2U(unsafe.Pointer(_zTerm)) { _1_temp = *_zIn @@ -5943,22 +6254,22 @@ _16: *postInc13(&_zIn, 1) = _1_temp goto _16 } - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _desiredEnc + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = _desiredEnc goto _translate_out _12: if int32(_desiredEnc) == i32(1) { { - p := (*int32)(unsafe.Pointer(&(_pMem.X4))) + p := (*int32)(unsafe.Pointer(&_pMem.X4)) *p = (*p) & i32(-2) sink1(*p) } - _len = ((_pMem.X4) * i32(2)) + i32(1) + _len = (_pMem.X4 * i32(2)) + i32(1) goto _19 } - _len = ((_pMem.X4) * i32(2)) + i32(2) + _len = (_pMem.X4 * i32(2)) + i32(2) _19: _zIn = (*uint8)(unsafe.Pointer(_pMem.X5)) - _zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_pMem.X4))) + _zTerm = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(_pMem.X4))) _zOut = (*uint8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.X9), uint64(_len))) if _zOut == nil { return _sqlite3NomemError(tls, i32(27399)) @@ -5978,7 +6289,7 @@ _23: if _c < uint32(i32(192)) { goto _25 } - _c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) + _c = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) _26: if (_zIn != _zTerm) && ((int32(*_zIn) & i32(192)) == i32(128)) { _c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(&_zIn, 1))) @@ -6016,7 +6327,7 @@ _37: if _c < uint32(i32(192)) { goto _39 } - _c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) + _c = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) _40: if (_zIn != _zTerm) && ((int32(*_zIn) & i32(192)) == i32(128)) { _c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(&_zIn, 1))) @@ -6039,7 +6350,7 @@ _47: goto _37 _38: _34: - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(int64((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = int32(int64((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)) *postInc13(&_z, 1) = uint8(i32(0)) goto _48 _21: @@ -6137,11 +6448,11 @@ _74: goto _64 _65: _63: - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(int64((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = int32(int64((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)) _48: *_z = uint8(i32(0)) func() { - if ((_pMem.X4) + func() int32 { + if (_pMem.X4 + func() int32 { if int32(_desiredEnc) == i32(1) { return i32(1) } @@ -6153,11 +6464,11 @@ _48: }() _c = uint32(_pMem.X1) _sqlite3VdbeMemRelease(tls, _pMem) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(uint32(i32(514)) | (_c & uint32(i32(32799)))) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _desiredEnc - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = (*int8)(unsafe.Pointer(_zOut)) - *(**int8)(unsafe.Pointer(&(_pMem.X6))) = _pMem.X5 - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X5)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(uint32(i32(514)) | (_c & uint32(i32(32799)))) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = _desiredEnc + *(**int8)(unsafe.Pointer(&_pMem.X5)) = (*int8)(unsafe.Pointer(_zOut)) + *(**int8)(unsafe.Pointer(&_pMem.X6)) = _pMem.X5 + *(*int32)(unsafe.Pointer(&_pMem.X7)) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X5)) _translate_out: return i32(0) } @@ -6168,10 +6479,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemTranslateØ00__func__Ø000[0], str(6125), 24) } -// Change pMem so that its MEM_Str or MEM_Blob value is stored in -// MEM.zMalloc, where it can be safely written. -// -// Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. +// C comment +// /* +// ** Change pMem so that its MEM_Str or MEM_Blob value is stored in +// ** MEM.zMalloc, where it can be safely written. +// ** +// ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. +// */ func _sqlite3VdbeMemMakeWriteable(tls *crt.TLS, _pMem *XMem) (r0 int32) { func() { if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 { @@ -6196,27 +6510,27 @@ func _sqlite3VdbeMemMakeWriteable(tls *crt.TLS, _pMem *XMem) (r0 int32) { }() != 0 { return i32(7) } - if (_pMem.X7) != i32(0) && (_pMem.X5) == (_pMem.X6) { + if _pMem.X7 != i32(0) && _pMem.X5 == _pMem.X6 { goto _10 } - if _sqlite3VdbeMemGrow(tls, _pMem, (_pMem.X4)+i32(2), i32(1)) != 0 { + if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.X4+i32(2), i32(1)) != 0 { return _sqlite3NomemError(tls, i32(69901)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4+i32(1)))) = int8(i32(0)) { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) | i32(512)) sink14(*p) } _10: _5: { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-4097)) sink14(*p) } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X11))))) = nil + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.X11)))) = nil return i32(0) } @@ -6232,14 +6546,17 @@ func init() { _sqlite3Utf8Trans1 = [64]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 0, 0} } -// Release any memory resources held by the Mem. Both the memory that is -// free by Mem.xDel and the Mem.zMalloc allocation are freed. -// -// Use this routine prior to clean up prior to abandoning a Mem, or to -// reset a Mem back to its minimum memory utilization. -// -// Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space -// prior to inserting new content into the Mem. +// C comment +// /* +// ** Release any memory resources held by the Mem. Both the memory that is +// ** free by Mem.xDel and the Mem.zMalloc allocation are freed. +// ** +// ** Use this routine prior to clean up prior to abandoning a Mem, or to +// ** reset a Mem back to its minimum memory utilization. +// ** +// ** Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space +// ** prior to inserting new content into the Mem. +// */ func _sqlite3VdbeMemRelease(tls *crt.TLS, _p *XMem) { func() { if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 { @@ -6247,7 +6564,7 @@ func _sqlite3VdbeMemRelease(tls *crt.TLS, _p *XMem) { crt.X__builtin_abort(tls) } }() - if ((int32(_p.X1) & i32(9312)) != i32(0)) || (_p.X7) != 0 { + if ((int32(_p.X1) & i32(9312)) != i32(0)) || _p.X7 != 0 { _vdbeMemClear(tls, _p) } } @@ -6258,24 +6575,30 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemReleaseØ00__func__Ø000[0], str(6210), 22) } -// Release memory held by the Mem p, both external memory cleared -// by p->xDel and memory in p->zMalloc. -// -// This is a helper routine invoked by sqlite3VdbeMemRelease() in -// the unusual case where there really is memory in p that needs -// to be freed. +// C comment +// /* +// ** Release memory held by the Mem p, both external memory cleared +// ** by p->xDel and memory in p->zMalloc. +// ** +// ** This is a helper routine invoked by sqlite3VdbeMemRelease() in +// ** the unusual case where there really is memory in p that needs +// ** to be freed. +// */ func _vdbeMemClear(tls *crt.TLS, _p *XMem) { if (int32(_p.X1) & i32(9312)) != i32(0) { _vdbeMemClearExternAndSetNull(tls, _p) } - if (_p.X7) != 0 { - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X9), (unsafe.Pointer)(_p.X6)) - *(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0) + if _p.X7 != 0 { + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X9), unsafe.Pointer(_p.X6)) + *(*int32)(unsafe.Pointer(&_p.X7)) = i32(0) } - *(**int8)(unsafe.Pointer(&(_p.X5))) = nil + *(**int8)(unsafe.Pointer(&_p.X5)) = nil } -// Make sure the given Mem is \u0000 terminated. +// C comment +// /* +// ** Make sure the given Mem is \u0000 terminated. +// */ func _sqlite3VdbeMemNulTerminate(tls *crt.TLS, _pMem *XMem) (r0 int32) { func() { if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 { @@ -6295,34 +6618,40 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemNulTerminateØ00__func__Ø000[0], str(6232), 27) } -// It is already known that pMem contains an unterminated string. -// Add the zero terminator. +// C comment +// /* +// ** It is already known that pMem contains an unterminated string. +// ** Add the zero terminator. +// */ func _vdbeMemAddTerminator(tls *crt.TLS, _pMem *XMem) (r0 int32) { - if _sqlite3VdbeMemGrow(tls, _pMem, (_pMem.X4)+i32(2), i32(1)) != 0 { + if _sqlite3VdbeMemGrow(tls, _pMem, _pMem.X4+i32(2), i32(1)) != 0 { return _sqlite3NomemError(tls, i32(69950)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4+i32(1)))) = int8(i32(0)) { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) | i32(512)) sink14(*p) } return i32(0) } -// Add MEM_Str to the set of representations for the given Mem. Numbers -// are converted using sqlite3_snprintf(). Converting a BLOB to a string -// is a no-op. -// -// Existing representations MEM_Int and MEM_Real are invalidated if -// bForce is true but are retained if bForce is false. -// -// A MEM_Null value will never be passed to this function. This function is -// used for converting values to text for returning to the user (i.e. via -// sqlite3_value_text()), or for ensuring that values to be used as btree -// keys are strings. In the former case a NULL pointer is returned the -// user and the latter is an internal programming error. +// C comment +// /* +// ** Add MEM_Str to the set of representations for the given Mem. Numbers +// ** are converted using sqlite3_snprintf(). Converting a BLOB to a string +// ** is a no-op. +// ** +// ** Existing representations MEM_Int and MEM_Real are invalidated if +// ** bForce is true but are retained if bForce is false. +// ** +// ** A MEM_Null value will never be passed to this function. This function is +// ** used for converting values to text for returning to the user (i.e. via +// ** sqlite3_value_text()), or for ensuring that values to be used as btree +// ** keys are strings. In the former case a NULL pointer is returned the +// ** user and the latter is an internal programming error. +// */ func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uint8) (r0 int32) { var _fg, _nByte int32 _fg = int32(_pMem.X1) @@ -6364,11 +6693,11 @@ func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uin } }() if _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) != 0 { - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(0)) return _sqlite3NomemError(tls, i32(70000)) } if (_fg & i32(4)) != 0 { - Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) goto _15 } func() { @@ -6377,18 +6706,18 @@ func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uin crt.X__builtin_abort(tls) } }() - Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) _15: - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = _sqlite3Strlen30(tls, _pMem.X5) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) | i32(514)) sink14(*p) } if _bForce != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-13)) sink14(*p) } @@ -6403,17 +6732,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemStringifyØ00__func__Ø000[0], str(6374), 24) } -// Change the pMem->zMalloc allocation to be at least szNew bytes. -// If pMem->zMalloc already meets or exceeds the requested size, this -// routine is a no-op. -// -// Any prior string or blob content in the pMem object may be discarded. -// The pMem->xDel destructor is called, if it exists. Though MEM_Str -// and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null -// values are preserved. -// -// Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM) -// if unable to complete the resizing. +// C comment +// /* +// ** Change the pMem->zMalloc allocation to be at least szNew bytes. +// ** If pMem->zMalloc already meets or exceeds the requested size, this +// ** routine is a no-op. +// ** +// ** Any prior string or blob content in the pMem object may be discarded. +// ** The pMem->xDel destructor is called, if it exists. Though MEM_Str +// ** and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null +// ** values are preserved. +// ** +// ** Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM) +// ** if unable to complete the resizing. +// */ func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 int32) { func() { if _szNew <= i32(0) { @@ -6422,12 +6754,12 @@ func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 } }() func() { - if (int32(_pMem.X1)&i32(1024)) != i32(0) && (_pMem.X7) != i32(0) { + if (int32(_pMem.X1)&i32(1024)) != i32(0) && _pMem.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69878), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000))), unsafe.Pointer(str(6406))) crt.X__builtin_abort(tls) } }() - if (_pMem.X7) < _szNew { + if _pMem.X7 < _szNew { return _sqlite3VdbeMemGrow(tls, _pMem, _szNew, i32(0)) } func() { @@ -6436,9 +6768,9 @@ func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = _pMem.X6 + *(**int8)(unsafe.Pointer(&_pMem.X5)) = _pMem.X6 { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(13)) sink14(*p) } @@ -6460,17 +6792,20 @@ func Xsqlite3_snprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, args return _z } -// sqlite3_snprintf() works like snprintf() except that it ignores the -// current locale settings. This is important for SQLite because we -// are not able to use a "," as the decimal point in place of "." as -// specified by some locales. -// -// Oops: The first two arguments of sqlite3_snprintf() are backwards -// from the snprintf() standard. Unfortunately, it is too late to change -// this without breaking compatibility, so we just have to live with the -// mistake. -// -// sqlite3_vsnprintf() is the varargs version. +// C comment +// /* +// ** sqlite3_snprintf() works like snprintf() except that it ignores the +// ** current locale settings. This is important for SQLite because we +// ** are not able to use a "," as the decimal point in place of "." as +// ** specified by some locales. +// ** +// ** Oops: The first two arguments of sqlite3_snprintf() are backwards +// ** from the snprintf() standard. Unfortunately, it is too late to change +// ** this without breaking compatibility, so we just have to live with the +// ** mistake. +// ** +// ** sqlite3_vsnprintf() is the varargs version. +// */ func Xsqlite3_vsnprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, _ap []interface{}) (r0 *int8) { var _acc XStrAccum if _n <= i32(0) { @@ -6481,31 +6816,34 @@ func Xsqlite3_vsnprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, _ap } _sqlite3MisuseError(tls, i32(26087)) if _zBuf != nil { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0)) } return _zBuf _2: _sqlite3StrAccumInit(tls, &_acc, nil, _zBuf, _n, i32(0)) _sqlite3VXPrintf(tls, &_acc, _zFormat, _ap) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_acc.X3))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(_acc.X3))) = int8(i32(0)) return _zBuf _ = _acc panic(0) } -// Extract the user data from a sqlite3_context structure and return a -// pointer to it. -// -// IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface -// returns a copy of the pointer to the database connection (the 1st -// parameter) of the sqlite3_create_function() and -// sqlite3_create_function16() routines that originally registered the -// application defined function. +// C comment +// /* +// ** Extract the user data from a sqlite3_context structure and return a +// ** pointer to it. +// ** +// ** IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface +// ** returns a copy of the pointer to the database connection (the 1st +// ** parameter) of the sqlite3_create_function() and +// ** sqlite3_create_function16() routines that originally registered the +// ** application defined function. +// */ func Xsqlite3_context_db_handle(tls *crt.TLS, _p *Xsqlite3_context) (r0 *Xsqlite3) { func() { - if _p == nil || (*XMem)(_p.X0) == nil { + if _p == nil || _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_context_db_handleØ00__func__Ø000))), unsafe.Pointer(str(6483))) crt.X__builtin_abort(tls) } @@ -6519,11 +6857,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_context_db_handleØ00__func__Ø000[0], str(6496), 26) } -// Return the length (in bytes) of the token that begins at z[0]. -// Store the token type in *tokenType before returning. +// C comment +// /* +// ** Return the length (in bytes) of the token that begins at z[0]. +// ** Store the token type in *tokenType before returning. +// */ func _sqlite3GetToken(tls *crt.TLS, _z *uint8, _tokenType *int32) (r0 int32) { var _i, _c, _35_delim, _58_n int32 - switch int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiClass)) + 1*uintptr(*_z)))) { + switch int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiClass)) + 1*uintptr(*_z)))) { case i32(0): goto _26 case i32(1): @@ -6585,7 +6926,7 @@ func _sqlite3GetToken(tls *crt.TLS, _z *uint8, _tokenType *int32) (r0 int32) { _1: _i = i32(1) _29: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(1)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(1)) == 0 { goto _32 } _i += 1 @@ -6595,12 +6936,12 @@ _32: return _i _2: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(45) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(45) { goto _33 } _i = i32(2) _34: - if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) || _c == i32(10) { + if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) == i32(0) || _c == i32(10) { goto _38 } _i += 1 @@ -6634,13 +6975,13 @@ _7: return i32(1) _8: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(42)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2))))) == i32(0)) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(42)) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(2))))) == i32(0)) { *_tokenType = i32(91) return i32(1) } - *func() *int32 { _i = i32(3); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2))))) + *func() *int32 { _i = i32(3); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(2))))) _41: - if _c == i32(42) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(47) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) { + if _c == i32(42) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == i32(47) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) == i32(0) { goto _46 } _i += 1 @@ -6658,10 +6999,10 @@ _9: _10: *_tokenType = i32(78) - return i32(1) + bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) == i32(61)) + return i32(1) + bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) == i32(61)) _11: - if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))) == i32(61) { + if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1)))))) == i32(61) { *_tokenType = i32(80) return i32(2) } @@ -6677,7 +7018,7 @@ _11: return i32(1) _12: - if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))) == i32(61) { + if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1)))))) == i32(61) { *_tokenType = i32(82) return i32(2) } @@ -6689,7 +7030,7 @@ _12: return i32(1) _13: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(61) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(61) { *_tokenType = i32(164) return i32(1) } @@ -6697,7 +7038,7 @@ _13: return i32(2) _14: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(124) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(124) { *_tokenType = i32(85) return i32(1) } @@ -6717,16 +7058,16 @@ _17: return i32(1) _18: - _35_delim = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) + _35_delim = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) _i = i32(1) _62: - if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) { + if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) == i32(0) { goto _65 } if _c != _35_delim { goto _66 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == _35_delim { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))) == _35_delim { _i += 1 goto _68 } @@ -6748,18 +7089,18 @@ _65: return _i _19: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1)))))))) & i32(4)) == 0 { *_tokenType = i32(122) return i32(1) } _20: *_tokenType = i32(134) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2))))))))&i32(8)) == 0 { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(2))))))))&i32(8)) == 0 { goto _77 } _i = i32(3) _78: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 { goto _81 } _i += 1 @@ -6770,24 +7111,24 @@ _81: _77: _i = i32(0) _82: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 { goto _85 } _i += 1 goto _82 _85: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(46) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != i32(46) { goto _86 } _i += 1 _87: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 { _i += 1 goto _87 } *_tokenType = i32(132) _86: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(101) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(69) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))))))&i32(4)) == 0 && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) != i32(43) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) != i32(45) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(2))))))))&i32(4)) == 0) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != i32(101) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != i32(69) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))))))&i32(4)) == 0 && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))) != i32(43) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))) != i32(45) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(2))))))))&i32(4)) == 0) { goto _94 } { @@ -6796,13 +7137,13 @@ _86: sink1(*p) } _95: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 { _i += 1 goto _95 } *_tokenType = i32(132) _94: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { *_tokenType = i32(164) _i += 1 goto _94 @@ -6810,9 +7151,9 @@ _94: return _i _21: - *func() *int32 { _i = i32(1); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) + *func() *int32 { _i = i32(1); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) _99: - if _c == i32(93) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) { + if _c == i32(93) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) == i32(0) { goto _103 } _i += 1 @@ -6830,7 +7171,7 @@ _22: *_tokenType = i32(135) _i = i32(1) _106: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 { goto _109 } _i += 1 @@ -6843,10 +7184,10 @@ _23: *_tokenType = i32(135) _i = i32(1) _110: - if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) { + if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) == i32(0) { goto _113 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(70)) != i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(70)) != i32(0) { _58_n += 1 goto _126 } @@ -6855,7 +7196,7 @@ _110: } _118: _i += 1 - if ((store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) != i32(0)) && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(1)) == 0)) && (_c != i32(41)) { + if ((store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))) != i32(0)) && ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(1)) == 0)) && (_c != i32(41)) { goto _118 } if _c == i32(41) { @@ -6866,7 +7207,7 @@ _118: _122: goto _113 _117: - if (_c == i32(58)) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == i32(58)) { + if (_c == i32(58)) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))) == i32(58)) { _i += 1 goto _126 } @@ -6883,13 +7224,13 @@ _113: _25: _i = i32(1) _128: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiClass)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) > i32(1) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiClass)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) > i32(1) { goto _131 } _i += 1 goto _128 _131: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { _i += 1 goto _133 } @@ -6897,29 +7238,29 @@ _131: return _keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _i, _tokenType) _26: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(39) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(39) { goto _134 } *_tokenType = i32(133) _i = i32(2) _135: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 { goto _138 } _i += 1 goto _135 _138: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(39) && (_i%i32(2)) == 0 { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == i32(39) && (_i%i32(2)) == 0 { goto _140 } *_tokenType = i32(164) _141: - if ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(39)) { + if ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != i32(39)) { _i += 1 goto _141 } _140: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != 0 { _i += 1 } return _i @@ -6933,7 +7274,7 @@ _28: return i32(1) _133: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) { _i += 1 goto _133 } @@ -6953,63 +7294,71 @@ func init() { _sqlite3CtypeMap = [256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 128, 0, 64, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 0, 0, 0, 64, 128, 42, 42, 42, 42, 42, 42, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64} } -// The sqlite3KeywordCode function looks up an identifier to determine if -// it is a keyword. If it is a keyword, the token code of that keyword is -// returned. If the input is not a keyword, TK_ID is returned. -// -// The implementation of this routine was generated by a program, -// mkkeywordhash.c, located in the tool subdirectory of the distribution. -// The output of the mkkeywordhash.c program is written into a file -// named keywordhash.h and then included into this source file by -// the #include below. - -// ************* Include keywordhash.h in the middle of tokenize.c *********** - -// ************* Begin file keywordhash.h ************************************ - -// **** This file contains automatically generated code ****** -// -// The code in this file has been automatically generated by -// -// sqlite/tool/mkkeywordhash.c -// -// The code in this file implements a function that determines whether -// or not a given identifier is really an SQL keyword. The same thing -// might be implemented more directly using a hand-written hash table. -// But by using this automatically generated code, the size of the code -// is substantially reduced. This is important for embedded applications -// on platforms with limited memory. - -// Hash score: 182 +// C comment +// /* +// ** The sqlite3KeywordCode function looks up an identifier to determine if +// ** it is a keyword. If it is a keyword, the token code of that keyword is +// ** returned. If the input is not a keyword, TK_ID is returned. +// ** +// ** The implementation of this routine was generated by a program, +// ** mkkeywordhash.c, located in the tool subdirectory of the distribution. +// ** The output of the mkkeywordhash.c program is written into a file +// ** named keywordhash.h and then included into this source file by +// ** the #include below. +// */ + +// C comment +// /************** Include keywordhash.h in the middle of tokenize.c ************/ + +// C comment +// /************** Begin file keywordhash.h *************************************/ + +// C comment +// /***** This file contains automatically generated code ****** +// ** +// ** The code in this file has been automatically generated by +// ** +// ** sqlite/tool/mkkeywordhash.c +// ** +// ** The code in this file implements a function that determines whether +// ** or not a given identifier is really an SQL keyword. The same thing +// ** might be implemented more directly using a hand-written hash table. +// ** But by using this automatically generated code, the size of the code +// ** is substantially reduced. This is important for embedded applications +// ** on platforms with limited memory. +// */ + +// C comment +// /* Hash score: 182 */ func _keywordCode(tls *crt.TLS, _z *int8, _n int32, _pType *int32) (r0 int32) { var _i, _j int32 var _zKW *int8 if _n < i32(2) { goto _0 } - _i = (((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))))))) * i32(4)) ^ (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) * i32(3))) ^ _n) % i32(127) - _i = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aHashØ002)) + 1*uintptr(_i)))) - i32(1) + _i = (((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))))))) * i32(4)) ^ (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1))))))))) * i32(3))) ^ _n) % i32(127) + _i = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00aHashØ002)) + 1*uintptr(_i)))) - i32(1) _1: if _i < i32(0) { goto _4 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aLenØ004)) + 1*uintptr(_i)))) != _n { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00aLenØ004)) + 1*uintptr(_i)))) != _n { goto _2 } _j = i32(0) - _zKW = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00zTextØ001)) + 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aOffsetØ005)) + 2*uintptr(_i)))))) + _zKW = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00zTextØ001)) + 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00aOffsetØ005)) + 2*uintptr(_i)))))) _6: - if (_j < _n) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j)))) & i32(-33)) == int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zKW)) + 1*uintptr(_j))))) { + if (_j < _n) && ((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_j)))) & i32(-33)) == int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zKW)) + 1*uintptr(_j))))) { _j += 1 goto _6 } if _j < _n { goto _2 } - *_pType = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aCodeØ006)) + 1*uintptr(_i)))) + *_pType = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00aCodeØ006)) + 1*uintptr(_i)))) goto _4 _2: - _i = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aNextØ003)) + 1*uintptr(_i)))) - i32(1) + _i = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_keywordCodeØ00aNextØ003)) + 1*uintptr(_i)))) - i32(1) goto _1 _4: _0: @@ -7058,8 +7407,11 @@ func init() { crt.Xstrncpy(nil, &_renameTableFuncØ00__func__Ø000[0], str(6522), 16) } -// Print into memory obtained from sqliteMalloc(). Use the internal -// %-conversion extensions. +// C comment +// /* +// ** Print into memory obtained from sqliteMalloc(). Use the internal +// ** %-conversion extensions. +// */ func _sqlite3MPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, args ...interface{}) (r0 *int8) { var _z *int8 var _ap []interface{} @@ -7069,8 +7421,11 @@ func _sqlite3MPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, args ...interf return _z } -// Print into memory obtained from sqliteMalloc(). Use the internal -// %-conversion extensions. +// C comment +// /* +// ** Print into memory obtained from sqliteMalloc(). Use the internal +// ** %-conversion extensions. +// */ func _sqlite3VMPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, _ap []interface{}) (r0 *int8) { var _z *int8 var _acc XStrAccum @@ -7081,8 +7436,8 @@ func _sqlite3VMPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, _ap []interfa crt.X__builtin_abort(tls) } }() - _sqlite3StrAccumInit(tls, &_acc, _db, (*int8)(unsafe.Pointer(&_zBase)), int32(u64(70)), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) - *(*uint8)(unsafe.Pointer(&(_acc.X7))) = uint8(i32(1)) + _sqlite3StrAccumInit(tls, &_acc, _db, (*int8)(unsafe.Pointer(&_zBase)), int32(u64(70)), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) + *(*uint8)(unsafe.Pointer(&_acc.X7)) = uint8(i32(1)) _sqlite3VXPrintf(tls, &_acc, _zFormat, _ap) _z = _sqlite3StrAccumFinish(tls, &_acc) if int32(_acc.X6) == i32(1) { @@ -7102,17 +7457,17 @@ func init() { } func _sqlite3StrAccumFinish(tls *crt.TLS, _p *XStrAccum) (r0 *int8) { - if (_p.X2) == nil { + if _p.X2 == nil { goto _0 } func() { - if ((_p.X2) == (_p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) { + if (_p.X2 == _p.X1) != ((int32(_p.X7) & i32(4)) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25951), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumFinishØ00__func__Ø000))), unsafe.Pointer(str(6554))) crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 1*uintptr(_p.X3))) = int8(i32(0)) - if ((_p.X5) > uint32(i32(0))) && ((int32(_p.X7) & i32(4)) == i32(0)) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 1*uintptr(_p.X3))) = int8(i32(0)) + if (_p.X5 > uint32(i32(0))) && ((int32(_p.X7) & i32(4)) == i32(0)) { return _strAccumFinishRealloc(tls, _p) } _0: @@ -7125,21 +7480,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StrAccumFinishØ00__func__Ø000[0], str(6591), 22) } -// Finish off a string by making sure it is zero-terminated. -// Return a pointer to the resulting string. Return a NULL -// pointer if any kind of error was encountered. +// C comment +// /* +// ** Finish off a string by making sure it is zero-terminated. +// ** Return a pointer to the resulting string. Return a NULL +// ** pointer if any kind of error was encountered. +// */ func _strAccumFinishRealloc(tls *crt.TLS, _p *XStrAccum) (r0 *int8) { func() { - if (_p.X5) <= uint32(i32(0)) || (int32(_p.X7)&i32(4)) != i32(0) { + if _p.X5 <= uint32(i32(0)) || (int32(_p.X7)&i32(4)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25939), unsafe.Pointer((*int8)(unsafe.Pointer(&_strAccumFinishReallocØ00__func__Ø000))), unsafe.Pointer(str(6613))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_p.X2))) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_p.X0), uint64((_p.X3)+uint32(i32(1))))) - if (_p.X2) != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(_p.X2), (unsafe.Pointer)(_p.X1), uint64((_p.X3)+uint32(i32(1)))) + *(**int8)(unsafe.Pointer(&_p.X2)) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_p.X0), uint64(_p.X3+uint32(i32(1))))) + if _p.X2 != nil { + crt.Xmemcpy(tls, unsafe.Pointer(_p.X2), unsafe.Pointer(_p.X1), uint64(_p.X3+uint32(i32(1)))) { - p := (*uint8)(unsafe.Pointer(&(_p.X7))) + p := (*uint8)(unsafe.Pointer(&_p.X7)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } @@ -7172,35 +7530,40 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_textØ00__func__Ø000[0], str(6708), 20) } -// *************************** sqlite3_result_ ******************************* -// The following routines are used by user-defined functions to specify -// the function result. -// -// The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the -// result as a string or blob but if the string or blob is too large, it -// then sets the error code to SQLITE_TOOBIG -// -// The invokeValueDestructor(P,X) routine invokes destructor function X() -// on value P is not going to be used and need to be destroyed. +// C comment +// /**************************** sqlite3_result_ ******************************* +// ** The following routines are used by user-defined functions to specify +// ** the function result. +// ** +// ** The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the +// ** result as a string or blob but if the string or blob is too large, it +// ** then sets the error code to SQLITE_TOOBIG +// ** +// ** The invokeValueDestructor(P,X) routine invokes destructor function X() +// ** on value P is not going to be used and need to be destroyed. +// */ func _setResultStrOrError(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) { if _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _z, _n, _enc, _xDel) == i32(18) { Xsqlite3_result_error_toobig(tls, _pCtx) } } -// Change the value of a Mem to be a string or a BLOB. -// -// The memory management strategy depends on the value of the xDel -// parameter. If the value passed is SQLITE_TRANSIENT, then the -// string is copied into a (possibly existing) buffer managed by the -// Mem structure. Otherwise, any existing buffer is freed and the -// pointer copied. -// -// If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH -// size limit) then no memory allocation occurs. If the string can be -// stored without allocating memory, then it is. If a memory allocation -// is required to store the string, then value of pMem is unchanged. In -// either case, SQLITE_TOOBIG is returned. +// C comment +// /* +// ** Change the value of a Mem to be a string or a BLOB. +// ** +// ** The memory management strategy depends on the value of the xDel +// ** parameter. If the value passed is SQLITE_TRANSIENT, then the +// ** string is copied into a (possibly existing) buffer managed by the +// ** Mem structure. Otherwise, any existing buffer is freed and the +// ** pointer copied. +// ** +// ** If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH +// ** size limit) then no memory allocation occurs. If the string can be +// ** stored without allocating memory, then it is. If a memory allocation +// ** is required to store the string, then value of pMem is unchanged. In +// ** either case, SQLITE_TOOBIG is returned. +// */ func _sqlite3VdbeMemSetStr(tls *crt.TLS, _pMem *XMem, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { var _nByte, _iLimit, _8_nAlloc int32 var _flags uint16 @@ -7222,8 +7585,8 @@ func _sqlite3VdbeMemSetStr(tls *crt.TLS, _pMem *XMem, _z *int8, _n int32, _enc u _sqlite3VdbeMemSetNull(tls, _pMem) return i32(0) } - if (*Xsqlite3)(_pMem.X9) != nil { - _iLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pMem.X9).X31))))) + 4*uintptr(i32(0)))) + if _pMem.X9 != nil { + _iLimit = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pMem.X9).X31))))) + 4*uintptr(i32(0)))) goto _7 } _iLimit = i32(1000000000) @@ -7254,7 +7617,7 @@ _7: _13: _nByte = i32(0) _16: - if _nByte > _iLimit || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte))))|int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte+i32(1)))))) == 0 { + if _nByte > _iLimit || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_nByte))))|int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_nByte+i32(1)))))) == 0 { goto _20 } { @@ -7275,7 +7638,10 @@ _10: f func(*crt.TLS, unsafe.Pointer) }{_xDel})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { goto _21 } _8_nAlloc = _nByte @@ -7302,24 +7668,25 @@ _10: }()) != 0 { return _sqlite3NomemError(tls, i32(70613)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem.X5), (unsafe.Pointer)(_z), uint64(_8_nAlloc)) + crt.Xmemcpy(tls, unsafe.Pointer(_pMem.X5), unsafe.Pointer(_z), uint64(_8_nAlloc)) goto _31 _21: if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { _sqlite3VdbeMemRelease(tls, _pMem) - *(**int8)(unsafe.Pointer(&(_pMem.X6))) = store0((**int8)(unsafe.Pointer(&(_pMem.X5))), _z) - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) + *(**int8)(unsafe.Pointer(&_pMem.X6)) = store0((**int8)(unsafe.Pointer(&_pMem.X5)), _z) + *(*int32)(unsafe.Pointer(&_pMem.X7)) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), unsafe.Pointer(_pMem.X6)) goto _31 } _sqlite3VdbeMemRelease(tls, _pMem) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = _z - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pMem.X10))) = _xDel + *(**int8)(unsafe.Pointer(&_pMem.X5)) = _z + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pMem.X10)) = _xDel { p := &_flags *p = uint16(int32(*p) | func() int32 { @@ -7335,9 +7702,9 @@ _21: sink14(*p) } _31: - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = _nByte - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = _flags - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(func() int32 { + *(*int32)(unsafe.Pointer(&_pMem.X4)) = _nByte + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = _flags + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(func() int32 { if int32(_enc) == i32(0) { return i32(1) } @@ -7358,25 +7725,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemSetStrØ00__func__Ø000[0], str(6765), 21) } -// This routine checks for a byte-order mark at the beginning of the -// UTF-16 string stored in *pMem. If one is present, it is removed and -// the encoding of the Mem adjusted. This routine does not do any -// byte-swapping, it just sets Mem.enc appropriately. -// -// The allocation (static, dynamic etc.) and encoding of the Mem may be -// changed by this function. +// C comment +// /* +// ** This routine checks for a byte-order mark at the beginning of the +// ** UTF-16 string stored in *pMem. If one is present, it is removed and +// ** the encoding of the Mem adjusted. This routine does not do any +// ** byte-swapping, it just sets Mem.enc appropriately. +// ** +// ** The allocation (static, dynamic etc.) and encoding of the Mem may be +// ** changed by this function. +// */ func _sqlite3VdbeMemHandleBom(tls *crt.TLS, _pMem *XMem) (r0 int32) { var _rc int32 var _bom, _1_b1, _1_b2 uint8 _rc = i32(0) _bom = u8(0) func() { - if (_pMem.X4) < i32(0) { + if _pMem.X4 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27472), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemHandleBomØ00__func__Ø000))), unsafe.Pointer(str(6001))) crt.X__builtin_abort(tls) } }() - if (_pMem.X4) <= i32(1) { + if _pMem.X4 <= i32(1) { goto _2 } _1_b1 = *(*uint8)(unsafe.Pointer(_pMem.X5)) @@ -7394,19 +7764,19 @@ _2: _rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem) if _rc == i32(0) { { - p := (*int32)(unsafe.Pointer(&(_pMem.X4))) + p := (*int32)(unsafe.Pointer(&_pMem.X4)) *p = (*p) - i32(2) sink1(*p) } - crt.Xmemmove(tls, (unsafe.Pointer)(_pMem.X5), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5))+1*uintptr(i32(2))))), uint64(_pMem.X4)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0)) + crt.Xmemmove(tls, unsafe.Pointer(_pMem.X5), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5))+1*uintptr(i32(2))))), uint64(_pMem.X4)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_pMem.X4+i32(1)))) = int8(i32(0)) { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) | i32(512)) sink14(*p) } - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _bom + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = _bom } _7: return _rc @@ -7418,7 +7788,8 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemHandleBomØ00__func__Ø000[0], str(6786), 24) } -// Force an SQLITE_TOOBIG error. +// C comment +// /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *crt.TLS, _pCtx *Xsqlite3_context) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 { @@ -7426,8 +7797,8 @@ func Xsqlite3_result_error_toobig(tls *crt.TLS, _pCtx *Xsqlite3_context) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(18) - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = i32(18) + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), str(6810), i32(-1), uint8(i32(1)), nil) } @@ -7437,20 +7808,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_error_toobigØ00__func__Ø000[0], str(6833), 28) } -// This function is used by SQL generated to implement the -// ALTER TABLE command. The first argument is the text of a CREATE TRIGGER -// statement. The second is a table name. The table name in the CREATE -// TRIGGER statement is replaced with the third argument and the result -// returned. This is analagous to renameTableFunc() above, except for CREATE -// TRIGGER, not CREATE INDEX and CREATE TABLE. +// C comment +// /* This function is used by SQL generated to implement the +// ** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER +// ** statement. The second is a table name. The table name in the CREATE +// ** TRIGGER statement is replaced with the third argument and the result +// ** returned. This is analagous to renameTableFunc() above, except for CREATE +// ** TRIGGER, not CREATE INDEX and CREATE TABLE. +// */ func _renameTriggerFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _token, _dist, _len int32 var _zRet *int8 var _zSql, _zTableName, _zCsr *uint8 var _tname XToken var _db *Xsqlite3 - _zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) _dist = i32(3) _zCsr = _zSql _len = i32(0) @@ -7463,12 +7836,12 @@ _1: if (*_zCsr) == 0 { return } - *(**int8)(unsafe.Pointer(&(_tname.X0))) = (*int8)(unsafe.Pointer(_zCsr)) - *(*uint32)(unsafe.Pointer(&(_tname.X1))) = uint32(_len) + *(**int8)(unsafe.Pointer(&_tname.X0)) = (*int8)(unsafe.Pointer(_zCsr)) + *(*uint32)(unsafe.Pointer(&_tname.X1)) = uint32(_len) _3: { p := &_zCsr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_len))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_len))) sink13(*p) } _len = _sqlite3GetToken(tls, _zCsr, &_token) @@ -7489,9 +7862,10 @@ _3: goto _1 } _zRet = _sqlite3MPrintf(tls, _db, str(4241), int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_tname.X0))))-uintptr(unsafe.Pointer(_zSql)))/1)), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.X0))+uintptr(_tname.X1))))) - Xsqlite3_result_text(tls, _context, _zRet, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + Xsqlite3_result_text(tls, _context, _zRet, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _0: _ = _tname } @@ -7509,9 +7883,9 @@ func _renameParentFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, var _db *Xsqlite3 _db = Xsqlite3_context_db_handle(tls, _context) _zOutput = nil - _zInput = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _zOld = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) - _zNew = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) + _zInput = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _zOld = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) + _zNew = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) if (_zInput == nil) || (_zOld == nil) { return @@ -7528,7 +7902,7 @@ _2: _7: { p := &_z - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink13(*p) } _n = _sqlite3GetToken(tls, _z, &_token) @@ -7550,11 +7924,11 @@ _7: } return str(0) }()), int32(int64((uintptr(unsafe.Pointer(_z))-uintptr(unsafe.Pointer(_zInput)))/1)), unsafe.Pointer(_zInput), unsafe.Pointer((*int8)(unsafe.Pointer(_zNew)))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zOutput)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput)) _zOutput = _4_zOut - _zInput = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n))) + _zInput = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n))) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_zParent)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zParent)) _6: _z = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_n))) goto _2 @@ -7567,10 +7941,11 @@ _5: return str(0) }()), unsafe.Pointer(_zInput)) return _context - }(), _zResult, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zOutput)) + }(), _zResult, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zOutput)) } func _sqlite3DbStrNDup(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n uint64) (r0 *int8) { @@ -7592,8 +7967,8 @@ func _sqlite3DbStrNDup(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n uint64) (r0 *in }() _zNew = (*int8)(_sqlite3DbMallocRawNN(tls, _db, _n+uint64(i32(1)))) if _zNew != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_z), _n) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNew)) + 1*uintptr(_n))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), _n) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNew)) + 1*uintptr(_n))) = int8(i32(0)) } return _zNew } @@ -7604,29 +7979,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DbStrNDupØ00__func__Ø000[0], str(6913), 17) } -// Convert an SQL-style quoted string into a normal string by removing -// the quote characters. The conversion is done in-place. If the -// input does not begin with a quote character, then this routine -// is a no-op. -// -// The input string must be zero-terminated. A new zero-terminator -// is added to the dequoted string. -// -// The return value is -1 if no dequoting occurs or the length of the -// dequoted string, exclusive of the zero terminator, if dequoting does -// occur. -// -// 2002-Feb-14: This routine is extended to remove MS-Access style -// brackets from around identifiers. For example: "[a-b-c]" becomes -// "a-b-c". +// C comment +// /* +// ** Convert an SQL-style quoted string into a normal string by removing +// ** the quote characters. The conversion is done in-place. If the +// ** input does not begin with a quote character, then this routine +// ** is a no-op. +// ** +// ** The input string must be zero-terminated. A new zero-terminator +// ** is added to the dequoted string. +// ** +// ** The return value is -1 if no dequoting occurs or the length of the +// ** dequoted string, exclusive of the zero terminator, if dequoting does +// ** occur. +// ** +// ** 2002-Feb-14: This routine is extended to remove MS-Access style +// ** brackets from around identifiers. For example: "[a-b-c]" becomes +// ** "a-b-c". +// */ func _sqlite3Dequote(tls *crt.TLS, _z *int8) { var _i, _j int32 var _quote int8 if _z == nil { return } - _quote = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_quote))))) & i32(128)) == 0 { + _quote = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0)))) + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_quote))))) & i32(128)) == 0 { return } if int32(_quote) == i32(91) { @@ -7635,16 +8013,16 @@ func _sqlite3Dequote(tls *crt.TLS, _z *int8) { *func() *int32 { _i = i32(1); return &_j }() = i32(0) _3: func() { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27909), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DequoteØ00__func__Ø000))), unsafe.Pointer(str(6930))) crt.X__builtin_abort(tls) } }() - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != int32(_quote) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != int32(_quote) { goto _8 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == int32(_quote) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_j, int32(1))))) = _quote + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1))))) == int32(_quote) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_j, 1)))) = _quote _i += 1 goto _10 } @@ -7652,12 +8030,12 @@ _3: _10: goto _11 _8: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_j, int32(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_j, 1)))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))) _11: _i += 1 goto _3 _5: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_j))) = int8(i32(0)) } var _sqlite3DequoteØ00__func__Ø000 [15]int8 @@ -7666,9 +8044,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DequoteØ00__func__Ø000[0], str(6935), 15) } -// This function registered all of the above C functions as SQL -// functions. This should be the only routine in this file with -// external linkage. +// C comment +// /* +// ** This function registered all of the above C functions as SQL +// ** functions. This should be the only routine in this file with +// ** external linkage. +// */ func _sqlite3RegisterDateTimeFunctions(tls *crt.TLS) { _sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001)), i32(8)) } @@ -7695,9 +8076,12 @@ func init() { }{_cdateFunc})), X5: nil, X6: str(7019), X7: t12{}}} } -// julianday( TIMESTRING, MOD, MOD, ...) -// -// Return the julian day number of the date specified in the arguments +// C comment +// /* +// ** julianday( TIMESTRING, MOD, MOD, ...) +// ** +// ** Return the julian day number of the date specified in the arguments +// */ func _juliandayFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _x XDateTime if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) { @@ -7707,25 +8091,28 @@ func _juliandayFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv _ = _x } -// Process time function arguments. argv[0] is a date-time stamp. -// argv[1] and following are modifiers. Parse them all and write -// the resulting time into the DateTime structure p. Return 0 -// on success and 1 if there are any errors. -// -// If there are zero parameters (if even argv[0] is undefined) -// then assume a default value of "now" for argv[0]. +// C comment +// /* +// ** Process time function arguments. argv[0] is a date-time stamp. +// ** argv[1] and following are modifiers. Parse them all and write +// ** the resulting time into the DateTime structure p. Return 0 +// ** on success and 1 if there are any errors. +// ** +// ** If there are zero parameters (if even argv[0] is undefined) +// ** then assume a default value of "now" for argv[0]. +// */ func _isDate(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem, _p *XDateTime) (r0 int32) { var _i, _n, _eType int32 var _z *uint8 - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(48)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(48)) if _argc == i32(0) { return _setDateTimeToCurrent(tls, _context, _p) } - if (store1(&_eType, Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) == i32(2)) || (_eType == i32(1)) { - _setRawDateNumber(tls, _p, Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + if (store1(&_eType, Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) == i32(2)) || (_eType == i32(1)) { + _setRawDateNumber(tls, _p, Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) goto _3 } - _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if (_z == nil) || _parseDateOrTime(tls, _context, (*int8)(unsafe.Pointer(_z)), _p) != 0 { return i32(1) } @@ -7735,8 +8122,8 @@ _6: if _i >= _argc { goto _9 } - _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) - _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) + _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) + _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) if (_z == nil) || _parseModifier(tls, _context, (*int8)(unsafe.Pointer(_z)), _n, _p) != 0 { return i32(1) } @@ -7744,29 +8131,35 @@ _6: goto _6 _9: _computeJD(tls, _p) - if ((_p.X14) != 0) || (_validJulianDay(tls, _p.X0) == 0) { + if (_p.X14 != 0) || (_validJulianDay(tls, _p.X0) == 0) { return i32(1) } return i32(0) } -// Set the time to the current time reported by the VFS. -// -// Return the number of errors. +// C comment +// /* +// ** Set the time to the current time reported by the VFS. +// ** +// ** Return the number of errors. +// */ func _setDateTimeToCurrent(tls *crt.TLS, _context *Xsqlite3_context, _p *XDateTime) (r0 int32) { - *(*int64)(unsafe.Pointer(&(_p.X0))) = _sqlite3StmtCurrentTime(tls, _context) - if (_p.X0) > int64(i32(0)) { - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1)) + *(*int64)(unsafe.Pointer(&_p.X0)) = _sqlite3StmtCurrentTime(tls, _context) + if _p.X0 > int64(i32(0)) { + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(1)) return i32(0) } return i32(1) } -// Return the current time for a statement. If the current time -// is requested more than once within the same run of a single prepared -// statement, the exact same time is returned for each invocation regardless -// of the amount of time that elapses between invocations. In other words, -// the time returned is always the time of the first call. +// C comment +// /* +// ** Return the current time for a statement. If the current time +// ** is requested more than once within the same run of a single prepared +// ** statement, the exact same time is returned for each invocation regardless +// ** of the amount of time that elapses between invocations. In other words, +// ** the time returned is always the time of the first call. +// */ func _sqlite3StmtCurrentTime(tls *crt.TLS, _p *Xsqlite3_context) (r0 int64) { var _rc int32 var _piTime *int64 @@ -7797,29 +8190,32 @@ func init() { func _sqlite3OsCurrentTimeInt64(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pTimeOut *int64) (r0 int32) { var _rc int32 var _2_r float64 - if ((_pVfs.X0) >= i32(2)) && ((*(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_pVfs.X18)}))) != nil) { - _rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_pVfs.X18)})))(tls, _pVfs, _pTimeOut) + if (_pVfs.X0 >= i32(2)) && (_pVfs.X18 != nil) { + _rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int64) int32 { + v := _pVfs.X18 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _pTimeOut) goto _2 } - _rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *float64) int32 - }{(_pVfs.X16)})))(tls, _pVfs, &_2_r) + _rc = func() func(*crt.TLS, *Xsqlite3_vfs, *float64) int32 { + v := _pVfs.X16 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, &_2_r) *_pTimeOut = int64(_2_r * (8.64e+07)) _2: return _rc } -// SQLITE_OMIT_UTF16 +// C comment +// /* SQLITE_OMIT_UTF16 */ -// EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five -// fundamental datatypes: 64-bit signed integer 64-bit IEEE floating -// point number string BLOB NULL +// C comment +// /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five +// ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating +// ** point number string BLOB NULL +// */ func Xsqlite3_value_type(tls *crt.TLS, _pVal *XMem) (r0 int32) { - return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_value_typeØ00aTypeØ001)) + 1*uintptr(int32(_pVal.X1)&i32(31))))) + return int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_value_typeØ00aTypeØ001)) + 1*uintptr(int32(_pVal.X1)&i32(31))))) } var _sqlite3_value_typeØ00aTypeØ001 [32]uint8 @@ -7828,16 +8224,19 @@ func init() { _sqlite3_value_typeØ00aTypeØ001 = [32]uint8{4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5, 4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5} } -// Input "r" is a numeric quantity which might be a julian day number, -// or the number of seconds since 1970. If the value if r is within -// range of a julian day number, install it as such and set validJD. -// If the value is a valid unix timestamp, put it in p->s and set p->rawS. +// C comment +// /* +// ** Input "r" is a numeric quantity which might be a julian day number, +// ** or the number of seconds since 1970. If the value if r is within +// ** range of a julian day number, install it as such and set validJD. +// ** If the value is a valid unix timestamp, put it in p->s and set p->rawS. +// */ func _setRawDateNumber(tls *crt.TLS, _p *XDateTime, _r float64) { - *(*float64)(unsafe.Pointer(&(_p.X7))) = _r - *(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(1)) + *(*float64)(unsafe.Pointer(&_p.X7)) = _r + *(*int8)(unsafe.Pointer(&_p.X9)) = int8(i32(1)) if (_r >= float64(0)) && (_r < (5.3734845e+06)) { - *(*int64)(unsafe.Pointer(&(_p.X0))) = int64((_r * (8.64e+07)) + (0.5)) - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1)) + *(*int64)(unsafe.Pointer(&_p.X0)) = int64((_r * (8.64e+07)) + (0.5)) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(1)) } } @@ -7859,10 +8258,10 @@ func _sqlite3VdbeRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) { } }() if (int32(_pMem.X1) & i32(8)) != 0 { - return *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) + return *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) } if (int32(_pMem.X1) & i32(4)) != 0 { - return float64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + return float64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) } if (int32(_pMem.X1) & i32(18)) != 0 { return _memRealValue(tls, _pMem) @@ -7876,10 +8275,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeRealValueØ00__func__Ø000[0], str(7067), 21) } -// Return the best representation of pMem that we can get into a -// double. If pMem is already a double or an integer, return its -// value. If it is a string or blob, try to convert it to a double. -// If it is a NULL, return 0.0. +// C comment +// /* +// ** Return the best representation of pMem that we can get into a +// ** double. If pMem is already a double or an integer, return its +// ** value. If it is a string or blob, try to convert it to a double. +// ** If it is a NULL, return 0.0. +// */ func _memRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) { var _val float64 _val = 0 @@ -7887,26 +8289,29 @@ func _memRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) { return _val } -// The string z[] is an text representation of a real number. -// Convert this string to a double and write it into *pResult. -// -// The string z[] is length bytes in length (bytes, not characters) and -// uses the encoding enc. The string is not necessarily zero-terminated. -// -// Return TRUE if the result is a valid real number (or integer) and FALSE -// if the string is empty or contains extraneous text. Valid numbers -// are in one of these formats: -// -// [+-]digits[E[+-]digits] -// [+-]digits.[digits][E[+-]digits] -// [+-].digits[E[+-]digits] -// -// Leading and trailing whitespace is ignored for the purpose of determining -// validity. -// -// If some prefix of the input string is a valid number, this routine -// returns FALSE but it still converts the prefix and writes the result -// into *pResult. +// C comment +// /* +// ** The string z[] is an text representation of a real number. +// ** Convert this string to a double and write it into *pResult. +// ** +// ** The string z[] is length bytes in length (bytes, not characters) and +// ** uses the encoding enc. The string is not necessarily zero-terminated. +// ** +// ** Return TRUE if the result is a valid real number (or integer) and FALSE +// ** if the string is empty or contains extraneous text. Valid numbers +// ** are in one of these formats: +// ** +// ** [+-]digits[E[+-]digits] +// ** [+-]digits.[digits][E[+-]digits] +// ** [+-].digits[E[+-]digits] +// ** +// ** Leading and trailing whitespace is ignored for the purpose of determining +// ** validity. +// ** +// ** If some prefix of the input string is a valid number, this routine +// ** returns FALSE but it still converts the prefix and writes the result +// ** into *pResult. +// */ func _sqlite3AtoF(tls *crt.TLS, _z *int8, _pResult *float64, _length int32, _enc uint8) (r0 int32) { var _incr, _sign, _d, _esign, _e, _eValid, _nDigits, _nonNum, _2_i int32 var _s int64 @@ -7936,7 +8341,7 @@ func _sqlite3AtoF(tls *crt.TLS, _z *int8, _pResult *float64, _length int32, _enc i32(0) _2_i = i32(3) - int32(_enc) _6: - if _2_i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_2_i)))) != i32(0) { + if _2_i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_2_i)))) != i32(0) { goto _10 } { @@ -7947,17 +8352,17 @@ _6: goto _6 _10: _nonNum = bool2int(_2_i < _length) - _zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_2_i^i32(1)))) + _zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_2_i^i32(1)))) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(int32(_enc)&i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(int32(_enc)&i32(1)))) sink0(*p) } _5: - if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 { + if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _5 @@ -7969,7 +8374,7 @@ _5: _sign = i32(-1) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _17 @@ -7977,17 +8382,17 @@ _5: if int32(*_z) == i32(43) { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } } _17: - if ((crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0) && (_s < i64(922337203685477579)) { + if ((crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0) && (_s < i64(922337203685477579)) { _s = (_s * int64(i32(10))) + int64(int32(*_z)-i32(48)) *func() *int32 { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } return &_nDigits @@ -7995,12 +8400,12 @@ _17: goto _17 } _19: - if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 { + if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 { *func() *int32 { *func() *int32 { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } return &_nDigits @@ -8017,11 +8422,11 @@ _19: } { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } _27: - if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) == 0 { + if crt.P2U(unsafe.Pointer(_z)) >= crt.P2U(unsafe.Pointer(_zEnd)) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) == 0 { goto _28 } if _s < i64(922337203685477579) { @@ -8031,7 +8436,7 @@ _27: *func() *int32 { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } return &_nDigits @@ -8047,7 +8452,7 @@ _26: } { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } _eValid = i32(0) @@ -8058,7 +8463,7 @@ _26: _esign = i32(-1) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _37 @@ -8066,12 +8471,12 @@ _26: if int32(*_z) == i32(43) { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } } _37: - if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 { + if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 { _e = func() int32 { if _e < i32(10000) { return ((_e * i32(10)) + (int32(*_z) - i32(48))) @@ -8080,17 +8485,17 @@ _37: }() { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } _eValid = i32(1) goto _37 } _33: - if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 { + if (crt.P2U(unsafe.Pointer(_z)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 { { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _33 @@ -8257,20 +8662,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AtoFØ00__func__Ø000[0], str(7158), 12) } -// Attempt to parse the given string into a julian day number. Return -// the number of errors. -// -// The following are acceptable forms for the input string: -// -// YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM -// DDDD.DD -// now -// -// In the first form, the +/-HH:MM is always optional. The fractional -// seconds extension (the ".FFF") is optional. The seconds portion -// (":SS.FFF") is option. The year and date can be omitted as long -// as there is a time string. The time string can be omitted as long -// as there is a year and date. +// C comment +// /* +// ** Attempt to parse the given string into a julian day number. Return +// ** the number of errors. +// ** +// ** The following are acceptable forms for the input string: +// ** +// ** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM +// ** DDDD.DD +// ** now +// ** +// ** In the first form, the +/-HH:MM is always optional. The fractional +// ** seconds extension (the ".FFF") is optional. The seconds portion +// ** (":SS.FFF") is option. The year and date can be omitted as long +// ** as there is a time string. The time string can be omitted as long +// ** as there is a year and date. +// */ func _parseDateOrTime(tls *crt.TLS, _context *Xsqlite3_context, _zDate *int8, _p *XDateTime) (r0 int32) { var _r float64 if _parseYyyyMmDd(tls, _zDate, _p) == i32(0) { @@ -8289,19 +8697,22 @@ func _parseDateOrTime(tls *crt.TLS, _context *Xsqlite3_context, _zDate *int8, _p return i32(1) } -// Parse dates of the form -// -// YYYY-MM-DD HH:MM:SS.FFF -// YYYY-MM-DD HH:MM:SS -// YYYY-MM-DD HH:MM -// YYYY-MM-DD -// -// Write the result into the DateTime structure and return 0 -// on success and 1 if the input string is not a well-formed -// date. +// C comment +// /* +// ** Parse dates of the form +// ** +// ** YYYY-MM-DD HH:MM:SS.FFF +// ** YYYY-MM-DD HH:MM:SS +// ** YYYY-MM-DD HH:MM +// ** YYYY-MM-DD +// ** +// ** Write the result into the DateTime structure and return 0 +// ** on success and 1 if the input string is not a well-formed +// ** date. +// */ func _parseYyyyMmDd(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) { var _Y, _M, _D, _neg int32 - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDate)) + 1*uintptr(i32(0))))) == i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDate)) + 1*uintptr(i32(0))))) == i32(45) { *(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1) _neg = i32(1) goto _1 @@ -8313,11 +8724,11 @@ _1: } { p := &_zDate - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(10)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(10)))) sink0(*p) } _3: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate)))))&i32(1)) != 0 || (i32(84) == int32(*(*uint8)(unsafe.Pointer(_zDate)))) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate)))))&i32(1)) != 0 || (i32(84) == int32(*(*uint8)(unsafe.Pointer(_zDate)))) { *(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1) goto _3 } @@ -8325,53 +8736,56 @@ _3: goto _9 } if int32(*_zDate) == i32(0) { - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(0)) goto _9 } return i32(1) _9: - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X1))) = func() int32 { + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X10)) = int8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X1)) = func() int32 { if _neg != 0 { return (-_Y) } return _Y }() - *(*int32)(unsafe.Pointer(&(_p.X2))) = _M - *(*int32)(unsafe.Pointer(&(_p.X3))) = _D - if (_p.X12) != 0 { + *(*int32)(unsafe.Pointer(&_p.X2)) = _M + *(*int32)(unsafe.Pointer(&_p.X3)) = _D + if _p.X12 != 0 { _computeJD(tls, _p) } return i32(0) } -// Convert zDate into one or more integers according to the conversion -// specifier zFormat. -// -// zFormat[] contains 4 characters for each integer converted, except for -// the last integer which is specified by three characters. The meaning -// of a four-character format specifiers ABCD is: -// -// A: number of digits to convert. Always "2" or "4". -// B: minimum value. Always "0" or "1". -// C: maximum value, decoded as: -// a: 12 -// b: 14 -// c: 24 -// d: 31 -// e: 59 -// f: 9999 -// D: the separator character, or \000 to indicate this is the -// last number to convert. -// -// Example: To translate an ISO-8601 date YYYY-MM-DD, the format would -// be "40f-21a-20c". The "40f-" indicates the 4-digit year followed by "-". -// The "21a-" indicates the 2-digit month followed by "-". The "20c" indicates -// the 2-digit day which is the last integer in the set. -// -// The function returns the number of successful conversions. +// C comment +// /* +// ** Convert zDate into one or more integers according to the conversion +// ** specifier zFormat. +// ** +// ** zFormat[] contains 4 characters for each integer converted, except for +// ** the last integer which is specified by three characters. The meaning +// ** of a four-character format specifiers ABCD is: +// ** +// ** A: number of digits to convert. Always "2" or "4". +// ** B: minimum value. Always "0" or "1". +// ** C: maximum value, decoded as: +// ** a: 12 +// ** b: 14 +// ** c: 24 +// ** d: 31 +// ** e: 59 +// ** f: 9999 +// ** D: the separator character, or \000 to indicate this is the +// ** last number to convert. +// ** +// ** Example: To translate an ISO-8601 date YYYY-MM-DD, the format would +// ** be "40f-21a-20c". The "40f-" indicates the 4-digit year followed by "-". +// ** The "21a-" indicates the 2-digit month followed by "-". The "20c" indicates +// ** the 2-digit day which is the last integer in the set. +// ** +// ** The function returns the number of successful conversions. +// */ func _getDigits(tls *crt.TLS, _zDate *int8, _zFormat *int8, args ...interface{}) (r0 int32) { var _cnt, _1_val int32 var _nextC, _1_N, _1_min int8 @@ -8380,23 +8794,23 @@ func _getDigits(tls *crt.TLS, _zDate *int8, _zFormat *int8, args ...interface{}) _cnt = i32(0) _ap = args _0: - _1_N = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(0))))) - i32(48)) - _1_min = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(1))))) - i32(48)) + _1_N = int8(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(0))))) - i32(48)) + _1_min = int8(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(1))))) - i32(48)) _1_val = i32(0) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2))))) < i32(97) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2))))) > i32(102) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(2))))) < i32(97) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(2))))) > i32(102) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18950), unsafe.Pointer((*int8)(unsafe.Pointer(&_getDigitsØ00__func__Ø000))), unsafe.Pointer(str(7186))) crt.X__builtin_abort(tls) } }() - _1_max = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getDigitsØ00aMxØ001)) + 2*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2)))))-i32(97)))) - _nextC = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(3)))) + _1_max = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getDigitsØ00aMxØ001)) + 2*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(2)))))-i32(97)))) + _nextC = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFormat)) + 1*uintptr(i32(3)))) _1_val = i32(0) _4: - if postInc3(&_1_N, int8(-1)) == 0 { + if postInc3(&_1_N, -1) == 0 { goto _5 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) == 0 { goto _end_getDigits } _1_val = ((_1_val * i32(10)) + int32(*_zDate)) - i32(48) @@ -8411,7 +8825,7 @@ _5: _cnt += 1 { p := &_zFormat - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(4)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(4)))) sink0(*p) } if _nextC != 0 { @@ -8437,11 +8851,14 @@ func init() { _getDigitsØ00aMxØ001 = [6]uint16{u16(12), u16(14), u16(24), u16(31), u16(59), u16(9999)} } -// Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. -// The HH, MM, and SS must each be exactly 2 digits. The -// fractional seconds FFFF can be one or more digits. -// -// Return 1 if there is a parsing error and 0 on success. +// C comment +// /* +// ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. +// ** The HH, MM, and SS must each be exactly 2 digits. The +// ** fractional seconds FFFF can be one or more digits. +// ** +// ** Return 1 if there is a parsing error and 0 on success. +// */ func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) { var _h, _m, _s int32 var _ms, _4_rScale float64 @@ -8451,7 +8868,7 @@ func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) { } { p := &_zDate - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(5)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(5)))) sink0(*p) } if int32(*_zDate) != i32(58) { @@ -8463,16 +8880,16 @@ func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) { } { p := &_zDate - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink0(*p) } - if int32(*_zDate) != i32(46) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDate)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 { + if int32(*_zDate) != i32(46) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDate)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 { goto _4 } _4_rScale = 1 *(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1) _5: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) != 0 { _ms = ((_ms * float64(10)) + float64(*_zDate)) - float64(i32(48)) { p := &_4_rScale @@ -8492,17 +8909,17 @@ _4: _1: _s = i32(0) _7: - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X4))) = _h - *(*int32)(unsafe.Pointer(&(_p.X5))) = _m - *(*float64)(unsafe.Pointer(&(_p.X7))) = float64(_s) + _ms + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X9)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X4)) = _h + *(*int32)(unsafe.Pointer(&_p.X5)) = _m + *(*float64)(unsafe.Pointer(&_p.X7)) = float64(_s) + _ms if _parseTimezone(tls, _zDate, _p) != 0 { return i32(1) } - *(*int8)(unsafe.Pointer(&(_p.X12))) = int8(func() int32 { - if (_p.X6) != i32(0) { + *(*int8)(unsafe.Pointer(&_p.X12)) = int8(func() int32 { + if _p.X6 != i32(0) { return i32(1) } return i32(0) @@ -8510,29 +8927,32 @@ _7: return i32(0) } -// Parse a timezone extension on the end of a date-time. -// The extension is of the form: -// -// (+/-)HH:MM -// -// Or the "zulu" notation: -// -// Z -// -// If the parse is successful, write the number of minutes -// of change in p->tz and return 0. If a parser error occurs, -// return non-zero. -// -// A missing specifier is not considered an error. +// C comment +// /* +// ** Parse a timezone extension on the end of a date-time. +// ** The extension is of the form: +// ** +// ** (+/-)HH:MM +// ** +// ** Or the "zulu" notation: +// ** +// ** Z +// ** +// ** If the parse is successful, write the number of minutes +// ** of change in p->tz and return 0. If a parser error occurs, +// ** return non-zero. +// ** +// ** A missing specifier is not considered an error. +// */ func _parseTimezone(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) { var _sgn, _nHr, _nMn, _c int32 _sgn = i32(0) _0: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 { *(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1) goto _0 } - *(*int32)(unsafe.Pointer(&(_p.X6))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X6)) = i32(0) _c = int32(*_zDate) if _c == i32(45) { _sgn = i32(-1) @@ -8555,29 +8975,32 @@ _5: } { p := &_zDate - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(5)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(5)))) sink0(*p) } - *(*int32)(unsafe.Pointer(&(_p.X6))) = _sgn * (_nMn + (_nHr * i32(60))) + *(*int32)(unsafe.Pointer(&_p.X6)) = _sgn * (_nMn + (_nHr * i32(60))) _zulu_time: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 { *(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1) goto _zulu_time } - *(*int8)(unsafe.Pointer(&(_p.X13))) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X13)) = int8(i32(1)) return bool2int(int32(*_zDate) != i32(0)) } -// Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume -// that the YYYY-MM-DD is according to the Gregorian calendar. -// -// Reference: Meeus page 61 +// C comment +// /* +// ** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume +// ** that the YYYY-MM-DD is according to the Gregorian calendar. +// ** +// ** Reference: Meeus page 61 +// */ func _computeJD(tls *crt.TLS, _p *XDateTime) { var _Y, _M, _D, _A, _B, _X1, _X2 int32 - if (_p.X8) != 0 { + if _p.X8 != 0 { return } - if (_p.X10) != 0 { + if _p.X10 != 0 { _Y = _p.X1 _M = _p.X2 _D = _p.X3 @@ -8587,7 +9010,7 @@ func _computeJD(tls *crt.TLS, _p *XDateTime) { _M = i32(1) _D = i32(1) _2: - if ((_Y < i32(-4713)) || (_Y > i32(9999))) || ((_p.X9) != 0) { + if ((_Y < i32(-4713)) || (_Y > i32(9999))) || (_p.X9 != 0) { _datetimeError(tls, _p) return } @@ -8603,33 +9026,36 @@ _2: _B = (i32(2) - _A) + (_A / i32(4)) _X1 = (i32(36525) * (_Y + i32(4716))) / i32(100) _X2 = (i32(306001) * (_M + i32(1))) / i32(10000) - *(*int64)(unsafe.Pointer(&(_p.X0))) = int64((float64(((_X1+_X2)+_D)+_B) - (1524.5)) * float64(i32(86400000))) - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1)) - if (_p.X11) == 0 { + *(*int64)(unsafe.Pointer(&_p.X0)) = int64((float64(((_X1+_X2)+_D)+_B) - (1524.5)) * float64(i32(86400000))) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(1)) + if _p.X11 == 0 { goto _7 } { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + (int64(((_p.X4)*i32(3600000))+((_p.X5)*i32(60000))) + int64((_p.X7)*float64(i32(1000)))) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + (int64((_p.X4*i32(3600000))+(_p.X5*i32(60000))) + int64(_p.X7*float64(i32(1000)))) sink6(*p) } - if (_p.X12) != 0 { + if _p.X12 != 0 { { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) - int64((_p.X6)*i32(60000)) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) - int64(_p.X6*i32(60000)) sink6(*p) } - *(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X10)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X12)) = int8(i32(0)) } _7: } -// Put the DateTime object into its error state. +// C comment +// /* +// ** Put the DateTime object into its error state. +// */ func _datetimeError(tls *crt.TLS, _p *XDateTime) { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(48)) - *(*int8)(unsafe.Pointer(&(_p.X14))) = int8(i32(1)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(48)) + *(*int8)(unsafe.Pointer(&_p.X14)) = int8(i32(1)) } func Xsqlite3_value_bytes(tls *crt.TLS, _pVal *XMem) (r0 int32) { @@ -8652,7 +9078,7 @@ func _sqlite3ValueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) { goto _5 } if (int32(_p.X1) & i32(16384)) != 0 { - return (_p.X4) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) + return _p.X4 + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) } return _p.X4 @@ -8669,40 +9095,46 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ValueBytesØ00__func__Ø000[0], str(7314), 18) } -// The sqlite3ValueBytes() routine returns the number of bytes in the -// sqlite3_value object assuming that it uses the encoding "enc". -// The valueBytes() routine is a helper function. +// C comment +// /* +// ** The sqlite3ValueBytes() routine returns the number of bytes in the +// ** sqlite3_value object assuming that it uses the encoding "enc". +// ** The valueBytes() routine is a helper function. +// */ func _valueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) { return func() int32 { if _valueToText(tls, _pVal, _enc) != nil { - return (_pVal.X4) + return _pVal.X4 } return i32(0) }() } -// Process a modifier to a date-time stamp. The modifiers are -// as follows: -// -// NNN days -// NNN hours -// NNN minutes -// NNN.NNNN seconds -// NNN months -// NNN years -// start of month -// start of year -// start of week -// start of day -// weekday N -// unixepoch -// localtime -// utc -// -// Return 0 on success and 1 if there is any kind of error. If the error -// is in a system call (i.e. localtime()), then an error message is written -// to context pCtx. If the error is an unrecognized modifier, no error is -// written to pCtx. +// C comment +// /* +// ** Process a modifier to a date-time stamp. The modifiers are +// ** as follows: +// ** +// ** NNN days +// ** NNN hours +// ** NNN minutes +// ** NNN.NNNN seconds +// ** NNN months +// ** NNN years +// ** start of month +// ** start of year +// ** start of week +// ** start of day +// ** weekday N +// ** unixepoch +// ** localtime +// ** utc +// ** +// ** Return 0 on success and 1 if there is any kind of error. If the error +// ** is in a system call (i.e. localtime()), then an error message is written +// ** to context pCtx. If the error is an unrecognized modifier, no error is +// ** written to pCtx. +// */ func _parseModifier(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _p *XDateTime) (r0 int32) { var _rc, _17_i, _24_x, _25_y int32 var _8_c1, _12_Z, _20_day int64 @@ -8710,7 +9142,7 @@ func _parseModifier(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _ var _r, _17_rRounder float64 var _20_tx XDateTime _rc = i32(1) - switch int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))))))) { + switch int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))))))) { case i32(43): goto _5 case i32(45): @@ -8751,7 +9183,7 @@ _1: if Xsqlite3_stricmp(tls, _z, str(7332)) == i32(0) { _computeJD(tls, _p) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + _localtimeOffset(tls, _p, _pCtx, &_rc) sink6(*p) } @@ -8759,15 +9191,15 @@ _1: } goto _19 _2: - if Xsqlite3_stricmp(tls, _z, str(7342)) != i32(0) || (_p.X9) == 0 { + if Xsqlite3_stricmp(tls, _z, str(7342)) != i32(0) || _p.X9 == 0 { goto _21 } - _r = ((_p.X7) * float64(1000)) + (2.1086676e+14) + _r = (_p.X7 * float64(1000)) + (2.1086676e+14) if (_r >= float64(0)) && (_r < (4.642690608e+14)) { _clearYMD_HMS_TZ(tls, _p) - *(*int64)(unsafe.Pointer(&(_p.X0))) = int64(_r) - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1)) - *(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0)) + *(*int64)(unsafe.Pointer(&_p.X0)) = int64(_r) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X9)) = int8(i32(0)) _rc = i32(0) } goto _25 @@ -8782,18 +9214,18 @@ _21: _8_c1 = _localtimeOffset(tls, _p, _pCtx, &_rc) if _rc == i32(0) { { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) - _8_c1 sink6(*p) } _clearYMD_HMS_TZ(tls, _p) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + (_8_c1 - _localtimeOffset(tls, _p, _pCtx, &_rc)) sink6(*p) } } - *(*int8)(unsafe.Pointer(&(_p.X13))) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X13)) = int8(i32(1)) goto _28 _26: _rc = i32(0) @@ -8801,14 +9233,14 @@ _28: _25: goto _19 _3: - if Xsqlite3_strnicmp(tls, _z, str(7356), i32(8)) != i32(0) || _sqlite3AtoF(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(8)))), &_r, _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(8))))), uint8(i32(1))) == 0 || float64(store1(&_n, int32(_r))) != _r || _n < i32(0) || _r >= float64(i32(7)) { + if Xsqlite3_strnicmp(tls, _z, str(7356), i32(8)) != i32(0) || _sqlite3AtoF(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(i32(8)))), &_r, _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(i32(8))))), uint8(i32(1))) == 0 || float64(store1(&_n, int32(_r))) != _r || _n < i32(0) || _r >= float64(i32(7)) { goto _33 } _computeYMD_HMS(tls, _p) - *(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X12)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) _computeJD(tls, _p) - _12_Z = (((_p.X0) + int64(i32(129600000))) / int64(i32(86400000))) % int64(i32(7)) + _12_Z = ((_p.X0 + int64(i32(129600000))) / int64(i32(86400000))) % int64(i32(7)) if _12_Z > int64(_n) { { p := &_12_Z @@ -8817,7 +9249,7 @@ _3: } } { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + ((int64(_n) - _12_Z) * int64(i32(86400000))) sink6(*p) } @@ -8829,29 +9261,29 @@ _4: if Xsqlite3_strnicmp(tls, _z, str(7365), i32(9)) != i32(0) { goto _19 } - if (((_p.X8) == 0) && ((_p.X10) == 0)) && ((_p.X11) == 0) { + if ((_p.X8 == 0) && (_p.X10 == 0)) && (_p.X11 == 0) { goto _19 } { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(9)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(9)))) sink0(*p) } _computeYMD(tls, _p) - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X5))), i32(0)) - *(*float64)(unsafe.Pointer(&(_p.X7))) = float64(0) - *(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X4)) = store1((*int32)(unsafe.Pointer(&_p.X5)), i32(0)) + *(*float64)(unsafe.Pointer(&_p.X7)) = float64(0) + *(*int8)(unsafe.Pointer(&_p.X9)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X12)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) if Xsqlite3_stricmp(tls, _z, str(7375)) == i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(1) _rc = i32(0) goto _43 } if Xsqlite3_stricmp(tls, _z, str(7381)) == i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X2))) = i32(1) - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X2)) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(1) _rc = i32(0) goto _43 } @@ -8863,7 +9295,7 @@ _43: _5: _n = i32(1) _44: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(58) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n))))))))&i32(1)) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == i32(58) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n))))))))&i32(1)) != 0 { goto _49 } _n += 1 @@ -8873,37 +9305,37 @@ _49: _rc = i32(1) goto _19 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) != i32(58) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) != i32(58) { goto _51 } _20_z2 = _z - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_20_z2))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_20_z2))))) & i32(4)) == 0 { *(*uintptr)(unsafe.Pointer(&_20_z2)) += uintptr(1) } - crt.Xmemset(tls, (unsafe.Pointer)(&_20_tx), i32(0), u64(48)) + crt.Xmemset(tls, unsafe.Pointer(&_20_tx), i32(0), u64(48)) if _parseHhMmSs(tls, _20_z2, &_20_tx) != 0 { goto _19 } _computeJD(tls, &_20_tx) { - p := (*int64)(unsafe.Pointer(&(_20_tx.X0))) + p := (*int64)(unsafe.Pointer(&_20_tx.X0)) *p = (*p) - int64(i32(43200000)) sink6(*p) } - _20_day = (_20_tx.X0) / int64(i32(86400000)) + _20_day = _20_tx.X0 / int64(i32(86400000)) { - p := (*int64)(unsafe.Pointer(&(_20_tx.X0))) + p := (*int64)(unsafe.Pointer(&_20_tx.X0)) *p = (*p) - (_20_day * int64(i32(86400000))) sink6(*p) } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(45) { - *(*int64)(unsafe.Pointer(&(_20_tx.X0))) = -(_20_tx.X0) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(45) { + *(*int64)(unsafe.Pointer(&_20_tx.X0)) = -_20_tx.X0 } _computeJD(tls, _p) _clearYMD_HMS_TZ(tls, _p) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + (_20_tx.X0) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + _20_tx.X0 sink6(*p) } _rc = i32(0) @@ -8911,11 +9343,11 @@ _49: _51: { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink0(*p) } _55: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _55 } @@ -8923,7 +9355,7 @@ _55: if (_n > i32(10)) || (_n < i32(3)) { goto _19 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) == i32(115) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1))))))))) == i32(115) { _n -= 1 } _computeJD(tls, _p) @@ -8939,10 +9371,10 @@ _62: if _17_i >= i32(6) { goto _65 } - if int32((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+32*uintptr(_17_i))).X1) != _n || Xsqlite3_strnicmp(tls, (*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+32*uintptr(_17_i))).X2, _z, _n) != i32(0) || _r <= (-((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType)) + 32*uintptr(_17_i))).X3)) || _r >= ((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+32*uintptr(_17_i))).X3) { + if int32((*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType))+32*uintptr(_17_i))).X1) != _n || Xsqlite3_strnicmp(tls, (*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType))+32*uintptr(_17_i))).X2, _z, _n) != i32(0) || _r <= (-((*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType)) + 32*uintptr(_17_i))).X3)) || _r >= ((*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType))+32*uintptr(_17_i))).X3) { goto _69 } - switch int32((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType)) + 32*uintptr(_17_i))).X0) { + switch int32((*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType)) + 32*uintptr(_17_i))).X0) { case i32(1): goto _71 case i32(2): @@ -8954,27 +9386,27 @@ _62: _71: _computeYMD_HMS(tls, _p) { - p := (*int32)(unsafe.Pointer(&(_p.X2))) + p := (*int32)(unsafe.Pointer(&_p.X2)) *p = (*p) + int32(_r) sink1(*p) } _24_x = func() int32 { - if (_p.X2) > i32(0) { - return (((_p.X2) - i32(1)) / i32(12)) + if _p.X2 > i32(0) { + return ((_p.X2 - i32(1)) / i32(12)) } - return (((_p.X2) - i32(12)) / i32(12)) + return ((_p.X2 - i32(12)) / i32(12)) }() { - p := (*int32)(unsafe.Pointer(&(_p.X1))) + p := (*int32)(unsafe.Pointer(&_p.X1)) *p = (*p) + _24_x sink1(*p) } { - p := (*int32)(unsafe.Pointer(&(_p.X2))) + p := (*int32)(unsafe.Pointer(&_p.X2)) *p = (*p) - (_24_x * i32(12)) sink1(*p) } - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) { p := &_r *p = (*p) - float64(int32(_r)) @@ -8985,11 +9417,11 @@ _72: _25_y = int32(_r) _computeYMD_HMS(tls, _p) { - p := (*int32)(unsafe.Pointer(&(_p.X1))) + p := (*int32)(unsafe.Pointer(&_p.X1)) *p = (*p) + _25_y sink1(*p) } - *(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X8)) = int8(i32(0)) { p := &_r *p = (*p) - float64(int32(_r)) @@ -8999,8 +9431,8 @@ _72: _73: _computeJD(tls, _p) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + int64((_r*((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+32*uintptr(_17_i))).X4))+_17_rRounder) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + int64((_r*((*t16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aXformType))+32*uintptr(_17_i))).X4))+_17_rRounder) sink6(*p) } _rc = i32(0) @@ -9020,14 +9452,17 @@ _19: panic(0) } -// Some systems have stricmp(). Others have strcasecmp(). Because -// there is no consistency, we will define our own. -// -// IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and -// sqlite3_strnicmp() APIs allow applications and extensions to compare -// the contents of two buffers containing UTF-8 strings in a -// case-independent fashion, using the same definition of "case -// independence" that SQLite uses internally when comparing identifiers. +// C comment +// /* +// ** Some systems have stricmp(). Others have strcasecmp(). Because +// ** there is no consistency, we will define our own. +// ** +// ** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and +// ** sqlite3_strnicmp() APIs allow applications and extensions to compare +// ** the contents of two buffers containing UTF-8 strings in a +// ** case-independent fashion, using the same definition of "case +// ** independence" that SQLite uses internally when comparing identifiers. +// */ func Xsqlite3_stricmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) { if _zLeft == nil { return func() int32 { @@ -9043,56 +9478,59 @@ func Xsqlite3_stricmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) { return _sqlite3StrICmp(tls, _zLeft, _zRight) } -// Compute the difference (in milliseconds) between localtime and UTC -// (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs, -// return this value and set *pRc to SQLITE_OK. -// -// Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value -// is undefined in this case. +// C comment +// /* +// ** Compute the difference (in milliseconds) between localtime and UTC +// ** (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs, +// ** return this value and set *pRc to SQLITE_OK. +// ** +// ** Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value +// ** is undefined in this case. +// */ func _localtimeOffset(tls *crt.TLS, _p *XDateTime, _pCtx *Xsqlite3_context, _pRc *int32) (r0 int64) { var _2_s int32 var _t int64 var _sLocal crt.Xtm var _x, _y XDateTime - crt.Xmemset(tls, (unsafe.Pointer)(&_sLocal), i32(0), u64(56)) + crt.Xmemset(tls, unsafe.Pointer(&_sLocal), i32(0), u64(56)) _x = *_p _computeYMD_HMS(tls, &_x) - if ((_x.X1) < i32(1971)) || ((_x.X1) >= i32(2038)) { - *(*int32)(unsafe.Pointer(&(_x.X1))) = i32(2000) - *(*int32)(unsafe.Pointer(&(_x.X2))) = i32(1) - *(*int32)(unsafe.Pointer(&(_x.X3))) = i32(1) - *(*int32)(unsafe.Pointer(&(_x.X4))) = i32(0) - *(*int32)(unsafe.Pointer(&(_x.X5))) = i32(0) - *(*float64)(unsafe.Pointer(&(_x.X7))) = float64(0) + if (_x.X1 < i32(1971)) || (_x.X1 >= i32(2038)) { + *(*int32)(unsafe.Pointer(&_x.X1)) = i32(2000) + *(*int32)(unsafe.Pointer(&_x.X2)) = i32(1) + *(*int32)(unsafe.Pointer(&_x.X3)) = i32(1) + *(*int32)(unsafe.Pointer(&_x.X4)) = i32(0) + *(*int32)(unsafe.Pointer(&_x.X5)) = i32(0) + *(*float64)(unsafe.Pointer(&_x.X7)) = float64(0) goto _2 } - _2_s = int32((_x.X7) + (0.5)) - *(*float64)(unsafe.Pointer(&(_x.X7))) = float64(_2_s) + _2_s = int32(_x.X7 + (0.5)) + *(*float64)(unsafe.Pointer(&_x.X7)) = float64(_2_s) _2: - *(*int32)(unsafe.Pointer(&(_x.X6))) = i32(0) - *(*int8)(unsafe.Pointer(&(_x.X8))) = int8(i32(0)) + *(*int32)(unsafe.Pointer(&_x.X6)) = i32(0) + *(*int8)(unsafe.Pointer(&_x.X8)) = int8(i32(0)) _computeJD(tls, &_x) - _t = ((_x.X0) / int64(i32(1000))) - i64(210866760000) + _t = (_x.X0 / int64(i32(1000))) - i64(210866760000) if _osLocaltime(tls, &_t, &_sLocal) != 0 { Xsqlite3_result_error(tls, _pCtx, str(7390), i32(-1)) *_pRc = i32(1) return int64(i32(0)) } - *(*int32)(unsafe.Pointer(&(_y.X1))) = (_sLocal.X5) + i32(1900) - *(*int32)(unsafe.Pointer(&(_y.X2))) = (_sLocal.X4) + i32(1) - *(*int32)(unsafe.Pointer(&(_y.X3))) = _sLocal.X3 - *(*int32)(unsafe.Pointer(&(_y.X4))) = _sLocal.X2 - *(*int32)(unsafe.Pointer(&(_y.X5))) = _sLocal.X1 - *(*float64)(unsafe.Pointer(&(_y.X7))) = float64(_sLocal.X0) - *(*int8)(unsafe.Pointer(&(_y.X10))) = int8(i32(1)) - *(*int8)(unsafe.Pointer(&(_y.X11))) = int8(i32(1)) - *(*int8)(unsafe.Pointer(&(_y.X8))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_y.X9))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_y.X12))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_y.X14))) = int8(i32(0)) + *(*int32)(unsafe.Pointer(&_y.X1)) = _sLocal.X5 + i32(1900) + *(*int32)(unsafe.Pointer(&_y.X2)) = _sLocal.X4 + i32(1) + *(*int32)(unsafe.Pointer(&_y.X3)) = _sLocal.X3 + *(*int32)(unsafe.Pointer(&_y.X4)) = _sLocal.X2 + *(*int32)(unsafe.Pointer(&_y.X5)) = _sLocal.X1 + *(*float64)(unsafe.Pointer(&_y.X7)) = float64(_sLocal.X0) + *(*int8)(unsafe.Pointer(&_y.X10)) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_y.X11)) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_y.X8)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_y.X9)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_y.X12)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_y.X14)) = int8(i32(0)) _computeJD(tls, &_y) *_pRc = i32(0) - return (_y.X0) - (_x.X0) + return _y.X0 - _x.X0 _ = _x _ = _y @@ -9101,29 +9539,35 @@ _2: panic(0) } -// Compute both YMD and HMS +// C comment +// /* +// ** Compute both YMD and HMS +// */ func _computeYMD_HMS(tls *crt.TLS, _p *XDateTime) { _computeYMD(tls, _p) _computeHMS(tls, _p) } -// Compute the Year, Month, and Day from the julian day number. +// C comment +// /* +// ** Compute the Year, Month, and Day from the julian day number. +// */ func _computeYMD(tls *crt.TLS, _p *XDateTime) { var _Z, _A, _B, _C, _D, _E, _X1 int32 - if (_p.X10) != 0 { + if _p.X10 != 0 { return } - if (_p.X8) == 0 { - *(*int32)(unsafe.Pointer(&(_p.X1))) = i32(2000) - *(*int32)(unsafe.Pointer(&(_p.X2))) = i32(1) - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1) + if _p.X8 == 0 { + *(*int32)(unsafe.Pointer(&_p.X1)) = i32(2000) + *(*int32)(unsafe.Pointer(&_p.X2)) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(1) goto _4 } if _validJulianDay(tls, _p.X0) == 0 { _datetimeError(tls, _p) return } - _Z = int32(((_p.X0) + int64(i32(43200000))) / int64(i32(86400000))) + _Z = int32((_p.X0 + int64(i32(43200000))) / int64(i32(86400000))) _A = int32((float64(_Z) - (1.86721625e+06)) / (36524.25)) _A = ((_Z + i32(1)) + _A) - (_A / i32(4)) _B = _A + i32(1524) @@ -9131,72 +9575,81 @@ func _computeYMD(tls *crt.TLS, _p *XDateTime) { _D = (i32(36525) * (_C & i32(32767))) / i32(100) _E = int32(float64(_B-_D) / (30.6001)) _X1 = int32((30.6001) * float64(_E)) - *(*int32)(unsafe.Pointer(&(_p.X3))) = (_B - _D) - _X1 - *(*int32)(unsafe.Pointer(&(_p.X2))) = func() int32 { + *(*int32)(unsafe.Pointer(&_p.X3)) = (_B - _D) - _X1 + *(*int32)(unsafe.Pointer(&_p.X2)) = func() int32 { if _E < i32(14) { return (_E - i32(1)) } return (_E - i32(13)) }() - *(*int32)(unsafe.Pointer(&(_p.X1))) = func() int32 { - if (_p.X2) > i32(2) { + *(*int32)(unsafe.Pointer(&_p.X1)) = func() int32 { + if _p.X2 > i32(2) { return (_C - i32(4716)) } return (_C - i32(4715)) }() _4: - *(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X10)) = int8(i32(1)) } -// Return TRUE if the given julian day number is within range. -// -// The input is the JulianDay times 86400000. +// C comment +// /* +// ** Return TRUE if the given julian day number is within range. +// ** +// ** The input is the JulianDay times 86400000. +// */ func _validJulianDay(tls *crt.TLS, _iJD int64) (r0 int32) { return bool2int((_iJD >= int64(i32(0))) && (_iJD <= i64(464269060799999))) } -// Compute the Hour, Minute, and Seconds from the julian day number. +// C comment +// /* +// ** Compute the Hour, Minute, and Seconds from the julian day number. +// */ func _computeHMS(tls *crt.TLS, _p *XDateTime) { var _s int32 - if (_p.X11) != 0 { + if _p.X11 != 0 { return } _computeJD(tls, _p) - _s = int32(((_p.X0) + int64(i32(43200000))) % int64(i32(86400000))) - *(*float64)(unsafe.Pointer(&(_p.X7))) = float64(_s) / float64(1000) + _s = int32((_p.X0 + int64(i32(43200000))) % int64(i32(86400000))) + *(*float64)(unsafe.Pointer(&_p.X7)) = float64(_s) / float64(1000) _s = int32(_p.X7) { - p := (*float64)(unsafe.Pointer(&(_p.X7))) + p := (*float64)(unsafe.Pointer(&_p.X7)) *p = (*p) - float64(_s) sink4(*p) } - *(*int32)(unsafe.Pointer(&(_p.X4))) = _s / i32(3600) + *(*int32)(unsafe.Pointer(&_p.X4)) = _s / i32(3600) { p := &_s - *p = (*p) - ((_p.X4) * i32(3600)) + *p = (*p) - (_p.X4 * i32(3600)) sink1(*p) } - *(*int32)(unsafe.Pointer(&(_p.X5))) = _s / i32(60) + *(*int32)(unsafe.Pointer(&_p.X5)) = _s / i32(60) { - p := (*float64)(unsafe.Pointer(&(_p.X7))) - *p = (*p) + float64(_s-((_p.X5)*i32(60))) + p := (*float64)(unsafe.Pointer(&_p.X7)) + *p = (*p) + float64(_s-(_p.X5*i32(60))) sink4(*p) } - *(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1)) -} - -// The following routine implements the rough equivalent of localtime_r() -// using whatever operating-system specific localtime facility that -// is available. This routine returns 0 on success and -// non-zero on any kind of error. -// -// If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this -// routine will always fail. -// -// EVIDENCE-OF: R-62172-00036 In this implementation, the standard C -// library function localtime_r() is used to assist in the calculation of -// local time. + *(*int8)(unsafe.Pointer(&_p.X9)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(1)) +} + +// C comment +// /* +// ** The following routine implements the rough equivalent of localtime_r() +// ** using whatever operating-system specific localtime facility that +// ** is available. This routine returns 0 on success and +// ** non-zero on any kind of error. +// ** +// ** If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this +// ** routine will always fail. +// ** +// ** EVIDENCE-OF: R-62172-00036 In this implementation, the standard C +// ** library function localtime_r() is used to assist in the calculation of +// ** local time. +// */ func _osLocaltime(tls *crt.TLS, _t *int64, _pTm *crt.Xtm) (r0 int32) { var _rc int32 var _mutex *Xsqlite3_mutex @@ -9204,7 +9657,7 @@ func _osLocaltime(tls *crt.TLS, _t *int64, _pTm *crt.Xtm) (r0 int32) { _mutex = _sqlite3MutexAlloc(tls, i32(2)) Xsqlite3_mutex_enter(tls, _mutex) _pX = crt.Xlocaltime(tls, _t) - if (_sqlite3Config.X38) != 0 { + if _sqlite3Config.X38 != 0 { _pX = nil } if _pX != nil { @@ -9222,9 +9675,12 @@ func Xsqlite3_result_error(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n i crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(1) - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) - _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _z, _n, uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = i32(1) + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) + _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _z, _n, uint8(i32(1)), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } var _sqlite3_result_errorØ00__func__Ø000 [21]int8 @@ -9233,11 +9689,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_errorØ00__func__Ø000[0], str(7413), 21) } -// Clear the YMD and HMS and the TZ +// C comment +// /* +// ** Clear the YMD and HMS and the TZ +// */ func _clearYMD_HMS_TZ(tls *crt.TLS, _p *XDateTime) { - *(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X10)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X11)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X12)) = int8(i32(0)) } func Xsqlite3_strnicmp(tls *crt.TLS, _zLeft *int8, _zRight *int8, _N int32) (r0 int32) { @@ -9256,7 +9715,7 @@ func Xsqlite3_strnicmp(tls *crt.TLS, _zLeft *int8, _zRight *int8, _N int32) (r0 _a = (*uint8)(unsafe.Pointer(_zLeft)) _b = (*uint8)(unsafe.Pointer(_zRight)) _5: - if ((postInc1(&_N, int32(-1)) > i32(0)) && (int32(*_a) != i32(0))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))) { + if ((postInc1(&_N, -1) > i32(0)) && (int32(*_a) != i32(0))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) == int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))) { *(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1) *(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1) goto _5 @@ -9265,7 +9724,7 @@ _5: if _N < i32(0) { return i32(0) } - return (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))) + return (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))) }() } @@ -9303,20 +9762,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_doubleØ00__func__Ø000[0], str(7453), 22) } -// Delete any previous value and set the value stored in *pMem to val, -// manifest type REAL. +// C comment +// /* +// ** Delete any previous value and set the value stored in *pMem to val, +// ** manifest type REAL. +// */ func _sqlite3VdbeMemSetDouble(tls *crt.TLS, _pMem *XMem, _val float64) { _sqlite3VdbeMemSetNull(tls, _pMem) if _sqlite3IsNaN(tls, _val) == 0 { - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(8)) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _val + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(8)) } } -// Return true if the floating point value is Not a Number (NaN). -// -// Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN. -// Otherwise, we have our own implementation that works on most systems. +// C comment +// /* +// ** Return true if the floating point value is Not a Number (NaN). +// ** +// ** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN. +// ** Otherwise, we have our own implementation that works on most systems. +// */ func _sqlite3IsNaN(tls *crt.TLS, _x float64) (r0 int32) { var _rc int32 var _y, _z float64 @@ -9326,68 +9791,89 @@ func _sqlite3IsNaN(tls *crt.TLS, _x float64) (r0 int32) { return _rc } -// date( TIMESTRING, MOD, MOD, ...) -// -// Return YYYY-MM-DD +// C comment +// /* +// ** date( TIMESTRING, MOD, MOD, ...) +// ** +// ** Return YYYY-MM-DD +// */ func _dateFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _x XDateTime var _1_zBuf [100]int8 if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) { _computeYMD(tls, &_x) Xsqlite3_snprintf(tls, int32(u64(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7475), _x.X1, _x.X2, _x.X3) - Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } _ = _x _ = _1_zBuf } -// time( TIMESTRING, MOD, MOD, ...) -// -// Return HH:MM:SS +// C comment +// /* +// ** time( TIMESTRING, MOD, MOD, ...) +// ** +// ** Return HH:MM:SS +// */ func _timeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _x XDateTime var _1_zBuf [100]int8 if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) { _computeHMS(tls, &_x) Xsqlite3_snprintf(tls, int32(u64(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7490), _x.X4, _x.X5, int32(_x.X7)) - Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } _ = _x _ = _1_zBuf } -// datetime( TIMESTRING, MOD, MOD, ...) -// -// Return YYYY-MM-DD HH:MM:SS +// C comment +// /* +// ** datetime( TIMESTRING, MOD, MOD, ...) +// ** +// ** Return YYYY-MM-DD HH:MM:SS +// */ func _datetimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _x XDateTime var _1_zBuf [100]int8 if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) { _computeYMD_HMS(tls, &_x) Xsqlite3_snprintf(tls, int32(u64(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7505), _x.X1, _x.X2, _x.X3, _x.X4, _x.X5, int32(_x.X7)) - Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } _ = _x _ = _1_zBuf } -// strftime( FORMAT, TIMESTRING, MOD, MOD, ...) -// -// Return a string described by FORMAT. Conversions as follows: -// -// %d day of month -// %f ** fractional seconds SS.SSS -// %H hour 00-24 -// %j day of year 000-366 -// %J ** julian day number -// %m month 01-12 -// %M minute 00-59 -// %s seconds since 1970-01-01 -// %S seconds 00-59 -// %w day of week 0-6 sunday==0 -// %W week of year 00-53 -// %Y year 0000-9999 -// %% % +// C comment +// /* +// ** strftime( FORMAT, TIMESTRING, MOD, MOD, ...) +// ** +// ** Return a string described by FORMAT. Conversions as follows: +// ** +// ** %d day of month +// ** %f ** fractional seconds SS.SSS +// ** %H hour 00-24 +// ** %j day of year 000-366 +// ** %J ** julian day number +// ** %m month 01-12 +// ** %M minute 00-59 +// ** %s seconds since 1970-01-01 +// ** %S seconds 00-59 +// ** %w day of week 0-6 sunday==0 +// ** %W week of year 00-53 +// ** %Y year 0000-9999 +// ** %% % +// */ func _strftimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _13_nDay, _14_wd int32 var _n, _i, _j uint64 @@ -9399,20 +9885,20 @@ func _strftimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv if _argc == i32(0) { return } - _zFmt = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) + _zFmt = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) if (_zFmt == nil) || _isDate(tls, _context, _argc-i32(1), (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(8))))))))))), &_x) != 0 { return } _db = Xsqlite3_context_db_handle(tls, _context) *func() *uint64 { _i = uint64(i32(0)); return &_n }() = uint64(i32(1)) _3: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) == 0 { goto _6 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) != i32(37) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) != i32(37) { goto _7 } - switch int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i+uint64(i32(1)))))) { + switch int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i+uint64(i32(1)))))) { case i32(37): goto _15 case i32(72): @@ -9487,7 +9973,7 @@ _6: _z = (*int8)(unsafe.Pointer(&_zBuf)) goto _27 } - if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if _n > uint64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { Xsqlite3_result_error_toobig(tls, _context) return } @@ -9501,15 +9987,15 @@ _27: _computeYMD_HMS(tls, &_x) _i = store17(&_j, uint64(i32(0))) _29: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) == 0 { goto _32 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) != i32(37) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) != i32(37) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i))) goto _34 } _i += 1 - switch int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) { + switch int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) { case i32(72): goto _38 case i32(74): @@ -9539,7 +10025,7 @@ _29: } _36: - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X3) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), _x.X3) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9551,15 +10037,15 @@ _37: if _12_s > (59.999) { _12_s = 59.999 } - Xsqlite3_snprintf(tls, i32(7), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7540), _12_s) + Xsqlite3_snprintf(tls, i32(7), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7540), _12_s) { p := &_j - *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))))) + *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))))) sink17(*p) } goto _49 _38: - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X4) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), _x.X4) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9568,14 +10054,14 @@ _38: goto _49 _39: _13_y = _x - *(*int8)(unsafe.Pointer(&(_13_y.X8))) = int8(i32(0)) - *(*int32)(unsafe.Pointer(&(_13_y.X2))) = i32(1) - *(*int32)(unsafe.Pointer(&(_13_y.X3))) = i32(1) + *(*int8)(unsafe.Pointer(&_13_y.X8)) = int8(i32(0)) + *(*int32)(unsafe.Pointer(&_13_y.X2)) = i32(1) + *(*int32)(unsafe.Pointer(&_13_y.X3)) = i32(1) _computeJD(tls, &_13_y) - _13_nDay = int32((((_x.X0) - (_13_y.X0)) + int64(i32(43200000))) / int64(i32(86400000))) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == i32(87) { - _14_wd = int32((((_x.X0) + int64(i32(43200000))) / int64(i32(86400000))) % int64(i32(7))) - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), ((_13_nDay+i32(7))-_14_wd)/i32(7)) + _13_nDay = int32(((_x.X0 - _13_y.X0) + int64(i32(43200000))) / int64(i32(86400000))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFmt)) + 1*uintptr(_i)))) == i32(87) { + _14_wd = int32(((_x.X0 + int64(i32(43200000))) / int64(i32(86400000))) % int64(i32(7))) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), ((_13_nDay+i32(7))-_14_wd)/i32(7)) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9583,7 +10069,7 @@ _39: } goto _52 } - Xsqlite3_snprintf(tls, i32(4), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7547), _13_nDay+i32(1)) + Xsqlite3_snprintf(tls, i32(4), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7547), _13_nDay+i32(1)) { p := &_j *p = (*p) + uint64(i32(3)) @@ -9592,15 +10078,15 @@ _39: _52: goto _49 _41: - Xsqlite3_snprintf(tls, i32(20), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7552), float64(_x.X0)/(8.64e+07)) + Xsqlite3_snprintf(tls, i32(20), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7552), float64(_x.X0)/(8.64e+07)) { p := &_j - *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))))) + *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))))) sink17(*p) } goto _49 _42: - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X2) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), _x.X2) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9608,7 +10094,7 @@ _42: } goto _49 _43: - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X5) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), _x.X5) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9616,15 +10102,15 @@ _43: } goto _49 _44: - Xsqlite3_snprintf(tls, i32(30), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(6348), ((_x.X0)/int64(i32(1000)))-i64(210866760000)) + Xsqlite3_snprintf(tls, i32(30), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(6348), (_x.X0/int64(i32(1000)))-i64(210866760000)) { p := &_j - *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))))) + *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))))) sink17(*p) } goto _49 _45: - Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), int32(_x.X7)) + Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7535), int32(_x.X7)) { p := &_j *p = (*p) + uint64(i32(2)) @@ -9632,38 +10118,43 @@ _45: } goto _49 _46: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = int8(int32(int8((((_x.X0)+int64(i32(129600000)))/int64(i32(86400000)))%int64(i32(7)))) + i32(48)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = int8(int32(int8(((_x.X0+int64(i32(129600000)))/int64(i32(86400000)))%int64(i32(7)))) + i32(48)) goto _49 _47: - Xsqlite3_snprintf(tls, i32(5), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7558), _x.X1) + Xsqlite3_snprintf(tls, i32(5), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))), str(7558), _x.X1) { p := &_j - *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))))) + *p = (*p) + uint64(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_j))))) sink17(*p) } goto _49 _48: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = int8(i32(37)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc17(&_j, uint64(1))))) = int8(i32(37)) goto _49 _49: _34: _i += 1 goto _29 _32: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_j))) = int8(i32(0)) Xsqlite3_result_text(tls, _context, _z, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { if _z == (*int8)(unsafe.Pointer(&_zBuf)) { - return (*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + return func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }() } - return (*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + return func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }() }()) _ = _zBuf _ = _13_y } -// An SQLITE_NOMEM error. +// C comment +// /* An SQLITE_NOMEM error. */ func Xsqlite3_result_error_nomem(tls *crt.TLS, _pCtx *Xsqlite3_context) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 { @@ -9672,8 +10163,8 @@ func Xsqlite3_result_error_nomem(tls *crt.TLS, _pCtx *Xsqlite3_context) { } }() _sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.X0)) - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = _sqlite3NomemError(tls, i32(76578)) - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = _sqlite3NomemError(tls, i32(76578)) + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) _sqlite3OomFault(tls, (*Xsqlite3)((*XMem)(_pCtx.X0).X9)) } @@ -9683,27 +10174,36 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_error_nomemØ00__func__Ø000[0], str(7563), 27) } -// current_time() -// -// This function returns the same value as time('now'). +// C comment +// /* +// ** current_time() +// ** +// ** This function returns the same value as time('now'). +// */ func _ctimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { _ = _NotUsed2 _timeFunc(tls, _context, i32(0), nil) } -// current_timestamp() -// -// This function returns the same value as datetime('now'). +// C comment +// /* +// ** current_timestamp() +// ** +// ** This function returns the same value as datetime('now'). +// */ func _ctimestampFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { _ = _NotUsed2 _datetimeFunc(tls, _context, i32(0), nil) } -// current_date() -// -// This function returns the same value as date('now'). +// C comment +// /* +// ** current_date() +// ** +// ** This function returns the same value as date('now'). +// */ func _cdateFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { _ = _NotUsed2 @@ -9846,26 +10346,29 @@ func init() { }{_versionFunc})), X5: nil, X6: str(7971), X7: t12{}}} } -// A function that loads a shared-library extension then returns NULL. +// C comment +// /* +// ** A function that loads a shared-library extension then returns NULL. +// */ func _loadExt(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _zFile, _zProc, _zErrMsg *int8 var _db *Xsqlite3 - _zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) + _zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) _db = Xsqlite3_context_db_handle(tls, _context) _zErrMsg = nil - if ((_db.X6) & i32(8388608)) == i32(0) { + if (_db.X6 & i32(8388608)) == i32(0) { Xsqlite3_result_error(tls, _context, str(7980), i32(-1)) return } if _argc == i32(2) { - _zProc = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))))) + _zProc = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))))) goto _2 } _zProc = nil _2: if (_zFile != nil) && Xsqlite3_load_extension(tls, _db, _zFile, _zProc, &_zErrMsg) != 0 { Xsqlite3_result_error(tls, _context, _zErrMsg, i32(-1)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg)) + Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) } } @@ -9878,16 +10381,19 @@ func Xsqlite3_load_extension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc * return _rc } -// Attempt to load an SQLite extension library contained in the file -// zFile. The entry point is zProc. zProc may be 0 in which case a -// default entry point name (sqlite3_extension_init) is used. Use -// of the default name is recommended. -// -// Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong. -// -// If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with -// error message text. The calling function should free this memory -// by calling sqlite3DbFree(db, ). +// C comment +// /* +// ** Attempt to load an SQLite extension library contained in the file +// ** zFile. The entry point is zProc. zProc may be 0 in which case a +// ** default entry point name (sqlite3_extension_init) is used. Use +// ** of the default name is recommended. +// ** +// ** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong. +// ** +// ** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with +// ** error message text. The calling function should free this memory +// ** by calling sqlite3DbFree(db, ). +// */ func _sqlite3LoadExtension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) { var _ii, _rc, _7_iFile, _7_iEntry, _7_c, _7_ncFile int32 var _nMsg uint64 @@ -9903,7 +10409,7 @@ func _sqlite3LoadExtension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *in if _pzErrMsg != nil { *_pzErrMsg = nil } - if ((_db.X6) & i32(4194304)) != i32(0) { + if (_db.X6 & i32(4194304)) != i32(0) { goto _1 } if _pzErrMsg != nil { @@ -9924,12 +10430,12 @@ _5: if _ii >= i32(1) || _handle != nil { goto _9 } - _3_zAltFile = Xsqlite3_mprintf(tls, str(8018), unsafe.Pointer(_zFile), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LoadExtensionØ00azEndingsØ001)) + 8*uintptr(_ii))))) + _3_zAltFile = Xsqlite3_mprintf(tls, str(8018), unsafe.Pointer(_zFile), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3LoadExtensionØ00azEndingsØ001)) + 8*uintptr(_ii))))) if _3_zAltFile == nil { return _sqlite3NomemError(tls, i32(112306)) } _handle = _sqlite3OsDlOpen(tls, _pVfs, _3_zAltFile) - Xsqlite3_free(tls, (unsafe.Pointer)(_3_zAltFile)) + Xsqlite3_free(tls, unsafe.Pointer(_3_zAltFile)) _ii += 1 goto _5 _9: @@ -9948,7 +10454,10 @@ _12: return i32(1) _11: - _xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)})) + _xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 { + v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry) + return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v)) + }() if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 }{_xInit})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { @@ -9962,10 +10471,10 @@ _11: _sqlite3OsDlClose(tls, _pVfs, _handle) return _sqlite3NomemError(tls, i32(112341)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_zAltEntry), (unsafe.Pointer)(str(8059)), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer(_zAltEntry), unsafe.Pointer(str(8059)), uint64(i32(8))) _7_iFile = _7_ncFile - i32(1) _17: - if _7_iFile < i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_7_iFile)))) == i32(47) { + if _7_iFile < i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_7_iFile)))) == i32(47) { goto _21 } _7_iFile -= 1 @@ -9981,18 +10490,21 @@ _21: } _7_iEntry = i32(8) _23: - if store1(&_7_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_7_iFile))))) == i32(0) || _7_c == i32(46) { + if store1(&_7_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_7_iFile))))) == i32(0) || _7_c == i32(46) { goto _27 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_7_c))))) & i32(2)) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAltEntry)) + 1*uintptr(postInc1(&_7_iEntry, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint32(_7_c))))) + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_7_c))))) & i32(2)) != 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry)) + 1*uintptr(postInc1(&_7_iEntry, 1)))) = int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint32(_7_c))))) } _7_iFile += 1 goto _23 _27: - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry))+uintptr(_7_iEntry)))), (unsafe.Pointer)(str(8072)), uint64(i32(6))) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry))+uintptr(_7_iEntry)))), unsafe.Pointer(str(8072)), uint64(i32(6))) _zEntry = _zAltEntry - _xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)})) + _xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 { + v := _sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry) + return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v)) + }() _15: if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 @@ -10016,11 +10528,11 @@ _15: } _30: _sqlite3OsDlClose(tls, _pVfs, _handle) - Xsqlite3_free(tls, (unsafe.Pointer)(_zAltEntry)) + Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry)) return i32(1) _29: - Xsqlite3_free(tls, (unsafe.Pointer)(_zAltEntry)) + Xsqlite3_free(tls, unsafe.Pointer(_zAltEntry)) _rc = _xInit(tls, _db, &_zErrmsg, &_sqlite3Apis) if _rc == 0 { goto _32 @@ -10031,26 +10543,29 @@ _29: if _pzErrMsg != nil { *_pzErrMsg = Xsqlite3_mprintf(tls, str(8121), unsafe.Pointer(_zErrmsg)) } - Xsqlite3_free(tls, (unsafe.Pointer)(_zErrmsg)) + Xsqlite3_free(tls, unsafe.Pointer(_zErrmsg)) _sqlite3OsDlClose(tls, _pVfs, _handle) return i32(1) _32: - _aHandle = (*unsafe.Pointer)(_sqlite3DbMallocZero(tls, _db, u64(8)*uint64((_db.X39)+i32(1)))) + _aHandle = (*unsafe.Pointer)(_sqlite3DbMallocZero(tls, _db, u64(8)*uint64(_db.X39+i32(1)))) if _aHandle == nil { return _sqlite3NomemError(tls, i32(112385)) } - if (_db.X39) > i32(0) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_aHandle), (unsafe.Pointer)(_db.X40), u64(8)*uint64(_db.X39)) + if _db.X39 > i32(0) { + crt.Xmemcpy(tls, unsafe.Pointer(_aHandle), unsafe.Pointer(_db.X40), u64(8)*uint64(_db.X39)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_db.X40)) - *(**unsafe.Pointer)(unsafe.Pointer(&(_db.X40))) = _aHandle - *(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X40)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_db.X39))), int32(1))))) = _handle + _sqlite3DbFree(tls, _db, unsafe.Pointer(_db.X40)) + *(**unsafe.Pointer)(unsafe.Pointer(&_db.X40)) = _aHandle + *(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_db.X40)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_db.X39)), 1)))) = _handle return i32(0) } -// Print into memory obtained from sqlite3_malloc()(). Omit the internal -// %-conversion extensions. +// C comment +// /* +// ** Print into memory obtained from sqlite3_malloc()(). Omit the internal +// ** %-conversion extensions. +// */ func Xsqlite3_mprintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 *int8) { var _z *int8 var _ap []interface{} @@ -10063,8 +10578,11 @@ func Xsqlite3_mprintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 *in return _z } -// Print into memory obtained from sqlite3_malloc(). Omit the internal -// %-conversion extensions. +// C comment +// /* +// ** Print into memory obtained from sqlite3_malloc(). Omit the internal +// ** %-conversion extensions. +// */ func Xsqlite3_vmprintf(tls *crt.TLS, _zFormat *int8, _ap []interface{}) (r0 *int8) { var _z *int8 var _acc XStrAccum @@ -10087,9 +10605,10 @@ func Xsqlite3_vmprintf(tls *crt.TLS, _zFormat *int8, _ap []interface{}) (r0 *int } func _sqlite3OsDlOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8) (r0 unsafe.Pointer) { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer - }{(_pVfs.X10)})))(tls, _pVfs, _zPath) + return func() func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer { + v := _pVfs.X10 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _zPath) } var _sqlite3LoadExtensionØ00azEndingsØ001 [1]*int8 @@ -10106,21 +10625,24 @@ func Xsqlite3_malloc64(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) { } func _sqlite3OsDlError(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) { - (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) - }{(_pVfs.X11)})))(tls, _pVfs, _nByte, _zBufOut) + func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) { + v := _pVfs.X11 + return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&v)) + }()(tls, _pVfs, _nByte, _zBufOut) } func _sqlite3OsDlSym(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHdle unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS) - }{(_pVfs.X12)})))(tls, _pVfs, _pHdle, _zSym) + return func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS) { + v := _pVfs.X12 + return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v)) + }()(tls, _pVfs, _pHdle, _zSym) } func _sqlite3OsDlClose(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHandle unsafe.Pointer) { - (*(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) - }{(_pVfs.X13)})))(tls, _pVfs, _pHandle) + func() func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer) { + v := _pVfs.X13 + return *(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&v)) + }()(tls, _pVfs, _pHandle) } var _sqlite3Apis Xsqlite3_api_routines @@ -10351,14 +10873,15 @@ func init() { }{Xsqlite3_set_last_insert_rowid}))} } -// Allocate or return the aggregate context for a user function. A new -// context is allocated on the first call. Subsequent calls return the -// same context that was returned on prior calls. +// C comment +// /* +// ** Allocate or return the aggregate context for a user function. A new +// ** context is allocated on the first call. Subsequent calls return the +// ** same context that was returned on prior calls. +// */ func Xsqlite3_aggregate_context(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) { func() { - if _p == nil || (*XFuncDef)(_p.X1) == nil || (*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*XFuncDef)(_p.X1).X5)}))) == nil { + if _p == nil || _p.X1 == nil || ((*XFuncDef)(_p.X1).X5) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76890), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_aggregate_contextØ00__func__Ø000))), unsafe.Pointer(str(8156))) crt.X__builtin_abort(tls) } @@ -10372,7 +10895,7 @@ func Xsqlite3_aggregate_context(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32 if (int32((*XMem)(_p.X2).X1) & i32(8192)) == i32(0) { return _createAggContext(tls, _p, _nByte) } - return (unsafe.Pointer)((*XMem)(_p.X2).X5) + return unsafe.Pointer((*XMem)(_p.X2).X5) } var _sqlite3_aggregate_contextØ00__func__Ø000 [26]int8 @@ -10381,8 +10904,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_aggregate_contextØ00__func__Ø000[0], str(8232), 26) } -// Create a new aggregate context for p and return a pointer to -// its pMem->z element. +// C comment +// /* +// ** Create a new aggregate context for p and return a pointer to +// ** its pMem->z element. +// */ func _createAggContext(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) { var _pMem *XMem _pMem = (*XMem)(_p.X2) @@ -10394,17 +10920,17 @@ func _createAggContext(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 uns }() if _nByte <= i32(0) { _sqlite3VdbeMemSetNull(tls, _pMem) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil + *(**int8)(unsafe.Pointer(&_pMem.X5)) = nil goto _3 } _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(8192)) - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))) = (*XFuncDef)(_p.X1) - if (_pMem.X5) != nil { - crt.Xmemset(tls, (unsafe.Pointer)(_pMem.X5), i32(0), uint64(_nByte)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(8192)) + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))))) = (*XFuncDef)(_p.X1) + if _pMem.X5 != nil { + crt.Xmemset(tls, unsafe.Pointer(_pMem.X5), i32(0), uint64(_nByte)) } _3: - return (unsafe.Pointer)(_pMem.X5) + return unsafe.Pointer(_pMem.X5) } var _createAggContextØ00__func__Ø000 [17]int8 @@ -10413,18 +10939,19 @@ func init() { crt.Xstrncpy(nil, &_createAggContextØ00__func__Ø000[0], str(8285), 17) } -// Return the number of times the Step function of an aggregate has been -// called. -// -// This function is deprecated. Do not use it for new code. It is -// provide only to avoid breaking legacy code. New aggregate function -// implementations should keep their own counts within their aggregate -// context. +// C comment +// /* +// ** Return the number of times the Step function of an aggregate has been +// ** called. +// ** +// ** This function is deprecated. Do not use it for new code. It is +// ** provide only to avoid breaking legacy code. New aggregate function +// ** implementations should keep their own counts within their aggregate +// ** context. +// */ func Xsqlite3_aggregate_count(tls *crt.TLS, _p *Xsqlite3_context) (r0 int32) { func() { - if _p == nil || (*XMem)(_p.X2) == nil || (*XFuncDef)(_p.X1) == nil || (*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*XFuncDef)(_p.X1).X5)}))) == nil { + if _p == nil || _p.X2 == nil || _p.X1 == nil || ((*XFuncDef)(_p.X1).X5) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_aggregate_countØ00__func__Ø000))), unsafe.Pointer(str(8302))) crt.X__builtin_abort(tls) } @@ -10438,7 +10965,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_aggregate_countØ00__func__Ø000[0], str(8350), 24) } -// Bind a blob value to an SQL statement variable. +// C comment +// /* +// ** Bind a blob value to an SQL statement variable. +// */ func Xsqlite3_bind_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { if _nData < i32(0) { return _sqlite3MisuseError(tls, i32(77424)) @@ -10446,7 +10976,10 @@ func Xsqlite3_bind_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData un return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(i32(0))) } -// Bind a text or BLOB value. +// C comment +// /* +// ** Bind a text or BLOB value. +// */ func _bindText(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer), _encoding uint8) (r0 int32) { var _rc int32 var _p *TVdbe @@ -10478,33 +11011,41 @@ _0: f func(*crt.TLS, unsafe.Pointer) }{_xDel})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)})))}))) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()}))) { _xDel(tls, _zData) } _6: return _rc } -// ****************************** sqlite3_bind_ *************************** -// -// Routines used to attach values to wildcards in a compiled SQL statement. - -// Unbind the value bound to variable i in virtual machine p. This is the -// the same as binding a NULL value to the column. If the "i" parameter is -// out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK. -// -// A successful evaluation of this routine acquires the mutex on p. -// the mutex is released if any kind of error occurs. -// -// The error code stored in database p->db is overwritten with the return -// value in any case. +// C comment +// /******************************* sqlite3_bind_ *************************** +// ** +// ** Routines used to attach values to wildcards in a compiled SQL statement. +// */ + +// C comment +// /* +// ** Unbind the value bound to variable i in virtual machine p. This is the +// ** the same as binding a NULL value to the column. If the "i" parameter is +// ** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK. +// ** +// ** A successful evaluation of this routine acquires the mutex on p. +// ** the mutex is released if any kind of error occurs. +// ** +// ** The error code stored in database p->db is overwritten with the return +// ** value in any case. +// */ func _vdbeUnbind(tls *crt.TLS, _p *TVdbe, _i int32) (r0 int32) { var _pVar *XMem if _vdbeSafetyNotNull(tls, _p) != 0 { return _sqlite3MisuseError(tls, i32(77342)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) - if ((_p.X5) != uint32(i32(770837923))) || ((_p.X9) >= i32(0)) { + if (_p.X5 != uint32(i32(770837923))) || (_p.X9 >= i32(0)) { _sqlite3Error(tls, (*Xsqlite3)(_p.X0), i32(21)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) Xsqlite3_log(tls, i32(21), str(8374), unsafe.Pointer(_p.X36)) @@ -10518,21 +11059,21 @@ func _vdbeUnbind(tls *crt.TLS, _p *TVdbe, _i int32) (r0 int32) { _i -= 1 _pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 72*uintptr(_i))) _sqlite3VdbeMemRelease(tls, _pVar) - *(*uint16)(unsafe.Pointer(&(_pVar.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_pVar.X1)) = uint16(i32(1)) _sqlite3Error(tls, (*Xsqlite3)(_p.X0), i32(0)) func() { - if ((uint32((_p.X32)>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && (_p.X41) != uint32(i32(0)) { + if ((uint32(_p.X32>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && _p.X41 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77372), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeUnbindØ00__func__Ø000))), unsafe.Pointer(str(8414))) crt.X__builtin_abort(tls) } }() - if ((_p.X41) != uint32(i32(0))) && (((_p.X41) & func() uint32 { + if (_p.X41 != uint32(i32(0))) && ((_p.X41 & func() uint32 { if _i >= i32(31) { return u32(2147483648) } return (u32(1) << uint(_i)) }()) != uint32(i32(0))) { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) } return i32(0) } @@ -10545,9 +11086,12 @@ func _vdbeSafetyNotNull(tls *crt.TLS, _p *TVdbe) (r0 int32) { return _vdbeSafety(tls, _p) } -// Check on a Vdbe to make sure it has not been finalized. Log -// an error and return true if it has been finalized (or is otherwise -// invalid). Return false if it is ok. +// C comment +// /* +// ** Check on a Vdbe to make sure it has not been finalized. Log +// ** an error and return true if it has been finalized (or is otherwise +// ** invalid). Return false if it is ok. +// */ func _vdbeSafety(tls *crt.TLS, _p *TVdbe) (r0 int32) { if (*Xsqlite3)(_p.X0) == nil { Xsqlite3_log(tls, i32(21), str(8486)) @@ -10556,9 +11100,12 @@ func _vdbeSafety(tls *crt.TLS, _p *TVdbe) (r0 int32) { return i32(0) } -// Set the current error code to err_code and clear any prior error message. -// Also set iSysErrno (by calling sqlite3System) if the err_code indicates -// that would be appropriate. +// C comment +// /* +// ** Set the current error code to err_code and clear any prior error message. +// ** Also set iSysErrno (by calling sqlite3System) if the err_code indicates +// ** that would be appropriate. +// */ func _sqlite3Error(tls *crt.TLS, _db *Xsqlite3, _err_code int32) { func() { if _db == nil { @@ -10566,8 +11113,8 @@ func _sqlite3Error(tls *crt.TLS, _db *Xsqlite3, _err_code int32) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_db.X10))) = _err_code - if _err_code != 0 || ((*XMem)(_db.X56) != nil) { + *(*int32)(unsafe.Pointer(&_db.X10)) = _err_code + if _err_code != 0 || (_db.X56 != nil) { _sqlite3ErrorFinish(tls, _db, _err_code) } } @@ -10578,11 +11125,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ErrorØ00__func__Ø000[0], str(8531), 13) } -// Helper function for sqlite3Error() - called rarely. Broken out into -// a separate routine to avoid unnecessary register saves on entry to -// sqlite3Error(). +// C comment +// /* +// ** Helper function for sqlite3Error() - called rarely. Broken out into +// ** a separate routine to avoid unnecessary register saves on entry to +// ** sqlite3Error(). +// */ func _sqlite3ErrorFinish(tls *crt.TLS, _db *Xsqlite3, _err_code int32) { - if (*XMem)(_db.X56) != nil { + if _db.X56 != nil { _sqlite3ValueSetNull(tls, (*XMem)(_db.X56)) } _sqlite3SystemError(tls, _db, _err_code) @@ -10592,8 +11142,11 @@ func _sqlite3ValueSetNull(tls *crt.TLS, _p *XMem) { _sqlite3VdbeMemSetNull(tls, _p) } -// Load the sqlite3.iSysErrno field if that is an appropriate thing -// to do based on the SQLite error code in rc. +// C comment +// /* +// ** Load the sqlite3.iSysErrno field if that is an appropriate thing +// ** to do based on the SQLite error code in rc. +// */ func _sqlite3SystemError(tls *crt.TLS, _db *Xsqlite3, _rc int32) { if _rc == i32(3082) { return @@ -10604,18 +11157,17 @@ func _sqlite3SystemError(tls *crt.TLS, _db *Xsqlite3, _rc int32) { sink1(*p) } if (_rc == i32(14)) || (_rc == i32(10)) { - *(*int32)(unsafe.Pointer(&(_db.X12))) = _sqlite3OsGetLastError(tls, (*Xsqlite3_vfs)(_db.X0)) + *(*int32)(unsafe.Pointer(&_db.X12)) = _sqlite3OsGetLastError(tls, (*Xsqlite3_vfs)(_db.X0)) } } func _sqlite3OsGetLastError(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) { return func() int32 { - if (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{(_pVfs.X17)}))) != nil { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{(_pVfs.X17)})))(tls, _pVfs, i32(0), nil) + if _pVfs.X17 != nil { + return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 { + v := _pVfs.X17 + return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, i32(0), nil) } return i32(0) }() @@ -10627,16 +11179,19 @@ func init() { crt.Xstrncpy(nil, &_vdbeUnbindØ00__func__Ø000[0], str(8544), 11) } -// This function must be called before exiting any API function (i.e. -// returning control to the user) that has called sqlite3_malloc or -// sqlite3_realloc. -// -// The returned value is normally a copy of the second argument to this -// function. However, if a malloc() failure has occurred since the previous -// invocation SQLITE_NOMEM is returned instead. -// -// If an OOM as occurred, then the connection error-code (the value -// returned by sqlite3_errcode()) is set to SQLITE_NOMEM. +// C comment +// /* +// ** This function must be called before exiting any API function (i.e. +// ** returning control to the user) that has called sqlite3_malloc or +// ** sqlite3_realloc. +// ** +// ** The returned value is normally a copy of the second argument to this +// ** function. However, if a malloc() failure has occurred since the previous +// ** invocation SQLITE_NOMEM is returned instead. +// ** +// ** If an OOM as occurred, then the connection error-code (the value +// ** returned by sqlite3_errcode()) is set to SQLITE_NOMEM. +// */ func _sqlite3ApiExit(tls *crt.TLS, _db *Xsqlite3, _rc int32) (r0 int32) { func() { if _db == nil { @@ -10650,10 +11205,10 @@ func _sqlite3ApiExit(tls *crt.TLS, _db *Xsqlite3, _rc int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - if ((_db.X17) != 0) || (_rc == i32(3082)) { + if (_db.X17 != 0) || (_rc == i32(3082)) { return _apiOomError(tls, _db) } - return _rc & (_db.X11) + return _rc & _db.X11 } var _sqlite3ApiExitØ00__func__Ø000 [15]int8 @@ -10662,29 +11217,35 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ApiExitØ00__func__Ø000[0], str(8555), 15) } -// Take actions at the end of an API call to indicate an OOM error +// C comment +// /* +// ** Take actions at the end of an API call to indicate an OOM error +// */ func _apiOomError(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { _sqlite3OomClear(tls, _db) _sqlite3Error(tls, _db, i32(7)) return _sqlite3NomemError(tls, i32(25030)) } -// This routine reactivates the memory allocator and clears the -// db->mallocFailed flag as necessary. -// -// The memory allocator is not restarted if there are running -// VDBEs. +// C comment +// /* +// ** This routine reactivates the memory allocator and clears the +// ** db->mallocFailed flag as necessary. +// ** +// ** The memory allocator is not restarted if there are running +// ** VDBEs. +// */ func _sqlite3OomClear(tls *crt.TLS, _db *Xsqlite3) { - if ((_db.X17) != 0) && ((_db.X37) == i32(0)) { - *(*uint8)(unsafe.Pointer(&(_db.X17))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0) + if (_db.X17 != 0) && (_db.X37 == i32(0)) { + *(*uint8)(unsafe.Pointer(&_db.X17)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(0) func() { - if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) <= uint32(i32(0)) { + if ((*t7)(unsafe.Pointer(&_db.X58)).X0) <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25019), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OomClearØ00__func__Ø000))), unsafe.Pointer(str(8570))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1 + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) -= 1 } } @@ -10722,25 +11283,31 @@ func Xsqlite3_bind_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _iValue return _rc } -// Delete any previous value and set the value stored in *pMem to val, -// manifest type INTEGER. +// C comment +// /* +// ** Delete any previous value and set the value stored in *pMem to val, +// ** manifest type INTEGER. +// */ func _sqlite3VdbeMemSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) { if (int32(_pMem.X1) & i32(9312)) != i32(0) { _vdbeReleaseAndSetInt64(tls, _pMem, _val) goto _1 } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _val + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) _1: } -// The pMem is known to contain content that needs to be destroyed prior -// to a value change. So invoke the destructor, then set the value to -// a 64-bit integer. +// C comment +// /* +// ** The pMem is known to contain content that needs to be destroyed prior +// ** to a value change. So invoke the destructor, then set the value to +// ** a 64-bit integer. +// */ func _vdbeReleaseAndSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) { _sqlite3VdbeMemSetNull(tls, _pMem) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _val + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) } func Xsqlite3_bind_null(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) { @@ -10754,8 +11321,11 @@ func Xsqlite3_bind_null(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32 return _rc } -// Return the number of wildcards that can be potentially bound to. -// This routine is added to support DBD::SQLite. +// C comment +// /* +// ** Return the number of wildcards that can be potentially bound to. +// ** This routine is added to support DBD::SQLite. +// */ func Xsqlite3_bind_parameter_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _p *TVdbe _p = (*TVdbe)(_pStmt) @@ -10771,9 +11341,12 @@ func Xsqlite3_bind_parameter_index(tls *crt.TLS, _pStmt unsafe.Pointer, _zName * return _sqlite3VdbeParameterIndex(tls, (*TVdbe)(_pStmt), _zName, _sqlite3Strlen30(tls, _zName)) } -// Given a wildcard parameter name, return the index of the variable -// with that name. If there is no variable with the given name, -// return 0. +// C comment +// /* +// ** Given a wildcard parameter name, return the index of the variable +// ** with that name. If there is no variable with the given name, +// ** return 0. +// */ func _sqlite3VdbeParameterIndex(tls *crt.TLS, _p *TVdbe, _zName *int8, _nName int32) (r0 int32) { if (_p == nil) || (_zName == nil) { return i32(0) @@ -10781,24 +11354,27 @@ func _sqlite3VdbeParameterIndex(tls *crt.TLS, _p *TVdbe, _zName *int8, _nName in return _sqlite3VListNameToNum(tls, _p.X25, _zName, _nName) } -// Return the number of the variable named zName, if it is in VList. -// or return 0 if there is no such variable. +// C comment +// /* +// ** Return the number of the variable named zName, if it is in VList. +// ** or return 0 if there is no such variable. +// */ func _sqlite3VListNameToNum(tls *crt.TLS, _pIn *int32, _zName *int8, _nName int32) (r0 int32) { var _i, _mx int32 var _1_z *int8 if _pIn == nil { return i32(0) } - _mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))) + _mx = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1)))) _i = i32(2) _1: - _1_z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2)))))) - if (crt.Xstrncmp(tls, _1_z, _zName, uint64(_nName)) == i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(_nName)))) == i32(0)) { - return *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i))) + _1_z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(2)))))) + if (crt.Xstrncmp(tls, _1_z, _zName, uint64(_nName)) == i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(_nName)))) == i32(0)) { + return *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i))) } { p := &_i - *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1))))) + *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(1))))) sink1(*p) } if _i < _mx { @@ -10807,10 +11383,13 @@ _1: return i32(0) } -// Return the name of a wildcard parameter. Return NULL if the index -// is out of range or if the wildcard is unnamed. -// -// The result is always UTF-8. +// C comment +// /* +// ** Return the name of a wildcard parameter. Return NULL if the index +// ** is out of range or if the wildcard is unnamed. +// ** +// ** The result is always UTF-8. +// */ func Xsqlite3_bind_parameter_name(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *int8) { var _p *TVdbe _p = (*TVdbe)(_pStmt) @@ -10820,23 +11399,26 @@ func Xsqlite3_bind_parameter_name(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) return _sqlite3VListNumToName(tls, _p.X25, _i) } -// Return a pointer to the name of a variable in the given VList that -// has the value iVal. Or return a NULL if there is no such variable in -// the list +// C comment +// /* +// ** Return a pointer to the name of a variable in the given VList that +// ** has the value iVal. Or return a NULL if there is no such variable in +// ** the list +// */ func _sqlite3VListNumToName(tls *crt.TLS, _pIn *int32, _iVal int32) (r0 *int8) { var _i, _mx int32 if _pIn == nil { return nil } - _mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))) + _mx = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1)))) _i = i32(2) _1: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i)))) == _iVal { - return (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2)))))) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i)))) == _iVal { + return (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(2)))))) } { p := &_i - *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1))))) + *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(1))))) sink1(*p) } if _i < _mx { @@ -10846,14 +11428,15 @@ _1: } func Xsqlite3_bind_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { - return _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_zData), _nData, _xDel, uint8(i32(1))) + return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), _nData, _xDel, uint8(i32(1))) } func Xsqlite3_bind_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(i32(2))) } -// SQLITE_OMIT_UTF16 +// C comment +// /* SQLITE_OMIT_UTF16 */ func Xsqlite3_bind_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _pValue *XMem) (r0 int32) { var _rc int32 switch Xsqlite3_value_type(tls, _pValue) { @@ -10870,21 +11453,27 @@ func Xsqlite3_bind_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _pValue } _1: - _rc = Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0)))))) + _rc = Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pValue.X0))))) goto _6 _2: - _rc = Xsqlite3_bind_double(tls, _pStmt, _i, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0)))))) + _rc = Xsqlite3_bind_double(tls, _pStmt, _i, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pValue.X0))))) goto _6 _3: if (int32(_pValue.X1) & i32(16384)) != 0 { - _rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0)))))) + _rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pValue.X0))))) goto _8 } - _rc = Xsqlite3_bind_blob(tls, _pStmt, _i, (unsafe.Pointer)(_pValue.X5), _pValue.X4, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + _rc = Xsqlite3_bind_blob(tls, _pStmt, _i, unsafe.Pointer(_pValue.X5), _pValue.X4, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _8: goto _6 _4: - _rc = _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_pValue.X5), _pValue.X4, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)})), _pValue.X2) + _rc = _bindText(tls, _pStmt, _i, unsafe.Pointer(_pValue.X5), _pValue.X4, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }(), _pValue.X2) goto _6 _5: _rc = Xsqlite3_bind_null(tls, _pStmt, _i) @@ -10905,44 +11494,53 @@ func Xsqlite3_bind_zeroblob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n in return _rc } -// Delete any previous value and set the value to be a BLOB of length -// n containing all zeros. +// C comment +// /* +// ** Delete any previous value and set the value to be a BLOB of length +// ** n containing all zeros. +// */ func _sqlite3VdbeMemSetZeroBlob(tls *crt.TLS, _pMem *XMem, _n int32) { _sqlite3VdbeMemRelease(tls, _pMem) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(16400)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(0) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(16400)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = i32(0) if _n < i32(0) { _n = i32(0) } - *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _n - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil + *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _n + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = nil } -// This routine sets the busy callback for an Sqlite database to the -// given callback function with the given argument. +// C comment +// /* +// ** This routine sets the busy callback for an Sqlite database to the +// ** given callback function with the given argument. +// */ func Xsqlite3_busy_handler(tls *crt.TLS, _db *Xsqlite3, _xBusy func(*crt.TLS, unsafe.Pointer, int32) int32, _pArg unsafe.Pointer) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(141988)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X0))) = _xBusy - *(*unsafe.Pointer)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X1))) = _pArg - *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0) - *(*int32)(unsafe.Pointer(&(_db.X74))) = i32(0) + *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X0))) = _xBusy + *(*unsafe.Pointer)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X1))) = _pArg + *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X2))) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X74)) = i32(0) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(0) } -// This routine installs a default busy handler that waits for the -// specified number of milliseconds before returning 0. +// C comment +// /* +// ** This routine installs a default busy handler that waits for the +// ** specified number of milliseconds before returning 0. +// */ func Xsqlite3_busy_timeout(tls *crt.TLS, _db *Xsqlite3, _ms int32) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(142038)) } if _ms > i32(0) { - Xsqlite3_busy_handler(tls, _db, _sqliteDefaultBusyCallback, (unsafe.Pointer)(_db)) - *(*int32)(unsafe.Pointer(&(_db.X74))) = _ms + Xsqlite3_busy_handler(tls, _db, _sqliteDefaultBusyCallback, unsafe.Pointer(_db)) + *(*int32)(unsafe.Pointer(&_db.X74)) = _ms goto _2 } Xsqlite3_busy_handler(tls, _db, nil, nil) @@ -10950,10 +11548,13 @@ _2: return i32(0) } -// This routine implements a busy callback that sleeps and tries -// again until a timeout value is reached. The timeout value is -// an integer number of milliseconds passed in as the first -// argument. +// C comment +// /* +// ** This routine implements a busy callback that sleeps and tries +// ** again until a timeout value is reached. The timeout value is +// ** an integer number of milliseconds passed in as the first +// ** argument. +// */ func _sqliteDefaultBusyCallback(tls *crt.TLS, _ptr unsafe.Pointer, _count int32) (r0 int32) { var _timeout, _delay, _prior int32 var _db *Xsqlite3 @@ -10966,12 +11567,12 @@ func _sqliteDefaultBusyCallback(tls *crt.TLS, _ptr unsafe.Pointer, _count int32) } }() if _count < i32(12) { - _delay = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(_count)))) - _prior = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(_count)))) + _delay = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(_count)))) + _prior = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(_count)))) goto _3 } - _delay = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(i32(11))))) - _prior = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(i32(11))))) + (_delay * (_count - i32(11))) + _delay = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(i32(11))))) + _prior = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(i32(11))))) + (_delay * (_count - i32(11))) _3: if (_prior + _delay) <= _timeout { goto _4 @@ -11004,12 +11605,16 @@ func init() { } func _sqlite3OsSleep(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nMicro int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_pVfs.X15)})))(tls, _pVfs, _nMicro) + return func() func(*crt.TLS, *Xsqlite3_vfs, int32) int32 { + v := _pVfs.X15 + return *(*func(*crt.TLS, *Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _nMicro) } -// Return the number of changes in the most recent call to sqlite3_exec(). +// C comment +// /* +// ** Return the number of changes in the most recent call to sqlite3_exec(). +// */ func Xsqlite3_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(141413)) @@ -11018,18 +11623,24 @@ func Xsqlite3_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return _db.X29 } -// Two variations on the public interface for closing a database -// connection. The sqlite3_close() version returns SQLITE_BUSY and -// leaves the connection option if there are unfinalized prepared -// statements or unfinished sqlite3_backups. The sqlite3_close_v2() -// version forces the connection to become a zombie if there are -// unclosed resources, and arranges for deallocation when the last -// prepare statement or sqlite3_backup closes. +// C comment +// /* +// ** Two variations on the public interface for closing a database +// ** connection. The sqlite3_close() version returns SQLITE_BUSY and +// ** leaves the connection option if there are unfinalized prepared +// ** statements or unfinished sqlite3_backups. The sqlite3_close_v2() +// ** version forces the connection to become a zombie if there are +// ** unclosed resources, and arranges for deallocation when the last +// ** prepare statement or sqlite3_backup closes. +// */ func Xsqlite3_close(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return _sqlite3Close(tls, _db, i32(0)) } -// Close an existing SQLite database +// C comment +// /* +// ** Close an existing SQLite database +// */ func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) { if _db == nil { return i32(0) @@ -11039,7 +11650,7 @@ func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) { } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) if (int32(_db.X24) & i32(8)) != 0 { - (_db.X41)(tls, uint32(i32(8)), _db.X42, (unsafe.Pointer)(_db), nil) + _db.X41(tls, uint32(i32(8)), _db.X42, unsafe.Pointer(_db), nil) } _disconnectAllVtab(tls, _db) _sqlite3VtabRollback(tls, _db) @@ -11048,7 +11659,7 @@ func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) { Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(5) } - *(*uint32)(unsafe.Pointer(&(_db.X28))) = uint32(i32(1691352191)) + *(*uint32)(unsafe.Pointer(&_db.X28)) = uint32(i32(1691352191)) _sqlite3LeaveMutexAndCloseZombie(tls, _db) return i32(0) } @@ -11063,8 +11674,11 @@ func _sqlite3SafetyCheckSickOrOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return i32(1) } -// Disconnect all sqlite3_vtab objects that belong to database connection -// db. This is called when db is being closed. +// C comment +// /* +// ** Disconnect all sqlite3_vtab objects that belong to database connection +// ** db. This is called when db is being closed. +// */ func _disconnectAllVtab(tls *crt.TLS, _db *Xsqlite3) { var _i int32 var _1_pSchema *XSchema @@ -11074,20 +11688,20 @@ func _disconnectAllVtab(tls *crt.TLS, _db *Xsqlite3) { _sqlite3BtreeEnterAll(tls, _db) _i = i32(0) _0: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _3 } _1_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X4) - if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X4) == nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X4) == nil { goto _4 } - _p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_1_pSchema.X2))).X2) + _p = (*XHashElem)((*XHash)(unsafe.Pointer(&_1_pSchema.X2)).X2) _5: if _p == nil { goto _8 } _3_pTab = (*XTable)(_p.X2) - if (_3_pTab.X16) != 0 { + if _3_pTab.X16 != 0 { _sqlite3VtabDisconnect(tls, _db, _3_pTab) } _p = (*XHashElem)(_p.X0) @@ -11097,13 +11711,13 @@ _4: _i += 1 goto _0 _3: - _p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X65))).X2) + _p = (*XHashElem)((*XHash)(unsafe.Pointer(&_db.X65)).X2) _10: if _p == nil { goto _13 } _4_pMod = (*XModule)(_p.X2) - if (*XTable)(_4_pMod.X4) != nil { + if _4_pMod.X4 != nil { _sqlite3VtabDisconnect(tls, _db, (*XTable)(_4_pMod.X4)) } _p = (*XHashElem)(_p.X0) @@ -11119,18 +11733,21 @@ func _sqlite3BtreeEnterAll(tls *crt.TLS, _db *Xsqlite3) { } } -// Enter the mutex on every Btree associated with a database -// connection. This is needed (for example) prior to parsing -// a statement since we will be comparing table and column names -// against all schemas and we do not want those schemas being -// reset out from under us. -// -// There is a corresponding leave-all procedures. -// -// Enter the mutexes in accending order by BtShared pointer address -// to avoid the possibility of deadlock when two threads with -// two or more btrees in common both try to lock all their btrees -// at the same instant. +// C comment +// /* +// ** Enter the mutex on every Btree associated with a database +// ** connection. This is needed (for example) prior to parsing +// ** a statement since we will be comparing table and column names +// ** against all schemas and we do not want those schemas being +// ** reset out from under us. +// ** +// ** There is a corresponding leave-all procedures. +// ** +// ** Enter the mutexes in accending order by BtShared pointer address +// ** to avoid the possibility of deadlock when two threads with +// ** two or more btrees in common both try to lock all their btrees +// ** at the same instant. +// */ func _btreeEnterAll(tls *crt.TLS, _db *Xsqlite3) { var _i, _skipOk int32 var _p *XBtree @@ -11143,18 +11760,18 @@ func _btreeEnterAll(tls *crt.TLS, _db *Xsqlite3) { }() _i = i32(0) _2: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _5 } _p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) - if (_p != nil) && ((_p.X3) != 0) { + if (_p != nil) && (_p.X3 != 0) { _sqlite3BtreeEnter(tls, _p) _skipOk = i32(0) } _i += 1 goto _2 _5: - *(*uint8)(unsafe.Pointer(&(_db.X25))) = uint8(_skipOk) + *(*uint8)(unsafe.Pointer(&_db.X25)) = uint8(_skipOk) } var _btreeEnterAllØ00__func__Ø000 [14]int8 @@ -11163,20 +11780,23 @@ func init() { crt.Xstrncpy(nil, &_btreeEnterAllØ00__func__Ø000[0], str(8722), 14) } -// Enter a mutex on the given BTree object. -// -// If the object is not sharable, then no mutex is ever required -// and this routine is a no-op. The underlying mutex is non-recursive. -// But we keep a reference count in Btree.wantToLock so the behavior -// of this interface is recursive. -// -// To avoid deadlocks, multiple Btrees are locked in the same order -// by all database connections. The p->pNext is a list of other -// Btrees belonging to the same database connection as the p Btree -// which need to be locked after p. If we cannot get a lock on -// p, then first unlock all of the others on p->pNext, then wait -// for the lock to become available on p, then relock all of the -// subsequent Btrees that desire a lock. +// C comment +// /* +// ** Enter a mutex on the given BTree object. +// ** +// ** If the object is not sharable, then no mutex is ever required +// ** and this routine is a no-op. The underlying mutex is non-recursive. +// ** But we keep a reference count in Btree.wantToLock so the behavior +// ** of this interface is recursive. +// ** +// ** To avoid deadlocks, multiple Btrees are locked in the same order +// ** by all database connections. The p->pNext is a list of other +// ** Btrees belonging to the same database connection as the p Btree +// ** which need to be locked after p. If we cannot get a lock on +// ** p, then first unlock all of the others on p->pNext, then wait +// ** for the lock to become available on p, then relock all of the +// ** subsequent Btrees that desire a lock. +// */ func _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) { func() { if (*XBtree)(_p.X9) != nil && crt.P2U(unsafe.Pointer((*XBtShared)((*XBtree)(_p.X9).X1))) <= crt.P2U(unsafe.Pointer((*XBtShared)(_p.X1))) { @@ -11203,19 +11823,19 @@ func _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) { } }() func() { - if (_p.X3) == 0 && ((*XBtree)(_p.X9) != nil || (*XBtree)(_p.X10) != nil) { + if _p.X3 == 0 && ((*XBtree)(_p.X9) != nil || (*XBtree)(_p.X10) != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8878))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X4) != 0 && (_p.X6) <= i32(0) { + if _p.X4 != 0 && _p.X6 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8922))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X3) == 0 && (_p.X6) != i32(0) { + if _p.X3 == 0 && _p.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58807), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8952))) crt.X__builtin_abort(tls) } @@ -11227,16 +11847,16 @@ func _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) { } }() func() { - if (int32(_p.X4) != i32(0) || (_p.X3) == 0) && (*Xsqlite3)((*XBtShared)(_p.X1).X1) != (*Xsqlite3)(_p.X0) { + if (int32(_p.X4) != i32(0) || _p.X3 == 0) && (*Xsqlite3)((*XBtShared)(_p.X1).X1) != (*Xsqlite3)(_p.X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(9017))) crt.X__builtin_abort(tls) } }() - if (_p.X3) == 0 { + if _p.X3 == 0 { return } - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 - if (_p.X4) != 0 { + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 + if _p.X4 != 0 { return } _btreeLockCarefully(tls, _p) @@ -11248,16 +11868,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeEnterØ00__func__Ø000[0], str(9068), 18) } -// This is a helper function for sqlite3BtreeLock(). By moving -// complex, but seldom used logic, out of sqlite3BtreeLock() and -// into this routine, we avoid unnecessary stack pointer changes -// and thus help the sqlite3BtreeLock() routine to run much faster -// in the common case. +// C comment +// /* This is a helper function for sqlite3BtreeLock(). By moving +// ** complex, but seldom used logic, out of sqlite3BtreeLock() and +// ** into this routine, we avoid unnecessary stack pointer changes +// ** and thus help the sqlite3BtreeLock() routine to run much faster +// ** in the common case. +// */ func _btreeLockCarefully(tls *crt.TLS, _p *XBtree) { var _pLater *XBtree if Xsqlite3_mutex_try(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) == i32(0) { *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtShared)(_p.X1).X1))))) = (*Xsqlite3)(_p.X0) - *(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X4)) = uint8(i32(1)) return } _pLater = (*XBtree)(_p.X9) @@ -11266,7 +11888,7 @@ _1: goto _4 } func() { - if (_pLater.X3) == 0 { + if _pLater.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58847), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000))), unsafe.Pointer(str(9086))) crt.X__builtin_abort(tls) } @@ -11278,12 +11900,12 @@ _1: } }() func() { - if (_pLater.X4) != 0 && (_pLater.X6) <= i32(0) { + if _pLater.X4 != 0 && _pLater.X6 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58849), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000))), unsafe.Pointer(str(9154))) crt.X__builtin_abort(tls) } }() - if (_pLater.X4) != 0 { + if _pLater.X4 != 0 { _unlockBtreeMutex(tls, _pLater) } _pLater = (*XBtree)(_pLater.X9) @@ -11295,7 +11917,7 @@ _14: if _pLater == nil { goto _17 } - if (_pLater.X6) != 0 { + if _pLater.X6 != 0 { _lockBtreeMutex(tls, _pLater) } _pLater = (*XBtree)(_pLater.X9) @@ -11303,23 +11925,25 @@ _14: _17: } -// Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another -// thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. +// C comment +// /* +// ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another +// ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. +// */ func Xsqlite3_mutex_try(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) { var _rc int32 _rc = i32(0) if _p != nil { func() { - if (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X5)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X5) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_tryØ00__func__Ø000))), unsafe.Pointer(str(9194))) crt.X__builtin_abort(tls) } }() - return (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X5)})))(tls, _p) + return func() func(*crt.TLS, *Xsqlite3_mutex) int32 { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X5 + return *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&v)) + }()(tls, _p) } return _rc } @@ -11336,8 +11960,11 @@ func init() { crt.Xstrncpy(nil, &_btreeLockCarefullyØ00__func__Ø000[0], str(9248), 19) } -// Release the BtShared mutex associated with B-Tree handle p and -// clear the p->locked boolean. +// C comment +// /* +// ** Release the BtShared mutex associated with B-Tree handle p and +// ** clear the p->locked boolean. +// */ func _unlockBtreeMutex(tls *crt.TLS, _p *XBtree) { var _pBt *XBtShared _pBt = (*XBtShared)(_p.X1) @@ -11366,7 +11993,7 @@ func _unlockBtreeMutex(tls *crt.TLS, _p *XBtree) { } }() Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pBt.X21)) - *(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X4)) = uint8(i32(0)) } var _unlockBtreeMutexØ00__func__Ø000 [17]int8 @@ -11375,9 +12002,12 @@ func init() { crt.Xstrncpy(nil, &_unlockBtreeMutexØ00__func__Ø000[0], str(9326), 17) } -// Obtain the BtShared mutex associated with B-Tree handle p. Also, -// set BtShared.db to the database handle associated with p and the -// p->locked boolean to true. +// C comment +// /* +// ** Obtain the BtShared mutex associated with B-Tree handle p. Also, +// ** set BtShared.db to the database handle associated with p and the +// ** p->locked boolean to true. +// */ func _lockBtreeMutex(tls *crt.TLS, _p *XBtree) { func() { if int32(_p.X4) != i32(0) { @@ -11399,7 +12029,7 @@ func _lockBtreeMutex(tls *crt.TLS, _p *XBtree) { }() Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtShared)(_p.X1).X1))))) = (*Xsqlite3)(_p.X0) - *(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X4)) = uint8(i32(1)) } var _lockBtreeMutexØ00__func__Ø000 [15]int8 @@ -11408,17 +12038,20 @@ func init() { crt.Xstrncpy(nil, &_lockBtreeMutexØ00__func__Ø000[0], str(9393), 15) } -// Table *p is a virtual table. This function removes the VTable object -// for table *p associated with database connection db from the linked -// list in p->pVTab. It also decrements the VTable ref count. This is -// used when closing database connection db to free all of its VTable -// objects without disturbing the rest of the Schema object (which may -// be being used by other shared-cache connections). +// C comment +// /* +// ** Table *p is a virtual table. This function removes the VTable object +// ** for table *p associated with database connection db from the linked +// ** list in p->pVTab. It also decrements the VTable ref count. This is +// ** used when closing database connection db to free all of its VTable +// ** objects without disturbing the rest of the Schema object (which may +// ** be being used by other shared-cache connections). +// */ func _sqlite3VtabDisconnect(tls *crt.TLS, _db *Xsqlite3, _p *XTable) { var _2_pVTab *XVTable var _ppVTab **XVTable func() { - if (_p.X16) == 0 { + if _p.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125207), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000))), unsafe.Pointer(str(9408))) crt.X__builtin_abort(tls) } @@ -11435,7 +12068,7 @@ func _sqlite3VtabDisconnect(tls *crt.TLS, _db *Xsqlite3, _p *XTable) { crt.X__builtin_abort(tls) } }() - _ppVTab = (**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) + _ppVTab = (**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X18)))) _6: if (*_ppVTab) == nil { goto _9 @@ -11457,10 +12090,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabDisconnectØ00__func__Ø000[0], str(9453), 22) } -// Return true if the current thread holds the database connection -// mutex and all required BtShared mutexes. -// -// This routine is used inside assert() statements only. +// C comment +// /* +// ** Return true if the current thread holds the database connection +// ** mutex and all required BtShared mutexes. +// ** +// ** This routine is used inside assert() statements only. +// */ func _sqlite3BtreeHoldsAllMutexes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _i int32 var _2_p *XBtree @@ -11469,11 +12105,11 @@ func _sqlite3BtreeHoldsAllMutexes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { } _i = i32(0) _1: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _4 } _2_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) - if ((_2_p != nil) && ((_2_p.X3) != 0)) && (((_2_p.X6) == i32(0)) || (Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_2_p.X1).X21)) == 0)) { + if ((_2_p != nil) && (_2_p.X3 != 0)) && ((_2_p.X6 == i32(0)) || (Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_2_p.X1).X21)) == 0)) { return i32(0) } _i += 1 @@ -11482,8 +12118,11 @@ _4: return i32(1) } -// Decrement the ref-count on a virtual table object. When the ref-count -// reaches zero, call the xDisconnect() method to delete the object. +// C comment +// /* +// ** Decrement the ref-count on a virtual table object. When the ref-count +// ** reaches zero, call the xDisconnect() method to delete the object. +// */ func _sqlite3VtabUnlock(tls *crt.TLS, _pVTab *XVTable) { var _db *Xsqlite3 var _1_p *Xsqlite3_vtab @@ -11495,28 +12134,29 @@ func _sqlite3VtabUnlock(tls *crt.TLS, _pVTab *XVTable) { } }() func() { - if (_pVTab.X3) <= i32(0) { + if _pVTab.X3 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000))), unsafe.Pointer(str(9478))) crt.X__builtin_abort(tls) } }() func() { - if (_db.X28) != u32(2687084183) && (_db.X28) != uint32(i32(1691352191)) { + if _db.X28 != u32(2687084183) && _db.X28 != uint32(i32(1691352191)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000))), unsafe.Pointer(str(9492))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pVTab.X3))) -= 1 - if (_pVTab.X3) != i32(0) { + *(*int32)(unsafe.Pointer(&_pVTab.X3)) -= 1 + if _pVTab.X3 != i32(0) { goto _7 } _1_p = (*Xsqlite3_vtab)(_pVTab.X2) if _1_p != nil { - (*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_module)(_1_p.X0).X4)})))(tls, _1_p) + func() func(*crt.TLS, *Xsqlite3_vtab) int32 { + v := (*Xsqlite3_module)(_1_p.X0).X4 + return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v)) + }()(tls, _1_p) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pVTab)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTab)) _7: } @@ -11526,28 +12166,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabUnlockØ00__func__Ø000[0], str(9555), 18) } -// Disconnect all the virtual table objects in the sqlite3.pDisconnect list. -// -// This function may only be called when the mutexes associated with all -// shared b-tree databases opened using connection db are held by the -// caller. This is done to protect the sqlite3.pDisconnect list. The -// sqlite3.pDisconnect list is accessed only as follows: -// -// 1) By this function. In this case, all BtShared mutexes and the mutex -// associated with the database handle itself must be held. -// -// 2) By function vtabDisconnectAll(), when it adds a VTable entry to -// the sqlite3.pDisconnect list. In this case either the BtShared mutex -// associated with the database the virtual table is stored in is held -// or, if the virtual table is stored in a non-sharable database, then -// the database handle mutex is held. -// -// As a result, a sqlite3.pDisconnect cannot be accessed simultaneously -// by multiple threads. It is thread-safe. +// C comment +// /* +// ** Disconnect all the virtual table objects in the sqlite3.pDisconnect list. +// ** +// ** This function may only be called when the mutexes associated with all +// ** shared b-tree databases opened using connection db are held by the +// ** caller. This is done to protect the sqlite3.pDisconnect list. The +// ** sqlite3.pDisconnect list is accessed only as follows: +// ** +// ** 1) By this function. In this case, all BtShared mutexes and the mutex +// ** associated with the database handle itself must be held. +// ** +// ** 2) By function vtabDisconnectAll(), when it adds a VTable entry to +// ** the sqlite3.pDisconnect list. In this case either the BtShared mutex +// ** associated with the database the virtual table is stored in is held +// ** or, if the virtual table is stored in a non-sharable database, then +// ** the database handle mutex is held. +// ** +// ** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously +// ** by multiple threads. It is thread-safe. +// */ func _sqlite3VtabUnlockList(tls *crt.TLS, _db *Xsqlite3) { var _p, _2_pNext *XVTable _p = (*XVTable)(_db.X68) - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X68))))) = nil + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X68)))) = nil func() { if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125246), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000))), unsafe.Pointer(str(9421))) @@ -11580,14 +12223,17 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabUnlockListØ00__func__Ø000[0], str(9573), 22) } -// Mark every prepared statement associated with a database connection -// as expired. -// -// An expired statement means that recompilation of the statement is -// recommend. Statements expire when things happen that make their -// programs obsolete. Removing user-defined functions or collating -// sequences, or changing an authorization function are the types of -// things that make prepared statements obsolete. +// C comment +// /* +// ** Mark every prepared statement associated with a database connection +// ** as expired. +// ** +// ** An expired statement means that recompilation of the statement is +// ** recommend. Statements expire when things happen that make their +// ** programs obsolete. Removing user-defined functions or collating +// ** sequences, or changing an authorization function are the types of +// ** things that make prepared statements obsolete. +// */ func _sqlite3ExpirePreparedStatements(tls *crt.TLS, _db *Xsqlite3) { var _p *TVdbe _p = (*TVdbe)(_db.X1) @@ -11595,7 +12241,7 @@ _0: if _p == nil { goto _3 } - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) _p = (*TVdbe)(_p.X2) goto _0 _3: @@ -11618,7 +12264,7 @@ func _btreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) { }() _i = i32(0) _2: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _5 } _p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -11636,7 +12282,10 @@ func init() { crt.Xstrncpy(nil, &_btreeLeaveAllØ00__func__Ø000[0], str(9595), 14) } -// Exit the recursive mutex on a Btree. +// C comment +// /* +// ** Exit the recursive mutex on a Btree. +// */ func _sqlite3BtreeLeave(tls *crt.TLS, _p *XBtree) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 { @@ -11644,17 +12293,17 @@ func _sqlite3BtreeLeave(tls *crt.TLS, _p *XBtree) { crt.X__builtin_abort(tls) } }() - if (_p.X3) == 0 { + if _p.X3 == 0 { goto _2 } func() { - if (_p.X6) <= i32(0) { + if _p.X6 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58869), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000))), unsafe.Pointer(str(9609))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X6))) -= 1 - if (_p.X6) == i32(0) { + *(*int32)(unsafe.Pointer(&_p.X6)) -= 1 + if _p.X6 == i32(0) { _unlockBtreeMutex(tls, _p) } _2: @@ -11666,36 +12315,42 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeLeaveØ00__func__Ø000[0], str(9625), 18) } -// Invoke the xRollback method of all virtual tables in the -// sqlite3.aVTrans array. Then clear the array itself. +// C comment +// /* +// ** Invoke the xRollback method of all virtual tables in the +// ** sqlite3.aVTrans array. Then clear the array itself. +// */ func _sqlite3VtabRollback(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { _callFinaliser(tls, _db, int32(u64(136))) return i32(0) } -// This function invokes either the xRollback or xCommit method -// of each of the virtual tables in the sqlite3.aVTrans array. The method -// called is identified by the second argument, "offset", which is -// the offset of the method to call in the sqlite3_module structure. -// -// The array is cleared after invoking the callbacks. +// C comment +// /* +// ** This function invokes either the xRollback or xCommit method +// ** of each of the virtual tables in the sqlite3.aVTrans array. The method +// ** called is identified by the second argument, "offset", which is +// ** the offset of the method to call in the sqlite3_module structure. +// ** +// ** The array is cleared after invoking the callbacks. +// */ func _callFinaliser(tls *crt.TLS, _db *Xsqlite3, _offset int32) { var _i int32 var _2_pVTab *XVTable var _2_p *Xsqlite3_vtab var _1_aVTrans **XVTable var _3_x func(*crt.TLS, *Xsqlite3_vtab) int32 - if (**XVTable)(unsafe.Pointer(_db.X67)) == nil { + if _db.X67 == nil { goto _0 } _1_aVTrans = (**XVTable)(unsafe.Pointer(_db.X67)) - *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = nil + *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_db.X67)))) = nil _i = i32(0) _1: - if _i >= (_db.X64) { + if _i >= _db.X64 { goto _4 } - _2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aVTrans)) + 8*uintptr(_i))) + _2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aVTrans)) + 8*uintptr(_i))) _2_p = (*Xsqlite3_vtab)(_2_pVTab.X2) if _2_p == nil { goto _5 @@ -11705,18 +12360,21 @@ _1: _3_x(tls, _2_p) } _5: - *(*int32)(unsafe.Pointer(&(_2_pVTab.X5))) = i32(0) + *(*int32)(unsafe.Pointer(&_2_pVTab.X5)) = i32(0) _sqlite3VtabUnlock(tls, _2_pVTab) _i += 1 goto _1 _4: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_aVTrans)) - *(*int32)(unsafe.Pointer(&(_db.X64))) = i32(0) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aVTrans)) + *(*int32)(unsafe.Pointer(&_db.X64)) = i32(0) _0: } -// Return TRUE if database connection db has unfinalized prepared -// statements or unfinished sqlite3_backup objects. +// C comment +// /* +// ** Return TRUE if database connection db has unfinalized prepared +// ** statements or unfinished sqlite3_backup objects. +// */ func _connectionIsBusy(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _j int32 var _1_pBt *XBtree @@ -11726,12 +12384,12 @@ func _connectionIsBusy(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (*TVdbe)(_db.X1) != nil { + if _db.X1 != nil { return i32(1) } _j = i32(0) _3: - if _j >= (_db.X5) { + if _j >= _db.X5 { goto _6 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_j))).X1) @@ -11763,7 +12421,7 @@ func _sqlite3BtreeIsInBackup(tls *crt.TLS, _p *XBtree) (r0 int32) { crt.X__builtin_abort(tls) } }() - return bool2int((_p.X7) != i32(0)) + return bool2int(_p.X7 != i32(0)) } var _sqlite3BtreeIsInBackupØ00__func__Ø000 [23]int8 @@ -11772,25 +12430,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeIsInBackupØ00__func__Ø000[0], str(9662), 23) } -// Set the most recent error code and error string for the sqlite -// handle "db". The error code is set to "err_code". -// -// If it is not NULL, string zFormat specifies the format of the -// error string in the style of the printf functions: The following -// format characters are allowed: -// -// %s Insert a string -// %z A string that should be freed after use -// %d Insert an integer -// %T Insert a token -// %S Insert the first element of a SrcList -// -// zFormat and any string tokens that follow it are assumed to be -// encoded in UTF-8. -// -// To clear the most recent error for sqlite handle "db", sqlite3Error -// should be called with err_code set to SQLITE_OK and zFormat set -// to NULL. +// C comment +// /* +// ** Set the most recent error code and error string for the sqlite +// ** handle "db". The error code is set to "err_code". +// ** +// ** If it is not NULL, string zFormat specifies the format of the +// ** error string in the style of the printf functions: The following +// ** format characters are allowed: +// ** +// ** %s Insert a string +// ** %z A string that should be freed after use +// ** %d Insert an integer +// ** %T Insert a token +// ** %S Insert the first element of a SrcList +// ** +// ** zFormat and any string tokens that follow it are assumed to be +// ** encoded in UTF-8. +// ** +// ** To clear the most recent error for sqlite handle "db", sqlite3Error +// ** should be called with err_code set to SQLITE_OK and zFormat set +// ** to NULL. +// */ func _sqlite3ErrorWithMsg(tls *crt.TLS, _db *Xsqlite3, _err_code int32, _zFormat *int8, args ...interface{}) { var _2_z *int8 var _2_ap []interface{} @@ -11800,19 +12461,20 @@ func _sqlite3ErrorWithMsg(tls *crt.TLS, _db *Xsqlite3, _err_code int32, _zFormat crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_db.X10))) = _err_code + *(*int32)(unsafe.Pointer(&_db.X10)) = _err_code _sqlite3SystemError(tls, _db, _err_code) if _zFormat == nil { _sqlite3Error(tls, _db, _err_code) goto _5 } - if ((*XMem)(_db.X56) != nil) || (store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X56))))), _sqlite3ValueNew(tls, _db)) != nil) { + if (_db.X56 != nil) || (store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X56)))), _sqlite3ValueNew(tls, _db)) != nil) { _2_ap = args _2_z = _sqlite3VMPrintf(tls, _db, _zFormat, _2_ap) _2_ap = nil - _sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), (unsafe.Pointer)(_2_z), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), unsafe.Pointer(_2_z), uint8(i32(1)), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } _5: } @@ -11823,19 +12485,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ErrorWithMsgØ00__func__Ø000[0], str(9685), 20) } -// Create a new sqlite3_value object. +// C comment +// /* +// ** Create a new sqlite3_value object. +// */ func _sqlite3ValueNew(tls *crt.TLS, _db *Xsqlite3) (r0 *XMem) { var _p *XMem _p = (*XMem)(_sqlite3DbMallocZero(tls, _db, u64(72))) if _p != nil { - *(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(1)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _db + *(*uint16)(unsafe.Pointer(&_p.X1)) = uint16(i32(1)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = _db } return _p } -// Allocate and zero memory. If the allocation fails, make -// the mallocFailed flag in the connection pointer. +// C comment +// /* +// ** Allocate and zero memory. If the allocation fails, make +// ** the mallocFailed flag in the connection pointer. +// */ func _sqlite3DbMallocZero(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) { var _p unsafe.Pointer _p = _sqlite3DbMallocRaw(tls, _db, _n) @@ -11845,19 +12513,25 @@ func _sqlite3DbMallocZero(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Poi return _p } -// Change the string value of an sqlite3_value object +// C comment +// /* +// ** Change the string value of an sqlite3_value object +// */ func _sqlite3ValueSetStr(tls *crt.TLS, _v *XMem, _n int32, _z unsafe.Pointer, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) { if _v != nil { _sqlite3VdbeMemSetStr(tls, _v, (*int8)(_z), _n, _enc, _xDel) } } -// Close the mutex on database connection db. -// -// Furthermore, if database connection db is a zombie (meaning that there -// has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and -// every sqlite3_stmt has now been finalized and every sqlite3_backup has -// finished, then free all resources. +// C comment +// /* +// ** Close the mutex on database connection db. +// ** +// ** Furthermore, if database connection db is a zombie (meaning that there +// ** has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and +// ** every sqlite3_stmt has now been finalized and every sqlite3_backup has +// ** finished, then free all resources. +// */ func _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) { var _j int32 var _2_pDb *XDb @@ -11865,7 +12539,7 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) { var _6_pNext, _6_p *XFuncDef var _8_pColl *XCollSeq var _11_pMod *XModule - if ((_db.X28) != uint32(i32(1691352191))) || _connectionIsBusy(tls, _db) != 0 { + if (_db.X28 != uint32(i32(1691352191))) || _connectionIsBusy(tls, _db) != 0 { Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return } @@ -11873,40 +12547,40 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) { _sqlite3CloseSavepoints(tls, _db) _j = i32(0) _2: - if _j >= (_db.X5) { + if _j >= _db.X5 { goto _5 } _2_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_j))) - if (*XBtree)(_2_pDb.X1) == nil { + if _2_pDb.X1 == nil { goto _6 } _sqlite3BtreeClose(tls, (*XBtree)(_2_pDb.X1)) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pDb.X1))))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pDb.X1)))) = nil if _j != i32(1) { - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pDb.X4))))) = nil + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pDb.X4)))) = nil } _6: _j += 1 goto _2 _5: - if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4) != nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X4) != nil { _sqlite3SchemaClear(tls, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4) } _sqlite3VtabUnlockList(tls, _db) _sqlite3CollapseDatabaseArray(tls, _db) func() { - if (_db.X5) > i32(2) { + if _db.X5 > i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141633), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9705))) crt.X__builtin_abort(tls) } }() func() { - if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) { + if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9716))) crt.X__builtin_abort(tls) } }() - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X69))).X2) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_db.X69)).X2) _13: if _i == nil { goto _16 @@ -11915,7 +12589,7 @@ _13: _17: _functionDestroy(tls, _db, _6_p) _6_pNext = (*XFuncDef)(_6_p.X3) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_6_p)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_6_p)) _6_p = _6_pNext if _6_p != nil { goto _17 @@ -11923,8 +12597,8 @@ _17: _i = (*XHashElem)(_i.X0) goto _13 _16: - _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X69)))) - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X70))).X2) + _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&_db.X69))) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_db.X70)).X2) _18: if _i == nil { goto _21 @@ -11935,57 +12609,60 @@ _22: if _j >= i32(3) { goto _25 } - if ((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl)) + 40*uintptr(_j))).X4) != nil { - ((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl)) + 40*uintptr(_j))).X4)(tls, (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl))+40*uintptr(_j))).X2) + if ((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pColl)) + 40*uintptr(_j))).X4) != nil { + ((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pColl)) + 40*uintptr(_j))).X4)(tls, (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pColl))+40*uintptr(_j))).X2) } _j += 1 goto _22 _25: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_8_pColl)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_8_pColl)) _i = (*XHashElem)(_i.X0) goto _18 _21: - _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X70)))) - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X65))).X2) + _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&_db.X70))) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_db.X65)).X2) _27: if _i == nil { goto _30 } _11_pMod = (*XModule)(_i.X2) - if (_11_pMod.X3) != nil { - (_11_pMod.X3)(tls, _11_pMod.X2) + if _11_pMod.X3 != nil { + _11_pMod.X3(tls, _11_pMod.X2) } _sqlite3VtabEponymousTableClear(tls, _db, _11_pMod) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_11_pMod)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_11_pMod)) _i = (*XHashElem)(_i.X0) goto _27 _30: - _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X65)))) + _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&_db.X65))) _sqlite3Error(tls, _db, i32(0)) _sqlite3ValueFree(tls, (*XMem)(_db.X56)) _sqlite3CloseExtensions(tls, _db) - *(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(3040180528) + *(*uint32)(unsafe.Pointer(&_db.X28)) = u32(3040180528) _sqlite3DbFree(tls, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(2671521075) + *(*uint32)(unsafe.Pointer(&_db.X28)) = u32(2671521075) Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_db.X3)) func() { - if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) != i32(0) { + if ((*t7)(unsafe.Pointer(&_db.X58)).X3) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9739))) crt.X__builtin_abort(tls) } }() - if ((*t7)(unsafe.Pointer(&(_db.X58))).X2) != 0 { - Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&(_db.X58))).X7) + if ((*t7)(unsafe.Pointer(&_db.X58)).X2) != 0 { + Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&_db.X58)).X7) } - Xsqlite3_free(tls, (unsafe.Pointer)(_db)) + Xsqlite3_free(tls, unsafe.Pointer(_db)) } -// Rollback all database files. If tripCode is not SQLITE_OK, then -// any write cursors are invalidated ("tripped" - as in "tripping a circuit -// breaker") and made to return tripCode if there are any further -// attempts to use that cursor. Read cursors remain open and valid -// but are "saved" in case the table pages are moved around. +// C comment +// /* +// ** Rollback all database files. If tripCode is not SQLITE_OK, then +// ** any write cursors are invalidated ("tripped" - as in "tripping a circuit +// ** breaker") and made to return tripCode if there are any further +// ** attempts to use that cursor. Read cursors remain open and valid +// ** but are "saved" in case the table pages are moved around. +// */ func _sqlite3RollbackAll(tls *crt.TLS, _db *Xsqlite3, _tripCode int32) { var _i, _inTrans, _schemaChange int32 var _1_p *XBtree @@ -11998,10 +12675,10 @@ func _sqlite3RollbackAll(tls *crt.TLS, _db *Xsqlite3, _tripCode int32) { }() _sqlite3BeginBenignMalloc(tls) _sqlite3BtreeEnterAll(tls, _db) - _schemaChange = bool2int((((_db.X6) & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0))) + _schemaChange = bool2int(((_db.X6 & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0))) _i = i32(0) _3: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _6 } _1_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -12018,20 +12695,20 @@ _7: _6: _sqlite3VtabRollback(tls, _db) _sqlite3EndBenignMalloc(tls) - if (((_db.X6) & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0)) { + if ((_db.X6 & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0)) { _sqlite3ExpirePreparedStatements(tls, _db) _sqlite3ResetAllSchemasOfConnection(tls, _db) } _sqlite3BtreeLeaveAll(tls, _db) - *(*int64)(unsafe.Pointer(&(_db.X77))) = int64(i32(0)) - *(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_db.X77)) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_db.X78)) = int64(i32(0)) { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-33554433) sink1(*p) } - if ((_db.X48) != nil) && (_inTrans != 0 || ((_db.X15) == 0)) { - (_db.X48)(tls, _db.X47) + if (_db.X48 != nil) && (_inTrans != 0 || (_db.X15 == 0)) { + _db.X48(tls, _db.X47) } } @@ -12041,7 +12718,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RollbackAllØ00__func__Ø000[0], str(9761), 19) } -// Return non-zero if a transaction is active. +// C comment +// /* +// ** Return non-zero if a transaction is active. +// */ func _sqlite3BtreeIsInTrans(tls *crt.TLS, _p *XBtree) (r0 int32) { func() { if _p != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 { @@ -12058,15 +12738,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeIsInTransØ00__func__Ø000[0], str(9821), 22) } -// Rollback the transaction in progress. -// -// If tripCode is not SQLITE_OK then cursors will be invalidated (tripped). -// Only write cursors are tripped if writeOnly is true but all cursors are -// tripped if writeOnly is false. Any attempt to use -// a tripped cursor will result in an error. -// -// This will release the write lock on the database file. If there -// are no active cursors, it also releases the read lock. +// C comment +// /* +// ** Rollback the transaction in progress. +// ** +// ** If tripCode is not SQLITE_OK then cursors will be invalidated (tripped). +// ** Only write cursors are tripped if writeOnly is true but all cursors are +// ** tripped if writeOnly is false. Any attempt to use +// ** a tripped cursor will result in an error. +// ** +// ** This will release the write lock on the database file. If there +// ** are no active cursors, it also releases the read lock. +// */ func _sqlite3BtreeRollback(tls *crt.TLS, _p *XBtree, _tripCode int32, _writeOnly int32) (r0 int32) { var _rc, _3_rc2, _4_rc2, _6_nPage int32 var _pBt *XBtShared @@ -12142,7 +12825,7 @@ _9: if _6_nPage == i32(0) { _sqlite3PagerPagecount(tls, (*XPager)(_pBt.X0), &_6_nPage) } - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(_6_nPage) + *(*uint32)(unsafe.Pointer(&_pBt.X18)) = uint32(_6_nPage) _releasePage(tls, _pPage1) _24: func() { @@ -12151,7 +12834,7 @@ _24: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pBt.X8))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pBt.X8)) = uint8(i32(1)) _btreeClearHasContent(tls, _pBt) _20: _btreeEndTransaction(tls, _p) @@ -12165,25 +12848,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeRollbackØ00__func__Ø000[0], str(10133), 21) } -// Save the positions of all cursors (except pExcept) that are open on -// the table with root-page iRoot. "Saving the cursor position" means that -// the location in the btree is remembered in such a way that it can be -// moved back to the same spot after the btree has been modified. This -// routine is called just before cursor pExcept is used to modify the -// table, for example in BtreeDelete() or BtreeInsert(). -// -// If there are two or more cursors on the same btree, then all such -// cursors should have their BTCF_Multiple flag set. The btreeCursor() -// routine enforces that rule. This routine only needs to be called in -// the uncommon case when pExpect has the BTCF_Multiple flag set. -// -// If pExpect!=NULL and if no other cursors are found on the same root-page, -// then the BTCF_Multiple flag on pExpect is cleared, to avoid another -// pointless call to this routine. -// -// Implementation note: This routine merely checks to see if any cursors -// need to be saved. It calls out to saveCursorsOnList() in the (unusual) -// event that cursors are in need to being saved. +// C comment +// /* +// ** Save the positions of all cursors (except pExcept) that are open on +// ** the table with root-page iRoot. "Saving the cursor position" means that +// ** the location in the btree is remembered in such a way that it can be +// ** moved back to the same spot after the btree has been modified. This +// ** routine is called just before cursor pExcept is used to modify the +// ** table, for example in BtreeDelete() or BtreeInsert(). +// ** +// ** If there are two or more cursors on the same btree, then all such +// ** cursors should have their BTCF_Multiple flag set. The btreeCursor() +// ** routine enforces that rule. This routine only needs to be called in +// ** the uncommon case when pExpect has the BTCF_Multiple flag set. +// ** +// ** If pExpect!=NULL and if no other cursors are found on the same root-page, +// ** then the BTCF_Multiple flag on pExpect is cleared, to avoid another +// ** pointless call to this routine. +// ** +// ** Implementation note: This routine merely checks to see if any cursors +// ** need to be saved. It calls out to saveCursorsOnList() in the (unusual) +// ** event that cursors are in need to being saved. +// */ func _saveAllCursors(tls *crt.TLS, _pBt *XBtShared, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) { var _p *XBtCursor func() { @@ -12203,7 +12889,7 @@ _5: if _p == nil { goto _8 } - if (_p != _pExcept) && ((uint32(i32(0)) == _iRoot) || ((_p.X7) == _iRoot)) { + if (_p != _pExcept) && ((uint32(i32(0)) == _iRoot) || (_p.X7 == _iRoot)) { goto _8 } _p = (*XBtCursor)(_p.X2) @@ -12214,7 +12900,7 @@ _8: } if _pExcept != nil { { - p := (*uint8)(unsafe.Pointer(&(_pExcept.X10))) + p := (*uint8)(unsafe.Pointer(&_pExcept.X10)) *p = uint8(int32(*p) & i32(-33)) sink2(*p) } @@ -12228,14 +12914,16 @@ func init() { crt.Xstrncpy(nil, &_saveAllCursorsØ00__func__Ø000[0], str(10186), 15) } -// This helper routine to saveAllCursors does the actual work of saving -// the cursors if and when a cursor is found that actually requires saving. -// The common case is that no cursors need to be saved, so this routine is -// broken out from its caller to avoid unnecessary stack pointer movement. +// C comment +// /* This helper routine to saveAllCursors does the actual work of saving +// ** the cursors if and when a cursor is found that actually requires saving. +// ** The common case is that no cursors need to be saved, so this routine is +// ** broken out from its caller to avoid unnecessary stack pointer movement. +// */ func _saveCursorsOnList(tls *crt.TLS, _p *XBtCursor, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) { var _3_rc int32 _0: - if _p == _pExcept || uint32(i32(0)) != _iRoot && (_p.X7) != _iRoot { + if _p == _pExcept || uint32(i32(0)) != _iRoot && _p.X7 != _iRoot { goto _3 } if int32(_p.X12) != i32(1) && int32(_p.X12) != i32(2) { @@ -12257,11 +12945,14 @@ _3: return i32(0) } -// Save the current cursor position in the variables BtCursor.nKey -// and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK. -// -// The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) -// prior to calling this routine. +// C comment +// /* +// ** Save the current cursor position in the variables BtCursor.nKey +// ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK. +// ** +// ** The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) +// ** prior to calling this routine. +// */ func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc int32 func() { @@ -12271,7 +12962,7 @@ func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() func() { - if unsafe.Pointer(nil) != (_pCur.X6) { + if unsafe.Pointer(nil) != _pCur.X6 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59695), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(10261))) crt.X__builtin_abort(tls) } @@ -12283,18 +12974,18 @@ func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() if int32(_pCur.X12) == i32(2) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(1)) goto _8 } - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0) + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(0) _8: _rc = _saveCursorKey(tls, _pCur) if _rc == i32(0) { _btreeReleaseAllCursorPages(tls, _pCur) - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(3)) } { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-15)) sink2(*p) } @@ -12311,17 +13002,20 @@ func _cursorHoldsMutex(tls *crt.TLS, _p *XBtCursor) (r0 int32) { return Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) } -// The cursor passed as the only argument must point to a valid entry -// when this function is called (i.e. have eState==CURSOR_VALID). This -// function saves the current cursor key in variables pCur->nKey and -// pCur->pKey. SQLITE_OK is returned if successful or an SQLite error -// code otherwise. -// -// If the cursor is open on an intkey table, then the integer key -// (the rowid) is stored in pCur->nKey and pCur->pKey is left set to -// NULL. If the cursor is open on a non-intkey table, then pCur->pKey is -// set to point to a malloced buffer pCur->nKey bytes in size containing -// the key. +// C comment +// /* +// ** The cursor passed as the only argument must point to a valid entry +// ** when this function is called (i.e. have eState==CURSOR_VALID). This +// ** function saves the current cursor key in variables pCur->nKey and +// ** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error +// ** code otherwise. +// ** +// ** If the cursor is open on an intkey table, then the integer key +// ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to +// ** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is +// ** set to point to a malloced buffer pCur->nKey bytes in size containing +// ** the key. +// */ func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc int32 var _2_pKey unsafe.Pointer @@ -12333,7 +13027,7 @@ func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() func() { - if unsafe.Pointer(nil) != (_pCur.X6) { + if unsafe.Pointer(nil) != _pCur.X6 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59658), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10261))) crt.X__builtin_abort(tls) } @@ -12344,18 +13038,18 @@ func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pCur.X15) != 0 { - *(*int64)(unsafe.Pointer(&(_pCur.X5))) = _sqlite3BtreeIntegerKey(tls, _pCur) + if _pCur.X15 != 0 { + *(*int64)(unsafe.Pointer(&_pCur.X5)) = _sqlite3BtreeIntegerKey(tls, _pCur) goto _7 } - *(*int64)(unsafe.Pointer(&(_pCur.X5))) = int64(_sqlite3BtreePayloadSize(tls, _pCur)) + *(*int64)(unsafe.Pointer(&_pCur.X5)) = int64(_sqlite3BtreePayloadSize(tls, _pCur)) _2_pKey = _sqlite3Malloc(tls, uint64(_pCur.X5)) if _2_pKey == nil { goto _8 } _rc = _sqlite3BtreePayload(tls, _pCur, uint32(i32(0)), uint32(int32(_pCur.X5)), _2_pKey) if _rc == i32(0) { - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = _2_pKey + *(*unsafe.Pointer)(unsafe.Pointer(&_pCur.X6)) = _2_pKey goto _10 } Xsqlite3_free(tls, _2_pKey) @@ -12366,7 +13060,7 @@ _8: _11: _7: func() { - if (_pCur.X15) != 0 && (_pCur.X6) != nil { + if _pCur.X15 != 0 && _pCur.X6 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59680), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10344))) crt.X__builtin_abort(tls) } @@ -12380,10 +13074,13 @@ func init() { crt.Xstrncpy(nil, &_saveCursorKeyØ00__func__Ø000[0], str(10376), 14) } -// Return the value of the integer key or "rowid" for a table btree. -// This routine is only valid for a cursor that is pointing into a -// ordinary table btree. If the cursor points to an index btree or -// is invalid, the result of this routine is undefined. +// C comment +// /* +// ** Return the value of the integer key or "rowid" for a table btree. +// ** This routine is only valid for a cursor that is pointing into a +// ** ordinary table btree. If the cursor points to an index btree or +// ** is invalid, the result of this routine is undefined. +// */ func _sqlite3BtreeIntegerKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) { func() { if _cursorHoldsMutex(tls, _pCur) == 0 { @@ -12398,13 +13095,13 @@ func _sqlite3BtreeIntegerKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) { } }() func() { - if (_pCur.X15) == 0 { + if _pCur.X15 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63394), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000))), unsafe.Pointer(str(10417))) crt.X__builtin_abort(tls) } }() _getCellInfo(tls, _pCur) - return (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0 + return (*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0 } var _sqlite3BtreeIntegerKeyØ00__func__Ø000 [23]int8 @@ -12415,14 +13112,14 @@ func init() { func _getCellInfo(tls *crt.TLS, _pCur *XBtCursor) { var _1_iPage int32 - if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) == i32(0) { + if int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4) == i32(0) { _1_iPage = int32(_pCur.X14) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(2)) sink2(*p) } - _btreeParseCell(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_1_iPage))), int32(_pCur.X16), (*XCellInfo)(unsafe.Pointer(&(_pCur.X4)))) + _btreeParseCell(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_1_iPage))), int32(_pCur.X16), (*XCellInfo)(unsafe.Pointer(&_pCur.X4))) goto _1 } _assertCellInfo(tls, _pCur) @@ -12430,19 +13127,20 @@ _1: } func _btreeParseCell(tls *crt.TLS, _pPage *XMemPage, _iCell int32, _pInfo *XCellInfo) { - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(1))))))))), _pInfo) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(1))))))))), _pInfo) } func _assertCellInfo(tls *crt.TLS, _pCur *XBtCursor) { var _iPage int32 var _info XCellInfo _iPage = int32(_pCur.X14) - crt.Xmemset(tls, (unsafe.Pointer)(&_info), i32(0), u64(24)) - _btreeParseCell(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_iPage))), int32(_pCur.X16), &_info) + crt.Xmemset(tls, unsafe.Pointer(&_info), i32(0), u64(24)) + _btreeParseCell(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_iPage))), int32(_pCur.X16), &_info) func() { - if (_sqlite3Config.X6) != i32(0) && crt.Xmemcmp(tls, (unsafe.Pointer)(&_info), (unsafe.Pointer)((*XCellInfo)(unsafe.Pointer(&(_pCur.X4)))), u64(24)) != i32(0) { + if _sqlite3Config.X6 != i32(0) && crt.Xmemcmp(tls, unsafe.Pointer(&_info), unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&_pCur.X4))), u64(24)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63355), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertCellInfoØ00__func__Ø000))), unsafe.Pointer(str(10456))) crt.X__builtin_abort(tls) } @@ -12456,13 +13154,16 @@ func init() { crt.Xstrncpy(nil, &_assertCellInfoØ00__func__Ø000[0], str(10514), 15) } -// Return the number of bytes of payload for the entry that pCur is -// currently pointing to. For table btrees, this will be the amount -// of data. For index btrees, this will be the size of the key. -// -// 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. +// C comment +// /* +// ** Return the number of bytes of payload for the entry that pCur is +// ** currently pointing to. For table btrees, this will be the amount +// ** of data. For index btrees, this will be the size of the key. +// ** +// ** 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 _sqlite3BtreePayloadSize(tls *crt.TLS, _pCur *XBtCursor) (r0 uint32) { func() { if _cursorHoldsMutex(tls, _pCur) == 0 { @@ -12477,7 +13178,7 @@ func _sqlite3BtreePayloadSize(tls *crt.TLS, _pCur *XBtCursor) (r0 uint32) { } }() _getCellInfo(tls, _pCur) - return (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X2 + return (*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X2 } var _sqlite3BtreePayloadSizeØ00__func__Ø000 [24]int8 @@ -12486,21 +13187,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreePayloadSizeØ00__func__Ø000[0], str(10529), 24) } -// Read part of the payload for the row at which that cursor pCur is currently -// pointing. "amt" bytes will be transferred into pBuf[]. The transfer -// begins at "offset". -// -// pCur can be pointing to either a table or an index b-tree. -// If pointing to a table btree, then the content section is read. If -// pCur is pointing to an index b-tree then the key section is read. -// -// For sqlite3BtreePayload(), the caller must ensure that pCur is pointing -// to a valid row in the table. For sqlite3BtreePayloadChecked(), the -// cursor might be invalid or might need to be restored before being read. -// -// Return SQLITE_OK on success or an error code if anything goes -// wrong. An error is returned if "offset+amt" is larger than -// the available payload. +// C comment +// /* +// ** Read part of the payload for the row at which that cursor pCur is currently +// ** pointing. "amt" bytes will be transferred into pBuf[]. The transfer +// ** begins at "offset". +// ** +// ** pCur can be pointing to either a table or an index b-tree. +// ** If pointing to a table btree, then the content section is read. If +// ** pCur is pointing to an index b-tree then the key section is read. +// ** +// ** For sqlite3BtreePayload(), the caller must ensure that pCur is pointing +// ** to a valid row in the table. For sqlite3BtreePayloadChecked(), the +// ** cursor might be invalid or might need to be restored before being read. +// ** +// ** Return SQLITE_OK on success or an error code if anything goes +// ** wrong. An error is returned if "offset+amt" is larger than +// ** the available payload. +// */ func _sqlite3BtreePayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) { func() { if _cursorHoldsMutex(tls, _pCur) == 0 { @@ -12515,13 +13219,13 @@ func _sqlite3BtreePayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt u } }() func() { - if int32(_pCur.X14) < i32(0) || (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) == nil { + if int32(_pCur.X14) < i32(0) || (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63757), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000))), unsafe.Pointer(str(10553))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) { + if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63758), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000))), unsafe.Pointer(str(10597))) crt.X__builtin_abort(tls) } @@ -12535,33 +13239,36 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreePayloadØ00__func__Ø000[0], str(10639), 20) } -// This function is used to read or overwrite payload information -// for the entry that the pCur cursor is pointing to. The eOp -// argument is interpreted as follows: -// -// 0: The operation is a read. Populate the overflow cache. -// 1: The operation is a write. Populate the overflow cache. -// -// A total of "amt" bytes are read or written beginning at "offset". -// Data is read to or from the buffer pBuf. -// -// The content being read or written might appear on the main page -// or be scattered out on multiple overflow pages. -// -// If the current cursor entry uses one or more overflow pages -// this function may allocate space for and lazily populate -// the overflow page-list cache array (BtCursor.aOverflow). -// Subsequent calls use this cache to make seeking to the supplied offset -// more efficient. -// -// Once an overflow page-list cache has been allocated, it must be -// invalidated if some other cursor writes to the same table, or if -// the cursor is moved to a different row. Additionally, in auto-vacuum -// mode, the following events may invalidate an overflow page-list cache. -// -// * An incremental vacuum, -// * A commit in auto_vacuum="full" mode, -// * Creating a table (may require moving an overflow page). +// C comment +// /* +// ** This function is used to read or overwrite payload information +// ** for the entry that the pCur cursor is pointing to. The eOp +// ** argument is interpreted as follows: +// ** +// ** 0: The operation is a read. Populate the overflow cache. +// ** 1: The operation is a write. Populate the overflow cache. +// ** +// ** A total of "amt" bytes are read or written beginning at "offset". +// ** Data is read to or from the buffer pBuf. +// ** +// ** The content being read or written might appear on the main page +// ** or be scattered out on multiple overflow pages. +// ** +// ** If the current cursor entry uses one or more overflow pages +// ** this function may allocate space for and lazily populate +// ** the overflow page-list cache array (BtCursor.aOverflow). +// ** Subsequent calls use this cache to make seeking to the supplied offset +// ** more efficient. +// ** +// ** Once an overflow page-list cache has been allocated, it must be +// ** invalidated if some other cursor writes to the same table, or if +// ** the cursor is moved to a different row. Additionally, in auto-vacuum +// ** mode, the following events may invalidate an overflow page-list cache. +// ** +// ** * An incremental vacuum, +// ** * A commit in auto_vacuum="full" mode, +// ** * Creating a table (may require moving an overflow page). +// */ func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf *uint8, _eOp int32) (r0 int32) { var _rc, _iIdx, _2_a, _6_nOvfl, _16_a int32 var _5_ovflSize, _5_nextPage uint32 @@ -12572,7 +13279,7 @@ func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, var _pPage *XMemPage _rc = i32(0) _iIdx = i32(0) - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) _pBt = (*XBtShared)(_pCur.X1) func() { if _pPage == nil { @@ -12605,9 +13312,9 @@ func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, } }() _getCellInfo(tls, _pCur) - _aPayload = (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1 + _aPayload = (*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X1 func() { - if (_offset + _amt) > ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X2) { + if (_offset + _amt) > ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63576), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10704))) crt.X__builtin_abort(tls) } @@ -12618,21 +13325,21 @@ func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, crt.X__builtin_abort(tls) } }() - if uint64(int64((uintptr(unsafe.Pointer(_aPayload))-uintptr(unsafe.Pointer(_pPage.X19)))/1)) > uint64((_pBt.X16)-uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)) { + if uint64(int64((uintptr(unsafe.Pointer(_aPayload))-uintptr(unsafe.Pointer(_pPage.X19)))/1)) > uint64(_pBt.X16-uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3)) { return _sqlite3CorruptError(tls, i32(63585)) } - if _offset >= uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) { + if _offset >= uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) { goto _16 } _2_a = int32(_amt) - if (uint32(_2_a) + _offset) > uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) { - _2_a = int32(uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) - _offset) + if (uint32(_2_a) + _offset) > uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) { + _2_a = int32(uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) - _offset) } - _rc = _copyPayload(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr(_offset)))), (unsafe.Pointer)(_pBuf), _2_a, _eOp, (*XPgHdr)(_pPage.X23)) + _rc = _copyPayload(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPayload))+1*uintptr(_offset)))), unsafe.Pointer(_pBuf), _2_a, _eOp, (*XPgHdr)(_pPage.X23)) _offset = uint32(i32(0)) { p := &_pBuf - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_2_a))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_2_a))) sink13(*p) } { @@ -12644,40 +13351,40 @@ func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _16: { p := &_offset - *p = (*p) - uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) + *p = (*p) - uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) sink5(*p) } _18: if _rc != i32(0) || _amt <= uint32(i32(0)) { goto _20 } - _5_ovflSize = (_pBt.X16) - uint32(i32(4)) - _5_nextPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)))) + _5_ovflSize = _pBt.X16 - uint32(i32(4)) + _5_nextPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPayload))+1*uintptr((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3)))) if (int32(_pCur.X10) & i32(4)) != i32(0) { goto _21 } - _6_nOvfl = int32((((((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X2) - uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)) + _5_ovflSize) - uint32(i32(1))) / _5_ovflSize) - if _6_nOvfl <= (_pCur.X8) { + _6_nOvfl = int32((((((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X2) - uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3)) + _5_ovflSize) - uint32(i32(1))) / _5_ovflSize) + if _6_nOvfl <= _pCur.X8 { goto _22 } - _7_aNew = (*uint32)(_sqlite3Realloc(tls, (unsafe.Pointer)(_pCur.X3), uint64(_6_nOvfl*i32(2))*u64(4))) + _7_aNew = (*uint32)(_sqlite3Realloc(tls, unsafe.Pointer(_pCur.X3), uint64(_6_nOvfl*i32(2))*u64(4))) if _7_aNew == nil { return _sqlite3NomemError(tls, i32(63623)) } - *(*int32)(unsafe.Pointer(&(_pCur.X8))) = _6_nOvfl * i32(2) - *(**uint32)(unsafe.Pointer(&(_pCur.X3))) = _7_aNew + *(*int32)(unsafe.Pointer(&_pCur.X8)) = _6_nOvfl * i32(2) + *(**uint32)(unsafe.Pointer(&_pCur.X3)) = _7_aNew _22: - crt.Xmemset(tls, (unsafe.Pointer)(_pCur.X3), i32(0), uint64(_6_nOvfl)*u64(4)) + crt.Xmemset(tls, unsafe.Pointer(_pCur.X3), i32(0), uint64(_6_nOvfl)*u64(4)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } goto _25 _21: - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_offset/_5_ovflSize)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_offset/_5_ovflSize)))) != 0 { _iIdx = int32(_offset / _5_ovflSize) - _5_nextPage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx))) + _5_nextPage = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx))) _offset = _offset % _5_ovflSize } _25: @@ -12692,12 +13399,12 @@ _30: goto _31 } func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx)))) != uint32(i32(0)) && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx)))) != _5_nextPage && (_sqlite3Config.X6) != i32(0) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx)))) != uint32(i32(0)) && (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx)))) != _5_nextPage && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63646), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10785))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx))) = _5_nextPage + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx))) = _5_nextPage if _offset < _5_ovflSize { goto _36 } @@ -12713,8 +13420,8 @@ _30: crt.X__builtin_abort(tls) } }() - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx+i32(1))))) != 0 { - _5_nextPage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx+i32(1)))) + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx+i32(1))))) != 0 { + _5_nextPage = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCur.X3)) + 4*uintptr(_iIdx+i32(1)))) goto _42 } _rc = _getOverflowPage(tls, _pBt, _5_nextPage, nil, &_5_nextPage) @@ -12739,7 +13446,7 @@ _36: if _rc == i32(0) { _aPayload = (*uint8)(_sqlite3PagerGetData(tls, _18_pDbPage)) _5_nextPage = _sqlite3Get4byte(tls, _aPayload) - _rc = _copyPayload(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr(_offset+uint32(i32(4)))))), (unsafe.Pointer)(_pBuf), _16_a, _eOp, _18_pDbPage) + _rc = _copyPayload(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPayload))+1*uintptr(_offset+uint32(i32(4)))))), unsafe.Pointer(_pBuf), _16_a, _eOp, _18_pDbPage) _sqlite3PagerUnref(tls, _18_pDbPage) _offset = uint32(i32(0)) } @@ -12753,7 +13460,7 @@ _36: } { p := &_pBuf - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_16_a))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_16_a))) sink13(*p) } _43: @@ -12780,15 +13487,18 @@ func _sqlite3CorruptError(tls *crt.TLS, _lineno int32) (r0 int32) { return _reportError(tls, i32(11), _lineno, str(10931)) } -// Copy data from a buffer to a page, or from a page to a buffer. -// -// pPayload is a pointer to data stored on database page pDbPage. -// If argument eOp is false, then nByte bytes of data are copied -// from pPayload to the buffer pointed at by pBuf. If eOp is true, -// then sqlite3PagerWrite() is called on pDbPage and nByte bytes -// of data are copied from the buffer pBuf to pPayload. -// -// SQLITE_OK is returned on success, otherwise an error code. +// C comment +// /* +// ** Copy data from a buffer to a page, or from a page to a buffer. +// ** +// ** pPayload is a pointer to data stored on database page pDbPage. +// ** If argument eOp is false, then nByte bytes of data are copied +// ** from pPayload to the buffer pointed at by pBuf. If eOp is true, +// ** then sqlite3PagerWrite() is called on pDbPage and nByte bytes +// ** of data are copied from the buffer pBuf to pPayload. +// ** +// ** SQLITE_OK is returned on success, otherwise an error code. +// */ func _copyPayload(tls *crt.TLS, _pPayload unsafe.Pointer, _pBuf unsafe.Pointer, _nByte int32, _eOp int32, _pDbPage *XPgHdr) (r0 int32) { var _1_rc int32 if _eOp == 0 { @@ -12806,18 +13516,21 @@ _2: return i32(0) } -// Mark a data page as writeable. This routine must be called before -// making changes to a page. The caller must check the return value -// of this function and be careful not to change any page data unless -// this routine returns SQLITE_OK. -// -// The difference between this function and pager_write() is that this -// function also deals with the special case where 2 or more pages -// fit on a single disk sector. In this case all co-resident pages -// must have been written to the journal file before returning. -// -// If an error occurs, SQLITE_NOMEM or an IO error code is returned -// as appropriate. Otherwise, SQLITE_OK. +// C comment +// /* +// ** Mark a data page as writeable. This routine must be called before +// ** making changes to a page. The caller must check the return value +// ** of this function and be careful not to change any page data unless +// ** this routine returns SQLITE_OK. +// ** +// ** The difference between this function and pager_write() is that this +// ** function also deals with the special case where 2 or more pages +// ** fit on a single disk sector. In this case all co-resident pages +// ** must have been written to the journal file before returning. +// ** +// ** If an error occurs, SQLITE_NOMEM or an IO error code is returned +// ** as appropriate. Otherwise, SQLITE_OK. +// */ func _sqlite3PagerWrite(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _pPager *XPager _pPager = (*XPager)(_pPg.X4) @@ -12839,19 +13552,19 @@ func _sqlite3PagerWrite(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (int32(_pPg.X6)&i32(4)) == i32(0) || (_pPager.X22) < (_pPg.X5) { + if (int32(_pPg.X6)&i32(4)) == i32(0) || _pPager.X22 < _pPg.X5 { goto _7 } - if (_pPager.X38) != 0 { + if _pPager.X38 != 0 { return _subjournalPageIfRequired(tls, _pPg) } return i32(0) _7: - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return _pPager.X26 } - if (_pPager.X47) > uint32(_pPager.X48) { + if _pPager.X47 > uint32(_pPager.X48) { func() { if int32(_pPager.X10) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52998), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000))), unsafe.Pointer(str(11043))) @@ -12869,12 +13582,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerWriteØ00__func__Ø000[0], str(11063), 18) } -// Usage: -// -// assert( assert_pager_state(pPager) ); -// -// This function runs many asserts to try to find inconsistencies in -// the internal state of the Pager object. +// C comment +// /* +// ** Usage: +// ** +// ** assert( assert_pager_state(pPager) ); +// ** +// ** This function runs many asserts to try to find inconsistencies in +// ** the internal state of the Pager object. +// */ func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) { var _pPager *XPager _pPager = _p @@ -12891,13 +13607,13 @@ func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) { } }() func() { - if int32(_p.X10) != i32(0) && (_pPager.X16) == 0 { + if int32(_p.X10) != i32(0) && _pPager.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47783), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11338))) crt.X__builtin_abort(tls) } }() func() { - if int32(_p.X2) != i32(2) && (_p.X3) == 0 { + if int32(_p.X2) != i32(2) && _p.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47788), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11380))) crt.X__builtin_abort(tls) } @@ -12908,7 +13624,7 @@ func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { func() { if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X31).X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47800), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11492))) @@ -12916,7 +13632,7 @@ func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) { } }() func() { - if (_p.X4) == 0 { + if _p.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47801), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11507))) crt.X__builtin_abort(tls) } @@ -12973,19 +13689,19 @@ func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) { _39: func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47817), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47818), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) && (_pPager.X10) == 0 { + if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47819), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11781))) crt.X__builtin_abort(tls) } @@ -12993,7 +13709,7 @@ _39: goto _46 _40: func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47823), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -13019,7 +13735,7 @@ _41: } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47830), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -13033,19 +13749,19 @@ _41: }() } func() { - if (_pPager.X22) != (_pPager.X23) { + if _pPager.X22 != _pPager.X23 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47834), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11912))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X23) != (_pPager.X24) { + if _pPager.X23 != _pPager.X24 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47835), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11947))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X23) != (_pPager.X25) { + if _pPager.X23 != _pPager.X25 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47836), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11986))) crt.X__builtin_abort(tls) } @@ -13065,7 +13781,7 @@ _42: } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47842), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -13085,13 +13801,13 @@ _42: }() } func() { - if (_pPager.X23) != (_pPager.X24) { + if _pPager.X23 != _pPager.X24 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47855), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11947))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X23) != (_pPager.X25) { + if _pPager.X23 != _pPager.X25 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47856), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11986))) crt.X__builtin_abort(tls) } @@ -13105,7 +13821,7 @@ _43: } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47861), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -13129,7 +13845,7 @@ _43: } }() func() { - if (_pPager.X23) > (_pPager.X25) { + if _pPager.X23 > _pPager.X25 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47868), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12214))) crt.X__builtin_abort(tls) } @@ -13143,7 +13859,7 @@ _44: } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47873), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -13163,13 +13879,13 @@ _44: goto _46 _45: func() { - if (_pPager.X26) == i32(0) { + if _pPager.X26 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47886), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12253))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) <= i32(0) && (_pPager.X10) == 0 { + if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) <= i32(0) && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47887), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12280))) crt.X__builtin_abort(tls) } @@ -13185,10 +13901,13 @@ func init() { crt.Xstrncpy(nil, &_assert_pager_stateØ00__func__Ø000[0], str(12341), 19) } -// Return the total number of references to all pages held by the cache. -// -// This is not the total number of pages referenced, but the sum of the -// reference count for all pages. +// C comment +// /* +// ** Return the total number of references to all pages held by the cache. +// ** +// ** This is not the total number of pages referenced, but the sum of the +// ** reference count for all pages. +// */ func _sqlite3PcacheRefCount(tls *crt.TLS, _pCache *XPCache) (r0 int32) { return _pCache.X3 } @@ -13200,13 +13919,16 @@ func _subjournalPageIfRequired(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { return i32(0) } -// Return true if it is necessary to write page *pPg into the sub-journal. -// A page needs to be written into the sub-journal if there exists one -// or more open savepoints for which: -// -// * The page-number is less than or equal to PagerSavepoint.nOrig, and -// * The bit corresponding to the page-number is not set in -// PagerSavepoint.pInSavepoint. +// C comment +// /* +// ** Return true if it is necessary to write page *pPg into the sub-journal. +// ** A page needs to be written into the sub-journal if there exists one +// ** or more open savepoints for which: +// ** +// ** * The page-number is less than or equal to PagerSavepoint.nOrig, and +// ** * The bit corresponding to the page-number is not set in +// ** PagerSavepoint.pInSavepoint. +// */ func _subjRequiresPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _i int32 var _pgno uint32 @@ -13216,11 +13938,11 @@ func _subjRequiresPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { _pgno = _pPg.X5 _i = i32(0) _0: - if _i >= (_pPager.X38) { + if _i >= _pPager.X38 { goto _3 } _p = (*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 48*uintptr(_i))) - if ((_p.X3) >= _pgno) && (i32(0) == _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_p.X2), _pgno)) { + if (_p.X3 >= _pgno) && (i32(0) == _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_p.X2), _pgno)) { return i32(1) } _i += 1 @@ -13229,9 +13951,12 @@ _3: return i32(0) } -// Check to see if the i-th bit is set. Return true or false. -// If p is NULL (if the bitmap has not been created) or if -// i is out of range, then return false. +// C comment +// /* +// ** Check to see if the i-th bit is set. Return true or false. +// ** If p is NULL (if the bitmap has not been created) or if +// ** i is out of range, then return false. +// */ func _sqlite3BitvecTestNotNull(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) { var _1_bin, _4_h uint32 func() { @@ -13241,30 +13966,30 @@ func _sqlite3BitvecTestNotNull(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) } }() _i -= 1 - if _i >= (_p.X0) { + if _i >= _p.X0 { return i32(0) } _2: - if (_p.X2) == 0 { + if _p.X2 == 0 { goto _4 } - _1_bin = _i / (_p.X2) - _i = _i % (_p.X2) - _p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin))) + _1_bin = _i / _p.X2 + _i = _i % _p.X2 + _p = *(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin))) if _p == nil { return i32(0) } goto _2 _4: if uint64(_p.X0) <= u64(3968) { - return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8)))))) & (i32(1) << uint(int32(_i&uint32(i32(7)))))) != i32(0)) + return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(_i/uint32(i32(8)))))) & (i32(1) << uint(int32(_i&uint32(i32(7)))))) != i32(0)) } _4_h = uint32(uint64(postInc5(&_i, uint32(1))*uint32(i32(1))) % u64(124)) _8: - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_4_h)))) == 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_4_h)))) == 0 { goto _9 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_4_h)))) == _i { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_4_h)))) == _i { return i32(1) } _4_h = uint32(uint64(_4_h+uint32(i32(1))) % u64(124)) @@ -13279,15 +14004,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BitvecTestNotNullØ00__func__Ø000[0], str(12360), 25) } -// Append a record of the current state of page pPg to the sub-journal. -// -// If successful, set the bit corresponding to pPg->pgno in the bitvecs -// for all open savepoints before returning. -// -// This function returns SQLITE_OK if everything is successful, an IO -// error code if the attempt to write to the sub-journal fails, or -// SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint -// bitvec. +// C comment +// /* +// ** Append a record of the current state of page pPg to the sub-journal. +// ** +// ** If successful, set the bit corresponding to pPg->pgno in the bitvecs +// ** for all open savepoints before returning. +// ** +// ** This function returns SQLITE_OK if everything is successful, an IO +// ** error code if the attempt to write to the sub-journal fails, or +// ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint +// ** bitvec. +// */ func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _rc int32 var _2_offset int64 @@ -13300,7 +14028,7 @@ func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { goto _0 } func() { - if (_pPager.X3) == 0 { + if _pPager.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51384), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12385))) crt.X__builtin_abort(tls) } @@ -13312,13 +14040,13 @@ func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { } }() func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) == nil && (_pPager.X29) != uint32(i32(0)) { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) == nil && _pPager.X29 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51386), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12447))) crt.X__builtin_abort(tls) } }() func() { - if (*XWal)(_pPager.X60) == nil && _pageInJournal(tls, _pPager, _pPg) == 0 && (_pPg.X5) <= (_pPager.X23) { + if (*XWal)(_pPager.X60) == nil && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.X5 <= _pPager.X23 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51387), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12490))) crt.X__builtin_abort(tls) } @@ -13328,18 +14056,18 @@ func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { goto _13 } _2_pData = _pPg.X1 - _2_offset = int64(_pPager.X29) * int64(i32(4)+(_pPager.X48)) + _2_offset = int64(_pPager.X29) * int64(i32(4)+_pPager.X48) _2_pData2 = (*int8)(_2_pData) _rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.X33), _2_offset, _pPg.X5) if _rc == i32(0) { - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X33), (unsafe.Pointer)(_2_pData2), _pPager.X48, _2_offset+int64(i32(4))) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X33), unsafe.Pointer(_2_pData2), _pPager.X48, _2_offset+int64(i32(4))) } _13: _0: if _rc == i32(0) { - *(*uint32)(unsafe.Pointer(&(_pPager.X29))) += 1 + *(*uint32)(unsafe.Pointer(&_pPager.X29)) += 1 func() { - if (_pPager.X38) <= i32(0) { + if _pPager.X38 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51415), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12572))) crt.X__builtin_abort(tls) } @@ -13355,7 +14083,10 @@ func init() { crt.Xstrncpy(nil, &_subjournalPageØ00__func__Ø000[0], str(12593), 15) } -// Return true if the page is already in the journal file. +// C comment +// /* +// ** Return true if the page is already in the journal file. +// */ func _pageInJournal(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr) (r0 int32) { return _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.X30), _pPg.X5) } @@ -13364,12 +14095,15 @@ func _sqlite3BitvecTest(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) { return bool2int((_p != nil) && _sqlite3BitvecTestNotNull(tls, _p, _i) != 0) } -// Ensure that the sub-journal file is open. If it is already open, this -// function is a no-op. -// -// SQLITE_OK is returned if everything goes according to plan. An -// SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() -// fails. +// C comment +// /* +// ** Ensure that the sub-journal file is open. If it is already open, this +// ** function is a no-op. +// ** +// ** SQLITE_OK is returned if everything goes according to plan. An +// ** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() +// ** fails. +// */ func _openSubJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _1_flags, _1_nStmtSpill int32 _rc = i32(0) @@ -13378,7 +14112,7 @@ func _openSubJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) { } _1_flags = i32(8222) _1_nStmtSpill = _sqlite3Config.X9 - if (int32(_pPager.X2) == i32(4)) || ((_pPager.X19) != 0) { + if (int32(_pPager.X2) == i32(4)) || (_pPager.X19 != 0) { _1_nStmtSpill = i32(-1) } _rc = _sqlite3JournalOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), nil, (*Xsqlite3_file)(_pPager.X33), _1_flags, _1_nStmtSpill) @@ -13386,50 +14120,57 @@ _0: return _rc } -// Open a journal file. -// -// The behaviour of the journal file depends on the value of parameter -// nSpill. If nSpill is 0, then the journal file is always create and -// accessed using the underlying VFS. If nSpill is less than zero, then -// all content is always stored in main-memory. Finally, if nSpill is a -// positive value, then the journal file is initially created in-memory -// but may be flushed to disk later on. In this case the journal file is -// flushed to disk either when it grows larger than nSpill bytes in size, -// or when sqlite3JournalCreate() is called. +// C comment +// /* +// ** Open a journal file. +// ** +// ** The behaviour of the journal file depends on the value of parameter +// ** nSpill. If nSpill is 0, then the journal file is always create and +// ** accessed using the underlying VFS. If nSpill is less than zero, then +// ** all content is always stored in main-memory. Finally, if nSpill is a +// ** positive value, then the journal file is initially created in-memory +// ** but may be flushed to disk later on. In this case the journal file is +// ** flushed to disk either when it grows larger than nSpill bytes in size, +// ** or when sqlite3JournalCreate() is called. +// */ func _sqlite3JournalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zName *int8, _pJfd *Xsqlite3_file, _flags int32, _nSpill int32) (r0 int32) { var _p *XMemJournal _p = (*XMemJournal)(unsafe.Pointer(_pJfd)) - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(88)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(88)) if _nSpill == i32(0) { return _sqlite3OsOpen(tls, _pVfs, _zName, _pJfd, _flags, nil) } if _nSpill > i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X1))) = _nSpill + *(*int32)(unsafe.Pointer(&_p.X1)) = _nSpill goto _2 } - *(*int32)(unsafe.Pointer(&(_p.X1))) = int32(u64(1016)) + *(*int32)(unsafe.Pointer(&_p.X1)) = int32(u64(1016)) func() { - if uint64(i32(1024)) != (u64(16) + uint64((_p.X1)-i32(8))) { + if uint64(i32(1024)) != (u64(16) + uint64(_p.X1-i32(8))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3JournalOpenØ00__func__Ø000))), unsafe.Pointer(str(12608))) crt.X__builtin_abort(tls) } }() _2: - *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = &_MemJournalMethods - *(*int32)(unsafe.Pointer(&(_p.X2))) = _nSpill - *(*int32)(unsafe.Pointer(&(_p.X7))) = _flags - *(**int8)(unsafe.Pointer(&(_p.X9))) = _zName - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pVfs + *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = &_MemJournalMethods + *(*int32)(unsafe.Pointer(&_p.X2)) = _nSpill + *(*int32)(unsafe.Pointer(&_p.X7)) = _flags + *(**int8)(unsafe.Pointer(&_p.X9)) = _zName + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X8)))) = _pVfs return i32(0) } -// The next group of routines are convenience wrappers around the -// VFS methods. +// C comment +// /* +// ** The next group of routines are convenience wrappers around the +// ** VFS methods. +// */ func _sqlite3OsOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pFlagsOut *int32) (r0 int32) { var _rc int32 - _rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32 - }{(_pVfs.X6)})))(tls, _pVfs, _zPath, _pFile, _flags&i32(556927), _pFlagsOut) + _rc = func() func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32 { + v := _pVfs.X6 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _zPath, _pFile, _flags&i32(556927), _pFlagsOut) func() { if _rc != i32(0) && (*Xsqlite3_io_methods)(_pFile.X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20292), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OsOpenØ00__func__Ø000))), unsafe.Pointer(str(12668))) @@ -13469,7 +14210,10 @@ func init() { }{_memjrnlFileSize})), X7: nil, X8: nil, X9: nil, X10: nil, X11: nil, X12: nil, X13: nil, X14: nil, X15: nil, X16: nil, X17: nil, X18: nil} } -// Close the file. +// C comment +// /* +// ** Close the file. +// */ func _memjrnlClose(tls *crt.TLS, _pJfd *Xsqlite3_file) (r0 int32) { var _p *XMemJournal _p = (*XMemJournal)(unsafe.Pointer(_pJfd)) @@ -13477,7 +14221,10 @@ func _memjrnlClose(tls *crt.TLS, _pJfd *Xsqlite3_file) (r0 int32) { return i32(0) } -// Free the list of FileChunk structures headed at MemJournal.pFirst. +// C comment +// /* +// ** Free the list of FileChunk structures headed at MemJournal.pFirst. +// */ func _memjrnlFreeChunks(tls *crt.TLS, _p *XMemJournal) { var _pIter, _pNext *XFileChunk _pIter = (*XFileChunk)(_p.X4) @@ -13486,15 +14233,18 @@ _0: goto _3 } _pNext = (*XFileChunk)(_pIter.X0) - Xsqlite3_free(tls, (unsafe.Pointer)(_pIter)) + Xsqlite3_free(tls, unsafe.Pointer(_pIter)) _pIter = _pNext goto _0 _3: - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = nil + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = nil } -// Read data from the in-memory journal file. This is the implementation -// of the sqlite3_vfs.xRead method. +// C comment +// /* +// ** Read data from the in-memory journal file. This is the implementation +// ** of the sqlite3_vfs.xRead method. +// */ func _memjrnlRead(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) { var _nRead, _iChunkOffset, _4_iSpace, _4_nCopy int32 var _1_iOff int64 @@ -13505,18 +14255,18 @@ func _memjrnlRead(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAm _zOut = (*uint8)(_zBuf) _nRead = _iAmt func() { - if (int64(_iAmt) + _iOfst) > ((*t23)(unsafe.Pointer(&(_p.X5))).X0) { + if (int64(_iAmt) + _iOfst) > ((*t23)(unsafe.Pointer(&_p.X5)).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88870), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12737))) crt.X__builtin_abort(tls) } }() func() { - if ((*t23)(unsafe.Pointer(&(_p.X6))).X0) != int64(i32(0)) && (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X6))).X1) == nil { + if ((*t23)(unsafe.Pointer(&_p.X6)).X0) != int64(i32(0)) && (*XFileChunk)((*t23)(unsafe.Pointer(&_p.X6)).X1) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88871), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12771))) crt.X__builtin_abort(tls) } }() - if ((*t23)(unsafe.Pointer(&(_p.X6))).X0) == _iOfst && _iOfst != int64(i32(0)) { + if ((*t23)(unsafe.Pointer(&_p.X6)).X0) == _iOfst && _iOfst != int64(i32(0)) { goto _6 } _1_iOff = i64(0) @@ -13544,7 +14294,7 @@ _7: _13: goto _14 _6: - _pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X6))).X1) + _pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&_p.X6)).X1) func() { if _pChunk == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88882), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12821))) @@ -13554,17 +14304,17 @@ _6: _14: _iChunkOffset = int32(_iOfst % int64(_p.X1)) _17: - _4_iSpace = (_p.X1) - _iChunkOffset + _4_iSpace = _p.X1 - _iChunkOffset _4_nCopy = func() int32 { - if _nRead < ((_p.X1) - _iChunkOffset) { + if _nRead < (_p.X1 - _iChunkOffset) { return _nRead } - return ((_p.X1) - _iChunkOffset) + return (_p.X1 - _iChunkOffset) }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_zOut), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&(_pChunk.X1)))))))+uintptr(_iChunkOffset)))), uint64(_4_nCopy)) + crt.Xmemcpy(tls, unsafe.Pointer(_zOut), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&_pChunk.X1))))))+uintptr(_iChunkOffset)))), uint64(_4_nCopy)) { p := &_zOut - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_4_nCopy))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_4_nCopy))) sink13(*p) } { @@ -13576,13 +14326,13 @@ _17: if ((_nRead >= i32(0)) && (store24(&_pChunk, (*XFileChunk)(_pChunk.X0)) != nil)) && (_nRead > i32(0)) { goto _17 } - *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X0))) = func() int64 { + *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X6)).X0))) = func() int64 { if _pChunk != nil { return (_iOfst + int64(_iAmt)) } return int64(i32(0)) }() - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X1))))) = _pChunk + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X6)).X1))))) = _pChunk return i32(0) } @@ -13592,7 +14342,10 @@ func init() { crt.Xstrncpy(nil, &_memjrnlReadØ00__func__Ø000[0], str(12831), 12) } -// Write data to the file. +// C comment +// /* +// ** Write data to the file. +// */ func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) { var _nWrite, _1_rc, _5_iChunkOffset, _5_iSpace int32 var _zWrite *uint8 @@ -13601,7 +14354,7 @@ func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iA _p = (*XMemJournal)(unsafe.Pointer(_pJfd)) _nWrite = _iAmt _zWrite = (*uint8)(_zBuf) - if (_p.X2) <= i32(0) || (int64(_iAmt)+_iOfst) <= int64(_p.X2) { + if _p.X2 <= i32(0) || (int64(_iAmt)+_iOfst) <= int64(_p.X2) { goto _1 } _1_rc = _memjrnlCreateFile(tls, _p) @@ -13612,7 +14365,7 @@ func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iA _1: func() { - if _iOfst != ((*t23)(unsafe.Pointer(&(_p.X5))).X0) && _iOfst != int64(i32(0)) { + if _iOfst != ((*t23)(unsafe.Pointer(&_p.X5)).X0) && _iOfst != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88982), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12843))) crt.X__builtin_abort(tls) } @@ -13627,46 +14380,46 @@ _10: if _nWrite <= i32(0) { goto _11 } - _5_pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X5))).X1) - _5_iChunkOffset = int32(((*t23)(unsafe.Pointer(&(_p.X5))).X0) % int64(_p.X1)) + _5_pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&_p.X5)).X1) + _5_iChunkOffset = int32(((*t23)(unsafe.Pointer(&_p.X5)).X0) % int64(_p.X1)) _5_iSpace = func() int32 { - if _nWrite < ((_p.X1) - _5_iChunkOffset) { + if _nWrite < (_p.X1 - _5_iChunkOffset) { return _nWrite } - return ((_p.X1) - _5_iChunkOffset) + return (_p.X1 - _5_iChunkOffset) }() if _5_iChunkOffset != i32(0) { goto _14 } - _6_pNew = (*XFileChunk)(Xsqlite3_malloc(tls, int32(u64(16)+uint64((_p.X1)-i32(8))))) + _6_pNew = (*XFileChunk)(Xsqlite3_malloc(tls, int32(u64(16)+uint64(_p.X1-i32(8))))) if _6_pNew == nil { return _sqlite3IoerrnomemError(tls, i32(89001)) } - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X0))))) = nil + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pNew.X0)))) = nil if _5_pChunk != nil { func() { - if (*XFileChunk)(_p.X4) == nil { + if _p.X4 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89005), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12906))) crt.X__builtin_abort(tls) } }() - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pChunk.X0))))) = _6_pNew + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pChunk.X0)))) = _6_pNew goto _19 } func() { - if (*XFileChunk)(_p.X4) != nil { + if _p.X4 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89008), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12916))) crt.X__builtin_abort(tls) } }() - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _6_pNew + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = _6_pNew _19: - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X1))))) = _6_pNew + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X5)).X1))))) = _6_pNew _14: - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&((*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X5))).X1).X1)))))))+uintptr(_5_iChunkOffset)))), (unsafe.Pointer)(_zWrite), uint64(_5_iSpace)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&((*XFileChunk)((*t23)(unsafe.Pointer(&_p.X5)).X1).X1)))))))+uintptr(_5_iChunkOffset)))), unsafe.Pointer(_zWrite), uint64(_5_iSpace)) { p := &_zWrite - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_5_iSpace))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_5_iSpace))) sink13(*p) } { @@ -13675,17 +14428,20 @@ _14: sink1(*p) } { - p := (*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X0))) + p := (*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X5)).X0))) *p = (*p) + int64(_5_iSpace) sink6(*p) } goto _10 _11: - *(*int32)(unsafe.Pointer(&(_p.X3))) = int32(int64(_iAmt) + _iOfst) + *(*int32)(unsafe.Pointer(&_p.X3)) = int32(int64(_iAmt) + _iOfst) return i32(0) } -// Flush the contents of memory to a real file on disk. +// C comment +// /* +// ** Flush the contents of memory to a real file on disk. +// */ func _memjrnlCreateFile(tls *crt.TLS, _p *XMemJournal) (r0 int32) { var _rc, _1_nChunk int32 var _1_iOff int64 @@ -13694,7 +14450,7 @@ func _memjrnlCreateFile(tls *crt.TLS, _p *XMemJournal) (r0 int32) { var _1_pIter *XFileChunk _pReal = (*Xsqlite3_file)(unsafe.Pointer(_p)) _copy = *_p - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(88)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(88)) _rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_copy.X8), _copy.X9, _pReal, _copy.X7, nil) if _rc != i32(0) { goto _0 @@ -13706,10 +14462,10 @@ _1: if _1_pIter == nil { goto _4 } - if (_1_iOff + int64(_1_nChunk)) > ((*t23)(unsafe.Pointer(&(_copy.X5))).X0) { - _1_nChunk = int32(((*t23)(unsafe.Pointer(&(_copy.X5))).X0) - _1_iOff) + if (_1_iOff + int64(_1_nChunk)) > ((*t23)(unsafe.Pointer(&_copy.X5)).X0) { + _1_nChunk = int32(((*t23)(unsafe.Pointer(&_copy.X5)).X0) - _1_iOff) } - _rc = _sqlite3OsWrite(tls, _pReal, (unsafe.Pointer)((*[8]uint8)(unsafe.Pointer(&(_1_pIter.X1)))), _1_nChunk, _1_iOff) + _rc = _sqlite3OsWrite(tls, _pReal, unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&_1_pIter.X1))), _1_nChunk, _1_iOff) if _rc != 0 { goto _4 } @@ -13733,21 +14489,26 @@ _0: } func _sqlite3OsWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X3)})))(tls, _id, _pBuf, _amt, _offset) -} - -// The following routines are convenience wrappers around methods -// of the sqlite3_file object. This is mostly just syntactic sugar. All -// of this would be completely automatic if SQLite were coded using -// C++ instead of plain old C. + return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X3 + return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _pBuf, _amt, _offset) +} + +// C comment +// /* +// ** The following routines are convenience wrappers around methods +// ** of the sqlite3_file object. This is mostly just syntactic sugar. All +// ** of this would be completely automatic if SQLite were coded using +// ** C++ instead of plain old C. +// */ func _sqlite3OsClose(tls *crt.TLS, _pId *Xsqlite3_file) { - if (*Xsqlite3_io_methods)(_pId.X0) != nil { - (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_pId.X0).X1)})))(tls, _pId) - *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pId.X0))))) = nil + if _pId.X0 != nil { + func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := (*Xsqlite3_io_methods)(_pId.X0).X1 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _pId) + *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pId.X0)))) = nil } } @@ -13757,9 +14518,12 @@ func init() { crt.Xstrncpy(nil, &_memjrnlWriteØ00__func__Ø000[0], str(12927), 13) } -// This version of the memory allocation is for use by the application. -// First make sure the memory subsystem is initialized, then do the -// allocation. +// C comment +// /* +// ** This version of the memory allocation is for use by the application. +// ** First make sure the memory subsystem is initialized, then do the +// ** allocation. +// */ func Xsqlite3_malloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) { if Xsqlite3_initialize(tls) != 0 { return nil @@ -13776,11 +14540,14 @@ func _sqlite3IoerrnomemError(tls *crt.TLS, _lineno int32) (r0 int32) { return _reportError(tls, i32(3082), _lineno, str(12940)) } -// Truncate the file. -// -// If the journal file is already on disk, truncate it there. Or, if it -// is still in main memory but is being truncated to zero bytes in size, -// ignore +// C comment +// /* +// ** Truncate the file. +// ** +// ** If the journal file is already on disk, truncate it there. Or, if it +// ** is still in main memory but is being truncated to zero bytes in size, +// ** ignore +// */ func _memjrnlTruncate(tls *crt.TLS, _pJfd *Xsqlite3_file, _size int64) (r0 int32) { var _p *XMemJournal _p = (*XMemJournal)(unsafe.Pointer(_pJfd)) @@ -13795,11 +14562,11 @@ func _memjrnlTruncate(tls *crt.TLS, _pJfd *Xsqlite3_file, _size int64) (r0 int32 }() }() != 0 { _memjrnlFreeChunks(tls, _p) - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(0) - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X1))))) = nil - *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X0))) = int64(i32(0)) - *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X1))))) = nil - *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X0))) = int64(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(0) + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X5)).X1))))) = nil + *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X5)).X0))) = int64(i32(0)) + *(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X6)).X1))))) = nil + *(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&_p.X6)).X0))) = int64(i32(0)) } return i32(0) } @@ -13810,55 +14577,67 @@ func init() { crt.Xstrncpy(nil, &_memjrnlTruncateØ00__func__Ø000[0], str(12954), 16) } -// Sync the file. -// -// If the real file has been created, call its xSync method. Otherwise, -// syncing an in-memory journal is a no-op. +// C comment +// /* +// ** Sync the file. +// ** +// ** If the real file has been created, call its xSync method. Otherwise, +// ** syncing an in-memory journal is a no-op. +// */ func _memjrnlSync(tls *crt.TLS, _pJfd *Xsqlite3_file, _flags int32) (r0 int32) { _ = _flags return i32(0) } -// Query the size of the file in bytes. +// C comment +// /* +// ** Query the size of the file in bytes. +// */ func _memjrnlFileSize(tls *crt.TLS, _pJfd *Xsqlite3_file, _pSize *int64) (r0 int32) { var _p *XMemJournal _p = (*XMemJournal)(unsafe.Pointer(_pJfd)) - *_pSize = (*t23)(unsafe.Pointer(&(_p.X5))).X0 + *_pSize = (*t23)(unsafe.Pointer(&_p.X5)).X0 return i32(0) } -// Write a 32-bit integer into the given file descriptor. Return SQLITE_OK -// on success or an error code is something goes wrong. +// C comment +// /* +// ** Write a 32-bit integer into the given file descriptor. Return SQLITE_OK +// ** on success or an error code is something goes wrong. +// */ func _write32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _val uint32) (r0 int32) { var _ac [4]int8 _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&_ac)))), _val) - return _sqlite3OsWrite(tls, _fd, (unsafe.Pointer)(&_ac), i32(4), _offset) + return _sqlite3OsWrite(tls, _fd, unsafe.Pointer(&_ac), i32(4), _offset) _ = _ac panic(0) } func _sqlite3Put4byte(tls *crt.TLS, _p *uint8, _v uint32) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(_v >> uint(i32(24))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))) = uint8(_v >> uint(i32(16))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(2)))) = uint8(_v >> uint(i32(8))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(3)))) = uint8(_v) -} - -// Set the bit number pgno in the PagerSavepoint.pInSavepoint -// bitvecs of all open savepoints. Return SQLITE_OK if successful -// or SQLITE_NOMEM if a malloc failure occurs. + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(0)))) = uint8(_v >> uint(i32(24))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(1)))) = uint8(_v >> uint(i32(16))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(2)))) = uint8(_v >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(3)))) = uint8(_v) +} + +// C comment +// /* +// ** Set the bit number pgno in the PagerSavepoint.pInSavepoint +// ** bitvecs of all open savepoints. Return SQLITE_OK if successful +// ** or SQLITE_NOMEM if a malloc failure occurs. +// */ func _addToSavepointBitvecs(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 int32) { var _ii, _rc int32 var _1_p *XPagerSavepoint _rc = i32(0) _ii = i32(0) _0: - if _ii >= (_pPager.X38) { + if _ii >= _pPager.X38 { goto _3 } _1_p = (*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 48*uintptr(_ii))) - if _pgno <= (_1_p.X3) { + if _pgno <= _1_p.X3 { { p := &_rc *p = (*p) | _sqlite3BitvecSet(tls, (*XBitvec)(_1_p.X2), _pgno) @@ -13877,16 +14656,19 @@ _3: return _rc } -// Set the i-th bit. Return 0 on success and an error code if -// anything goes wrong. -// -// This routine might cause sub-bitmaps to be allocated. Failing -// to get the memory needed to hold the sub-bitmap is the only -// that can go wrong with an insert, assuming p and i are valid. -// -// The calling function must ensure that p is a valid Bitvec object -// and that the value for "i" is within range of the Bitvec object. -// Otherwise the behavior is undefined. +// C comment +// /* +// ** Set the i-th bit. Return 0 on success and an error code if +// ** anything goes wrong. +// ** +// ** This routine might cause sub-bitmaps to be allocated. Failing +// ** to get the memory needed to hold the sub-bitmap is the only +// ** that can go wrong with an insert, assuming p and i are valid. +// ** +// ** The calling function must ensure that p is a valid Bitvec object +// ** and that the value for "i" is within range of the Bitvec object. +// ** Otherwise the behavior is undefined. +// */ func _sqlite3BitvecSet(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) { var _8_rc int32 var _h, _1_bin, _8_j uint32 @@ -13901,39 +14683,39 @@ func _sqlite3BitvecSet(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) { } }() func() { - if _i > (_p.X0) { + if _i > _p.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(43882), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000))), unsafe.Pointer(str(12974))) crt.X__builtin_abort(tls) } }() _i -= 1 _5: - if uint64(_p.X0) <= u64(3968) || (_p.X2) == 0 { + if uint64(_p.X0) <= u64(3968) || _p.X2 == 0 { goto _6 } - _1_bin = _i / (_p.X2) - _i = _i % (_p.X2) - if (*(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin)))) != nil { + _1_bin = _i / _p.X2 + _i = _i % _p.X2 + if (*(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin)))) != nil { goto _8 } - *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin))) = _sqlite3BitvecCreate(tls, _p.X2) - if (*(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin)))) == nil { + *(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin))) = _sqlite3BitvecCreate(tls, _p.X2) + if (*(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin)))) == nil { return _sqlite3NomemError(tls, i32(43889)) } _8: - _p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin))) + _p = *(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin))) goto _5 _6: if uint64(_p.X0) <= u64(3968) { { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(_i/uint32(i32(8))))) *p = uint8(int32(*p) | (i32(1) << uint(int32(_i&uint32(i32(7)))))) sink2(*p) } return i32(0) } _h = uint32(uint64(postInc5(&_i, uint32(1))*uint32(i32(1))) % u64(124)) - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_h)))) != 0 { goto _11 } if uint64(_p.X1) < u64(123) { @@ -13941,14 +14723,14 @@ _6: } goto _bitvec_set_rehash _11: - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) == _i { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_h)))) == _i { return i32(0) } _h += 1 if uint64(_h) >= u64(124) { _h = uint32(i32(0)) } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_h)))) != 0 { goto _11 } _bitvec_set_rehash: @@ -13959,31 +14741,31 @@ _bitvec_set_rehash: if _8_aiValues == nil { return _sqlite3NomemError(tls, i32(43924)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_8_aiValues), (unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), u64(496)) - crt.Xmemset(tls, (unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), i32(0), u64(496)) - *(*uint32)(unsafe.Pointer(&(_p.X2))) = uint32(((uint64(_p.X0) + u64(62)) - uint64(i32(1))) / u64(62)) + crt.Xmemcpy(tls, unsafe.Pointer(_8_aiValues), unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3))))), u64(496)) + crt.Xmemset(tls, unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3))))), i32(0), u64(496)) + *(*uint32)(unsafe.Pointer(&_p.X2)) = uint32(((uint64(_p.X0) + u64(62)) - uint64(i32(1))) / u64(62)) _8_rc = _sqlite3BitvecSet(tls, _p, _i) _8_j = uint32(i32(0)) _20: if uint64(_8_j) >= u64(124) { goto _23 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aiValues)) + 4*uintptr(_8_j)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_aiValues)) + 4*uintptr(_8_j)))) != 0 { { p := &_8_rc - *p = (*p) | _sqlite3BitvecSet(tls, _p, *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aiValues)) + 4*uintptr(_8_j)))) + *p = (*p) | _sqlite3BitvecSet(tls, _p, *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_aiValues)) + 4*uintptr(_8_j)))) sink1(*p) } } _8_j += 1 goto _20 _23: - _sqlite3DbFree(tls, nil, (unsafe.Pointer)(_8_aiValues)) + _sqlite3DbFree(tls, nil, unsafe.Pointer(_8_aiValues)) return _8_rc _bitvec_set_end: - *(*uint32)(unsafe.Pointer(&(_p.X1))) += 1 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h))) = _i + *(*uint32)(unsafe.Pointer(&_p.X1)) += 1 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_h))) = _i return i32(0) } @@ -13993,15 +14775,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BitvecSetØ00__func__Ø000[0], str(12986), 17) } -// Create a new bitmap object able to handle bits between 0 and iSize, -// inclusive. Return a pointer to the new object. Return NULL if -// malloc fails. +// C comment +// /* +// ** Create a new bitmap object able to handle bits between 0 and iSize, +// ** inclusive. Return a pointer to the new object. Return NULL if +// ** malloc fails. +// */ func _sqlite3BitvecCreate(tls *crt.TLS, _iSize uint32) (r0 *XBitvec) { var _p *XBitvec i32(0) _p = (*XBitvec)(_sqlite3MallocZero(tls, u64(512))) if _p != nil { - *(*uint32)(unsafe.Pointer(&(_p.X0))) = _iSize + *(*uint32)(unsafe.Pointer(&_p.X0)) = _iSize } return _p } @@ -14012,15 +14797,18 @@ func init() { crt.Xstrncpy(nil, &_addToSavepointBitvecsØ00__func__Ø000[0], str(13003), 22) } -// This is a variant of sqlite3PagerWrite() that runs when the sector size -// is larger than the page size. SQLite makes the (reasonable) assumption that -// all bytes of a sector are written together by hardware. Hence, all bytes of -// a sector need to be journalled in case of a power loss in the middle of -// a write. -// -// Usually, the sector size is less than or equal to the page size, in which -// case pages can be individually written. This routine only runs in the -// exceptional case where the page size is smaller than the sector size. +// C comment +// /* +// ** This is a variant of sqlite3PagerWrite() that runs when the sector size +// ** is larger than the page size. SQLite makes the (reasonable) assumption that +// ** all bytes of a sector are written together by hardware. Hence, all bytes of +// ** a sector need to be journalled in case of a power loss in the middle of +// ** a write. +// ** +// ** Usually, the sector size is less than or equal to the page size, in which +// ** case pages can be individually written. This routine only runs in the +// ** exceptional case where the page size is smaller than the sector size. +// */ func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _rc, _nPage, _ii, _needSync int32 var _nPageCount, _pg1, _nPagePerSector, _4_pg uint32 @@ -14030,9 +14818,9 @@ func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { _nPage = i32(0) _needSync = i32(0) _pPager = (*XPager)(_pPg.X4) - _nPagePerSector = (_pPager.X47) / uint32(_pPager.X48) + _nPagePerSector = _pPager.X47 / uint32(_pPager.X48) func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52907), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } @@ -14044,14 +14832,14 @@ func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { } }() { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } - _pg1 = (((_pPg.X5) - uint32(i32(1))) & (^(_nPagePerSector - uint32(i32(1))))) + uint32(i32(1)) + _pg1 = ((_pPg.X5 - uint32(i32(1))) & (^(_nPagePerSector - uint32(i32(1))))) + uint32(i32(1)) _nPageCount = _pPager.X22 - if (_pPg.X5) > _nPageCount { - _nPage = int32(((_pPg.X5) - _pg1) + uint32(i32(1))) + if _pPg.X5 > _nPageCount { + _nPage = int32((_pPg.X5 - _pg1) + uint32(i32(1))) goto _7 } if ((_pg1 + _nPagePerSector) - uint32(i32(1))) > _nPageCount { @@ -14067,13 +14855,13 @@ _7: } }() func() { - if _pg1 > (_pPg.X5) { + if _pg1 > _pPg.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52926), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13076))) crt.X__builtin_abort(tls) } }() func() { - if (_pg1 + uint32(_nPage)) <= (_pPg.X5) { + if (_pg1 + uint32(_nPage)) <= _pPg.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52927), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13091))) crt.X__builtin_abort(tls) } @@ -14084,10 +14872,10 @@ _14: goto _18 } _4_pg = _pg1 + uint32(_ii) - if _4_pg != (_pPg.X5) && _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.X30), _4_pg) != 0 { + if _4_pg != _pPg.X5 && _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.X30), _4_pg) != 0 { goto _20 } - if _4_pg == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) { + if _4_pg == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1)) { goto _21 } _rc = _sqlite3PagerGet(tls, _pPager, _4_pg, &_4_pPage, i32(0)) @@ -14118,7 +14906,7 @@ _18: goto _28 } func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52958), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } @@ -14131,7 +14919,7 @@ _31: _12_pPage = _sqlite3PagerLookup(tls, _pPager, _pg1+uint32(_ii)) if _12_pPage != nil { { - p := (*uint16)(unsafe.Pointer(&(_12_pPage.X6))) + p := (*uint16)(unsafe.Pointer(&_12_pPage.X6)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -14148,7 +14936,7 @@ _28: } }() { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) & i32(-5)) sink2(*p) } @@ -14167,18 +14955,24 @@ func init() { _sqlite3PendingByte = i32(1073741824) } -// Dispatch all page fetch requests to the appropriate getter method. +// C comment +// /* Dispatch all page fetch requests to the appropriate getter method. +// */ func _sqlite3PagerGet(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) { - return (*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32 - }{(_pPager.X57)})))(tls, _pPager, _pgno, _ppPage, _flags) -} - -// Mark a single data page as writeable. The page is written into the -// main journal or sub-journal as required. If the page is written into -// one of the journals, the corresponding bit is set in the -// Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs -// of any open savepoints as appropriate. + return func() func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32 { + v := _pPager.X57 + return *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pPager, _pgno, _ppPage, _flags) +} + +// C comment +// /* +// ** Mark a single data page as writeable. The page is written into the +// ** main journal or sub-journal as required. If the page is written into +// ** one of the journals, the corresponding bit is set in the +// ** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs +// ** of any open savepoints as appropriate. +// */ func _pager_write(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _rc int32 var _pPager *XPager @@ -14197,7 +14991,7 @@ func _pager_write(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52814), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13293))) crt.X__builtin_abort(tls) } @@ -14244,7 +15038,7 @@ _10: crt.X__builtin_abort(tls) } }() - if (_pPg.X5) > (_pPager.X23) { + if _pPg.X5 > _pPager.X23 { goto _22 } _rc = _pagerAddPageToRollbackJournal(tls, _pPg) @@ -14255,7 +15049,7 @@ _10: _22: if int32(_pPager.X14) != i32(4) { { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -14263,15 +15057,15 @@ _22: _24: _19: { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) | i32(4)) sink14(*p) } - if (_pPager.X38) > i32(0) { + if _pPager.X38 > i32(0) { _rc = _subjournalPageIfRequired(tls, _pPg) } - if (_pPager.X22) < (_pPg.X5) { - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _pPg.X5 + if _pPager.X22 < _pPg.X5 { + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = _pPg.X5 } return _rc } @@ -14282,26 +15076,29 @@ func init() { crt.Xstrncpy(nil, &_pager_writeØ00__func__Ø000[0], str(13440), 12) } -// This function is called at the start of every write transaction. -// There must already be a RESERVED or EXCLUSIVE lock on the database -// file when this routine is called. -// -// Open the journal file for pager pPager and write a journal header -// to the start of it. If there are active savepoints, open the sub-journal -// as well. This function is only used when the journal file is being -// opened to write a rollback log for a transaction. It is not used -// when opening a hot journal file to roll it back. -// -// If the journal file is already open (as it may be in exclusive mode), -// then this function just writes a journal header to the start of the -// already open file. -// -// Whether or not the journal file is opened by this function, the -// Pager.pInJournal bitvec structure is allocated. -// -// Return SQLITE_OK if everything is successful. Otherwise, return -// SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or -// an IO error code if opening or writing the journal file fails. +// C comment +// /* +// ** This function is called at the start of every write transaction. +// ** There must already be a RESERVED or EXCLUSIVE lock on the database +// ** file when this routine is called. +// ** +// ** Open the journal file for pager pPager and write a journal header +// ** to the start of it. If there are active savepoints, open the sub-journal +// ** as well. This function is only used when the journal file is being +// ** opened to write a rollback log for a transaction. It is not used +// ** when opening a hot journal file to roll it back. +// ** +// ** If the journal file is already open (as it may be in exclusive mode), +// ** then this function just writes a journal header to the start of the +// ** already open file. +// ** +// ** Whether or not the journal file is opened by this function, the +// ** Pager.pInJournal bitvec structure is allocated. +// ** +// ** Return SQLITE_OK if everything is successful. Otherwise, return +// ** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or +// ** an IO error code if opening or writing the journal file fails. +// */ func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _5_flags, _5_nSpill int32 var _pVfs *Xsqlite3_vfs @@ -14326,7 +15123,7 @@ func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) { } }() if func() int32 { - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52597), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -14340,7 +15137,7 @@ func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) { if (*XWal)(_pPager.X60) != nil || int32(_pPager.X2) == i32(2) { goto _10 } - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = _sqlite3BitvecCreate(tls, _pPager.X22) + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X30)))) = _sqlite3BitvecCreate(tls, _pPager.X22) if (*XBitvec)(_pPager.X30) == nil { return _sqlite3NomemError(tls, i32(52602)) } @@ -14352,7 +15149,7 @@ func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) { goto _14 } _5_flags = i32(6) - if (_pPager.X10) != 0 { + if _pPager.X10 != 0 { { p := &_5_flags *p = (*p) | i32(4104) @@ -14381,16 +15178,16 @@ _14: }() _12: if _rc == i32(0) { - *(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0) - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0)) - *(*int64)(unsafe.Pointer(&(_pPager.X35))) = int64(i32(0)) + *(*int32)(unsafe.Pointer(&_pPager.X27)) = i32(0) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X17)) = uint8(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X35)) = int64(i32(0)) _rc = _writeJournalHdr(tls, _pPager) } _10: if _rc != i32(0) { _sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30)) - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X30)))) = nil goto _23 } func() { @@ -14399,7 +15196,7 @@ _10: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(3)) _23: return _rc } @@ -14410,31 +15207,36 @@ func init() { crt.Xstrncpy(nil, &_pager_open_journalØ00__func__Ø000[0], str(13547), 19) } -// Open an in-memory journal file. +// C comment +// /* +// ** Open an in-memory journal file. +// */ func _sqlite3MemJournalOpen(tls *crt.TLS, _pJfd *Xsqlite3_file) { _sqlite3JournalOpen(tls, nil, nil, _pJfd, i32(0), i32(-1)) } -// Verify that the database file has not be deleted or renamed out from -// under the pager. Return SQLITE_OK if the database is still were it ought -// to be on disk. Return non-zero (SQLITE_READONLY_DBMOVED or some other error -// code from sqlite3OsAccess()) if the database has gone missing. +// C comment +// /* Verify that the database file has not be deleted or renamed out from +// ** under the pager. Return SQLITE_OK if the database is still were it ought +// ** to be on disk. Return non-zero (SQLITE_READONLY_DBMOVED or some other error +// ** code from sqlite3OsAccess()) if the database has gone missing. +// */ func _databaseIsUnmoved(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _bHasMoved, _rc int32 _bHasMoved = i32(0) - if (_pPager.X10) != 0 { + if _pPager.X10 != 0 { return i32(0) } - if (_pPager.X22) == uint32(i32(0)) { + if _pPager.X22 == uint32(i32(0)) { return i32(0) } func() { - if (_pPager.X51) == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X51)) + 1*uintptr(i32(0))))) == 0 { + if _pPager.X51 == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPager.X51)) + 1*uintptr(i32(0))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51865), unsafe.Pointer((*int8)(unsafe.Pointer(&_databaseIsUnmovedØ00__func__Ø000))), unsafe.Pointer(str(13566))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(20), (unsafe.Pointer)(&_bHasMoved)) + _rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(20), unsafe.Pointer(&_bHasMoved)) if _rc == i32(12) { _rc = i32(0) goto _8 @@ -14452,31 +15254,38 @@ func init() { crt.Xstrncpy(nil, &_databaseIsUnmovedØ00__func__Ø000[0], str(13608), 18) } -// Use sqlite3OsFileControl() when we are doing something that might fail -// and we need to know about the failures. Use sqlite3OsFileControlHint() -// when simply tossing information over the wall to the VFS and we do not -// really care if the VFS receives and understands the information since it -// is only a hint and can be safely ignored. The sqlite3OsFileControlHint() -// routine has no return value since the return value would be meaningless. +// C comment +// /* +// ** Use sqlite3OsFileControl() when we are doing something that might fail +// ** and we need to know about the failures. Use sqlite3OsFileControlHint() +// ** when simply tossing information over the wall to the VFS and we do not +// ** really care if the VFS receives and understands the information since it +// ** is only a hint and can be safely ignored. The sqlite3OsFileControlHint() +// ** routine has no return value since the return value would be meaningless. +// */ func _sqlite3OsFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X10)})))(tls, _id, _op, _pArg) -} - -// The journal file must be open when this routine is called. A journal -// header (JOURNAL_HDR_SZ bytes) is written into the journal file at the -// current location. -// -// The format for the journal header is as follows: -// - 8 bytes: Magic identifying journal format. -// - 4 bytes: Number of records in journal, or -1 no-sync mode is on. -// - 4 bytes: Random number used for page hash. -// - 4 bytes: Initial database page count. -// - 4 bytes: Sector size used by the process that wrote this journal. -// - 4 bytes: Database page size. -// -// Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. + return func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X10 + return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _op, _pArg) +} + +// C comment +// /* +// ** The journal file must be open when this routine is called. A journal +// ** header (JOURNAL_HDR_SZ bytes) is written into the journal file at the +// ** current location. +// ** +// ** The format for the journal header is as follows: +// ** - 8 bytes: Magic identifying journal format. +// ** - 4 bytes: Number of records in journal, or -1 no-sync mode is on. +// ** - 4 bytes: Random number used for page hash. +// ** - 4 bytes: Initial database page count. +// ** - 4 bytes: Sector size used by the process that wrote this journal. +// ** - 4 bytes: Database page size. +// ** +// ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. +// */ func _writeJournalHdr(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _ii int32 var _nHeader, _nWrite uint32 @@ -14490,12 +15299,12 @@ func _writeJournalHdr(tls *crt.TLS, _pPager *XPager) (r0 int32) { crt.X__builtin_abort(tls) } }() - if _nHeader > (_pPager.X47) { + if _nHeader > _pPager.X47 { _nHeader = _pPager.X47 } _ii = i32(0) _3: - if _ii >= (_pPager.X38) { + if _ii >= _pPager.X38 { goto _6 } if ((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 48*uintptr(_ii))).X1) == int64(i32(0)) { @@ -14504,40 +15313,40 @@ _3: _ii += 1 goto _3 _6: - *(*int64)(unsafe.Pointer(&(_pPager.X35))) = store6((*int64)(unsafe.Pointer(&(_pPager.X34))), _journalHdrOffset(tls, _pPager)) + *(*int64)(unsafe.Pointer(&_pPager.X35)) = store6((*int64)(unsafe.Pointer(&_pPager.X34)), _journalHdrOffset(tls, _pPager)) func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X4) == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _pPager.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48380), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13646))) crt.X__builtin_abort(tls) } }() - if (((_pPager.X4) != 0) || (int32(_pPager.X2) == i32(4))) || (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))&i32(512)) != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_zHeader), (unsafe.Pointer)(&_aJournalMagic), u64(8)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(8)))))), u32(4294967295)) + if ((_pPager.X4 != 0) || (int32(_pPager.X2) == i32(4))) || (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))&i32(512)) != 0 { + crt.Xmemcpy(tls, unsafe.Pointer(_zHeader), unsafe.Pointer(&_aJournalMagic), u64(8)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(8)))))), u32(4294967295)) goto _14 } - crt.Xmemset(tls, (unsafe.Pointer)(_zHeader), i32(0), u64(12)) + crt.Xmemset(tls, unsafe.Pointer(_zHeader), i32(0), u64(12)) _14: - Xsqlite3_randomness(tls, int32(u64(4)), (unsafe.Pointer)((*uint32)(unsafe.Pointer(&(_pPager.X28))))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(12)))))), _pPager.X28) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(16)))))), _pPager.X23) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(20)))))), _pPager.X47) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(24)))))), uint32(_pPager.X48)) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u64(28))))), i32(0), uint64(_nHeader)-u64(28)) + Xsqlite3_randomness(tls, int32(u64(4)), unsafe.Pointer((*uint32)(unsafe.Pointer(&_pPager.X28)))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(12)))))), _pPager.X28) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(16)))))), _pPager.X23) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(20)))))), _pPager.X47) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(24)))))), uint32(_pPager.X48)) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHeader))+1*uintptr(u64(28))))), i32(0), uint64(_nHeader)-u64(28)) _nWrite = uint32(i32(0)) _15: - if _rc != i32(0) || _nWrite >= (_pPager.X47) { + if _rc != i32(0) || _nWrite >= _pPager.X47 { goto _19 } - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_zHeader), int32(_nHeader), _pPager.X34) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(_zHeader), int32(_nHeader), _pPager.X34) func() { - if (_pPager.X35) > (_pPager.X34) { + if _pPager.X35 > _pPager.X34 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48429), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13683))) crt.X__builtin_abort(tls) } }() { - p := (*int64)(unsafe.Pointer(&(_pPager.X34))) + p := (*int64)(unsafe.Pointer(&_pPager.X34)) *p = (*p) + int64(_nHeader) sink6(*p) } @@ -14557,19 +15366,22 @@ func init() { crt.Xstrncpy(nil, &_writeJournalHdrØ00__func__Ø000[0], str(13724), 16) } -// Return the offset of the sector boundary at or immediately -// following the value in pPager->journalOff, assuming a sector -// size of pPager->sectorSize bytes. -// -// i.e for a sector size of 512: -// -// Pager.journalOff Return value -// --------------------------------------- -// 0 0 -// 512 512 -// 100 512 -// 2000 2048 -// +// C comment +// /* +// ** Return the offset of the sector boundary at or immediately +// ** following the value in pPager->journalOff, assuming a sector +// ** size of pPager->sectorSize bytes. +// ** +// ** i.e for a sector size of 512: +// ** +// ** Pager.journalOff Return value +// ** --------------------------------------- +// ** 0 0 +// ** 512 512 +// ** 100 512 +// ** 2000 2048 +// ** +// */ func _journalHdrOffset(tls *crt.TLS, _pPager *XPager) (r0 int64) { var _offset, _c int64 _offset = i64(0) @@ -14605,9 +15417,10 @@ func init() { } func _sqlite3OsDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X12)})))(tls, _id) + return func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X12 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _id) } var _aJournalMagic [8]uint8 @@ -14616,7 +15429,10 @@ func init() { _aJournalMagic = [8]uint8{217, 213, 5, 249, 32, 161, 99, 215} } -// Return N random bytes. +// C comment +// /* +// ** Return N random bytes. +// */ func Xsqlite3_randomness(tls *crt.TLS, _N int32, _pBuf unsafe.Pointer) { var _2_i int32 var _t uint8 @@ -14630,22 +15446,22 @@ func Xsqlite3_randomness(tls *crt.TLS, _N int32, _pBuf unsafe.Pointer) { _mutex = _sqlite3MutexAlloc(tls, i32(5)) Xsqlite3_mutex_enter(tls, _mutex) if (_N <= i32(0)) || (_pBuf == nil) { - *(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_sqlite3Prng.X0)) = uint8(i32(0)) Xsqlite3_mutex_leave(tls, _mutex) return } - if (_sqlite3Prng.X0) != 0 { + if _sqlite3Prng.X0 != 0 { goto _3 } - *(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X1))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_sqlite3Prng.X2)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_sqlite3Prng.X1)) = uint8(i32(0)) _sqlite3OsRandomness(tls, Xsqlite3_vfs_find(tls, nil), i32(256), (*int8)(unsafe.Pointer(&_2_k))) _2_i = i32(0) _4: if _2_i >= i32(256) { goto _7 } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i))) = uint8(_2_i) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_2_i))) = uint8(_2_i) _2_i += 1 goto _4 _7: @@ -14655,17 +15471,17 @@ _8: goto _11 } { - p := (*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2))) - *p = uint8(int32(*p) + (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i)))) + int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_2_k)) + 1*uintptr(_2_i)))))) + p := (*uint8)(unsafe.Pointer(&_sqlite3Prng.X2)) + *p = uint8(int32(*p) + (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_2_i)))) + int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_2_k)) + 1*uintptr(_2_i)))))) sink2(*p) } - _t = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i))) = _t + _t = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X2))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X2))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_2_i))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_2_i))) = _t _2_i += 1 goto _8 _11: - *(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X0))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_sqlite3Prng.X0)) = uint8(i32(1)) _3: func() { if _N <= i32(0) { @@ -14674,21 +15490,21 @@ _3: } }() _14: - *(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X1))) += 1 - _t = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1))) + *(*uint8)(unsafe.Pointer(&_sqlite3Prng.X1)) += 1 + _t = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X1))) { - p := (*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2))) + p := (*uint8)(unsafe.Pointer(&_sqlite3Prng.X2)) *p = uint8(int32(*p) + int32(_t)) sink2(*p) } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) = _t + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X1))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X2))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X2))) = _t { p := &_t - *p = uint8(int32(*p) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1))))) + *p = uint8(int32(*p) + int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_sqlite3Prng.X1))))) sink2(*p) } - *postInc13(&_zBuf, 1) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_t))) + *postInc13(&_zBuf, 1) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[256]uint8)(unsafe.Pointer(&_sqlite3Prng.X3)))) + 1*uintptr(_t))) if preInc1(&_N, -1) != 0 { goto _14 } @@ -14699,15 +15515,20 @@ _14: var _sqlite3Prng Tsqlite3PrngType -// SQLITE_OMIT_LOAD_EXTENSION +// C comment +// /* SQLITE_OMIT_LOAD_EXTENSION */ func _sqlite3OsRandomness(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{(_pVfs.X14)})))(tls, _pVfs, _nByte, _zBufOut) + return func() func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32 { + v := _pVfs.X14 + return *(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _nByte, _zBufOut) } -// Locate a VFS by name. If no name is given, simply return the -// first VFS on the list. +// C comment +// /* +// ** Locate a VFS by name. If no name is given, simply return the +// ** first VFS on the list. +// */ func Xsqlite3_vfs_find(tls *crt.TLS, _zVfs *int8) (r0 *Xsqlite3_vfs) { var _rc int32 var _mutex *Xsqlite3_mutex @@ -14745,13 +15566,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_randomnessØ00__func__Ø000[0], str(13838), 19) } -// Destroy a bitmap object. Reclaim all memory used. +// C comment +// /* +// ** Destroy a bitmap object. Reclaim all memory used. +// */ func _sqlite3BitvecDestroy(tls *crt.TLS, _p *XBitvec) { var _1_i uint32 if _p == nil { return } - if (_p.X2) == 0 { + if _p.X2 == 0 { goto _1 } _1_i = uint32(i32(0)) @@ -14759,16 +15583,19 @@ _2: if uint64(_1_i) >= u64(62) { goto _5 } - _sqlite3BitvecDestroy(tls, *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_i)))) + _sqlite3BitvecDestroy(tls, *(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_i)))) _1_i += 1 goto _2 _5: _1: - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) } -// Make sure the page is marked as dirty. If it isn't dirty already, -// make it so. +// C comment +// /* +// ** Make sure the page is marked as dirty. If it isn't dirty already, +// ** make it so. +// */ func _sqlite3PcacheMakeDirty(tls *crt.TLS, _p *XPgHdr) { func() { if int32(_p.X7) <= i32(0) { @@ -14786,13 +15613,13 @@ func _sqlite3PcacheMakeDirty(tls *crt.TLS, _p *XPgHdr) { goto _4 } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) & i32(-17)) sink14(*p) } if (int32(_p.X6) & i32(1)) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) ^ i32(3)) sink14(*p) } @@ -14828,7 +15655,7 @@ func _sqlite3PcachePageSanity(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { } }() func() { - if (_pPg.X5) <= uint32(i32(0)) && (*XPager)(_pPg.X4) != nil { + if _pPg.X5 <= uint32(i32(0)) && (*XPager)(_pPg.X4) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(13976))) crt.X__builtin_abort(tls) } @@ -14877,10 +15704,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcachePageSanityØ00__func__Ø000[0], str(14115), 24) } -// Manage pPage's participation on the dirty list. Bits of the addRemove -// argument determines what operation to do. The 0x01 bit means first -// remove pPage from the dirty list. The 0x02 means add pPage back to -// the dirty list. Doing both moves pPage to the front of the dirty list. +// C comment +// /* +// ** Manage pPage's participation on the dirty list. Bits of the addRemove +// ** argument determines what operation to do. The 0x01 bit means first +// ** remove pPage from the dirty list. The 0x02 means add pPage back to +// ** the dirty list. Doing both moves pPage to the front of the dirty list. +// */ func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) { var _p *XPCache _p = (*XPCache)(_pPage.X8) @@ -14888,21 +15718,21 @@ func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) { goto _0 } func() { - if (*XPgHdr)(_pPage.X9) == nil && _pPage != (*XPgHdr)(_p.X1) { + if _pPage.X9 == nil && _pPage != (*XPgHdr)(_p.X1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44288), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14139))) crt.X__builtin_abort(tls) } }() func() { - if (*XPgHdr)(_pPage.X10) == nil && _pPage != (*XPgHdr)(_p.X0) { + if _pPage.X10 == nil && _pPage != (*XPgHdr)(_p.X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44289), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14181))) crt.X__builtin_abort(tls) } }() if (*XPgHdr)(_p.X2) == _pPage { - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*XPgHdr)(_pPage.X10) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = (*XPgHdr)(_pPage.X10) } - if (*XPgHdr)(_pPage.X9) != nil { + if _pPage.X9 != nil { *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X9).X10))))) = (*XPgHdr)(_pPage.X10) goto _9 } @@ -14912,9 +15742,9 @@ func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) { crt.X__builtin_abort(tls) } }() - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XPgHdr)(_pPage.X10) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = (*XPgHdr)(_pPage.X10) _9: - if (*XPgHdr)(_pPage.X10) != nil { + if _pPage.X10 != nil { *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X10).X9))))) = (*XPgHdr)(_pPage.X9) goto _13 } @@ -14924,9 +15754,9 @@ _9: crt.X__builtin_abort(tls) } }() - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = (*XPgHdr)(_pPage.X9) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = (*XPgHdr)(_pPage.X9) func() { - if (_p.X8) == 0 && int32(_p.X9) != i32(2) { + if _p.X8 == 0 && int32(_p.X9) != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44311), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14257))) crt.X__builtin_abort(tls) } @@ -14938,11 +15768,11 @@ _9: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_p.X9)) = uint8(i32(2)) } _13: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X9))))) = nil - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X10))))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X9)))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X10)))) = nil _0: if (int32(_addRemove) & i32(2)) == 0 { goto _23 @@ -14953,8 +15783,8 @@ _0: crt.X__builtin_abort(tls) } }() - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X9))))) = (*XPgHdr)(_p.X0) - if (*XPgHdr)(_pPage.X9) != nil { + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X9)))) = (*XPgHdr)(_p.X0) + if _pPage.X9 != nil { func() { if (*XPgHdr)((*XPgHdr)(_pPage.X9).X10) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44325), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14387))) @@ -14964,20 +15794,20 @@ _0: *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X9).X10))))) = _pPage goto _31 } - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pPage - if (_p.X8) != 0 { + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _pPage + if _p.X8 != 0 { func() { if int32(_p.X9) != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44330), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14420))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X9)) = uint8(i32(1)) } _31: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pPage - if ((*XPgHdr)(_p.X2) == nil) && (i32(0) == (int32(_pPage.X6) & i32(8))) { - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pPage + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _pPage + if (_p.X2 == nil) && (i32(0) == (int32(_pPage.X6) & i32(8))) { + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = _pPage } _23: } @@ -14988,7 +15818,10 @@ func init() { crt.Xstrncpy(nil, &_pcacheManageDirtyListØ00__func__Ø000[0], str(14434), 22) } -// Write page pPg onto the end of the rollback journal. +// C comment +// /* +// ** Write page pPg onto the end of the rollback journal. +// */ func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { var _rc int32 var _iOff int64 @@ -14998,13 +15831,13 @@ func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { _pPager = (*XPager)(_pPg.X4) _iOff = _pPager.X34 func() { - if (_pPg.X5) == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) { + if _pPg.X5 == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52754), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14456))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X35) > (_pPager.X34) { + if _pPager.X35 > _pPager.X34 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52756), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14489))) crt.X__builtin_abort(tls) } @@ -15012,7 +15845,7 @@ func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { _pData2 = (*int8)(_pPg.X1) _cksum = _pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_pData2))) { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -15020,7 +15853,7 @@ func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { if _rc != i32(0) { return _rc } - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_pData2), _pPager.X48, _iOff+int64(i32(4))) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(_pData2), _pPager.X48, _iOff+int64(i32(4))) if _rc != i32(0) { return _rc } @@ -15029,11 +15862,11 @@ func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { return _rc } { - p := (*int64)(unsafe.Pointer(&(_pPager.X34))) - *p = (*p) + int64(i32(8)+(_pPager.X48)) + p := (*int64)(unsafe.Pointer(&_pPager.X34)) + *p = (*p) + int64(i32(8)+_pPager.X48) sink6(*p) } - *(*int32)(unsafe.Pointer(&(_pPager.X27))) += 1 + *(*int32)(unsafe.Pointer(&_pPager.X27)) += 1 func() { if (*XBitvec)(_pPager.X30) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52785), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14528))) @@ -15067,33 +15900,36 @@ func init() { crt.Xstrncpy(nil, &_pagerAddPageToRollbackJournalØ00__func__Ø000[0], str(14550), 30) } -// Parameter aData must point to a buffer of pPager->pageSize bytes -// of data. Compute and return a checksum based ont the contents of the -// page of data and the current value of pPager->cksumInit. -// -// This is not a real checksum. It is really just the sum of the -// random initial value (pPager->cksumInit) and every 200th byte -// of the page data, starting with byte offset (pPager->pageSize%200). -// Each byte is interpreted as an 8-bit unsigned integer. -// -// Changing the formula used to compute this checksum results in an -// incompatible journal file format. -// -// If journal corruption occurs due to a power failure, the most likely -// scenario is that one end or the other of the record will be changed. -// It is much less likely that the two ends of the journal record will be -// correct and the middle be corrupt. Thus, this "checksum" scheme, -// though fast and simple, catches the mostly likely kind of corruption. +// C comment +// /* +// ** Parameter aData must point to a buffer of pPager->pageSize bytes +// ** of data. Compute and return a checksum based ont the contents of the +// ** page of data and the current value of pPager->cksumInit. +// ** +// ** This is not a real checksum. It is really just the sum of the +// ** random initial value (pPager->cksumInit) and every 200th byte +// ** of the page data, starting with byte offset (pPager->pageSize%200). +// ** Each byte is interpreted as an 8-bit unsigned integer. +// ** +// ** Changing the formula used to compute this checksum results in an +// ** incompatible journal file format. +// ** +// ** If journal corruption occurs due to a power failure, the most likely +// ** scenario is that one end or the other of the record will be changed. +// ** It is much less likely that the two ends of the journal record will be +// ** correct and the middle be corrupt. Thus, this "checksum" scheme, +// ** though fast and simple, catches the mostly likely kind of corruption. +// */ func _pager_cksum(tls *crt.TLS, _pPager *XPager, _aData *uint8) (r0 uint32) { var _i int32 var _cksum uint32 _cksum = _pPager.X28 - _i = (_pPager.X48) - i32(200) + _i = _pPager.X48 - i32(200) _0: if _i > i32(0) { { p := &_cksum - *p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_i)))) + *p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_i)))) sink5(*p) } { @@ -15106,12 +15942,15 @@ _0: return _cksum } -// Release a page reference. -// -// If the number of references to the page drop to zero, then the -// page is added to the LRU list. When all references to all pages -// are released, a rollback occurs and the lock on the database is -// removed. +// C comment +// /* +// ** Release a page reference. +// ** +// ** If the number of references to the page drop to zero, then the +// ** page is added to the LRU list. When all references to all pages +// ** are released, a rollback occurs and the lock on the database is +// ** removed. +// */ func _sqlite3PagerUnrefNotNull(tls *crt.TLS, _pPg *XPgHdr) { var _pPager *XPager func() { @@ -15136,21 +15975,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerUnrefNotNullØ00__func__Ø000[0], str(14580), 25) } -// Release a reference to page pPg. pPg must have been returned by an -// earlier call to pagerAcquireMapPage(). +// C comment +// /* +// ** Release a reference to page pPg. pPg must have been returned by an +// ** earlier call to pagerAcquireMapPage(). +// */ func _pagerReleaseMapPage(tls *crt.TLS, _pPg *XPgHdr) { var _pPager *XPager _pPager = (*XPager)(_pPg.X4) - *(*int32)(unsafe.Pointer(&(_pPager.X41))) -= 1 - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X3))))) = (*XPgHdr)(_pPager.X43) - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X43))))) = _pPg + *(*int32)(unsafe.Pointer(&_pPager.X41)) -= 1 + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPg.X3)))) = (*XPgHdr)(_pPager.X43) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X43)))) = _pPg func() { if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0).X0) < i32(3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50978), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerReleaseMapPageØ00__func__Ø000))), unsafe.Pointer(str(14605))) crt.X__builtin_abort(tls) } }() - _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64((_pPg.X5)-uint32(i32(1)))*int64(_pPager.X48), _pPg.X1) + _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(_pPg.X5-uint32(i32(1)))*int64(_pPager.X48), _pPg.X1) } var _pagerReleaseMapPageØ00__func__Ø000 [20]int8 @@ -15160,13 +16002,17 @@ func init() { } func _sqlite3OsUnfetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X18)})))(tls, _id, _iOff, _p) + return func() func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X18 + return *(*func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _iOff, _p) } -// Decrement the reference count on a page. If the page is clean and the -// reference count drops to 0, then it is made eligible for recycling. +// C comment +// /* +// ** Decrement the reference count on a page. If the page is clean and the +// ** reference count drops to 0, then it is made eligible for recycling. +// */ func _sqlite3PcacheRelease(tls *crt.TLS, _p *XPgHdr) { func() { if int32(_p.X7) <= i32(0) { @@ -15175,7 +16021,7 @@ func _sqlite3PcacheRelease(tls *crt.TLS, _p *XPgHdr) { } }() *(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) -= 1 - if int32(preInc18((*int16)(unsafe.Pointer(&(_p.X7))), -1)) != i32(0) { + if int32(preInc18((*int16)(unsafe.Pointer(&_p.X7)), -1)) != i32(0) { goto _2 } if (int32(_p.X6) & i32(1)) != 0 { @@ -15195,37 +16041,44 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheReleaseØ00__func__Ø000[0], str(14659), 21) } -// Wrapper around the pluggable caches xUnpin method. If the cache is -// being used for an in-memory database, this function is a no-op. +// C comment +// /* +// ** Wrapper around the pluggable caches xUnpin method. If the cache is +// ** being used for an in-memory database, this function is a no-op. +// */ func _pcacheUnpin(tls *crt.TLS, _p *XPgHdr) { if ((*XPCache)(_p.X8).X8) != 0 { - (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X8)})))(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(0)) + func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X8 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v)) + }()(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(0)) } } func _pagerUnlockIfUnused(tls *crt.TLS, _pPager *XPager) { - if ((_pPager.X41) == i32(0)) && (_sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) == i32(0)) { + if (_pPager.X41 == i32(0)) && (_sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) == i32(0)) { _pagerUnlockAndRollback(tls, _pPager) } } -// Execute a rollback if a transaction is active and unlock the -// database file. -// -// If the pager has already entered the ERROR state, do not attempt -// the rollback at this time. Instead, pager_unlock() is called. The -// call to pager_unlock() will discard all in-memory pages, unlock -// the database file and move the pager back to OPEN state. If this -// means that there is a hot-journal left in the file-system, the next -// connection to obtain a shared lock on the pager (which may be this one) -// will roll it back. -// -// If the pager has not already entered the ERROR state, but an IO or -// malloc error occurs during a rollback, then this will itself cause -// the pager to enter the ERROR state. Which will be cleared by the -// call to pager_unlock(), as described above. +// C comment +// /* +// ** Execute a rollback if a transaction is active and unlock the +// ** database file. +// ** +// ** If the pager has already entered the ERROR state, do not attempt +// ** the rollback at this time. Instead, pager_unlock() is called. The +// ** call to pager_unlock() will discard all in-memory pages, unlock +// ** the database file and move the pager back to OPEN state. If this +// ** means that there is a hot-journal left in the file-system, the next +// ** connection to obtain a shared lock on the pager (which may be this one) +// ** will roll it back. +// ** +// ** If the pager has not already entered the ERROR state, but an IO or +// ** malloc error occurs during a rollback, then this will itself cause +// ** the pager to enter the ERROR state. Which will be cleared by the +// ** call to pager_unlock(), as described above. +// */ func _pagerUnlockAndRollback(tls *crt.TLS, _pPager *XPager) { if int32(_pPager.X14) == i32(6) || int32(_pPager.X14) == i32(0) { goto _1 @@ -15242,7 +16095,7 @@ func _pagerUnlockAndRollback(tls *crt.TLS, _pPager *XPager) { _sqlite3EndBenignMalloc(tls) goto _6 } - if (_pPager.X1) == 0 { + if _pPager.X1 == 0 { func() { if int32(_pPager.X14) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49062), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000))), unsafe.Pointer(str(14680))) @@ -15262,30 +16115,33 @@ func init() { crt.Xstrncpy(nil, &_pagerUnlockAndRollbackØ00__func__Ø000[0], str(14709), 23) } -// If a write transaction is open, then all changes made within the -// transaction are reverted and the current write-transaction is closed. -// The pager falls back to PAGER_READER state if successful, or PAGER_ERROR -// state if an error occurs. -// -// If the pager is already in PAGER_ERROR state when this function is called, -// it returns Pager.errCode immediately. No work is performed in this case. -// -// Otherwise, in rollback mode, this function performs two functions: -// -// 1) It rolls back the journal file, restoring all database file and -// in-memory cache pages to the state they were in when the transaction -// was opened, and -// -// 2) It finalizes the journal file, so that it is not used for hot -// rollback at any point in the future. -// -// Finalization of the journal file (task 2) is only performed if the -// rollback is successful. -// -// In WAL mode, all cache-entries containing data modified within the -// current transaction are either expelled from the cache or reverted to -// their pre-transaction state by re-reading data from the database or -// WAL files. The WAL transaction is then closed. +// C comment +// /* +// ** If a write transaction is open, then all changes made within the +// ** transaction are reverted and the current write-transaction is closed. +// ** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR +// ** state if an error occurs. +// ** +// ** If the pager is already in PAGER_ERROR state when this function is called, +// ** it returns Pager.errCode immediately. No work is performed in this case. +// ** +// ** Otherwise, in rollback mode, this function performs two functions: +// ** +// ** 1) It rolls back the journal file, restoring all database file and +// ** in-memory cache pages to the state they were in when the transaction +// ** was opened, and +// ** +// ** 2) It finalizes the journal file, so that it is not used for hot +// ** rollback at any point in the future. +// ** +// ** Finalization of the journal file (task 2) is only performed if the +// ** rollback is successful. +// ** +// ** In WAL mode, all cache-entries containing data modified within the +// ** current transaction are either expelled from the cache or reverted to +// ** their pre-transaction state by re-reading data from the database or +// ** WAL files. The WAL transaction is then closed. +// */ func _sqlite3PagerRollback(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _1_rc2, _2_eState int32 _rc = i32(0) @@ -15316,9 +16172,9 @@ _4: } _2_eState = int32(_pPager.X14) _rc = _pager_end_transaction(tls, _pPager, i32(0), i32(0)) - if ((_pPager.X13) == 0) && (_2_eState > i32(2)) { - *(*int32)(unsafe.Pointer(&(_pPager.X26))) = i32(4) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(6)) + if (_pPager.X13 == 0) && (_2_eState > i32(2)) { + *(*int32)(unsafe.Pointer(&_pPager.X26)) = i32(4) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(6)) _setGetterMethod(tls, _pPager) return _rc } @@ -15363,7 +16219,7 @@ func _sqlite3PagerSavepoint(tls *crt.TLS, _pPager *XPager, _op int32, _iSavepoin crt.X__builtin_abort(tls) } }() - if _rc != i32(0) || _iSavepoint >= (_pPager.X38) { + if _rc != i32(0) || _iSavepoint >= _pPager.X38 { goto _7 } _1_nNew = _iSavepoint + func() int32 { @@ -15374,14 +16230,14 @@ func _sqlite3PagerSavepoint(tls *crt.TLS, _pPager *XPager, _op int32, _iSavepoin }() _1_ii = _1_nNew _10: - if _1_ii >= (_pPager.X38) { + if _1_ii >= _pPager.X38 { goto _13 } _sqlite3BitvecDestroy(tls, (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37)+48*uintptr(_1_ii))).X2)) _1_ii += 1 goto _10 _13: - *(*int32)(unsafe.Pointer(&(_pPager.X38))) = _1_nNew + *(*int32)(unsafe.Pointer(&_pPager.X38)) = _1_nNew if _op != i32(1) { goto _14 } @@ -15397,7 +16253,7 @@ _13: } }() } - *(*uint32)(unsafe.Pointer(&(_pPager.X29))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pPager.X29)) = uint32(i32(0)) _16: goto _22 _14: @@ -15427,53 +16283,60 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerSavepointØ00__func__Ø000[0], str(15042), 22) } -// The file-handle passed as the only argument is open on a journal file. -// Return true if this "journal file" is currently stored in heap memory, -// or false otherwise. +// C comment +// /* +// ** The file-handle passed as the only argument is open on a journal file. +// ** Return true if this "journal file" is currently stored in heap memory, +// ** or false otherwise. +// */ func _sqlite3JournalIsInMemory(tls *crt.TLS, _p *Xsqlite3_file) (r0 int32) { return bool2int((*Xsqlite3_io_methods)(_p.X0) == &_MemJournalMethods) } func _sqlite3OsTruncate(tls *crt.TLS, _id *Xsqlite3_file, _size int64) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X4)})))(tls, _id, _size) -} - -// Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback -// the entire master journal file. The case pSavepoint==NULL occurs when -// a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction -// savepoint. -// -// When pSavepoint is not NULL (meaning a non-transaction savepoint is -// being rolled back), then the rollback consists of up to three stages, -// performed in the order specified: -// -// * Pages are played back from the main journal starting at byte -// offset PagerSavepoint.iOffset and continuing to -// PagerSavepoint.iHdrOffset, or to the end of the main journal -// file if PagerSavepoint.iHdrOffset is zero. -// -// * If PagerSavepoint.iHdrOffset is not zero, then pages are played -// back starting from the journal header immediately following -// PagerSavepoint.iHdrOffset to the end of the main journal file. -// -// * Pages are then played back from the sub-journal file, starting -// with the PagerSavepoint.iSubRec and continuing to the end of -// the journal file. -// -// Throughout the rollback process, each time a page is rolled back, the -// corresponding bit is set in a bitvec structure (variable pDone in the -// implementation below). This is used to ensure that a page is only -// rolled back the first time it is encountered in either journal. -// -// If pSavepoint is NULL, then pages are only played back from the main -// journal file. There is no need for a bitvec in this case. -// -// In either case, before playback commences the Pager.dbSize variable -// is reset to the value that it held at the start of the savepoint -// (or transaction). No page with a page-number greater than this value -// is played back. If one is encountered it is simply skipped. + return func() func(*crt.TLS, *Xsqlite3_file, int64) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X4 + return *(*func(*crt.TLS, *Xsqlite3_file, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _size) +} + +// C comment +// /* +// ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback +// ** the entire master journal file. The case pSavepoint==NULL occurs when +// ** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction +// ** savepoint. +// ** +// ** When pSavepoint is not NULL (meaning a non-transaction savepoint is +// ** being rolled back), then the rollback consists of up to three stages, +// ** performed in the order specified: +// ** +// ** * Pages are played back from the main journal starting at byte +// ** offset PagerSavepoint.iOffset and continuing to +// ** PagerSavepoint.iHdrOffset, or to the end of the main journal +// ** file if PagerSavepoint.iHdrOffset is zero. +// ** +// ** * If PagerSavepoint.iHdrOffset is not zero, then pages are played +// ** back starting from the journal header immediately following +// ** PagerSavepoint.iHdrOffset to the end of the main journal file. +// ** +// ** * Pages are then played back from the sub-journal file, starting +// ** with the PagerSavepoint.iSubRec and continuing to the end of +// ** the journal file. +// ** +// ** Throughout the rollback process, each time a page is rolled back, the +// ** corresponding bit is set in a bitvec structure (variable pDone in the +// ** implementation below). This is used to ensure that a page is only +// ** rolled back the first time it is encountered in either journal. +// ** +// ** If pSavepoint is NULL, then pages are only played back from the main +// ** journal file. There is no need for a bitvec in this case. +// ** +// ** In either case, before playback commences the Pager.dbSize variable +// ** is reset to the value that it held at the start of the savepoint +// ** (or transaction). No page with a page-number greater than this value +// ** is played back. If one is encountered it is simply skipped. +// */ func _pagerPlaybackSavepoint(tls *crt.TLS, _pPager *XPager, _pSavepoint *XPagerSavepoint) (r0 int32) { var _rc int32 var _szJ, _iHdrOff, _10_offset int64 @@ -15501,13 +16364,13 @@ func _pagerPlaybackSavepoint(tls *crt.TLS, _pPager *XPager, _pSavepoint *XPagerS return _sqlite3NomemError(tls, i32(50299)) } _4: - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = func() uint32 { + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = func() uint32 { if _pSavepoint != nil { - return (_pSavepoint.X3) + return _pSavepoint.X3 } - return (_pPager.X23) + return _pPager.X23 }() - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10 + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = _pPager.X10 if (_pSavepoint == nil) && ((*XWal)(_pPager.X60) != nil) { return _pagerRollbackWal(tls, _pPager) } @@ -15522,15 +16385,15 @@ _4: goto _14 } _iHdrOff = func() int64 { - if (_pSavepoint.X1) != 0 { - return (_pSavepoint.X1) + if _pSavepoint.X1 != 0 { + return _pSavepoint.X1 } return _szJ }() - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = _pSavepoint.X0 + *(*int64)(unsafe.Pointer(&_pPager.X34)) = _pSavepoint.X0 _17: - if (_rc == i32(0)) && ((_pPager.X34) < _iHdrOff) { - _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), _pDone, i32(1), i32(1)) + if (_rc == i32(0)) && (_pPager.X34 < _iHdrOff) { + _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&_pPager.X34)), _pDone, i32(1), i32(1)) goto _17 } func() { @@ -15541,9 +16404,9 @@ _17: }() goto _22 _14: - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) _22: - if _rc != i32(0) || (_pPager.X34) >= _szJ { + if _rc != i32(0) || _pPager.X34 >= _szJ { goto _24 } _7_nJRec = uint32(i32(0)) @@ -15554,15 +16417,15 @@ _22: crt.X__builtin_abort(tls) } }() - if (_7_nJRec == uint32(i32(0))) && (((_pPager.X35) + int64(_pPager.X47)) == (_pPager.X34)) { - _7_nJRec = uint32((_szJ - (_pPager.X34)) / int64((_pPager.X48)+i32(8))) + if (_7_nJRec == uint32(i32(0))) && ((_pPager.X35 + int64(_pPager.X47)) == _pPager.X34) { + _7_nJRec = uint32((_szJ - _pPager.X34) / int64(_pPager.X48+i32(8))) } _7_ii = uint32(i32(0)) _30: - if _rc != i32(0) || _7_ii >= _7_nJRec || (_pPager.X34) >= _szJ { + if _rc != i32(0) || _7_ii >= _7_nJRec || _pPager.X34 >= _szJ { goto _35 } - _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), _pDone, i32(1), i32(1)) + _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&_pPager.X34)), _pDone, i32(1), i32(1)) _7_ii += 1 goto _30 _35: @@ -15575,7 +16438,7 @@ _35: goto _22 _24: func() { - if _rc == i32(0) && (_pPager.X34) < _szJ { + if _rc == i32(0) && _pPager.X34 < _szJ { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50366), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15125))) crt.X__builtin_abort(tls) } @@ -15583,17 +16446,17 @@ _24: if _pSavepoint == nil { goto _41 } - _10_offset = int64(_pSavepoint.X4) * int64(i32(4)+(_pPager.X48)) + _10_offset = int64(_pSavepoint.X4) * int64(i32(4)+_pPager.X48) if (*XWal)(_pPager.X60) != nil { - _rc = _sqlite3WalSavepointUndo(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_pSavepoint.X5)))))) + _rc = _sqlite3WalSavepointUndo(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_pSavepoint.X5))))) } _10_ii = _pSavepoint.X4 _43: - if _rc != i32(0) || _10_ii >= (_pPager.X29) { + if _rc != i32(0) || _10_ii >= _pPager.X29 { goto _47 } func() { - if _10_offset != (int64(_10_ii) * int64(i32(4)+(_pPager.X48))) { + if _10_offset != (int64(_10_ii) * int64(i32(4)+_pPager.X48)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50380), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15166))) crt.X__builtin_abort(tls) } @@ -15611,7 +16474,7 @@ _47: _41: _sqlite3BitvecDestroy(tls, _pDone) if _rc == i32(0) { - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = _szJ + *(*int64)(unsafe.Pointer(&_pPager.X34)) = _szJ } return _rc @@ -15625,39 +16488,45 @@ func init() { crt.Xstrncpy(nil, &_pagerPlaybackSavepointØ00__func__Ø000[0], str(15203), 23) } -// This function is called to rollback a transaction on a WAL database. +// C comment +// /* +// ** This function is called to rollback a transaction on a WAL database. +// */ func _pagerRollbackWal(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 var _pList, _1_pNext *XPgHdr - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _pPager.X23 - _rc = _sqlite3WalUndo(tls, (*XWal)(_pPager.X60), _pagerUndoCallback, (unsafe.Pointer)(_pPager)) + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = _pPager.X23 + _rc = _sqlite3WalUndo(tls, (*XWal)(_pPager.X60), _pagerUndoCallback, unsafe.Pointer(_pPager)) _pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59)) _0: if (_pList != nil) && (_rc == i32(0)) { _1_pNext = (*XPgHdr)(_pList.X3) - _rc = _pagerUndoCallback(tls, (unsafe.Pointer)(_pPager), _pList.X5) + _rc = _pagerUndoCallback(tls, unsafe.Pointer(_pPager), _pList.X5) _pList = _1_pNext goto _0 } return _rc } -// If any data has been written (but not committed) to the log file, this -// function moves the write-pointer back to the start of the transaction. -// -// Additionally, the callback function is invoked for each frame written -// to the WAL since the start of the transaction. If the callback returns -// other than SQLITE_OK, it is not invoked again and the error code is -// returned to the caller. -// -// Otherwise, if the callback function does not return an error, this -// function returns SQLITE_OK. +// C comment +// /* +// ** If any data has been written (but not committed) to the log file, this +// ** function moves the write-pointer back to the start of the transaction. +// ** +// ** Additionally, the callback function is invoked for each frame written +// ** to the WAL since the start of the transaction. If the callback returns +// ** other than SQLITE_OK, it is not invoked again and the error code is +// ** returned to the caller. +// ** +// ** Otherwise, if the callback function does not return an error, this +// ** function returns SQLITE_OK. +// */ func _sqlite3WalUndo(tls *crt.TLS, _pWal *XWal, _xUndo func(*crt.TLS, unsafe.Pointer, uint32) int32, _pUndoCtx unsafe.Pointer) (r0 int32) { var _rc int32 var _1_iMax, _1_iFrame uint32 _rc = i32(0) if func() int32 { - if (_pWal.X12) != 0 { + if _pWal.X12 != 0 { return i32(1) } return func() int32 { @@ -15668,9 +16537,9 @@ func _sqlite3WalUndo(tls *crt.TLS, _pWal *XWal, _xUndo func(*crt.TLS, unsafe.Poi }() == 0 { goto _2 } - _1_iMax = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 - crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), u64(48)) - _1_iFrame = ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) + uint32(i32(1)) + _1_iMax = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 + crt.Xmemcpy(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), unsafe.Pointer(_walIndexHdr(tls, _pWal)), u64(48)) + _1_iFrame = ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) + uint32(i32(1)) _3: if func() int32 { if _rc == i32(0) { @@ -15694,7 +16563,7 @@ _3: _1_iFrame += 1 goto _3 _9: - if _1_iMax != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _1_iMax != ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { _walCleanupHash(tls, _pWal) } _2: @@ -15707,15 +16576,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalUndoØ00__func__Ø000[0], str(15256), 15) } -// Return a pointer to the WalIndexHdr structure in the wal-index. +// C comment +// /* +// ** Return a pointer to the WalIndexHdr structure in the wal-index. +// */ func _walIndexHdr(tls *crt.TLS, _pWal *XWal) (r0 *XWalIndexHdr) { func() { - if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { + if _pWal.X5 <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55066), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexHdrØ00__func__Ø000))), unsafe.Pointer(str(15271))) crt.X__builtin_abort(tls) } }() - return (*XWalIndexHdr)(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0)))))) + return (*XWalIndexHdr)(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0)))))) } var _walIndexHdrØ00__func__Ø000 [12]int8 @@ -15724,20 +16596,26 @@ func init() { crt.Xstrncpy(nil, &_walIndexHdrØ00__func__Ø000[0], str(15308), 12) } -// Return the page number associated with frame iFrame in this WAL. +// C comment +// /* +// ** Return the page number associated with frame iFrame in this WAL. +// */ func _walFramePgno(tls *crt.TLS, _pWal *XWal, _iFrame uint32) (r0 uint32) { var _iHash int32 _iHash = _walFramePage(tls, _iFrame) if _iHash == i32(0) { - return *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0)))))) + 4*uintptr((u64(34)+uint64(_iFrame))-uint64(i32(1))))) + return *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0)))))) + 4*uintptr((u64(34)+uint64(_iFrame))-uint64(i32(1))))) } - return *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_iHash))))) + 4*uintptr((uint64(_iFrame-uint32(i32(1)))-u64(4062))%uint64(i32(4096))))) + return *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_iHash))))) + 4*uintptr((uint64(_iFrame-uint32(i32(1)))-u64(4062))%uint64(i32(4096))))) } -// Return the number of the wal-index page that contains the hash-table -// and page-number array that contain entries corresponding to WAL frame -// iFrame. The wal-index is broken up into 32KB pages. Wal-index pages -// are numbered starting from 0. +// C comment +// /* +// ** Return the number of the wal-index page that contains the hash-table +// ** and page-number array that contain entries corresponding to WAL frame +// ** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages +// ** are numbered starting from 0. +// */ func _walFramePage(tls *crt.TLS, _iFrame uint32) (r0 int32) { var _iHash int32 _iHash = int32(((uint64(_iFrame+uint32(i32(4096))) - u64(4062)) - uint64(i32(1))) / uint64(i32(4096))) @@ -15756,16 +16634,19 @@ func init() { crt.Xstrncpy(nil, &_walFramePageØ00__func__Ø000[0], str(15593), 13) } -// Remove entries from the hash table that point to WAL slots greater -// than pWal->hdr.mxFrame. -// -// This function is called whenever pWal->hdr.mxFrame is decreased due -// to a rollback or savepoint. -// -// At most only the hash table containing pWal->hdr.mxFrame needs to be -// updated. Any later hash tables will be automatically cleared when -// pWal->hdr.mxFrame advances to the point where those hash tables are -// actually needed. +// C comment +// /* +// ** Remove entries from the hash table that point to WAL slots greater +// ** than pWal->hdr.mxFrame. +// ** +// ** This function is called whenever pWal->hdr.mxFrame is decreased due +// ** to a rollback or savepoint. +// ** +// ** At most only the hash table containing pWal->hdr.mxFrame needs to be +// ** updated. Any later hash tables will be automatically cleared when +// ** pWal->hdr.mxFrame advances to the point where those hash tables are +// ** actually needed. +// */ func _walCleanupHash(tls *crt.TLS, _pWal *XWal) { var _iLimit, _nByte, _i int32 var _iZero uint32 @@ -15776,28 +16657,28 @@ func _walCleanupHash(tls *crt.TLS, _pWal *XWal) { _iZero = u32(0) _iLimit = i32(0) func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55418), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } }() - if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) == uint32(i32(0)) { + if ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) == uint32(i32(0)) { return } func() { - if (_pWal.X5) <= _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _pWal.X5 <= _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55429), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15622))) crt.X__builtin_abort(tls) } }() func() { - if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))))) == nil { + if (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55430), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15668))) crt.X__builtin_abort(tls) } }() - _walHashGet(tls, _pWal, _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6), &_aHash, &_aPgno, &_iZero) - _iLimit = int32(((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) - _iZero) + _walHashGet(tls, _pWal, _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6), &_aHash, &_aPgno, &_iZero) + _iLimit = int32(((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) - _iZero) func() { if _iLimit <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55437), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15716))) @@ -15809,14 +16690,14 @@ _9: if _i >= i32(8192) { goto _12 } - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_i)))) > _iLimit { - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_i))) = uint16(i32(0)) + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHash)) + 2*uintptr(_i)))) > _iLimit { + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHash)) + 2*uintptr(_i))) = uint16(i32(0)) } _i += 1 goto _9 _12: - _nByte = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_aHash)))) - uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(_iLimit+i32(1))))))))) / 1)) - crt.Xmemset(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(_iLimit+i32(1))))), i32(0), uint64(_nByte)) + _nByte = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_aHash)))) - uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno))+4*uintptr(_iLimit+i32(1))))))))) / 1)) + crt.Xmemset(tls, unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno))+4*uintptr(_iLimit+i32(1))))), i32(0), uint64(_nByte)) } var _walCleanupHashØ00__func__Ø000 [15]int8 @@ -15825,18 +16706,21 @@ func init() { crt.Xstrncpy(nil, &_walCleanupHashØ00__func__Ø000[0], str(15725), 15) } -// Return pointers to the hash table and page number array stored on -// page iHash of the wal-index. The wal-index is broken into 32KB pages -// numbered starting from 0. -// -// Set output variable *paHash to point to the start of the hash table -// in the wal-index file. Set *piZero to one less than the frame -// number of the first frame indexed by this hash table. If a -// slot in the hash table is set to N, it refers to frame number -// (*piZero+N) in the log. -// -// Finally, set *paPgno so that *paPgno[1] is the page number of the -// first frame indexed by the hash table, frame (*piZero+1). +// C comment +// /* +// ** Return pointers to the hash table and page number array stored on +// ** page iHash of the wal-index. The wal-index is broken into 32KB pages +// ** numbered starting from 0. +// ** +// ** Set output variable *paHash to point to the start of the hash table +// ** in the wal-index file. Set *piZero to one less than the frame +// ** number of the first frame indexed by this hash table. If a +// ** slot in the hash table is set to N, it refers to frame number +// ** (*piZero+N) in the log. +// ** +// ** Finally, set *paPgno so that *paPgno[1] is the page number of the +// ** first frame indexed by the hash table, frame (*piZero+1). +// */ func _walHashGet(tls *crt.TLS, _pWal *XWal, _iHash int32, _paHash **uint16, _paPgno **uint32, _piZero *uint32) (r0 int32) { var _rc int32 var _1_iZero uint32 @@ -15852,61 +16736,64 @@ func _walHashGet(tls *crt.TLS, _pWal *XWal, _iHash int32, _paHash **uint16, _paP if _rc != i32(0) { goto _3 } - _1_aHash = (*uint16)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(i32(4096)))))) + _1_aHash = (*uint16)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(i32(4096)))))) if _iHash == i32(0) { - _aPgno = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(u64(34)))) + _aPgno = (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(u64(34)))) _1_iZero = uint32(i32(0)) goto _5 } _1_iZero = uint32(u64(4062) + uint64((_iHash-i32(1))*i32(4096))) _5: - *_paPgno = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(i32(-1)))) + *_paPgno = (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(i32(-1)))) *_paHash = _1_aHash *_piZero = _1_iZero _3: return _rc } -// Obtain a pointer to the iPage'th page of the wal-index. The wal-index -// is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are -// numbered from zero. -// -// If this call is successful, *ppPage is set to point to the wal-index -// page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs, -// then an SQLite error code is returned and *ppPage is set to 0. +// C comment +// /* +// ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index +// ** is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are +// ** numbered from zero. +// ** +// ** If this call is successful, *ppPage is set to point to the wal-index +// ** page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs, +// ** then an SQLite error code is returned and *ppPage is set to 0. +// */ func _walIndexPage(tls *crt.TLS, _pWal *XWal, _iPage int32, _ppPage **uint32) (r0 int32) { var _rc, _1_nByte int32 var _1_apNew **uint32 _rc = i32(0) - if (_pWal.X5) > _iPage { + if _pWal.X5 > _iPage { goto _0 } _1_nByte = int32(u64(8) * uint64(_iPage+i32(1))) - _1_apNew = (**uint32)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_pWal.X7), uint64(_1_nByte))) + _1_apNew = (**uint32)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pWal.X7), uint64(_1_nByte))) if _1_apNew == nil { *_ppPage = nil return _sqlite3NomemError(tls, i32(55025)) } - crt.Xmemset(tls, (unsafe.Pointer)((**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_apNew))+8*uintptr(_pWal.X5)))), i32(0), u64(8)*uint64((_iPage+i32(1))-(_pWal.X5))) - *(***uint32)(unsafe.Pointer(&(_pWal.X7))) = _1_apNew - *(*int32)(unsafe.Pointer(&(_pWal.X5))) = _iPage + i32(1) + crt.Xmemset(tls, unsafe.Pointer((**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_apNew))+8*uintptr(_pWal.X5)))), i32(0), u64(8)*uint64((_iPage+i32(1))-_pWal.X5)) + *(***uint32)(unsafe.Pointer(&_pWal.X7)) = _1_apNew + *(*int32)(unsafe.Pointer(&_pWal.X5)) = _iPage + i32(1) _0: - if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_iPage)))) != nil { + if (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_iPage)))) != nil { goto _2 } if int32(_pWal.X11) != i32(2) { goto _3 } - *(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_iPage))) = (*uint32)(_sqlite3MallocZero(tls, u64(32768))) - if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_iPage)))) == nil { + *(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_iPage))) = (*uint32)(_sqlite3MallocZero(tls, u64(32768))) + if (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_iPage)))) == nil { _rc = _sqlite3NomemError(tls, i32(55037)) } goto _5 _3: - _rc = _sqlite3OsShmMap(tls, (*Xsqlite3_file)(_pWal.X1), _iPage, int32(u64(32768)), int32(_pWal.X12), (*unsafe.Pointer)(unsafe.Pointer((**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7))+8*uintptr(_iPage)))))) + _rc = _sqlite3OsShmMap(tls, (*Xsqlite3_file)(_pWal.X1), _iPage, int32(u64(32768)), int32(_pWal.X12), (*unsafe.Pointer)(unsafe.Pointer((**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7))+8*uintptr(_iPage)))))) if _rc == i32(8) { { - p := (*uint8)(unsafe.Pointer(&(_pWal.X14))) + p := (*uint8)(unsafe.Pointer(&_pWal.X14)) *p = uint8(int32(*p) | i32(2)) sink2(*p) } @@ -15914,7 +16801,7 @@ _3: } _5: _2: - *_ppPage = *(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_iPage))) + *_ppPage = *(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_iPage))) func() { if _iPage != i32(0) && (*_ppPage) == nil && _rc == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55050), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexPageØ00__func__Ø000))), unsafe.Pointer(str(15765))) @@ -15925,9 +16812,10 @@ _2: } func _sqlite3OsShmMap(tls *crt.TLS, _id *Xsqlite3_file, _iPage int32, _pgsz int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X13)})))(tls, _id, _iPage, _pgsz, _bExtend, _pp) + return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X13 + return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _iPage, _pgsz, _bExtend, _pp) } var _walIndexPageØ00__func__Ø000 [13]int8 @@ -15942,16 +16830,19 @@ func init() { crt.Xstrncpy(nil, &_walHashGetØ00__func__Ø000[0], str(15815), 11) } -// This function is invoked once for each page that has already been -// written into the log file when a WAL transaction is rolled back. -// Parameter iPg is the page number of said page. The pCtx argument -// is actually a pointer to the Pager structure. -// -// If page iPg is present in the cache, and has no outstanding references, -// it is discarded. Otherwise, if there are one or more outstanding -// references, the page content is reloaded from the database. If the -// attempt to reload content from the database is required and fails, -// return an SQLite error code. Otherwise, SQLITE_OK. +// C comment +// /* +// ** This function is invoked once for each page that has already been +// ** written into the log file when a WAL transaction is rolled back. +// ** Parameter iPg is the page number of said page. The pCtx argument +// ** is actually a pointer to the Pager structure. +// ** +// ** If page iPg is present in the cache, and has no outstanding references, +// ** it is discarded. Otherwise, if there are one or more outstanding +// ** references, the page content is reloaded from the database. If the +// ** attempt to reload content from the database is required and fails, +// ** return an SQLite error code. Otherwise, SQLITE_OK. +// */ func _pagerUndoCallback(tls *crt.TLS, _pCtx unsafe.Pointer, _iPg uint32) (r0 int32) { var _rc int32 var _3_iFrame uint32 @@ -15979,9 +16870,10 @@ func _pagerUndoCallback(tls *crt.TLS, _pCtx unsafe.Pointer, _iPg uint32) (r0 int _rc = _readDbPage(tls, _pPg, _3_iFrame) } if _rc == i32(0) { - (*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_pPager.X56)})))(tls, _pPg) + func() func(*crt.TLS, *XPgHdr) { + v := _pPager.X56 + return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v)) + }()(tls, _pPg) } _sqlite3PagerUnrefNotNull(tls, _pPg) _4: @@ -15996,15 +16888,18 @@ func init() { crt.Xstrncpy(nil, &_pagerUndoCallbackØ00__func__Ø000[0], str(15846), 18) } -// Acquire a page if it is already in the in-memory cache. Do -// not read the page from disk. Return a pointer to the page, -// or 0 if the page is not in cache. -// -// See also sqlite3PagerGet(). The difference between this routine -// and sqlite3PagerGet() is that _get() will go to the disk and read -// in the page if the page is not already in cache. This routine -// returns NULL if the page is not in cache or if a disk I/O error -// has ever happened. +// C comment +// /* +// ** Acquire a page if it is already in the in-memory cache. Do +// ** not read the page from disk. Return a pointer to the page, +// ** or 0 if the page is not in cache. +// ** +// ** See also sqlite3PagerGet(). The difference between this routine +// ** and sqlite3PagerGet() is that _get() will go to the disk and read +// ** in the page if the page is not already in cache. This routine +// ** returns NULL if the page is not in cache or if a disk I/O error +// ** has ever happened. +// */ func _sqlite3PagerLookup(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 *XPgHdr) { var _pPage *Xsqlite3_pcache_page func() { @@ -16027,7 +16922,7 @@ func _sqlite3PagerLookup(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 *XPgHd }() _pPage = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.X59), _pgno, i32(0)) func() { - if _pPage != nil && (_pPager.X21) == 0 { + if _pPage != nil && _pPager.X21 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000))), unsafe.Pointer(str(15901))) crt.X__builtin_abort(tls) } @@ -16044,28 +16939,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerLookupØ00__func__Ø000[0], str(15939), 19) } -// Try to obtain a page from the cache. -// -// This routine returns a pointer to an sqlite3_pcache_page object if -// such an object is already in cache, or if a new one is created. -// This routine returns a NULL pointer if the object was not in cache -// and could not be created. -// -// The createFlags should be 0 to check for existing pages and should -// be 3 (not 1, but 3) to try to create a new page. -// -// If the createFlag is 0, then NULL is always returned if the page -// is not already in the cache. If createFlag is 1, then a new page -// is created only if that can be done without spilling dirty pages -// and without exceeding the cache size limit. -// -// The caller needs to invoke sqlite3PcacheFetchFinish() to properly -// initialize the sqlite3_pcache_page object and convert it into a -// PgHdr object. The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish() -// routines are split this way for performance reasons. When separated -// they can both (usually) operate without having to push values to -// the stack on entry and pop them back off on exit, which saves a -// lot of pushing and popping. +// C comment +// /* +// ** Try to obtain a page from the cache. +// ** +// ** This routine returns a pointer to an sqlite3_pcache_page object if +// ** such an object is already in cache, or if a new one is created. +// ** This routine returns a NULL pointer if the object was not in cache +// ** and could not be created. +// ** +// ** The createFlags should be 0 to check for existing pages and should +// ** be 3 (not 1, but 3) to try to create a new page. +// ** +// ** If the createFlag is 0, then NULL is always returned if the page +// ** is not already in the cache. If createFlag is 1, then a new page +// ** is created only if that can be done without spilling dirty pages +// ** and without exceeding the cache size limit. +// ** +// ** The caller needs to invoke sqlite3PcacheFetchFinish() to properly +// ** initialize the sqlite3_pcache_page object and convert it into a +// ** PgHdr object. The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish() +// ** routines are split this way for performance reasons. When separated +// ** they can both (usually) operate without having to push values to +// ** the stack on entry and pop them back off on exit, which saves a +// ** lot of pushing and popping. +// */ func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) { var _eCreate int32 var _pRes *Xsqlite3_pcache_page @@ -16076,7 +16974,7 @@ func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFl } }() func() { - if (_pCache.X12) == nil { + if _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(15958))) crt.X__builtin_abort(tls) } @@ -16089,7 +16987,7 @@ func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFl }() func() { if int32(_pCache.X9) != func() int32 { - if ((_pCache.X8) != 0) && ((*XPgHdr)(_pCache.X0) != nil) { + if (_pCache.X8 != 0) && (_pCache.X0 != nil) { return i32(1) } return i32(2) @@ -16112,14 +17010,15 @@ func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFl } }() func() { - if _createFlag != i32(0) && _eCreate != (i32(1)+bool2int(((_pCache.X8) == 0) || ((*XPgHdr)(_pCache.X0) == nil))) { + if _createFlag != i32(0) && _eCreate != (i32(1)+bool2int((_pCache.X8 == 0) || (_pCache.X0 == nil))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44510), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(16154))) crt.X__builtin_abort(tls) } }() - _pRes = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, _pgno, _eCreate) + _pRes = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X7 + return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v)) + }()(tls, _pCache.X12, _pgno, _eCreate) return _pRes } @@ -16129,10 +17028,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheFetchØ00__func__Ø000[0], str(16221), 19) } -// This routine converts the sqlite3_pcache_page object returned by -// sqlite3PcacheFetch() into an initialized PgHdr object. This routine -// must be called after sqlite3PcacheFetch() in order to get a usable -// result. +// C comment +// /* +// ** This routine converts the sqlite3_pcache_page object returned by +// ** sqlite3PcacheFetch() into an initialized PgHdr object. This routine +// ** must be called after sqlite3PcacheFetch() in order to get a usable +// ** result. +// */ func _sqlite3PcacheFetchFinish(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) { var _pPgHdr *XPgHdr func() { @@ -16142,11 +17044,11 @@ func _sqlite3PcacheFetchFinish(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pP } }() _pPgHdr = (*XPgHdr)(_pPage.X1) - if (*Xsqlite3_pcache_page)(_pPgHdr.X0) == nil { + if _pPgHdr.X0 == nil { return _pcacheFetchFinishWithInit(tls, _pCache, _pgno, _pPage) } - *(*int32)(unsafe.Pointer(&(_pCache.X3))) += 1 - *(*int16)(unsafe.Pointer(&(_pPgHdr.X7))) += 1 + *(*int32)(unsafe.Pointer(&_pCache.X3)) += 1 + *(*int16)(unsafe.Pointer(&_pPgHdr.X7)) += 1 func() { if _sqlite3PcachePageSanity(tls, _pPgHdr) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44625), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000))), unsafe.Pointer(str(16240))) @@ -16162,13 +17064,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheFetchFinishØ00__func__Ø000[0], str(16272), 25) } -// This is a helper routine for sqlite3PcacheFetchFinish() -// -// In the uncommon case where the page being fetched has not been -// initialized, this routine is invoked to do the initialization. -// This routine is broken out into a separate function since it -// requires extra stack manipulation that can be avoided in the common -// case. +// C comment +// /* +// ** This is a helper routine for sqlite3PcacheFetchFinish() +// ** +// ** In the uncommon case where the page being fetched has not been +// ** initialized, this routine is invoked to do the initialization. +// ** This routine is broken out into a separate function since it +// ** requires extra stack manipulation that can be avoided in the common +// ** case. +// */ func _pcacheFetchFinishWithInit(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) { var _pPgHdr *XPgHdr func() { @@ -16184,14 +17089,14 @@ func _pcacheFetchFinishWithInit(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _p crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X3)))), i32(0), u64(48)) - *(**Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X0))))) = _pPage - *(*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X1))) = _pPage.X0 - *(*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X2))) = (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPgHdr)) + 72*uintptr(i32(1))))) + crt.Xmemset(tls, unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPgHdr.X3))), i32(0), u64(48)) + *(**Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPgHdr.X0)))) = _pPage + *(*unsafe.Pointer)(unsafe.Pointer(&_pPgHdr.X1)) = _pPage.X0 + *(*unsafe.Pointer)(unsafe.Pointer(&_pPgHdr.X2)) = unsafe.Pointer((*XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPgHdr)) + 72*uintptr(i32(1))))) crt.Xmemset(tls, _pPgHdr.X2, i32(0), uint64(i32(8))) - *(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X8))))) = _pCache - *(*uint32)(unsafe.Pointer(&(_pPgHdr.X5))) = _pgno - *(*uint16)(unsafe.Pointer(&(_pPgHdr.X6))) = uint16(i32(1)) + *(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPgHdr.X8)))) = _pCache + *(*uint32)(unsafe.Pointer(&_pPgHdr.X5)) = _pgno + *(*uint16)(unsafe.Pointer(&_pPgHdr.X6)) = uint16(i32(1)) return _sqlite3PcacheFetchFinish(tls, _pCache, _pgno, _pPage) } @@ -16201,14 +17106,20 @@ func init() { crt.Xstrncpy(nil, &_pcacheFetchFinishWithInitØ00__func__Ø000[0], str(16314), 26) } -// Return the number of references to the page supplied as an argument. +// C comment +// /* +// ** Return the number of references to the page supplied as an argument. +// */ func _sqlite3PcachePageRefcount(tls *crt.TLS, _p *XPgHdr) (r0 int32) { return int32(_p.X7) } -// Drop a page from the cache. There must be exactly one reference to the -// page. This function deletes that reference, so after it returns the -// page pointed to by p is invalid. +// C comment +// /* +// ** Drop a page from the cache. There must be exactly one reference to the +// ** page. This function deletes that reference, so after it returns the +// ** page pointed to by p is invalid. +// */ func _sqlite3PcacheDrop(tls *crt.TLS, _p *XPgHdr) { func() { if int32(_p.X7) != i32(1) { @@ -16226,9 +17137,10 @@ func _sqlite3PcacheDrop(tls *crt.TLS, _p *XPgHdr) { _pcacheManageDirtyList(tls, _p, uint8(i32(1))) } *(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) -= 1 - (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X8)})))(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(1)) + func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32) { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X8 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&v)) + }()(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(1)) } var _sqlite3PcacheDropØ00__func__Ø000 [18]int8 @@ -16237,21 +17149,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheDropØ00__func__Ø000[0], str(16351), 18) } -// Search the wal file for page pgno. If found, set *piRead to the frame that -// contains the page. Otherwise, if pgno is not in the wal file, set *piRead -// to zero. -// -// Return SQLITE_OK if successful, or an error code if an error occurs. If an -// error does occur, the final value of *piRead is undefined. +// C comment +// /* +// ** Search the wal file for page pgno. If found, set *piRead to the frame that +// ** contains the page. Otherwise, if pgno is not in the wal file, set *piRead +// ** to zero. +// ** +// ** Return SQLITE_OK if successful, or an error code if an error occurs. If an +// ** error does occur, the final value of *piRead is undefined. +// */ func _sqlite3WalFindFrame(tls *crt.TLS, _pWal *XWal, _pgno uint32, _piRead *uint32) (r0 int32) { var _iHash, _iMinHash, _2_iKey, _2_nCollide, _2_rc int32 var _iRead, _iLast, _2_iZero, _4_iFrame uint32 var _2_aHash *uint16 var _2_aPgno *uint32 _iRead = u32(0) - _iLast = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + _iLast = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 func() { - if int32(_pWal.X9) < i32(0) && (_pWal.X23) == 0 { + if int32(_pWal.X9) < i32(0) && _pWal.X23 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57067), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000))), unsafe.Pointer(str(16369))) crt.X__builtin_abort(tls) } @@ -16273,20 +17188,20 @@ _5: _2_nCollide = i32(8192) _2_iKey = _walHash(tls, _pgno) _11: - if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey)))) == 0 { + if (*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_aHash)) + 2*uintptr(_2_iKey)))) == 0 { goto _14 } - _4_iFrame = uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey)))) + _2_iZero - if ((_4_iFrame <= _iLast) && (_4_iFrame >= (_pWal.X19))) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aPgno)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey))))))) == _pgno) { + _4_iFrame = uint32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_aHash)) + 2*uintptr(_2_iKey)))) + _2_iZero + if ((_4_iFrame <= _iLast) && (_4_iFrame >= _pWal.X19)) && ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_aPgno)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_aHash)) + 2*uintptr(_2_iKey))))))) == _pgno) { func() { - if _4_iFrame <= _iRead && (_sqlite3Config.X6) != i32(0) { + if _4_iFrame <= _iRead && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000))), unsafe.Pointer(str(16406))) crt.X__builtin_abort(tls) } }() _iRead = _4_iFrame } - if postInc1(&_2_nCollide, int32(-1)) == i32(0) { + if postInc1(&_2_nCollide, -1) == i32(0) { return _sqlite3CorruptError(tls, i32(57126)) } _2_iKey = _walNextHash(tls, _2_iKey) @@ -16308,9 +17223,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalFindFrameØ00__func__Ø000[0], str(16433), 20) } -// Compute a hash on a page number. The resulting hash value must land -// between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances -// the hash to the next value in the event of a collision. +// C comment +// /* +// ** Compute a hash on a page number. The resulting hash value must land +// ** between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances +// ** the hash to the next value in the event of a collision. +// */ func _walHash(tls *crt.TLS, _iPage uint32) (r0 int32) { func() { if _iPage <= uint32(i32(0)) { @@ -16332,15 +17250,18 @@ func _walNextHash(tls *crt.TLS, _iPriorHash int32) (r0 int32) { return (_iPriorHash + i32(1)) & i32(8191) } -// Read the content for page pPg out of the database file and into -// pPg->pData. A shared lock or greater must be held on the database -// file before this function is called. -// -// If page 1 is read, then the value of Pager.dbFileVers[] is set to -// the value read from the database file. -// -// If an IO error occurs, then the IO error is returned to the caller. -// Otherwise, SQLITE_OK is returned. +// C comment +// /* +// ** Read the content for page pPg out of the database file and into +// ** pPg->pData. A shared lock or greater must be held on the database +// ** file before this function is called. +// ** +// ** If page 1 is read, then the value of Pager.dbFileVers[] is set to +// ** the value read from the database file. +// ** +// ** If an IO error occurs, then the IO error is returned to the caller. +// ** Otherwise, SQLITE_OK is returned. +// */ func _readDbPage(tls *crt.TLS, _pPg *XPgHdr, _iFrame uint32) (r0 int32) { var _rc, _pgsz int32 var _2_iOffset int64 @@ -16352,7 +17273,7 @@ func _readDbPage(tls *crt.TLS, _pPg *XPgHdr, _iFrame uint32) (r0 int32) { _rc = i32(0) _pgsz = _pPager.X48 func() { - if int32(_pPager.X14) < i32(1) || (_pPager.X13) != 0 { + if int32(_pPager.X14) < i32(1) || _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49903), unsafe.Pointer((*int8)(unsafe.Pointer(&_readDbPageØ00__func__Ø000))), unsafe.Pointer(str(16469))) crt.X__builtin_abort(tls) } @@ -16377,11 +17298,11 @@ _6: goto _8 } if _rc != 0 { - crt.Xmemset(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), i32(255), u64(16)) + crt.Xmemset(tls, unsafe.Pointer((*[16]int8)(unsafe.Pointer(&_pPager.X40))), i32(255), u64(16)) goto _10 } _6_dbFileVers = (*uint8)(unsafe.Pointer(uintptr(_pPg.X1) + 1*uintptr(i32(24)))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)(_6_dbFileVers), u64(16)) + crt.Xmemcpy(tls, unsafe.Pointer((*[16]int8)(unsafe.Pointer(&_pPager.X40))), unsafe.Pointer(_6_dbFileVers), u64(16)) _10: _8: return _rc @@ -16393,16 +17314,19 @@ func init() { crt.Xstrncpy(nil, &_readDbPageØ00__func__Ø000[0], str(16527), 11) } -// Read the contents of frame iRead from the wal file into buffer pOut -// (which is nOut bytes in size). Return SQLITE_OK if successful, or an -// error code otherwise. +// C comment +// /* +// ** Read the contents of frame iRead from the wal file into buffer pOut +// ** (which is nOut bytes in size). Return SQLITE_OK if successful, or an +// ** error code otherwise. +// */ func _sqlite3WalReadFrame(tls *crt.TLS, _pWal *XWal, _iRead uint32, _nOut int32, _pOut *uint8) (r0 int32) { var _sz int32 var _iOffset int64 - _sz = int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) + _sz = int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5) _sz = (_sz & i32(65024)) + ((_sz & i32(1)) << uint(i32(16))) _iOffset = (int64(i32(32)) + (int64(_iRead-uint32(i32(1))) * int64(_sz+i32(24)))) + int64(i32(24)) - return _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_pOut), func() int32 { + return _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(_pOut), func() int32 { if _nOut > _sz { return _sz } @@ -16411,20 +17335,24 @@ func _sqlite3WalReadFrame(tls *crt.TLS, _pWal *XWal, _iRead uint32, _nOut int32, } func _sqlite3OsRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X2)})))(tls, _id, _pBuf, _amt, _offset) -} - -// Restart the backup process. This is called when the pager layer -// detects that the database has been modified by an external database -// connection. In this case there is no way of knowing which of the -// pages that have been copied into the destination database are still -// valid and which are not, so the entire process needs to be restarted. -// -// It is assumed that the mutex associated with the BtShared object -// corresponding to the source database is held when this function is -// called. + return func() func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X2 + return *(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _pBuf, _amt, _offset) +} + +// C comment +// /* +// ** Restart the backup process. This is called when the pager layer +// ** detects that the database has been modified by an external database +// ** connection. In this case there is no way of knowing which of the +// ** pages that have been copied into the destination database are still +// ** valid and which are not, so the entire process needs to be restarted. +// ** +// ** It is assumed that the mutex associated with the BtShared object +// ** corresponding to the source database is held when this function is +// ** called. +// */ func _sqlite3BackupRestart(tls *crt.TLS, _pBackup *Xsqlite3_backup) { var _p *Xsqlite3_backup _p = _pBackup @@ -16438,7 +17366,7 @@ _0: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(i32(1)) + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(i32(1)) _p = (*Xsqlite3_backup)(_p.X11) goto _0 _3: @@ -16450,7 +17378,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BackupRestartØ00__func__Ø000[0], str(16578), 21) } -// Return a list of all dirty pages in the cache, sorted by page number. +// C comment +// /* +// ** Return a list of all dirty pages in the cache, sorted by page number. +// */ func _sqlite3PcacheDirtyList(tls *crt.TLS, _pCache *XPCache) (r0 *XPgHdr) { var _p *XPgHdr _p = (*XPgHdr)(_pCache.X0) @@ -16458,7 +17389,7 @@ _0: if _p == nil { goto _3 } - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = (*XPgHdr)(_p.X9) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = (*XPgHdr)(_p.X9) _p = (*XPgHdr)(_p.X9) goto _0 _3: @@ -16469,14 +17400,14 @@ func _pcacheSortDirtyList(tls *crt.TLS, _pIn *XPgHdr) (r0 *XPgHdr) { var _i int32 var _p *XPgHdr var _a [32]*XPgHdr - crt.Xmemset(tls, (unsafe.Pointer)(&_a), i32(0), u64(256)) + crt.Xmemset(tls, unsafe.Pointer(&_a), i32(0), u64(256)) _0: if _pIn == nil { goto _1 } _p = _pIn _pIn = (*XPgHdr)(_p.X3) - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = nil _i = i32(0) _2: if func() int32 { @@ -16491,12 +17422,12 @@ _2: }() == 0 { goto _7 } - if (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i)))) == nil { - *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i))) = _p + if (*(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i)))) == nil { + *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i))) = _p goto _7 } - _p = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i))), _p) - *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i))) = nil + _p = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i))), _p) + *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i))) = nil _i += 1 goto _2 _7: @@ -16510,24 +17441,24 @@ _7: } return i32(0) }() != 0 { - *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i))) = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i))), _p) + *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i))) = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i))), _p) } goto _0 _1: - _p = *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(i32(0)))) + _p = *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(i32(0)))) _i = i32(1) _13: if _i >= i32(32) { goto _16 } - if (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i)))) == nil { + if (*(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i)))) == nil { goto _14 } _p = func() *XPgHdr { if _p != nil { - return _pcacheMergeDirtyList(tls, _p, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i)))) + return _pcacheMergeDirtyList(tls, _p, *(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i)))) } - return (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 8*uintptr(_i)))) + return (*(**XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(&_a)) + 8*uintptr(_i)))) }() _14: _i += 1 @@ -16545,8 +17476,11 @@ func init() { crt.Xstrncpy(nil, &_pcacheSortDirtyListØ00__func__Ø000[0], str(16599), 20) } -// Merge two lists of pages connected by pDirty and in pgno order. -// Do not bother fixing the pDirtyPrev pointers. +// C comment +// /* +// ** Merge two lists of pages connected by pDirty and in pgno order. +// ** Do not bother fixing the pDirtyPrev pointers. +// */ func _pcacheMergeDirtyList(tls *crt.TLS, _pA *XPgHdr, _pB *XPgHdr) (r0 *XPgHdr) { var _result XPgHdr var _pTail *XPgHdr @@ -16558,23 +17492,23 @@ func _pcacheMergeDirtyList(tls *crt.TLS, _pA *XPgHdr, _pB *XPgHdr) (r0 *XPgHdr) } }() _3: - if (_pA.X5) >= (_pB.X5) { + if _pA.X5 >= _pB.X5 { goto _6 } - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pA + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X3)))) = _pA _pTail = _pA _pA = (*XPgHdr)(_pA.X3) if _pA == nil { - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pB + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X3)))) = _pB goto _5 } goto _8 _6: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pB + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X3)))) = _pB _pTail = _pB _pB = (*XPgHdr)(_pB.X3) if _pB == nil { - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pA + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X3)))) = _pA goto _5 } _8: @@ -16592,41 +17526,44 @@ func init() { crt.Xstrncpy(nil, &_pcacheMergeDirtyListØ00__func__Ø000[0], str(16634), 21) } -// Read a single page from either the journal file (if isMainJrnl==1) or -// from the sub-journal (if isMainJrnl==0) and playback that page. -// The page begins at offset *pOffset into the file. The *pOffset -// value is increased to the start of the next page in the journal. -// -// The main rollback journal uses checksums - the statement journal does -// not. -// -// If the page number of the page record read from the (sub-)journal file -// is greater than the current value of Pager.dbSize, then playback is -// skipped and SQLITE_OK is returned. -// -// If pDone is not NULL, then it is a record of pages that have already -// been played back. If the page at *pOffset has already been played back -// (if the corresponding pDone bit is set) then skip the playback. -// Make sure the pDone bit corresponding to the *pOffset page is set -// prior to returning. -// -// If the page record is successfully read from the (sub-)journal file -// and played back, then SQLITE_OK is returned. If an IO error occurs -// while reading the record from the (sub-)journal file or while writing -// to the database file, then the IO error code is returned. If data -// is successfully read from the (sub-)journal file but appears to be -// corrupted, SQLITE_DONE is returned. Data is considered corrupted in -// two circumstances: -// -// * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or -// * If the record is being rolled back from the main journal file -// and the checksum field does not match the record content. -// -// Neither of these two scenarios are possible during a savepoint rollback. -// -// If this is a savepoint rollback, then memory may have to be dynamically -// allocated by this function. If this is the case and an allocation fails, -// SQLITE_NOMEM is returned. +// C comment +// /* +// ** Read a single page from either the journal file (if isMainJrnl==1) or +// ** from the sub-journal (if isMainJrnl==0) and playback that page. +// ** The page begins at offset *pOffset into the file. The *pOffset +// ** value is increased to the start of the next page in the journal. +// ** +// ** The main rollback journal uses checksums - the statement journal does +// ** not. +// ** +// ** If the page number of the page record read from the (sub-)journal file +// ** is greater than the current value of Pager.dbSize, then playback is +// ** skipped and SQLITE_OK is returned. +// ** +// ** If pDone is not NULL, then it is a record of pages that have already +// ** been played back. If the page at *pOffset has already been played back +// ** (if the corresponding pDone bit is set) then skip the playback. +// ** Make sure the pDone bit corresponding to the *pOffset page is set +// ** prior to returning. +// ** +// ** If the page record is successfully read from the (sub-)journal file +// ** and played back, then SQLITE_OK is returned. If an IO error occurs +// ** while reading the record from the (sub-)journal file or while writing +// ** to the database file, then the IO error code is returned. If data +// ** is successfully read from the (sub-)journal file but appears to be +// ** corrupted, SQLITE_DONE is returned. Data is considered corrupted in +// ** two circumstances: +// ** +// ** * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or +// ** * If the record is being rolled back from the main journal file +// ** and the checksum field does not match the record content. +// ** +// ** Neither of these two scenarios are possible during a savepoint rollback. +// ** +// ** If this is a savepoint rollback, then memory may have to be dynamically +// ** allocated by this function. If this is the case and an allocation fails, +// ** SQLITE_NOMEM is returned. +// */ func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _pDone *XBitvec, _isMainJrnl int32, _isSavepnt int32) (r0 int32) { var _rc, _isSynced int32 var _11_ofst int64 @@ -16694,16 +17631,16 @@ func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _p if _rc != i32(0) { return _rc } - _rc = _sqlite3OsRead(tls, _jfd, (unsafe.Pointer)(_aData), _pPager.X48, (*_pOffset)+int64(i32(4))) + _rc = _sqlite3OsRead(tls, _jfd, unsafe.Pointer(_aData), _pPager.X48, (*_pOffset)+int64(i32(4))) if _rc != i32(0) { return _rc } { p := _pOffset - *p = (*p) + int64(((_pPager.X48)+i32(4))+(_isMainJrnl*i32(4))) + *p = (*p) + int64((_pPager.X48+i32(4))+(_isMainJrnl*i32(4))) sink6(*p) } - if (_pgno == uint32(i32(0))) || (_pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))) { + if (_pgno == uint32(i32(0))) || (_pgno == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1))) { func() { if _isSavepnt != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49220), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16948))) @@ -16712,7 +17649,7 @@ func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _p }() return i32(101) } - if (_pgno > (_pPager.X22)) || _sqlite3BitvecTest(tls, _pDone, _pgno) != 0 { + if (_pgno > _pPager.X22) || _sqlite3BitvecTest(tls, _pDone, _pgno) != 0 { return i32(0) } if _isMainJrnl == 0 { @@ -16729,8 +17666,8 @@ _33: if (_pDone != nil) && (store1(&_rc, _sqlite3BitvecSet(tls, _pDone, _pgno)) != i32(0)) { return _rc } - if (_pgno == uint32(i32(1))) && (int32(_pPager.X45) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(20)))))) { - *(*int16)(unsafe.Pointer(&(_pPager.X45))) = int16(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(20))))) + if (_pgno == uint32(i32(1))) && (int32(_pPager.X45) != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(i32(20)))))) { + *(*int16)(unsafe.Pointer(&_pPager.X45)) = int16(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(i32(20))))) } if (*XWal)(_pPager.X60) != nil { _pPg = nil @@ -16739,19 +17676,19 @@ _33: _pPg = _sqlite3PagerLookup(tls, _pPager, _pgno) _42: func() { - if _pPg == nil && (_pPager.X13) != 0 { + if _pPg == nil && _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49288), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16959))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pPager.X14) == i32(0) && _pPg != nil && (_pPager.X10) == 0 { + if int32(_pPager.X14) == i32(0) && _pPg != nil && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49289), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16973))) crt.X__builtin_abort(tls) } }() if _isMainJrnl != 0 { - _isSynced = bool2int(((_pPager.X4) != 0) || ((*_pOffset) <= (_pPager.X35))) + _isSynced = bool2int((_pPager.X4 != 0) || ((*_pOffset) <= _pPager.X35)) goto _52 } _isSynced = bool2int((_pPg == nil) || (i32(0) == (int32(_pPg.X6) & i32(8)))) @@ -16766,11 +17703,11 @@ _52: crt.X__builtin_abort(tls) } }() - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_aData), _pPager.X48, _11_ofst) - if _pgno > (_pPager.X24) { - *(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _pgno + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), unsafe.Pointer(_aData), _pPager.X48, _11_ofst) + if _pgno > _pPager.X24 { + *(*uint32)(unsafe.Pointer(&_pPager.X24)) = _pgno } - if (*Xsqlite3_backup)(_pPager.X36) != nil { + if _pPager.X36 != nil { _sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.X36), _pgno, (*uint8)(unsafe.Pointer(_aData))) } goto _64 @@ -16791,7 +17728,7 @@ _57: } }() { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) | i32(2)) sink2(*p) } @@ -16803,7 +17740,7 @@ _57: } }() { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) & i32(-3)) sink2(*p) } @@ -16816,12 +17753,13 @@ _64: goto _72 } _15_pData = _pPg.X1 - crt.Xmemcpy(tls, _15_pData, (unsafe.Pointer)(_aData), uint64(_pPager.X48)) - (*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_pPager.X56)})))(tls, _pPg) + crt.Xmemcpy(tls, _15_pData, unsafe.Pointer(_aData), uint64(_pPager.X48)) + func() func(*crt.TLS, *XPgHdr) { + v := _pPager.X56 + return *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&v)) + }()(tls, _pPg) if _pgno == uint32(i32(1)) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_15_pData)+1*uintptr(i32(24))))), u64(16)) + crt.Xmemcpy(tls, unsafe.Pointer((*[16]int8)(unsafe.Pointer(&_pPager.X40))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_15_pData)+1*uintptr(i32(24))))), u64(16)) } _sqlite3PcacheRelease(tls, _pPg) _72: @@ -16834,15 +17772,18 @@ func init() { crt.Xstrncpy(nil, &_pager_playback_one_pageØ00__func__Ø000[0], str(17130), 24) } -// Read a 32-bit integer from the given file descriptor. Store the integer -// that is read in *pRes. Return SQLITE_OK if everything worked, or an -// error code is something goes wrong. -// -// All values are stored on disk as big-endian. +// C comment +// /* +// ** Read a 32-bit integer from the given file descriptor. Store the integer +// ** that is read in *pRes. Return SQLITE_OK if everything worked, or an +// ** error code is something goes wrong. +// ** +// ** All values are stored on disk as big-endian. +// */ func _read32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _pRes *uint32) (r0 int32) { var _rc int32 var _ac [4]uint8 - _rc = _sqlite3OsRead(tls, _fd, (unsafe.Pointer)(&_ac), int32(u64(4)), _offset) + _rc = _sqlite3OsRead(tls, _fd, unsafe.Pointer(&_ac), int32(u64(4)), _offset) if _rc == i32(0) { *_pRes = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(&_ac))) } @@ -16852,9 +17793,12 @@ func _read32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _pRes *uint32) panic(0) } -// Read or write a four-byte big-endian integer value. +// C comment +// /* +// ** Read or write a four-byte big-endian integer value. +// */ func _sqlite3Get4byte(tls *crt.TLS, _p *uint8) (r0 uint32) { - return (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(3))))) + return (((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(3))))) } func _sqlite3BackupUpdate(tls *crt.TLS, _pBackup *Xsqlite3_backup, _iPage uint32, _aData *uint8) { @@ -16863,16 +17807,19 @@ func _sqlite3BackupUpdate(tls *crt.TLS, _pBackup *Xsqlite3_backup, _iPage uint32 } } -// This function is called after the contents of page iPage of the -// source database have been modified. If page iPage has already been -// copied into the destination database, then the data written to the -// destination is now invalidated. The destination copy of iPage needs -// to be updated with the new data before the backup operation is -// complete. -// -// It is assumed that the mutex associated with the BtShared object -// corresponding to the source database is held when this function is -// called. +// C comment +// /* +// ** This function is called after the contents of page iPage of the +// ** source database have been modified. If page iPage has already been +// ** copied into the destination database, then the data written to the +// ** destination is now invalidated. The destination copy of iPage needs +// ** to be updated with the new data before the backup operation is +// ** complete. +// ** +// ** 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 *crt.TLS, _p *Xsqlite3_backup, _iPage uint32, _aData *uint8) { var _2_rc int32 func() { @@ -16888,11 +17835,11 @@ _2: crt.X__builtin_abort(tls) } }() - if _isFatalError(tls, _p.X7) != 0 || _iPage >= (_p.X4) { + if _isFatalError(tls, _p.X7) != 0 || _iPage >= _p.X4 { goto _6 } func() { - if (*Xsqlite3)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69602), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupUpdateØ00__func__Ø000))), unsafe.Pointer(str(17154))) crt.X__builtin_abort(tls) } @@ -16907,7 +17854,7 @@ _2: } }() if _2_rc != i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X7))) = _2_rc + *(*int32)(unsafe.Pointer(&_p.X7)) = _2_rc } _6: if store26(&_p, (*Xsqlite3_backup)(_p.X11)) != nil { @@ -16921,9 +17868,12 @@ func init() { crt.Xstrncpy(nil, &_backupUpdateØ00__func__Ø000[0], str(17202), 13) } -// Argument rc is an SQLite error code. Return true if this error is -// considered fatal if encountered during a backup operation. All errors -// are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED. +// C comment +// /* +// ** Argument rc is an SQLite error code. Return true if this error is +// ** considered fatal if encountered during a backup operation. All errors +// ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED. +// */ func _isFatalError(tls *crt.TLS, _rc int32) (r0 int32) { return bool2int(((_rc != i32(0)) && (_rc != i32(5))) && func() int32 { if _rc != i32(6) { @@ -16943,9 +17893,12 @@ func init() { crt.Xstrncpy(nil, &_isFatalErrorØ00__func__Ø000[0], str(17215), 13) } -// Parameter zSrcData points to a buffer containing the data for -// page iSrcPg from the source database. Copy this data into the -// destination database. +// C comment +// /* +// ** Parameter zSrcData points to a buffer containing the data for +// ** page iSrcPg from the source database. Copy this data into the +// ** destination database. +// */ func _backupOnePage(tls *crt.TLS, _p *Xsqlite3_backup, _iSrcPg uint32, _zSrcData *uint8, _bUpdate int32) (r0 int32) { var _nSrcPgsz, _nDestPgsz, _nCopy, _rc int32 var _iEnd, _iOff int64 @@ -16971,7 +17924,7 @@ func _backupOnePage(tls *crt.TLS, _p *Xsqlite3_backup, _iSrcPg uint32, _zSrcData } }() func() { - if (_p.X3) == 0 { + if _p.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69147), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17270))) crt.X__builtin_abort(tls) } @@ -17010,13 +17963,13 @@ _14: if i32(0) != store1(&_rc, _sqlite3PagerGet(tls, _pDestPager, _2_iDest, &_2_pDestPg, i32(0))) || i32(0) != store1(&_rc, _sqlite3PagerWrite(tls, _2_pDestPg)) { goto _21 } - _3_zIn = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSrcData)) + 1*uintptr(_iOff%int64(_nSrcPgsz)))) + _3_zIn = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSrcData)) + 1*uintptr(_iOff%int64(_nSrcPgsz)))) _3_zDestData = (*uint8)(_sqlite3PagerGetData(tls, _2_pDestPg)) - _3_zOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_zDestData)) + 1*uintptr(_iOff%int64(_nDestPgsz)))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_3_zOut), (unsafe.Pointer)(_3_zIn), uint64(_nCopy)) + _3_zOut = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_zDestData)) + 1*uintptr(_iOff%int64(_nDestPgsz)))) + crt.Xmemcpy(tls, unsafe.Pointer(_3_zOut), unsafe.Pointer(_3_zIn), uint64(_nCopy)) *(*uint8)(unsafe.Pointer(uintptr(_sqlite3PagerGetExtra(tls, _2_pDestPg)) + 1*uintptr(i32(0)))) = uint8(i32(0)) if (_iOff == int64(i32(0))) && (_bUpdate == i32(0)) { - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_zOut))+1*uintptr(i32(28)))), _sqlite3BtreeLastPage(tls, (*XBtree)(_p.X6))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_zOut))+1*uintptr(i32(28)))), _sqlite3BtreeLastPage(tls, (*XBtree)(_p.X6))) } _21: _sqlite3PagerUnref(tls, _2_pDestPg) @@ -17031,26 +17984,35 @@ _18: return _rc } -// Return the pager associated with a BTree. This routine is used for -// testing and debugging only. +// C comment +// /* +// ** Return the pager associated with a BTree. This routine is used for +// ** testing and debugging only. +// */ func _sqlite3BtreePager(tls *crt.TLS, _p *XBtree) (r0 *XPager) { return (*XPager)((*XBtShared)(_p.X1).X0) } -// Return the currently defined page size +// C comment +// /* +// ** Return the currently defined page size +// */ func _sqlite3BtreeGetPageSize(tls *crt.TLS, _p *XBtree) (r0 int32) { return int32((*XBtShared)(_p.X1).X15) } -// This function is similar to sqlite3BtreeGetReserve(), except that it -// may only be called if it is guaranteed that the b-tree mutex is already -// held. -// -// This is useful in one special case in the backup API code where it is -// known that the shared b-tree mutex is held, but the mutex on the -// database handle that owns *p is not. In this case if sqlite3BtreeEnter() -// were to be called, it might collide with some other operation on the -// database handle that owns *p, causing undefined behavior. +// C comment +// /* +// ** This function is similar to sqlite3BtreeGetReserve(), except that it +// ** may only be called if it is guaranteed that the b-tree mutex is already +// ** held. +// ** +// ** This is useful in one special case in the backup API code where it is +// ** known that the shared b-tree mutex is held, but the mutex on the +// ** database handle that owns *p is not. In this case if sqlite3BtreeEnter() +// ** were to be called, it might collide with some other operation on the +// ** database handle that owns *p, causing undefined behavior. +// */ func _sqlite3BtreeGetReserveNoMutex(tls *crt.TLS, _p *XBtree) (r0 int32) { var _n int32 func() { @@ -17075,12 +18037,18 @@ func init() { crt.Xstrncpy(nil, &_backupOnePageØ00__func__Ø000[0], str(17419), 14) } -// Return true if this is an in-memory or temp-file backed pager. +// C comment +// /* +// ** Return true if this is an in-memory or temp-file backed pager. +// */ func _sqlite3PagerIsMemdb(tls *crt.TLS, _pPager *XPager) (r0 int32) { return int32(_pPager.X10) } -// Return a pointer to the data for the specified page. +// C comment +// /* +// ** Return a pointer to the data for the specified page. +// */ func _sqlite3PagerGetData(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) { func() { if int32(_pPg.X7) <= i32(0) && ((*XPager)(_pPg.X4).X13) == 0 { @@ -17097,8 +18065,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerGetDataØ00__func__Ø000[0], str(17467), 20) } -// Return a pointer to the Pager.nExtra bytes of "extra" space -// allocated along with the specified page. +// C comment +// /* +// ** Return a pointer to the Pager.nExtra bytes of "extra" space +// ** allocated along with the specified page. +// */ func _sqlite3PagerGetExtra(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) { return _pPg.X2 } @@ -17119,13 +18090,16 @@ func _sqlite3BtreeLastPage(tls *crt.TLS, _p *XBtree) (r0 uint32) { return _btreePagecount(tls, (*XBtShared)(_p.X1)) } -// Return true if the BtShared mutex is held on the btree, or if the -// B-Tree is not marked as sharable. -// -// This routine is used only from within assert() statements. +// C comment +// /* +// ** Return true if the BtShared mutex is held on the btree, or if the +// ** B-Tree is not marked as sharable. +// ** +// ** This routine is used only from within assert() statements. +// */ func _sqlite3BtreeHoldsMutex(tls *crt.TLS, _p *XBtree) (r0 int32) { func() { - if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && (_p.X6) <= i32(0) { + if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && _p.X6 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58885), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000))), unsafe.Pointer(str(17544))) crt.X__builtin_abort(tls) } @@ -17148,7 +18122,7 @@ func _sqlite3BtreeHoldsMutex(tls *crt.TLS, _p *XBtree) (r0 int32) { crt.X__builtin_abort(tls) } }() - return bool2int((int32(_p.X3) == i32(0)) || ((_p.X4) != 0)) + return bool2int((int32(_p.X3) == i32(0)) || (_p.X4 != 0)) } var _sqlite3BtreeHoldsMutexØ00__func__Ø000 [23]int8 @@ -17163,8 +18137,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeLastPageØ00__func__Ø000[0], str(17804), 21) } -// Return the size of the database file in pages. If there is any kind of -// error, return ((unsigned int)-1). +// C comment +// /* +// ** Return the size of the database file in pages. If there is any kind of +// ** error, return ((unsigned int)-1). +// */ func _btreePagecount(tls *crt.TLS, _pBt *XBtShared) (r0 uint32) { return _pBt.X18 } @@ -17175,21 +18152,24 @@ func _sqlite3PagerUnref(tls *crt.TLS, _pPg *XPgHdr) { } } -// The journal file must be open when this is called. A journal header file -// (JOURNAL_HDR_SZ bytes) is read from the current location in the journal -// file. The current location in the journal file is given by -// pPager->journalOff. See comments above function writeJournalHdr() for -// a description of the journal header format. -// -// If the header is read successfully, *pNRec is set to the number of -// page records following this header and *pDbSize is set to the size of the -// database before the transaction began, in pages. Also, pPager->cksumInit -// is set to the value read from the journal header. SQLITE_OK is returned -// in this case. -// -// If the journal header file appears to be corrupted, SQLITE_DONE is -// returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes -// cannot be read from the journal file an error code is returned. +// C comment +// /* +// ** The journal file must be open when this is called. A journal header file +// ** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal +// ** file. The current location in the journal file is given by +// ** pPager->journalOff. See comments above function writeJournalHdr() for +// ** a description of the journal header format. +// ** +// ** If the header is read successfully, *pNRec is set to the number of +// ** page records following this header and *pDbSize is set to the size of the +// ** database before the transaction began, in pages. Also, pPager->cksumInit +// ** is set to the value read from the journal header. SQLITE_OK is returned +// ** in this case. +// ** +// ** If the journal header file appears to be corrupted, SQLITE_DONE is +// ** returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes +// ** cannot be read from the journal file an error code is returned. +// */ func _readJournalHdr(tls *crt.TLS, _pPager *XPager, _isHot int32, _journalSize int64, _pNRec *uint32, _pDbSize *uint32) (r0 int32) { var _rc int32 var _iHdrOff int64 @@ -17201,26 +18181,26 @@ func _readJournalHdr(tls *crt.TLS, _pPager *XPager, _isHot int32, _journalSize i crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = _journalHdrOffset(tls, _pPager) - if ((_pPager.X34) + int64(_pPager.X47)) > _journalSize { + *(*int64)(unsafe.Pointer(&_pPager.X34)) = _journalHdrOffset(tls, _pPager) + if (_pPager.X34 + int64(_pPager.X47)) > _journalSize { return i32(101) } _iHdrOff = _pPager.X34 - if _isHot == 0 && _iHdrOff == (_pPager.X35) { + if _isHot == 0 && _iHdrOff == _pPager.X35 { goto _4 } - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_aMagic), int32(u64(8)), _iHdrOff) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_aMagic), int32(u64(8)), _iHdrOff) if _rc != 0 { return _rc } - if crt.Xmemcmp(tls, (unsafe.Pointer)(&_aMagic), (unsafe.Pointer)(&_aJournalMagic), u64(8)) != i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer(&_aMagic), unsafe.Pointer(&_aJournalMagic), u64(8)) != i32(0) { return i32(101) } _4: - if ((i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(8)), _pNRec))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(12)), (*uint32)(unsafe.Pointer(&(_pPager.X28))))))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(16)), _pDbSize))) { + if ((i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(8)), _pNRec))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(12)), (*uint32)(unsafe.Pointer(&_pPager.X28)))))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(16)), _pDbSize))) { return _rc } - if (_pPager.X34) != int64(i32(0)) { + if _pPager.X34 != int64(i32(0)) { goto _10 } if (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(20)), &_6_iSectorSize))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(24)), &_6_iPageSize))) { @@ -17233,10 +18213,10 @@ _4: return i32(101) } _rc = _sqlite3PagerSetPagesize(tls, _pPager, &_6_iPageSize, i32(-1)) - *(*uint32)(unsafe.Pointer(&(_pPager.X47))) = _6_iSectorSize + *(*uint32)(unsafe.Pointer(&_pPager.X47)) = _6_iSectorSize _10: { - p := (*int64)(unsafe.Pointer(&(_pPager.X34))) + p := (*int64)(unsafe.Pointer(&_pPager.X34)) *p = (*p) + int64(_pPager.X47) sink6(*p) } @@ -17252,34 +18232,37 @@ func init() { crt.Xstrncpy(nil, &_readJournalHdrØ00__func__Ø000[0], str(17825), 15) } -// Change the page size used by the Pager object. The new page size -// is passed in *pPageSize. -// -// If the pager is in the error state when this function is called, it -// is a no-op. The value returned is the error state error code (i.e. -// one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL). -// -// Otherwise, if all of the following are true: -// -// * the new page size (value of *pPageSize) is valid (a power -// of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and -// -// * there are no outstanding page references, and -// -// * the database is either not an in-memory database or it is -// an in-memory database that currently consists of zero pages. -// -// then the pager object page size is set to *pPageSize. -// -// If the page size is changed, then this function uses sqlite3PagerMalloc() -// to obtain a new Pager.pTmpSpace buffer. If this allocation attempt -// fails, SQLITE_NOMEM is returned and the page size remains unchanged. -// In all other cases, SQLITE_OK is returned. -// -// If the page size is not changed, either because one of the enumerated -// conditions above is not true, the pager was in error state when this -// function was called, or because the memory allocation attempt failed, -// then *pPageSize is set to the old, retained page size before returning. +// C comment +// /* +// ** Change the page size used by the Pager object. The new page size +// ** is passed in *pPageSize. +// ** +// ** If the pager is in the error state when this function is called, it +// ** is a no-op. The value returned is the error state error code (i.e. +// ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL). +// ** +// ** Otherwise, if all of the following are true: +// ** +// ** * the new page size (value of *pPageSize) is valid (a power +// ** of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and +// ** +// ** * there are no outstanding page references, and +// ** +// ** * the database is either not an in-memory database or it is +// ** an in-memory database that currently consists of zero pages. +// ** +// ** then the pager object page size is set to *pPageSize. +// ** +// ** If the page size is changed, then this function uses sqlite3PagerMalloc() +// ** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt +// ** fails, SQLITE_NOMEM is returned and the page size remains unchanged. +// ** In all other cases, SQLITE_OK is returned. +// ** +// ** If the page size is not changed, either because one of the enumerated +// ** conditions above is not true, the pager was in error state when this +// ** function was called, or because the memory allocation attempt failed, +// ** then *pPageSize is set to the old, retained page size before returning. +// */ func _sqlite3PagerSetPagesize(tls *crt.TLS, _pPager *XPager, _pPageSize *uint32, _nReserve int32) (r0 int32) { var _rc int32 var _1_nByte int64 @@ -17293,7 +18276,7 @@ func _sqlite3PagerSetPagesize(tls *crt.TLS, _pPager *XPager, _pPageSize *uint32, crt.X__builtin_abort(tls) } }() - if int32(_pPager.X13) != i32(0) && (_pPager.X22) != uint32(i32(0)) || _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) || _pageSize == 0 || _pageSize == uint32(_pPager.X48) { + if int32(_pPager.X13) != i32(0) && _pPager.X22 != uint32(i32(0)) || _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) || _pageSize == 0 || _pageSize == uint32(_pPager.X48) { goto _8 } _1_pNew = nil @@ -17314,13 +18297,13 @@ _11: _rc = _sqlite3PcacheSetPageSize(tls, (*XPCache)(_pPager.X59), int32(_pageSize)) } if _rc == i32(0) { - _sqlite3PageFree(tls, (unsafe.Pointer)(_pPager.X58)) - *(**int8)(unsafe.Pointer(&(_pPager.X58))) = _1_pNew - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = uint32(((_1_nByte + int64(_pageSize)) - int64(i32(1))) / int64(_pageSize)) - *(*int32)(unsafe.Pointer(&(_pPager.X48))) = int32(_pageSize) + _sqlite3PageFree(tls, unsafe.Pointer(_pPager.X58)) + *(**int8)(unsafe.Pointer(&_pPager.X58)) = _1_pNew + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = uint32(((_1_nByte + int64(_pageSize)) - int64(i32(1))) / int64(_pageSize)) + *(*int32)(unsafe.Pointer(&_pPager.X48)) = int32(_pageSize) goto _15 } - _sqlite3PageFree(tls, (unsafe.Pointer)(_1_pNew)) + _sqlite3PageFree(tls, unsafe.Pointer(_1_pNew)) _15: _8: *_pPageSize = uint32(_pPager.X48) @@ -17336,7 +18319,7 @@ _8: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_pPager.X45))) = int16(_nReserve) + *(*int16)(unsafe.Pointer(&_pPager.X45)) = int16(_nReserve) _pagerFixMaplimit(tls, _pPager) _16: return _rc @@ -17349,41 +18332,54 @@ func init() { } func _sqlite3OsFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X6)})))(tls, _id, _pSize) -} - -// Malloc function used by SQLite to obtain space from the buffer configured -// using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer -// exists, this function falls back to sqlite3Malloc(). + return func() func(*crt.TLS, *Xsqlite3_file, *int64) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X6 + return *(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _pSize) +} + +// C comment +// /* +// ** Malloc function used by SQLite to obtain space from the buffer configured +// ** using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer +// ** exists, this function falls back to sqlite3Malloc(). +// */ func _sqlite3PageMalloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) { return _pcache1Alloc(tls, _sz) } -// Discard the entire contents of the in-memory page-cache. +// C comment +// /* +// ** Discard the entire contents of the in-memory page-cache. +// */ func _pager_reset(tls *crt.TLS, _pPager *XPager) { - *(*uint32)(unsafe.Pointer(&(_pPager.X39))) += 1 + *(*uint32)(unsafe.Pointer(&_pPager.X39)) += 1 _sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.X36)) _sqlite3PcacheClear(tls, (*XPCache)(_pPager.X59)) } -// Discard the contents of the cache. +// C comment +// /* +// ** Discard the contents of the cache. +// */ func _sqlite3PcacheClear(tls *crt.TLS, _pCache *XPCache) { _sqlite3PcacheTruncate(tls, _pCache, uint32(i32(0))) } -// Drop every cache entry whose page number is greater than "pgno". The -// caller must ensure that there are no outstanding references to any pages -// other than page 1 with a page number greater than pgno. -// -// If there is a reference to page 1 and the pgno parameter passed to this -// function is 0, then the data area associated with page 1 is zeroed, but -// the page object is not dropped. +// C comment +// /* +// ** Drop every cache entry whose page number is greater than "pgno". The +// ** caller must ensure that there are no outstanding references to any pages +// ** other than page 1 with a page number greater than pgno. +// ** +// ** If there is a reference to page 1 and the pgno parameter passed to this +// ** function is 0, then the data area associated with page 1 is zeroed, but +// ** the page object is not dropped. +// */ func _sqlite3PcacheTruncate(tls *crt.TLS, _pCache *XPCache, _pgno uint32) { var _1_p, _1_pNext *XPgHdr var _4_pPage1 *Xsqlite3_pcache_page - if (_pCache.X12) == nil { + if _pCache.X12 == nil { goto _0 } _1_p = (*XPgHdr)(_pCache.X0) @@ -17393,12 +18389,12 @@ _1: } _1_pNext = (*XPgHdr)(_1_p.X9) func() { - if (_1_p.X5) <= uint32(i32(0)) { + if _1_p.X5 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000))), unsafe.Pointer(str(17958))) crt.X__builtin_abort(tls) } }() - if (_1_p.X5) > _pgno { + if _1_p.X5 > _pgno { func() { if (int32(_1_p.X6) & i32(2)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000))), unsafe.Pointer(str(17968))) @@ -17410,12 +18406,13 @@ _1: _1_p = _1_pNext goto _1 _4: - if _pgno != uint32(i32(0)) || (_pCache.X3) == 0 { + if _pgno != uint32(i32(0)) || _pCache.X3 == 0 { goto _11 } - _4_pPage1 = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, uint32(i32(1)), i32(0)) + _4_pPage1 = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X7 + return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v)) + }()(tls, _pCache.X12, uint32(i32(1)), i32(0)) if func() int32 { if _4_pPage1 != nil { return i32(1) @@ -17430,7 +18427,7 @@ _4: _pgno = uint32(i32(1)) } _11: - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X10)(tls, _pCache.X12, _pgno+uint32(i32(1))) + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X10)(tls, _pCache.X12, _pgno+uint32(i32(1))) _0: } @@ -17440,8 +18437,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheTruncateØ00__func__Ø000[0], str(17989), 22) } -// Make sure the page is marked as clean. If it isn't clean already, -// make it so. +// C comment +// /* +// ** Make sure the page is marked as clean. If it isn't clean already, +// ** make it so. +// */ func _sqlite3PcacheMakeClean(tls *crt.TLS, _p *XPgHdr) { func() { if _sqlite3PcachePageSanity(tls, _p) == 0 { @@ -17469,12 +18469,12 @@ func _sqlite3PcacheMakeClean(tls *crt.TLS, _p *XPgHdr) { }() _pcacheManageDirtyList(tls, _p, uint8(i32(1))) { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) & i32(-15)) sink14(*p) } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } @@ -17496,29 +18496,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheMakeCleanØ00__func__Ø000[0], str(18039), 23) } -// Change the page size for PCache object. The caller must ensure that there -// are no outstanding page references when this function is called. +// C comment +// /* +// ** Change the page size for PCache object. The caller must ensure that there +// ** are no outstanding page references when this function is called. +// */ func _sqlite3PcacheSetPageSize(tls *crt.TLS, _pCache *XPCache, _szPage int32) (r0 int32) { var _1_pNew unsafe.Pointer func() { - if (_pCache.X3) != i32(0) || (*XPgHdr)(_pCache.X0) != nil { + if _pCache.X3 != i32(0) || (*XPgHdr)(_pCache.X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44444), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(18062))) crt.X__builtin_abort(tls) } }() - if (_pCache.X6) == 0 { + if _pCache.X6 == 0 { goto _3 } - _1_pNew = ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X4)(tls, _szPage, int32(uint64(_pCache.X7)+u64(72)), int32(_pCache.X8)) + _1_pNew = ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X4)(tls, _szPage, int32(uint64(_pCache.X7)+u64(72)), int32(_pCache.X8)) if _1_pNew == nil { return _sqlite3NomemError(tls, i32(44451)) } - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X5)(tls, _1_pNew, _numberOfCachePages(tls, _pCache)) - if (_pCache.X12) != nil { - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X11)(tls, _pCache.X12) + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X5)(tls, _1_pNew, _numberOfCachePages(tls, _pCache)) + if _pCache.X12 != nil { + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X11)(tls, _pCache.X12) } - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X12))) = _1_pNew - *(*int32)(unsafe.Pointer(&(_pCache.X6))) = _szPage + *(*unsafe.Pointer)(unsafe.Pointer(&_pCache.X12)) = _1_pNew + *(*int32)(unsafe.Pointer(&_pCache.X6)) = _szPage _3: return i32(0) } @@ -17529,52 +18532,65 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheSetPageSizeØ00__func__Ø000[0], str(18102), 25) } -// Compute the number of pages of cache requested. p->szCache is the -// cache size requested by the "PRAGMA cache_size" statement. +// C comment +// /* +// ** Compute the number of pages of cache requested. p->szCache is the +// ** cache size requested by the "PRAGMA cache_size" statement. +// */ func _numberOfCachePages(tls *crt.TLS, _p *XPCache) (r0 int32) { - if (_p.X4) >= i32(0) { + if _p.X4 >= i32(0) { return _p.X4 } - return int32((int64(i32(-1024)) * int64(_p.X4)) / int64((_p.X6)+(_p.X7))) + return int32((int64(i32(-1024)) * int64(_p.X4)) / int64(_p.X6+_p.X7)) } -// Free an allocated buffer obtained from sqlite3PageMalloc(). +// C comment +// /* +// ** Free an allocated buffer obtained from sqlite3PageMalloc(). +// */ func _sqlite3PageFree(tls *crt.TLS, _p unsafe.Pointer) { _pcache1Free(tls, _p) } -// Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap. +// C comment +// /* +// ** Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap. +// */ func _pagerFixMaplimit(tls *crt.TLS, _pPager *XPager) { var _1_sz int64 var _fd *Xsqlite3_file _fd = (*Xsqlite3_file)(_pPager.X31) if ((*Xsqlite3_io_methods)(_fd.X0) != nil) && (((*Xsqlite3_io_methods)(_fd.X0).X0) >= i32(3)) { _1_sz = _pPager.X42 - *(*uint8)(unsafe.Pointer(&(_pPager.X20))) = uint8(bool2int(_1_sz > int64(i32(0)))) + *(*uint8)(unsafe.Pointer(&_pPager.X20)) = uint8(bool2int(_1_sz > int64(i32(0)))) _setGetterMethod(tls, _pPager) - _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(18), (unsafe.Pointer)(&_1_sz)) + _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(18), unsafe.Pointer(&_1_sz)) } } -// Set the Pager.xGet method for the appropriate routine used to fetch -// content from the pager. +// C comment +// /* +// ** Set the Pager.xGet method for the appropriate routine used to fetch +// ** content from the pager. +// */ func _setGetterMethod(tls *crt.TLS, _pPager *XPager) { - if (_pPager.X26) != 0 { - *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageError + if _pPager.X26 != 0 { + *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pPager.X57)))) = _getPageError goto _3 } - if (_pPager.X20) != 0 { - *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageMMap + if _pPager.X20 != 0 { + *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pPager.X57)))) = _getPageMMap goto _3 } - *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageNormal + *(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pPager.X57)))) = _getPageNormal _3: } -// The page getter method for when the pager is an error state +// C comment +// /* The page getter method for when the pager is an error state */ func _getPageError(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) { func() { - if (_pPager.X26) == i32(0) { + if _pPager.X26 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52502), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageErrorØ00__func__Ø000))), unsafe.Pointer(str(12253))) crt.X__builtin_abort(tls) } @@ -17589,7 +18605,8 @@ func init() { crt.Xstrncpy(nil, &_getPageErrorØ00__func__Ø000[0], str(18127), 13) } -// The page getter for when memory-mapped I/O is enabled +// C comment +// /* The page getter for when memory-mapped I/O is enabled */ func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) { var _rc, _bMmapOk int32 var _iFrame uint32 @@ -17600,7 +18617,7 @@ func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _iFrame = u32(0) _bMmapOk = bool2int((_pgno > uint32(i32(1))) && ((int32(_pPager.X14) == i32(1)) || (_flags&i32(2)) != 0)) func() { - if (_pPager.X20) == 0 { + if _pPager.X20 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52440), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(18140))) crt.X__builtin_abort(tls) } @@ -17627,7 +18644,7 @@ func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52455), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -17649,7 +18666,7 @@ _15: if _rc != i32(0) || _4_pData == nil { goto _20 } - if (int32(_pPager.X14) > i32(1)) || ((_pPager.X10) != 0) { + if (int32(_pPager.X14) > i32(1)) || (_pPager.X10 != 0) { _pPg = _sqlite3PagerLookup(tls, _pPager, _pgno) } if _pPg == nil { @@ -17683,27 +18700,32 @@ func init() { crt.Xstrncpy(nil, &_getPageMMapØ00__func__Ø000[0], str(18215), 12) } -// The real implementation of xFetch and xUnfetch +// C comment +// /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _iAmt int32, _pp *unsafe.Pointer) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X17)})))(tls, _id, _iOff, _iAmt, _pp) -} - -// Obtain a reference to a memory mapped page object for page number pgno. -// The new object will use the pointer pData, obtained from xFetch(). -// If successful, set *ppPage to point to the new page reference -// and return SQLITE_OK. Otherwise, return an SQLite error code and set -// *ppPage to zero. -// -// Page references obtained by calling this function should be released -// by calling pagerReleaseMapPage(). + return func() func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X17 + return *(*func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _iOff, _iAmt, _pp) +} + +// C comment +// /* +// ** Obtain a reference to a memory mapped page object for page number pgno. +// ** The new object will use the pointer pData, obtained from xFetch(). +// ** If successful, set *ppPage to point to the new page reference +// ** and return SQLITE_OK. Otherwise, return an SQLite error code and set +// ** *ppPage to zero. +// ** +// ** Page references obtained by calling this function should be released +// ** by calling pagerReleaseMapPage(). +// */ func _pagerAcquireMapPage(tls *crt.TLS, _pPager *XPager, _pgno uint32, _pData unsafe.Pointer, _ppPage **XPgHdr) (r0 int32) { var _p *XPgHdr - if (*XPgHdr)(_pPager.X43) != nil { + if _pPager.X43 != nil { *_ppPage = store25(&_p, (*XPgHdr)(_pPager.X43)) - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X43))))) = (*XPgHdr)(_p.X3) - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X43)))) = (*XPgHdr)(_p.X3) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = nil func() { if int32(_pPager.X44) < i32(8) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50940), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18227))) @@ -17718,13 +18740,13 @@ func _pagerAcquireMapPage(tls *crt.TLS, _pPager *XPager, _pgno uint32, _pData un _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(_pgno-uint32(i32(1)))*int64(_pPager.X48), _pData) return _sqlite3NomemError(tls, i32(50946)) } - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 72*uintptr(i32(1))))) - *(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(i32(32)) - *(*int16)(unsafe.Pointer(&(_p.X7))) = int16(i32(1)) - *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _pPager + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X2)) = unsafe.Pointer((*XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 72*uintptr(i32(1))))) + *(*uint16)(unsafe.Pointer(&_p.X6)) = uint16(i32(32)) + *(*int16)(unsafe.Pointer(&_p.X7)) = int16(i32(1)) + *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = _pPager _3: func() { - if _p.X2 != (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+72*uintptr(i32(1))))) { + if _p.X2 != unsafe.Pointer((*XPgHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_p))+72*uintptr(i32(1))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50954), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18245))) crt.X__builtin_abort(tls) } @@ -17753,9 +18775,9 @@ _3: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X5))) = _pgno - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))) = _pData - *(*int32)(unsafe.Pointer(&(_pPager.X41))) += 1 + *(*uint32)(unsafe.Pointer(&_p.X5)) = _pgno + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X1)) = _pData + *(*int32)(unsafe.Pointer(&_pPager.X41)) += 1 return i32(0) } @@ -17765,61 +18787,64 @@ func init() { crt.Xstrncpy(nil, &_pagerAcquireMapPageØ00__func__Ø000[0], str(18321), 20) } -// The page getter methods each try to acquire a reference to a -// page with page number pgno. If the requested reference is -// successfully obtained, it is copied to *ppPage and SQLITE_OK returned. -// -// There are different implementations of the getter method depending -// on the current state of the pager. -// -// getPageNormal() -- The normal getter -// getPageError() -- Used if the pager is in an error state -// getPageMmap() -- Used if memory-mapped I/O is enabled -// -// If the requested page is already in the cache, it is returned. -// Otherwise, a new page object is allocated and populated with data -// read from the database file. In some cases, the pcache module may -// choose not to allocate a new page object and may reuse an existing -// object with no outstanding references. -// -// The extra data appended to a page is always initialized to zeros the -// first time a page is loaded into memory. If the page requested is -// already in the cache when this function is called, then the extra -// data is left as it was when the page object was last used. -// -// If the database image is smaller than the requested page or if -// the flags parameter contains the PAGER_GET_NOCONTENT bit and the -// requested page is not already stored in the cache, then no -// actual disk read occurs. In this case the memory image of the -// page is initialized to all zeros. -// -// If PAGER_GET_NOCONTENT is true, it means that we do not care about -// the contents of the page. This occurs in two scenarios: -// -// a) When reading a free-list leaf page from the database, and -// -// b) When a savepoint is being rolled back and we need to load -// a new page into the cache to be filled with the data read -// from the savepoint journal. -// -// If PAGER_GET_NOCONTENT is true, then the data returned is zeroed instead -// of being read from the database. Additionally, the bits corresponding -// to pgno in Pager.pInJournal (bitvec of pages already written to the -// journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open -// savepoints are set. This means if the page is made writable at any -// point in the future, using a call to sqlite3PagerWrite(), its contents -// will not be journaled. This saves IO. -// -// The acquisition might fail for several reasons. In all cases, -// an appropriate error code is returned and *ppPage is set to NULL. -// -// See also sqlite3PagerLookup(). Both this routine and Lookup() attempt -// to find a page in the in-memory cache first. If the page is not already -// in memory, this routine goes to disk to read it in whereas Lookup() -// just returns 0. This routine acquires a read-lock the first time it -// has to go to disk, and could also playback an old journal if necessary. -// Since Lookup() never goes to disk, it never has to deal with locks -// or journal files. +// C comment +// /* +// ** The page getter methods each try to acquire a reference to a +// ** page with page number pgno. If the requested reference is +// ** successfully obtained, it is copied to *ppPage and SQLITE_OK returned. +// ** +// ** There are different implementations of the getter method depending +// ** on the current state of the pager. +// ** +// ** getPageNormal() -- The normal getter +// ** getPageError() -- Used if the pager is in an error state +// ** getPageMmap() -- Used if memory-mapped I/O is enabled +// ** +// ** If the requested page is already in the cache, it is returned. +// ** Otherwise, a new page object is allocated and populated with data +// ** read from the database file. In some cases, the pcache module may +// ** choose not to allocate a new page object and may reuse an existing +// ** object with no outstanding references. +// ** +// ** The extra data appended to a page is always initialized to zeros the +// ** first time a page is loaded into memory. If the page requested is +// ** already in the cache when this function is called, then the extra +// ** data is left as it was when the page object was last used. +// ** +// ** If the database image is smaller than the requested page or if +// ** the flags parameter contains the PAGER_GET_NOCONTENT bit and the +// ** requested page is not already stored in the cache, then no +// ** actual disk read occurs. In this case the memory image of the +// ** page is initialized to all zeros. +// ** +// ** If PAGER_GET_NOCONTENT is true, it means that we do not care about +// ** the contents of the page. This occurs in two scenarios: +// ** +// ** a) When reading a free-list leaf page from the database, and +// ** +// ** b) When a savepoint is being rolled back and we need to load +// ** a new page into the cache to be filled with the data read +// ** from the savepoint journal. +// ** +// ** If PAGER_GET_NOCONTENT is true, then the data returned is zeroed instead +// ** of being read from the database. Additionally, the bits corresponding +// ** to pgno in Pager.pInJournal (bitvec of pages already written to the +// ** journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open +// ** savepoints are set. This means if the page is made writable at any +// ** point in the future, using a call to sqlite3PagerWrite(), its contents +// ** will not be journaled. This saves IO. +// ** +// ** The acquisition might fail for several reasons. In all cases, +// ** an appropriate error code is returned and *ppPage is set to NULL. +// ** +// ** See also sqlite3PagerLookup(). Both this routine and Lookup() attempt +// ** to find a page in the in-memory cache first. If the page is not already +// ** in memory, this routine goes to disk to read it in whereas Lookup() +// ** just returns 0. This routine acquires a read-lock the first time it +// ** has to go to disk, and could also playback an old journal if necessary. +// ** Since Lookup() never goes to disk, it never has to deal with locks +// ** or journal files. +// */ func _getPageNormal(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) { var _rc int32 var _10_iFrame uint32 @@ -17828,7 +18853,7 @@ func _getPageNormal(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHd var _pBase *Xsqlite3_pcache_page _rc = i32(0) func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52326), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -17876,7 +18901,7 @@ _9: } }() func() { - if (_pPg.X5) != _pgno { + if _pPg.X5 != _pgno { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52344), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18356))) crt.X__builtin_abort(tls) } @@ -17888,31 +18913,31 @@ _9: } }() _noContent = uint8(bool2int((_flags & i32(1)) != i32(0))) - if ((*XPager)(_pPg.X4) != nil) && (_noContent == 0) { + if (_pPg.X4 != nil) && (_noContent == 0) { func() { - if _pgno > uint32(i32(2147483647)) || _pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) { + if _pgno > uint32(i32(2147483647)) || _pgno == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52351), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18410))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(0)))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(i32(0)))) += 1 return i32(0) } - if (_pgno > uint32(i32(2147483647))) || (_pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))) { + if (_pgno > uint32(i32(2147483647))) || (_pgno == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1))) { _rc = _sqlite3CorruptError(tls, i32(52363)) goto _pager_acquire_err } - *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X4))))) = _pPager + *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPg.X4)))) = _pPager func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && (_pPager.X13) != 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52369), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18462))) crt.X__builtin_abort(tls) } }() - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && (_pPager.X22) >= _pgno && _noContent == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && _pPager.X22 >= _pgno && _noContent == 0 { goto _32 } - if _pgno > (_pPager.X49) { + if _pgno > _pPager.X49 { _rc = i32(13) goto _pager_acquire_err } @@ -17920,7 +18945,7 @@ _9: goto _34 } _sqlite3BeginBenignMalloc(tls) - if _pgno <= (_pPager.X23) { + if _pgno <= _pPager.X23 { _rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.X30), _pgno) } _rc = _addToSavepointBitvecs(tls, _pPager, _pgno) @@ -17944,7 +18969,7 @@ _37: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(1)))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(i32(1)))) += 1 _rc = _readDbPage(tls, _pPg, _10_iFrame) if _rc != i32(0) { goto _pager_acquire_err @@ -17973,39 +18998,42 @@ func init() { crt.Xstrncpy(nil, &_getPageNormalØ00__func__Ø000[0], str(18526), 14) } -// If the sqlite3PcacheFetch() routine is unable to allocate a new -// page because no clean pages are available for reuse and the cache -// size limit has been reached, then this routine can be invoked to -// try harder to allocate a page. This routine might invoke the stress -// callback to spill dirty pages to the journal. It will then try to -// allocate the new page and will only fail to allocate a new page on -// an OOM error. -// -// This routine should be invoked only after sqlite3PcacheFetch() fails. +// C comment +// /* +// ** If the sqlite3PcacheFetch() routine is unable to allocate a new +// ** page because no clean pages are available for reuse and the cache +// ** size limit has been reached, then this routine can be invoked to +// ** try harder to allocate a page. This routine might invoke the stress +// ** callback to spill dirty pages to the journal. It will then try to +// ** allocate the new page and will only fail to allocate a new page on +// ** an OOM error. +// ** +// ** This routine should be invoked only after sqlite3PcacheFetch() fails. +// */ func _sqlite3PcacheFetchStress(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _ppPage **Xsqlite3_pcache_page) (r0 int32) { var _3_rc int32 var _pPg *XPgHdr if int32(_pCache.X9) == i32(2) { return i32(0) } - if _sqlite3PcachePagecount(tls, _pCache) <= (_pCache.X5) { + if _sqlite3PcachePagecount(tls, _pCache) <= _pCache.X5 { goto _1 } _pPg = (*XPgHdr)(_pCache.X2) _2: - if _pPg == nil || (_pPg.X7) == 0 && (int32(_pPg.X6)&i32(8)) == 0 { + if _pPg == nil || _pPg.X7 == 0 && (int32(_pPg.X6)&i32(8)) == 0 { goto _7 } _pPg = (*XPgHdr)(_pPg.X10) goto _2 _7: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = _pPg + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X2)))) = _pPg if _pPg != nil { goto _8 } _pPg = (*XPgHdr)(_pCache.X1) _9: - if _pPg == nil || (_pPg.X7) == 0 { + if _pPg == nil || _pPg.X7 == 0 { goto _13 } _pPg = (*XPgHdr)(_pPg.X10) @@ -18015,17 +19043,19 @@ _8: if _pPg == nil { goto _14 } - _3_rc = (*(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{(_pCache.X10)})))(tls, _pCache.X11, _pPg) + _3_rc = func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 { + v := _pCache.X10 + return *(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&v)) + }()(tls, _pCache.X11, _pPg) if (_3_rc != i32(0)) && (_3_rc != i32(5)) { return _3_rc } _14: _1: - *_ppPage = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, _pgno, i32(2)) + *_ppPage = func() func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X7 + return *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&v)) + }()(tls, _pCache.X12, _pgno, i32(2)) return func() int32 { if (*_ppPage) == nil { return _sqlite3NomemError(tls, i32(44572)) @@ -18034,15 +19064,18 @@ _1: }() } -// Return the total number of pages in the cache. +// C comment +// /* +// ** Return the total number of pages in the cache. +// */ func _sqlite3PcachePagecount(tls *crt.TLS, _pCache *XPCache) (r0 int32) { func() { - if (_pCache.X12) == nil { + if _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44922), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePagecountØ00__func__Ø000))), unsafe.Pointer(str(15958))) crt.X__builtin_abort(tls) } }() - return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X6)(tls, _pCache.X12) + return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X6)(tls, _pCache.X12) } var _sqlite3PcachePagecountØ00__func__Ø000 [23]int8 @@ -18052,38 +19085,42 @@ func init() { } func _sqlite3OsFileControlHint(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) { - (*(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X10)})))(tls, _id, _op, _pArg) -} - -// Move the write position of the WAL back to the point identified by -// the values in the aWalData[] array. aWalData must point to an array -// of WAL_SAVEPOINT_NDATA u32 values that has been previously populated -// by a call to WalSavepoint(). + func() func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X10 + return *(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _op, _pArg) +} + +// C comment +// /* +// ** Move the write position of the WAL back to the point identified by +// ** the values in the aWalData[] array. aWalData must point to an array +// ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated +// ** by a call to WalSavepoint(). +// */ func _sqlite3WalSavepointUndo(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) (r0 int32) { var _rc int32 _rc = i32(0) func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57316), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } }() func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3))))) == (_pWal.X22) && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0))))) > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(3))))) == _pWal.X22 && (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(0))))) > ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57317), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000))), unsafe.Pointer(str(18563))) crt.X__builtin_abort(tls) } }() - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3))))) != (_pWal.X22) { - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0)))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22 + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(3))))) != _pWal.X22 { + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(0)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0))))) < ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(1)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(2)))) + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(0))))) < ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(1)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(2)))) _walCleanupHash(tls, _pWal) } return _rc @@ -18095,57 +19132,60 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalSavepointUndoØ00__func__Ø000[0], str(18622), 24) } -// This routine ends a transaction. A transaction is usually ended by -// either a COMMIT or a ROLLBACK operation. This routine may be called -// after rollback of a hot-journal, or if an error occurs while opening -// the journal file or writing the very first journal-header of a -// database transaction. -// -// This routine is never called in PAGER_ERROR state. If it is called -// in PAGER_NONE or PAGER_SHARED state and the lock held is less -// exclusive than a RESERVED lock, it is a no-op. -// -// Otherwise, any active savepoints are released. -// -// If the journal file is open, then it is "finalized". Once a journal -// file has been finalized it is not possible to use it to roll back a -// transaction. Nor will it be considered to be a hot-journal by this -// or any other database connection. Exactly how a journal is finalized -// depends on whether or not the pager is running in exclusive mode and -// the current journal-mode (Pager.journalMode value), as follows: -// -// journalMode==MEMORY -// Journal file descriptor is simply closed. This destroys an -// in-memory journal. -// -// journalMode==TRUNCATE -// Journal file is truncated to zero bytes in size. -// -// journalMode==PERSIST -// The first 28 bytes of the journal file are zeroed. This invalidates -// the first journal header in the file, and hence the entire journal -// file. An invalid journal file cannot be rolled back. -// -// journalMode==DELETE -// The journal file is closed and deleted using sqlite3OsDelete(). -// -// If the pager is running in exclusive mode, this method of finalizing -// the journal file is never used. Instead, if the journalMode is -// DELETE and the pager is in exclusive mode, the method described under -// journalMode==PERSIST is used instead. -// -// After the journal is finalized, the pager moves to PAGER_READER state. -// If running in non-exclusive rollback mode, the lock on the file is -// downgraded to a SHARED_LOCK. -// -// SQLITE_OK is returned if no error occurs. If an error occurs during -// any of the IO operations to finalize the journal file or unlock the -// database then the IO error code is returned to the user. If the -// operation to finalize the journal file fails, then the code still -// tries to unlock the database file if not in exclusive mode. If the -// unlock operation fails as well, then the first error code related -// to the first error encountered (the journal finalization one) is -// returned. +// C comment +// /* +// ** This routine ends a transaction. A transaction is usually ended by +// ** either a COMMIT or a ROLLBACK operation. This routine may be called +// ** after rollback of a hot-journal, or if an error occurs while opening +// ** the journal file or writing the very first journal-header of a +// ** database transaction. +// ** +// ** This routine is never called in PAGER_ERROR state. If it is called +// ** in PAGER_NONE or PAGER_SHARED state and the lock held is less +// ** exclusive than a RESERVED lock, it is a no-op. +// ** +// ** Otherwise, any active savepoints are released. +// ** +// ** If the journal file is open, then it is "finalized". Once a journal +// ** file has been finalized it is not possible to use it to roll back a +// ** transaction. Nor will it be considered to be a hot-journal by this +// ** or any other database connection. Exactly how a journal is finalized +// ** depends on whether or not the pager is running in exclusive mode and +// ** the current journal-mode (Pager.journalMode value), as follows: +// ** +// ** journalMode==MEMORY +// ** Journal file descriptor is simply closed. This destroys an +// ** in-memory journal. +// ** +// ** journalMode==TRUNCATE +// ** Journal file is truncated to zero bytes in size. +// ** +// ** journalMode==PERSIST +// ** The first 28 bytes of the journal file are zeroed. This invalidates +// ** the first journal header in the file, and hence the entire journal +// ** file. An invalid journal file cannot be rolled back. +// ** +// ** journalMode==DELETE +// ** The journal file is closed and deleted using sqlite3OsDelete(). +// ** +// ** If the pager is running in exclusive mode, this method of finalizing +// ** the journal file is never used. Instead, if the journalMode is +// ** DELETE and the pager is in exclusive mode, the method described under +// ** journalMode==PERSIST is used instead. +// ** +// ** After the journal is finalized, the pager moves to PAGER_READER state. +// ** If running in non-exclusive rollback mode, the lock on the file is +// ** downgraded to a SHARED_LOCK. +// ** +// ** SQLITE_OK is returned if no error occurs. If an error occurs during +// ** any of the IO operations to finalize the journal file or unlock the +// ** database then the IO error code is returned to the user. If the +// ** operation to finalize the journal file fails, then the code still +// ** tries to unlock the database file if not in exclusive mode. If the +// ** unlock operation fails as well, then the first error code related +// ** to the first error encountered (the journal finalization one) is +// ** returned. +// */ func _pager_end_transaction(tls *crt.TLS, _pPager *XPager, _hasMaster int32, _bCommit int32) (r0 int32) { var _rc, _rc2, _9_bDelete int32 _rc = i32(0) @@ -18188,24 +19228,24 @@ func _pager_end_transaction(tls *crt.TLS, _pPager *XPager, _hasMaster int32, _bC if int32(_pPager.X2) != i32(3) { goto _14 } - if (_pPager.X34) == int64(i32(0)) { + if _pPager.X34 == int64(i32(0)) { _rc = i32(0) goto _16 } _rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), int64(i32(0))) - if (_rc == i32(0)) && ((_pPager.X5) != 0) { + if (_rc == i32(0)) && (_pPager.X5 != 0) { _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), int32(_pPager.X9)) } _16: - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) goto _24 _14: - if (int32(_pPager.X2) == i32(1)) || (((_pPager.X1) != 0) && (int32(_pPager.X2) != i32(5))) { - _rc = _zeroJournalHdr(tls, _pPager, bool2int(_hasMaster != 0 || ((_pPager.X10) != 0))) - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) + if (int32(_pPager.X2) == i32(1)) || ((_pPager.X1 != 0) && (int32(_pPager.X2) != i32(5))) { + _rc = _zeroJournalHdr(tls, _pPager, bool2int(_hasMaster != 0 || (_pPager.X10 != 0))) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) goto _24 } - _9_bDelete = bool2int((_pPager.X10) == 0) + _9_bDelete = bool2int(_pPager.X10 == 0) func() { if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X32)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48967), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18691))) @@ -18225,12 +19265,12 @@ _14: _24: _9: _sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30)) - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil - *(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0) + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X30)))) = nil + *(*int32)(unsafe.Pointer(&_pPager.X27)) = i32(0) if _rc != i32(0) { goto _32 } - if ((_pPager.X13) != 0) || _pagerFlushOnCommit(tls, _pPager, _bCommit) != 0 { + if (_pPager.X13 != 0) || _pagerFlushOnCommit(tls, _pPager, _bCommit) != 0 { _sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.X59)) goto _35 } @@ -18248,7 +19288,7 @@ _32: }() goto _42 } - if ((_rc == i32(0)) && _bCommit != 0) && ((_pPager.X24) > (_pPager.X22)) { + if ((_rc == i32(0)) && _bCommit != 0) && (_pPager.X24 > _pPager.X22) { func() { if int32(_pPager.X15) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49016), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18888))) @@ -18266,12 +19306,12 @@ _42: _rc = i32(0) } _47: - if ((_pPager.X1) == 0) && (((*XWal)(_pPager.X60) == nil) || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(0)) != 0) { + if (_pPager.X1 == 0) && (((*XWal)(_pPager.X60) == nil) || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(0)) != 0) { _rc2 = _pagerUnlockDb(tls, _pPager, i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = uint8(i32(0)) } - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X17)) = uint8(i32(0)) return func() int32 { if _rc == i32(0) { return _rc2 @@ -18286,54 +19326,61 @@ func init() { crt.Xstrncpy(nil, &_pager_end_transactionØ00__func__Ø000[0], str(18918), 22) } -// Free all structures in the Pager.aSavepoint[] array and set both -// Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal -// if it is open and the pager is not in exclusive mode. +// C comment +// /* +// ** Free all structures in the Pager.aSavepoint[] array and set both +// ** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal +// ** if it is open and the pager is not in exclusive mode. +// */ func _releaseAllSavepoints(tls *crt.TLS, _pPager *XPager) { var _ii int32 _ii = i32(0) _0: - if _ii >= (_pPager.X38) { + if _ii >= _pPager.X38 { goto _3 } _sqlite3BitvecDestroy(tls, (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37)+48*uintptr(_ii))).X2)) _ii += 1 goto _0 _3: - if ((_pPager.X1) == 0) || _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X33)) != 0 { + if (_pPager.X1 == 0) || _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X33)) != 0 { _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X33)) } Xsqlite3_free(tls, _pPager.X37) - *(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X37))))) = nil - *(*int32)(unsafe.Pointer(&(_pPager.X38))) = i32(0) - *(*uint32)(unsafe.Pointer(&(_pPager.X29))) = uint32(i32(0)) + *(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X37)))) = nil + *(*int32)(unsafe.Pointer(&_pPager.X38)) = i32(0) + *(*uint32)(unsafe.Pointer(&_pPager.X29)) = uint32(i32(0)) } func _sqlite3OsSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X5)})))(tls, _id, _flags) -} - -// The journal file must be open when this function is called. -// -// This function is a no-op if the journal file has not been written to -// within the current transaction (i.e. if Pager.journalOff==0). -// -// If doTruncate is non-zero or the Pager.journalSizeLimit variable is -// set to 0, then truncate the journal file to zero bytes in size. Otherwise, -// zero the 28-byte header at the start of the journal file. In either case, -// if the pager is not in no-sync mode, sync the journal file immediately -// after writing or truncating it. -// -// If Pager.journalSizeLimit is set to a positive, non-zero value, and -// following the truncation or zeroing described above the size of the -// journal file in bytes is larger than this value, then truncate the -// journal file to Pager.journalSizeLimit bytes. The journal file does -// not need to be synced following this operation. -// -// If an IO error occurs, abandon processing and return the IO error code. -// Otherwise, return SQLITE_OK. + return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X5 + return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _flags) +} + +// C comment +// /* +// ** The journal file must be open when this function is called. +// ** +// ** This function is a no-op if the journal file has not been written to +// ** within the current transaction (i.e. if Pager.journalOff==0). +// ** +// ** If doTruncate is non-zero or the Pager.journalSizeLimit variable is +// ** set to 0, then truncate the journal file to zero bytes in size. Otherwise, +// ** zero the 28-byte header at the start of the journal file. In either case, +// ** if the pager is not in no-sync mode, sync the journal file immediately +// ** after writing or truncating it. +// ** +// ** If Pager.journalSizeLimit is set to a positive, non-zero value, and +// ** following the truncation or zeroing described above the size of the +// ** journal file in bytes is larger than this value, then truncate the +// ** journal file to Pager.journalSizeLimit bytes. The journal file does +// ** not need to be synced following this operation. +// ** +// ** If an IO error occurs, abandon processing and return the IO error code. +// ** Otherwise, return SQLITE_OK. +// */ func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32) { var _rc int32 var _1_iLimit, _5_sz int64 @@ -18350,7 +19397,7 @@ func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32 crt.X__builtin_abort(tls) } }() - if (_pPager.X34) == 0 { + if _pPager.X34 == 0 { goto _4 } _1_iLimit = _pPager.X50 @@ -18358,9 +19405,9 @@ func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32 _rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), int64(i32(0))) goto _7 } - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_zeroJournalHdrØ00zeroHdrØ001), int32(u64(28)), int64(i32(0))) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_zeroJournalHdrØ00zeroHdrØ001), int32(u64(28)), int64(i32(0))) _7: - if (_rc == i32(0)) && ((_pPager.X4) == 0) { + if (_rc == i32(0)) && (_pPager.X4 == 0) { _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), i32(16)|int32(_pPager.X9)) } if _rc != i32(0) || _1_iLimit <= int64(i32(0)) { @@ -18390,9 +19437,10 @@ func _sqlite3OsDelete(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _dirSync crt.X__builtin_abort(tls) } }() - return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pVfs.X7)})))(tls, _pVfs, _zPath, _dirSync) + return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32 { + v := _pVfs.X7 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _zPath, _dirSync) } var _sqlite3OsDeleteØ00__func__Ø000 [16]int8 @@ -18401,20 +19449,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3OsDeleteØ00__func__Ø000[0], str(19019), 16) } -// The write transaction open on pPager is being committed (bCommit==1) -// or rolled back (bCommit==0). -// -// Return TRUE if and only if all dirty pages should be flushed to disk. -// -// Rules: -// -// * For non-TEMP databases, always sync to disk. This is necessary -// for transactions to be durable. -// -// * Sync TEMP database only on a COMMIT (not a ROLLBACK) when the backing -// file has been created already (via a spill on pagerStress()) and -// when the number of dirty pages in memory exceeds 25% of the total -// cache size. +// C comment +// /* +// ** The write transaction open on pPager is being committed (bCommit==1) +// ** or rolled back (bCommit==0). +// ** +// ** Return TRUE if and only if all dirty pages should be flushed to disk. +// ** +// ** Rules: +// ** +// ** * For non-TEMP databases, always sync to disk. This is necessary +// ** for transactions to be durable. +// ** +// ** * Sync TEMP database only on a COMMIT (not a ROLLBACK) when the backing +// ** file has been created already (via a spill on pagerStress()) and +// ** when the number of dirty pages in memory exceeds 25% of the total +// ** cache size. +// */ func _pagerFlushOnCommit(tls *crt.TLS, _pPager *XPager, _bCommit int32) (r0 int32) { if int32(_pPager.X10) == i32(0) { return i32(1) @@ -18428,8 +19479,11 @@ func _pagerFlushOnCommit(tls *crt.TLS, _pPager *XPager, _bCommit int32) (r0 int3 return bool2int(_sqlite3PCachePercentDirty(tls, (*XPCache)(_pPager.X59)) >= i32(25)) } -// Return the number of dirty pages currently in the cache, as a percentage -// of the configured cache size. +// C comment +// /* +// ** Return the number of dirty pages currently in the cache, as a percentage +// ** of the configured cache size. +// */ func _sqlite3PCachePercentDirty(tls *crt.TLS, _pCache *XPCache) (r0 int32) { var _nDirty, _nCache int32 var _pDirty *XPgHdr @@ -18452,7 +19506,10 @@ _3: }() } -// Make every page in the cache clean. +// C comment +// /* +// ** Make every page in the cache clean. +// */ func _sqlite3PcacheCleanAll(tls *crt.TLS, _pCache *XPCache) { var _p *XPgHdr _0: @@ -18462,7 +19519,10 @@ _0: } } -// Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages. +// C comment +// /* +// ** Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages. +// */ func _sqlite3PcacheClearWritable(tls *crt.TLS, _pCache *XPCache) { var _p *XPgHdr _p = (*XPgHdr)(_pCache.X0) @@ -18471,59 +19531,66 @@ _0: goto _3 } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) & i32(-13)) sink14(*p) } _p = (*XPgHdr)(_p.X9) goto _0 _3: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = (*XPgHdr)(_pCache.X1) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X2)))) = (*XPgHdr)(_pCache.X1) } -// End a write transaction. The commit has already been done. This -// routine merely releases the lock. +// C comment +// /* +// ** End a write transaction. The commit has already been done. This +// ** routine merely releases the lock. +// */ func _sqlite3WalEndWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) { - if (_pWal.X12) != 0 { + if _pWal.X12 != 0 { _walUnlockExclusive(tls, _pWal, i32(0), i32(1)) - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_pWal.X20))) = uint32(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_pWal.X20)) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X15)) = uint8(i32(0)) } return i32(0) } func _walUnlockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) { - if (_pWal.X11) != 0 { + if _pWal.X11 != 0 { return } _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, _n, i32(9)) } func _sqlite3OsShmLock(tls *crt.TLS, _id *Xsqlite3_file, _offset int32, _n int32, _flags int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X14)})))(tls, _id, _offset, _n, _flags) -} - -// This function is used to change the actual size of the database -// file in the file-system. This only happens when committing a transaction, -// or rolling back a transaction (including rolling back a hot-journal). -// -// If the main database file is not open, or the pager is not in either -// DBMOD or OPEN state, this function is a no-op. Otherwise, the size -// of the file is changed to nPage pages (nPage*pPager->pageSize bytes). -// If the file on disk is currently larger than nPage pages, then use the VFS -// xTruncate() method to truncate it. -// -// Or, it might be the case that the file on disk is smaller than -// nPage pages. Some operating system implementations can get confused if -// you try to truncate a file to some size that is larger than it -// currently is, so detect this case and write a single zero byte to -// the end of the new file instead. -// -// If successful, return SQLITE_OK. If an IO error occurs while modifying -// the database file, return the error code to the caller. + return func() func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X14 + return *(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _offset, _n, _flags) +} + +// C comment +// /* +// ** This function is used to change the actual size of the database +// ** file in the file-system. This only happens when committing a transaction, +// ** or rolling back a transaction (including rolling back a hot-journal). +// ** +// ** If the main database file is not open, or the pager is not in either +// ** DBMOD or OPEN state, this function is a no-op. Otherwise, the size +// ** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). +// ** If the file on disk is currently larger than nPage pages, then use the VFS +// ** xTruncate() method to truncate it. +// ** +// ** Or, it might be the case that the file on disk is smaller than +// ** nPage pages. Some operating system implementations can get confused if +// ** you try to truncate a file to some size that is larger than it +// ** currently is, so detect this case and write a single zero byte to +// ** the end of the new file instead. +// ** +// ** If successful, return SQLITE_OK. If an IO error occurs while modifying +// ** the database file, return the error code to the caller. +// */ func _pager_truncate(tls *crt.TLS, _pPager *XPager, _nPage uint32) (r0 int32) { var _rc, _1_szPage int32 var _1_currentSize, _1_newSize int64 @@ -18562,12 +19629,12 @@ func _pager_truncate(tls *crt.TLS, _pPager *XPager, _nPage uint32) (r0 int32) { } if (_1_currentSize + int64(_1_szPage)) <= _1_newSize { _4_pTmp = _pPager.X58 - crt.Xmemset(tls, (unsafe.Pointer)(_4_pTmp), i32(0), uint64(_1_szPage)) - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_4_pTmp), _1_szPage, _1_newSize-int64(_1_szPage)) + crt.Xmemset(tls, unsafe.Pointer(_4_pTmp), i32(0), uint64(_1_szPage)) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), unsafe.Pointer(_4_pTmp), _1_szPage, _1_newSize-int64(_1_szPage)) } _13: if _rc == i32(0) { - *(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _nPage + *(*uint32)(unsafe.Pointer(&_pPager.X24)) = _nPage } _10: _6: @@ -18580,28 +19647,31 @@ func init() { crt.Xstrncpy(nil, &_pager_truncateØ00__func__Ø000[0], str(19064), 15) } -// This function is called to change the WAL subsystem into or out -// of locking_mode=EXCLUSIVE. -// -// If op is zero, then attempt to change from locking_mode=EXCLUSIVE -// into locking_mode=NORMAL. This means that we must acquire a lock -// on the pWal->readLock byte. If the WAL is already in locking_mode=NORMAL -// or if the acquisition of the lock fails, then return 0. If the -// transition out of exclusive-mode is successful, return 1. This -// operation must occur while the pager is still holding the exclusive -// lock on the main database file. -// -// If op is one, then change from locking_mode=NORMAL into -// locking_mode=EXCLUSIVE. This means that the pWal->readLock must -// be released. Return 1 if the transition is made and 0 if the -// WAL is already in exclusive-locking mode - meaning that this -// routine is a no-op. The pager must already hold the exclusive lock -// on the main database file before invoking this operation. -// -// If op is negative, then do a dry-run of the op==1 case but do -// not actually change anything. The pager uses this to see if it -// should acquire the database exclusive lock prior to invoking -// the op==1 case. +// C comment +// /* +// ** This function is called to change the WAL subsystem into or out +// ** of locking_mode=EXCLUSIVE. +// ** +// ** If op is zero, then attempt to change from locking_mode=EXCLUSIVE +// ** into locking_mode=NORMAL. This means that we must acquire a lock +// ** on the pWal->readLock byte. If the WAL is already in locking_mode=NORMAL +// ** or if the acquisition of the lock fails, then return 0. If the +// ** transition out of exclusive-mode is successful, return 1. This +// ** operation must occur while the pager is still holding the exclusive +// ** lock on the main database file. +// ** +// ** If op is one, then change from locking_mode=NORMAL into +// ** locking_mode=EXCLUSIVE. This means that the pWal->readLock must +// ** be released. Return 1 if the transition is made and 0 if the +// ** WAL is already in exclusive-locking mode - meaning that this +// ** routine is a no-op. The pager must already hold the exclusive lock +// ** on the main database file before invoking this operation. +// ** +// ** If op is negative, then do a dry-run of the op==1 case but do +// ** not actually change anything. The pager uses this to see if it +// ** should acquire the database exclusive lock prior to invoking +// ** the op==1 case. +// */ func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) { var _rc int32 func() { @@ -18617,7 +19687,7 @@ func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) { } }() func() { - if int32(_pWal.X9) < i32(0) && (_pWal.X23) == 0 { + if int32(_pWal.X9) < i32(0) && _pWal.X23 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57911), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(16369))) crt.X__builtin_abort(tls) } @@ -18631,12 +19701,12 @@ func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) { if _op != i32(0) { goto _12 } - if (_pWal.X11) == 0 { + if _pWal.X11 == 0 { goto _13 } - *(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X11)) = uint8(i32(0)) if _walLockShared(tls, _pWal, i32(3)+int32(_pWal.X9)) != i32(0) { - *(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X11)) = uint8(i32(1)) } _rc = bool2int(int32(_pWal.X11) == i32(0)) goto _15 @@ -18659,7 +19729,7 @@ _12: } }() _walUnlockShared(tls, _pWal, i32(3)+int32(_pWal.X9)) - *(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X11)) = uint8(i32(1)) _rc = i32(1) goto _22 } @@ -18674,40 +19744,46 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalExclusiveModeØ00__func__Ø000[0], str(19245), 24) } -// Set or release locks on the WAL. Locks are either shared or exclusive. -// A lock cannot be moved directly between shared and exclusive - it must go -// through the unlocked state first. -// -// In locking_mode=EXCLUSIVE, all of these routines become no-ops. +// C comment +// /* +// ** Set or release locks on the WAL. Locks are either shared or exclusive. +// ** A lock cannot be moved directly between shared and exclusive - it must go +// ** through the unlocked state first. +// ** +// ** In locking_mode=EXCLUSIVE, all of these routines become no-ops. +// */ func _walLockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) (r0 int32) { var _rc int32 - if (_pWal.X11) != 0 { + if _pWal.X11 != 0 { return i32(0) } _rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, i32(1), i32(6)) - *(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5)))) + *(*uint8)(unsafe.Pointer(&_pWal.X23)) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5)))) return _rc } func _walUnlockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) { - if (_pWal.X11) != 0 { + if _pWal.X11 != 0 { return } _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, i32(1), i32(5)) } -// Unlock the database file to level eLock, which must be either NO_LOCK -// or SHARED_LOCK. Regardless of whether or not the call to xUnlock() -// succeeds, set the Pager.eLock variable to match the (attempted) new lock. -// -// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -// called, do not modify it. See the comment above the #define of -// UNKNOWN_LOCK for an explanation of this. +// C comment +// /* +// ** Unlock the database file to level eLock, which must be either NO_LOCK +// ** or SHARED_LOCK. Regardless of whether or not the call to xUnlock() +// ** succeeds, set the Pager.eLock variable to match the (attempted) new lock. +// ** +// ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +// ** called, do not modify it. See the comment above the #define of +// ** UNKNOWN_LOCK for an explanation of this. +// */ func _pagerUnlockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) { var _rc int32 _rc = i32(0) func() { - if (_pPager.X1) != 0 && int32(_pPager.X15) != _eLock { + if _pPager.X1 != 0 && int32(_pPager.X15) != _eLock { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48049), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000))), unsafe.Pointer(str(19269))) crt.X__builtin_abort(tls) } @@ -18734,13 +19810,13 @@ func _pagerUnlockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) { } }() _rc = func() int32 { - if (_pPager.X11) != 0 { + if _pPager.X11 != 0 { return i32(0) } return _sqlite3OsUnlock(tls, (*Xsqlite3_file)(_pPager.X31), _eLock) }() if int32(_pPager.X15) != i32(5) { - *(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(_eLock) + *(*uint8)(unsafe.Pointer(&_pPager.X15)) = uint8(_eLock) } _9: return _rc @@ -18753,66 +19829,70 @@ func init() { } func _sqlite3OsUnlock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X8)})))(tls, _id, _lockType) -} - -// Playback the journal and thus restore the database file to -// the state it was in before we started making changes. -// -// The journal file format is as follows: -// -// (1) 8 byte prefix. A copy of aJournalMagic[]. -// (2) 4 byte big-endian integer which is the number of valid page records -// in the journal. If this value is 0xffffffff, then compute the -// number of page records from the journal size. -// (3) 4 byte big-endian integer which is the initial value for the -// sanity checksum. -// (4) 4 byte integer which is the number of pages to truncate the -// database to during a rollback. -// (5) 4 byte big-endian integer which is the sector size. The header -// is this many bytes in size. -// (6) 4 byte big-endian integer which is the page size. -// (7) zero padding out to the next sector size. -// (8) Zero or more pages instances, each as follows: -// + 4 byte page number. -// + pPager->pageSize bytes of data. -// + 4 byte checksum -// -// When we speak of the journal header, we mean the first 7 items above. -// Each entry in the journal is an instance of the 8th item. -// -// Call the value from the second bullet "nRec". nRec is the number of -// valid page entries in the journal. In most cases, you can compute the -// value of nRec from the size of the journal file. But if a power -// failure occurred while the journal was being written, it could be the -// case that the size of the journal file had already been increased but -// the extra entries had not yet made it safely to disk. In such a case, -// the value of nRec computed from the file size would be too large. For -// that reason, we always use the nRec value in the header. -// -// If the nRec value is 0xffffffff it means that nRec should be computed -// from the file size. This value is used when the user selects the -// no-sync option for the journal. A power failure could lead to corruption -// in this case. But for things like temporary table (which will be -// deleted when the power is restored) we don't care. -// -// If the file opened as the journal file is not a well-formed -// journal file then all pages up to the first corrupted page are rolled -// back (or no pages if the journal header is corrupted). The journal file -// is then deleted and SQLITE_OK returned, just as if no corruption had -// been encountered. -// -// If an I/O or malloc() error occurs, the journal-file is not deleted -// and an error code is returned. -// -// The isHot parameter indicates that we are trying to rollback a journal -// that might be a hot journal. Or, it could be that the journal is -// preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE. -// If the journal really is hot, reset the pager cache prior rolling -// back any content. If the journal is merely persistent, no reset is -// needed. + return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X8 + return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _lockType) +} + +// C comment +// /* +// ** Playback the journal and thus restore the database file to +// ** the state it was in before we started making changes. +// ** +// ** The journal file format is as follows: +// ** +// ** (1) 8 byte prefix. A copy of aJournalMagic[]. +// ** (2) 4 byte big-endian integer which is the number of valid page records +// ** in the journal. If this value is 0xffffffff, then compute the +// ** number of page records from the journal size. +// ** (3) 4 byte big-endian integer which is the initial value for the +// ** sanity checksum. +// ** (4) 4 byte integer which is the number of pages to truncate the +// ** database to during a rollback. +// ** (5) 4 byte big-endian integer which is the sector size. The header +// ** is this many bytes in size. +// ** (6) 4 byte big-endian integer which is the page size. +// ** (7) zero padding out to the next sector size. +// ** (8) Zero or more pages instances, each as follows: +// ** + 4 byte page number. +// ** + pPager->pageSize bytes of data. +// ** + 4 byte checksum +// ** +// ** When we speak of the journal header, we mean the first 7 items above. +// ** Each entry in the journal is an instance of the 8th item. +// ** +// ** Call the value from the second bullet "nRec". nRec is the number of +// ** valid page entries in the journal. In most cases, you can compute the +// ** value of nRec from the size of the journal file. But if a power +// ** failure occurred while the journal was being written, it could be the +// ** case that the size of the journal file had already been increased but +// ** the extra entries had not yet made it safely to disk. In such a case, +// ** the value of nRec computed from the file size would be too large. For +// ** that reason, we always use the nRec value in the header. +// ** +// ** If the nRec value is 0xffffffff it means that nRec should be computed +// ** from the file size. This value is used when the user selects the +// ** no-sync option for the journal. A power failure could lead to corruption +// ** in this case. But for things like temporary table (which will be +// ** deleted when the power is restored) we don't care. +// ** +// ** If the file opened as the journal file is not a well-formed +// ** journal file then all pages up to the first corrupted page are rolled +// ** back (or no pages if the journal header is corrupted). The journal file +// ** is then deleted and SQLITE_OK returned, just as if no corruption had +// ** been encountered. +// ** +// ** If an I/O or malloc() error occurs, the journal-file is not deleted +// ** and an error code is returned. +// ** +// ** The isHot parameter indicates that we are trying to rollback a journal +// ** that might be a hot journal. Or, it could be that the journal is +// ** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE. +// ** If the journal really is hot, reset the pager cache prior rolling +// ** back any content. If the journal is merely persistent, no reset is +// ** needed. +// */ func _pager_playback(tls *crt.TLS, _pPager *XPager, _isHot int32) (r0 int32) { var _rc, _res, _needPagerReset, _nPlayback int32 var _szJ int64 @@ -18836,14 +19916,14 @@ func _pager_playback(tls *crt.TLS, _pPager *XPager, _isHot int32) (r0 int32) { } _zMaster = _pPager.X58 _rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.X32), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.X0).X2)+i32(1))) - if (_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != 0) { + if (_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(i32(0))))) != 0) { _rc = _sqlite3OsAccess(tls, _pVfs, _zMaster, i32(0), &_res) } _zMaster = nil if (_rc != i32(0)) || (_res == 0) { goto _end_playback } - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) _needPagerReset = _isHot _7: _rc = _readJournalHdr(tls, _pPager, _isHot, _szJ, &_nRec, &_mxPg) @@ -18857,24 +19937,24 @@ _7: _9: if _nRec == u32(4294967295) { func() { - if (_pPager.X34) != int64(_pPager.X47) { + if _pPager.X34 != int64(_pPager.X47) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49757), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playbackØ00__func__Ø000))), unsafe.Pointer(str(19429))) crt.X__builtin_abort(tls) } }() - _nRec = uint32(int32((_szJ - int64(_pPager.X47)) / int64((_pPager.X48)+i32(8)))) + _nRec = uint32(int32((_szJ - int64(_pPager.X47)) / int64(_pPager.X48+i32(8)))) } - if ((_nRec == uint32(i32(0))) && (_isHot == 0)) && (((_pPager.X35) + int64(_pPager.X47)) == (_pPager.X34)) { - _nRec = uint32(int32((_szJ - (_pPager.X34)) / int64((_pPager.X48)+i32(8)))) + if ((_nRec == uint32(i32(0))) && (_isHot == 0)) && ((_pPager.X35 + int64(_pPager.X47)) == _pPager.X34) { + _nRec = uint32(int32((_szJ - _pPager.X34) / int64(_pPager.X48+i32(8)))) } - if (_pPager.X34) != int64(_pPager.X47) { + if _pPager.X34 != int64(_pPager.X47) { goto _17 } _rc = _pager_truncate(tls, _pPager, _mxPg) if _rc != i32(0) { goto _end_playback } - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _mxPg + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = _mxPg _17: _u = uint32(i32(0)) _19: @@ -18885,13 +19965,13 @@ _19: _pager_reset(tls, _pPager) _needPagerReset = i32(0) } - _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), nil, i32(1), i32(0)) + _rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&_pPager.X34)), nil, i32(1), i32(0)) if _rc == i32(0) { _nPlayback += 1 goto _25 } if _rc == i32(101) { - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = _szJ + *(*int64)(unsafe.Pointer(&_pPager.X34)) = _szJ goto _22 } if _rc == i32(522) { @@ -18905,10 +19985,10 @@ _25: _22: goto _7 _end_playback: - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil { + if ((*Xsqlite3_file)(_pPager.X31).X0) != nil { _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), int32(u32(3389603744)), nil) } - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10 + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = _pPager.X10 if _rc == i32(0) { _zMaster = _pPager.X58 _rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.X32), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.X0).X2)+i32(1))) @@ -18917,9 +19997,9 @@ _end_playback: _rc = _sqlite3PagerSync(tls, _pPager, nil) } if _rc == i32(0) { - _rc = _pager_end_transaction(tls, _pPager, bool2int(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != i32(0)), i32(0)) + _rc = _pager_end_transaction(tls, _pPager, bool2int(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(i32(0))))) != i32(0)), i32(0)) } - if ((_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != 0)) && _res != 0 { + if ((_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(i32(0))))) != 0)) && _res != 0 { _rc = _pager_delmaster(tls, _pPager, _zMaster) } if _isHot != 0 && _nPlayback != 0 { @@ -18935,36 +20015,39 @@ func init() { crt.Xstrncpy(nil, &_pager_playbackØ00__func__Ø000[0], str(19499), 15) } -// When this is called the journal file for pager pPager must be open. -// This function attempts to read a master journal file name from the -// end of the file and, if successful, copies it into memory supplied -// by the caller. See comments above writeMasterJournal() for the format -// used to store a master journal file name at the end of a journal file. -// -// zMaster must point to a buffer of at least nMaster bytes allocated by -// the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is -// enough space to write the master journal name). If the master journal -// name in the journal is longer than nMaster bytes (including a -// nul-terminator), then this is handled as if no master journal name -// were present in the journal. -// -// If a master journal file name is present at the end of the journal -// file, then it is copied into the buffer pointed to by zMaster. A -// nul-terminator byte is appended to the buffer following the master -// journal file name. -// -// If it is determined that no master journal file name is present -// zMaster[0] is set to 0 and SQLITE_OK returned. -// -// If an error occurs while reading from the journal file, an SQLite -// error code is returned. +// C comment +// /* +// ** When this is called the journal file for pager pPager must be open. +// ** This function attempts to read a master journal file name from the +// ** end of the file and, if successful, copies it into memory supplied +// ** by the caller. See comments above writeMasterJournal() for the format +// ** used to store a master journal file name at the end of a journal file. +// ** +// ** zMaster must point to a buffer of at least nMaster bytes allocated by +// ** the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is +// ** enough space to write the master journal name). If the master journal +// ** name in the journal is longer than nMaster bytes (including a +// ** nul-terminator), then this is handled as if no master journal name +// ** were present in the journal. +// ** +// ** If a master journal file name is present at the end of the journal +// ** file, then it is copied into the buffer pointed to by zMaster. A +// ** nul-terminator byte is appended to the buffer following the master +// ** journal file name. +// ** +// ** If it is determined that no master journal file name is present +// ** zMaster[0] is set to 0 and SQLITE_OK returned. +// ** +// ** If an error occurs while reading from the journal file, an SQLite +// ** error code is returned. +// */ func _readMasterJournal(tls *crt.TLS, _pJrnl *Xsqlite3_file, _zMaster *int8, _nMaster uint32) (r0 int32) { var _rc int32 var _szJ int64 var _len, _cksum, _u uint32 var _aMagic [8]uint8 - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0)))) = int8(i32(0)) - if ((((((((i32(0) != store1(&_rc, _sqlite3OsFileSize(tls, _pJrnl, &_szJ))) || (_szJ < int64(i32(16)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(16)), &_len)))) || (_len >= _nMaster)) || (_len == uint32(i32(0)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(12)), &_cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, (unsafe.Pointer)(&_aMagic), i32(8), _szJ-int64(i32(8)))))) || crt.Xmemcmp(tls, (unsafe.Pointer)(&_aMagic), (unsafe.Pointer)(&_aJournalMagic), uint64(i32(8))) != 0) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, (unsafe.Pointer)(_zMaster), int32(_len), (_szJ-int64(i32(16)))-int64(_len)))) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(i32(0)))) = int8(i32(0)) + if ((((((((i32(0) != store1(&_rc, _sqlite3OsFileSize(tls, _pJrnl, &_szJ))) || (_szJ < int64(i32(16)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(16)), &_len)))) || (_len >= _nMaster)) || (_len == uint32(i32(0)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(12)), &_cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, unsafe.Pointer(&_aMagic), i32(8), _szJ-int64(i32(8)))))) || crt.Xmemcmp(tls, unsafe.Pointer(&_aMagic), unsafe.Pointer(&_aJournalMagic), uint64(i32(8))) != 0) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, unsafe.Pointer(_zMaster), int32(_len), (_szJ-int64(i32(16)))-int64(_len)))) { return _rc } _u = uint32(i32(0)) @@ -18974,7 +20057,7 @@ _9: } { p := &_cksum - *p = (*p) - uint32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_u)))) + *p = (*p) - uint32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(_u)))) sink5(*p) } _u += 1 @@ -18983,7 +20066,7 @@ _12: if _cksum != 0 { _len = uint32(i32(0)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_len))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(_len))) = int8(i32(0)) return i32(0) _ = _aMagic @@ -18991,16 +20074,20 @@ _12: } func _sqlite3OsAccess(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pVfs.X8)})))(tls, _pVfs, _zPath, _flags, _pResOut) -} - -// Sync the database file to disk. This is a no-op for in-memory databases -// or pages with the Pager.noSync flag set. -// -// If successful, or if called on a pager for which it is a no-op, this -// function returns SQLITE_OK. Otherwise, an IO error code is returned. + return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pVfs.X8 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _zPath, _flags, _pResOut) +} + +// C comment +// /* +// ** Sync the database file to disk. This is a no-op for in-memory databases +// ** or pages with the Pager.noSync flag set. +// ** +// ** If successful, or if called on a pager for which it is a no-op, this +// ** function returns SQLITE_OK. Otherwise, an IO error code is returned. +// */ func _sqlite3PagerSync(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) { var _rc int32 var _1_pArg unsafe.Pointer @@ -19008,15 +20095,15 @@ func _sqlite3PagerSync(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil { goto _0 } - _1_pArg = (unsafe.Pointer)(_zMaster) + _1_pArg = unsafe.Pointer(_zMaster) _rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(21), _1_pArg) if _rc == i32(12) { _rc = i32(0) } _0: - if (_rc == i32(0)) && ((_pPager.X4) == 0) { + if (_rc == i32(0)) && (_pPager.X4 == 0) { func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53162), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSyncØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } @@ -19032,47 +20119,50 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerSyncØ00__func__Ø000[0], str(19514), 17) } -// Parameter zMaster is the name of a master journal file. A single journal -// file that referred to the master journal file has just been rolled back. -// This routine checks if it is possible to delete the master journal file, -// and does so if it is. -// -// Argument zMaster may point to Pager.pTmpSpace. So that buffer is not -// available for use within this function. -// -// When a master journal file is created, it is populated with the names -// of all of its child journals, one after another, formatted as utf-8 -// encoded text. The end of each child journal file is marked with a -// nul-terminator byte (0x00). i.e. the entire contents of a master journal -// file for a transaction involving two databases might be: -// -// "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00" -// -// A master journal file may only be deleted once all of its child -// journals have been rolled back. -// -// This function reads the contents of the master-journal file into -// memory and loops through each of the child journal names. For -// each child journal, it checks if: -// -// * if the child journal exists, and if so -// * if the child journal contains a reference to master journal -// file zMaster -// -// If a child journal can be found that matches both of the criteria -// above, this function returns without doing anything. Otherwise, if -// no such child journal can be found, file zMaster is deleted from -// the file-system using sqlite3OsDelete(). -// -// If an IO error within this function, an error code is returned. This -// function allocates memory by calling sqlite3Malloc(). If an allocation -// fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors -// occur, SQLITE_OK is returned. -// -// TODO: This function allocates a single block of memory to load -// the entire contents of the master journal file. This could be -// a couple of kilobytes or so - potentially larger than the page -// size. +// C comment +// /* +// ** Parameter zMaster is the name of a master journal file. A single journal +// ** file that referred to the master journal file has just been rolled back. +// ** This routine checks if it is possible to delete the master journal file, +// ** and does so if it is. +// ** +// ** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not +// ** available for use within this function. +// ** +// ** When a master journal file is created, it is populated with the names +// ** of all of its child journals, one after another, formatted as utf-8 +// ** encoded text. The end of each child journal file is marked with a +// ** nul-terminator byte (0x00). i.e. the entire contents of a master journal +// ** file for a transaction involving two databases might be: +// ** +// ** "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00" +// ** +// ** A master journal file may only be deleted once all of its child +// ** journals have been rolled back. +// ** +// ** This function reads the contents of the master-journal file into +// ** memory and loops through each of the child journal names. For +// ** each child journal, it checks if: +// ** +// ** * if the child journal exists, and if so +// ** * if the child journal contains a reference to master journal +// ** file zMaster +// ** +// ** If a child journal can be found that matches both of the criteria +// ** above, this function returns without doing anything. Otherwise, if +// ** no such child journal can be found, file zMaster is deleted from +// ** the file-system using sqlite3OsDelete(). +// ** +// ** If an IO error within this function, an error code is returned. This +// ** function allocates memory by calling sqlite3Malloc(). If an allocation +// ** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors +// ** occur, SQLITE_OK is returned. +// ** +// ** TODO: This function allocates a single block of memory to load +// ** the entire contents of the master journal file. This could be +// ** a couple of kilobytes or so - potentially larger than the page +// ** size. +// */ func _pager_delmaster(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) { var _rc, _nMasterPtr, _2_flags, _4_exists, _6_c, _6_flags int32 var _nMasterJournal int64 @@ -19081,7 +20171,7 @@ func _pager_delmaster(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) var _pVfs *Xsqlite3_vfs _pVfs = (*Xsqlite3_vfs)(_pPager.X0) _zMasterJournal = nil - _pMaster = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64((_pVfs.X1)*i32(2)))) + _pMaster = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.X1*i32(2)))) _pJournal = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pMaster)))) + uintptr(_pVfs.X1))))) if _pMaster == nil { _rc = _sqlite3NomemError(tls, i32(49453)) @@ -19097,18 +20187,18 @@ _1: if _rc != i32(0) { goto _delmaster_out } - _nMasterPtr = (_pVfs.X2) + i32(1) + _nMasterPtr = _pVfs.X2 + i32(1) _zMasterJournal = (*int8)(_sqlite3Malloc(tls, uint64((_nMasterJournal+int64(_nMasterPtr))+int64(i32(1))))) if _zMasterJournal == nil { _rc = _sqlite3NomemError(tls, i32(49470)) goto _delmaster_out } - _zMasterPtr = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterJournal)) + 1*uintptr(_nMasterJournal+int64(i32(1))))) - _rc = _sqlite3OsRead(tls, _pMaster, (unsafe.Pointer)(_zMasterJournal), int32(_nMasterJournal), int64(i32(0))) + _zMasterPtr = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMasterJournal)) + 1*uintptr(_nMasterJournal+int64(i32(1))))) + _rc = _sqlite3OsRead(tls, _pMaster, unsafe.Pointer(_zMasterJournal), int32(_nMasterJournal), int64(i32(0))) if _rc != i32(0) { goto _delmaster_out } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterJournal)) + 1*uintptr(_nMasterJournal))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMasterJournal)) + 1*uintptr(_nMasterJournal))) = int8(i32(0)) _zJournal = _zMasterJournal _6: if int64((uintptr(unsafe.Pointer(_zJournal))-uintptr(unsafe.Pointer(_zMasterJournal)))/1) >= _nMasterJournal { @@ -19131,14 +20221,14 @@ _6: if _rc != i32(0) { goto _delmaster_out } - _6_c = bool2int((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterPtr)) + 1*uintptr(i32(0))))) != i32(0)) && (crt.Xstrcmp(tls, _zMasterPtr, _zMaster) == i32(0))) + _6_c = bool2int((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMasterPtr)) + 1*uintptr(i32(0))))) != i32(0)) && (crt.Xstrcmp(tls, _zMasterPtr, _zMaster) == i32(0))) if _6_c != 0 { goto _delmaster_out } _9: { p := &_zJournal - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zJournal)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zJournal)+i32(1)))) sink0(*p) } goto _6 @@ -19146,7 +20236,7 @@ _7: _sqlite3OsClose(tls, _pMaster) _rc = _sqlite3OsDelete(tls, _pVfs, _zMaster, i32(0)) _delmaster_out: - Xsqlite3_free(tls, (unsafe.Pointer)(_zMasterJournal)) + Xsqlite3_free(tls, unsafe.Pointer(_zMasterJournal)) if _pMaster != nil { _sqlite3OsClose(tls, _pMaster) func() { @@ -19155,7 +20245,7 @@ _delmaster_out: crt.X__builtin_abort(tls) } }() - Xsqlite3_free(tls, (unsafe.Pointer)(_pMaster)) + Xsqlite3_free(tls, unsafe.Pointer(_pMaster)) } return _rc } @@ -19166,39 +20256,42 @@ func init() { crt.Xstrncpy(nil, &_pager_delmasterØ00__func__Ø000[0], str(19549), 16) } -// Set the value of the Pager.sectorSize variable for the given -// pager based on the value returned by the xSectorSize method -// of the open database file. The sector size will be used -// to determine the size and alignment of journal header and -// master journal pointers within created journal files. -// -// For temporary files the effective sector size is always 512 bytes. -// -// Otherwise, for non-temporary files, the effective sector size is -// the value returned by the xSectorSize() method rounded up to 32 if -// it is less than 32, or rounded down to MAX_SECTOR_SIZE if it -// is greater than MAX_SECTOR_SIZE. -// -// If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set -// the effective sector size to its minimum value (512). The purpose of -// pPager->sectorSize is to define the "blast radius" of bytes that -// might change if a crash occurs while writing to a single byte in -// that range. But with POWERSAFE_OVERWRITE, the blast radius is zero -// (that is what POWERSAFE_OVERWRITE means), so we minimize the sector -// size. For backwards compatibility of the rollback journal file format, -// we cannot reduce the effective sector size below 512. +// C comment +// /* +// ** Set the value of the Pager.sectorSize variable for the given +// ** pager based on the value returned by the xSectorSize method +// ** of the open database file. The sector size will be used +// ** to determine the size and alignment of journal header and +// ** master journal pointers within created journal files. +// ** +// ** For temporary files the effective sector size is always 512 bytes. +// ** +// ** Otherwise, for non-temporary files, the effective sector size is +// ** the value returned by the xSectorSize() method rounded up to 32 if +// ** it is less than 32, or rounded down to MAX_SECTOR_SIZE if it +// ** is greater than MAX_SECTOR_SIZE. +// ** +// ** If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set +// ** the effective sector size to its minimum value (512). The purpose of +// ** pPager->sectorSize is to define the "blast radius" of bytes that +// ** might change if a crash occurs while writing to a single byte in +// ** that range. But with POWERSAFE_OVERWRITE, the blast radius is zero +// ** (that is what POWERSAFE_OVERWRITE means), so we minimize the sector +// ** size. For backwards compatibility of the rollback journal file format, +// ** we cannot reduce the effective sector size below 512. +// */ func _setSectorSize(tls *crt.TLS, _pPager *XPager) { func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49617), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSectorSizeØ00__func__Ø000))), unsafe.Pointer(str(19565))) crt.X__builtin_abort(tls) } }() - if ((_pPager.X10) != 0) || ((_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31)) & i32(4096)) != i32(0)) { - *(*uint32)(unsafe.Pointer(&(_pPager.X47))) = uint32(i32(512)) + if (_pPager.X10 != 0) || ((_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31)) & i32(4096)) != i32(0)) { + *(*uint32)(unsafe.Pointer(&_pPager.X47)) = uint32(i32(512)) goto _5 } - *(*uint32)(unsafe.Pointer(&(_pPager.X47))) = uint32(_sqlite3SectorSize(tls, (*Xsqlite3_file)(_pPager.X31))) + *(*uint32)(unsafe.Pointer(&_pPager.X47)) = uint32(_sqlite3SectorSize(tls, (*Xsqlite3_file)(_pPager.X31))) _5: } @@ -19208,8 +20301,11 @@ func init() { crt.Xstrncpy(nil, &_setSectorSizeØ00__func__Ø000[0], str(19604), 14) } -// Return a sanitized version of the sector-size of OS file pFile. The -// return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE. +// C comment +// /* +// ** Return a sanitized version of the sector-size of OS file pFile. The +// ** return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE. +// */ func _sqlite3SectorSize(tls *crt.TLS, _pFile *Xsqlite3_file) (r0 int32) { var _iRet int32 _iRet = _sqlite3OsSectorSize(tls, _pFile) @@ -19227,9 +20323,10 @@ _2: func _sqlite3OsSectorSize(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { var _xSectorSize func(*crt.TLS, *Xsqlite3_file) int32 - _xSectorSize = *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X11)})) + _xSectorSize = func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X11 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }() return func() int32 { if _xSectorSize != nil { return _xSectorSize(tls, _id) @@ -19238,41 +20335,44 @@ func _sqlite3OsSectorSize(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { }() } -// This function is called whenever an IOERR or FULL error that requires -// the pager to transition into the ERROR state may ahve occurred. -// The first argument is a pointer to the pager structure, the second -// the error-code about to be returned by a pager API function. The -// value returned is a copy of the second argument to this function. -// -// If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the -// IOERR sub-codes, the pager enters the ERROR state and the error code -// is stored in Pager.errCode. While the pager remains in the ERROR state, -// all major API calls on the Pager will immediately return Pager.errCode. -// -// The ERROR state indicates that the contents of the pager-cache -// cannot be trusted. This state can be cleared by completely discarding -// the contents of the pager-cache. If a transaction was active when -// the persistent error occurred, then the rollback journal may need -// to be replayed to restore the contents of the database file (as if -// it were a hot-journal). +// C comment +// /* +// ** This function is called whenever an IOERR or FULL error that requires +// ** the pager to transition into the ERROR state may ahve occurred. +// ** The first argument is a pointer to the pager structure, the second +// ** the error-code about to be returned by a pager API function. The +// ** value returned is a copy of the second argument to this function. +// ** +// ** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the +// ** IOERR sub-codes, the pager enters the ERROR state and the error code +// ** is stored in Pager.errCode. While the pager remains in the ERROR state, +// ** all major API calls on the Pager will immediately return Pager.errCode. +// ** +// ** The ERROR state indicates that the contents of the pager-cache +// ** cannot be trusted. This state can be cleared by completely discarding +// ** the contents of the pager-cache. If a transaction was active when +// ** the persistent error occurred, then the rollback journal may need +// ** to be replayed to restore the contents of the database file (as if +// ** it were a hot-journal). +// */ func _pager_error(tls *crt.TLS, _pPager *XPager, _rc int32) (r0 int32) { var _rc2 int32 _rc2 = _rc & i32(255) func() { - if _rc != i32(0) && (_pPager.X13) != 0 { + if _rc != i32(0) && _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48816), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_errorØ00__func__Ø000))), unsafe.Pointer(str(19618))) crt.X__builtin_abort(tls) } }() func() { - if (_pPager.X26) != i32(13) && (_pPager.X26) != i32(0) && ((_pPager.X26)&i32(255)) != i32(10) { + if _pPager.X26 != i32(13) && _pPager.X26 != i32(0) && (_pPager.X26&i32(255)) != i32(10) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48817), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_errorØ00__func__Ø000))), unsafe.Pointer(str(19642))) crt.X__builtin_abort(tls) } }() if (_rc2 == i32(13)) || (_rc2 == i32(10)) { - *(*int32)(unsafe.Pointer(&(_pPager.X26))) = _rc - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(6)) + *(*int32)(unsafe.Pointer(&_pPager.X26)) = _rc + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(6)) _setGetterMethod(tls, _pPager) } return _rc @@ -19284,21 +20384,24 @@ func init() { crt.Xstrncpy(nil, &_pager_errorØ00__func__Ø000[0], str(19743), 12) } -// This function is a no-op if the pager is in exclusive mode and not -// in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN -// state. -// -// If the pager is not in exclusive-access mode, the database file is -// completely unlocked. If the file is unlocked and the file-system does -// not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is -// closed (if it is open). -// -// If the pager is in ERROR state when this function is called, the -// contents of the pager cache are discarded before switching back to -// the OPEN state. Regardless of whether the pager is in exclusive-mode -// or not, any journal file left in the file-system will be treated -// as a hot-journal and rolled back the next time a read-transaction -// is opened (by this or by any other connection). +// C comment +// /* +// ** This function is a no-op if the pager is in exclusive mode and not +// ** in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN +// ** state. +// ** +// ** If the pager is not in exclusive-access mode, the database file is +// ** completely unlocked. If the file is unlocked and the file-system does +// ** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is +// ** closed (if it is open). +// ** +// ** If the pager is in ERROR state when this function is called, the +// ** contents of the pager cache are discarded before switching back to +// ** the OPEN state. Regardless of whether the pager is in exclusive-mode +// ** or not, any journal file left in the file-system will be treated +// ** as a hot-journal and rolled back the next time a read-transaction +// ** is opened (by this or by any other connection). +// */ func _pager_unlock(tls *crt.TLS, _pPager *XPager) { var _2_rc, _2_iDc int32 func() { @@ -19308,7 +20411,7 @@ func _pager_unlock(tls *crt.TLS, _pPager *XPager) { } }() _sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30)) - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X30)))) = nil _releaseAllSavepoints(tls, _pPager) if (*XWal)(_pPager.X60) != nil { func() { @@ -19318,10 +20421,10 @@ func _pager_unlock(tls *crt.TLS, _pPager *XPager) { } }() _sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.X60)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(0)) goto _8 } - if (_pPager.X1) != 0 { + if _pPager.X1 != 0 { goto _8 } _2_iDc = func() int32 { @@ -19341,48 +20444,48 @@ func _pager_unlock(tls *crt.TLS, _pPager *XPager) { } _2_rc = _pagerUnlockDb(tls, _pPager, i32(0)) if (_2_rc != i32(0)) && (int32(_pPager.X14) == i32(6)) { - *(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(i32(5)) + *(*uint8)(unsafe.Pointer(&_pPager.X15)) = uint8(i32(5)) } func() { - if (_pPager.X26) == 0 && int32(_pPager.X14) == i32(6) { + if _pPager.X26 == 0 && int32(_pPager.X14) == i32(6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48766), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19866))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(0)) _8: func() { - if (_pPager.X26) != i32(0) && (_pPager.X13) != 0 { + if _pPager.X26 != i32(0) && _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48776), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19913))) crt.X__builtin_abort(tls) } }() - if (_pPager.X26) == 0 { + if _pPager.X26 == 0 { goto _21 } if int32(_pPager.X10) == i32(0) { _pager_reset(tls, _pPager) - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(0)) goto _23 } - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(func() int32 { if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil { return i32(0) } return i32(1) }()) _23: - if (_pPager.X20) != 0 { + if _pPager.X20 != 0 { _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil) } - *(*int32)(unsafe.Pointer(&(_pPager.X26))) = i32(0) + *(*int32)(unsafe.Pointer(&_pPager.X26)) = i32(0) _setGetterMethod(tls, _pPager) _21: - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) - *(*int64)(unsafe.Pointer(&(_pPager.X35))) = int64(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pPager.X35)) = int64(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X17)) = uint8(i32(0)) } var _pager_unlockØ00__func__Ø000 [13]int8 @@ -19391,17 +20494,23 @@ func init() { crt.Xstrncpy(nil, &_pager_unlockØ00__func__Ø000[0], str(19950), 13) } -// Finish with a read transaction. All this does is release the -// read-lock. +// C comment +// /* +// ** Finish with a read transaction. All this does is release the +// ** read-lock. +// */ func _sqlite3WalEndReadTransaction(tls *crt.TLS, _pWal *XWal) { _sqlite3WalEndWriteTransaction(tls, _pWal) if int32(_pWal.X9) >= i32(0) { _walUnlockShared(tls, _pWal, i32(3)+int32(_pWal.X9)) - *(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_pWal.X9)) = int16(i32(-1)) } } -// Change the size of an existing memory allocation +// C comment +// /* +// ** Change the size of an existing memory allocation +// */ func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 unsafe.Pointer) { var _nOld, _nNew, _nDiff int32 var _pNew unsafe.Pointer @@ -19418,24 +20527,24 @@ func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 uns return nil } _nOld = _sqlite3MallocSize(tls, _pOld) - _nNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, int32(_nBytes)) + _nNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X4)(tls, int32(_nBytes)) if _nOld == _nNew { _pNew = _pOld goto _11 } - if (_sqlite3Config.X0) == 0 { + if _sqlite3Config.X0 == 0 { goto _5 } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _sqlite3StatusHighwater(tls, i32(5), int32(_nBytes)) _nDiff = _nNew - _nOld - if (_nDiff > i32(0)) && (_sqlite3StatusValue(tls, i32(0)) >= ((_mem0.X1) - int64(_nDiff))) { + if (_nDiff > i32(0)) && (_sqlite3StatusValue(tls, i32(0)) >= (_mem0.X1 - int64(_nDiff))) { _sqlite3MallocAlarm(tls, _nDiff) } - _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew) - if (_pNew == nil) && ((_mem0.X1) > int64(i32(0))) { + _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X2)(tls, _pOld, _nNew) + if (_pNew == nil) && (_mem0.X1 > int64(i32(0))) { _sqlite3MallocAlarm(tls, int32(_nBytes)) - _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew) + _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X2)(tls, _pOld, _nNew) } if _pNew != nil { _nNew = _sqlite3MallocSize(tls, _pNew) @@ -19444,7 +20553,7 @@ func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 uns Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) goto _11 _5: - _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew) + _pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X2)(tls, _pOld, _nNew) _11: func() { if (int64((uintptr(unsafe.Pointer((*int8)(_pNew)))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { @@ -19461,23 +20570,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ReallocØ00__func__Ø000[0], str(19990), 15) } -// Given the page number of an overflow page in the database (parameter -// ovfl), this function finds the page number of the next page in the -// linked list of overflow pages. If possible, it uses the auto-vacuum -// pointer-map data instead of reading the content of page ovfl to do so. -// -// If an error occurs an SQLite error code is returned. Otherwise: -// -// The page number of the next overflow page in the linked list is -// written to *pPgnoNext. If page ovfl is the last page in its linked -// list, *pPgnoNext is set to zero. -// -// If ppPage is not NULL, and a reference to the MemPage object corresponding -// to page number pOvfl was obtained, then *ppPage is set to point to that -// reference. It is the responsibility of the caller to call releasePage() -// on *ppPage to free the reference. In no reference was obtained (because -// the pointer-map was used to obtain the value for *pPgnoNext), then -// *ppPage is set to zero. +// C comment +// /* +// ** Given the page number of an overflow page in the database (parameter +// ** ovfl), this function finds the page number of the next page in the +// ** linked list of overflow pages. If possible, it uses the auto-vacuum +// ** pointer-map data instead of reading the content of page ovfl to do so. +// ** +// ** If an error occurs an SQLite error code is returned. Otherwise: +// ** +// ** The page number of the next overflow page in the linked list is +// ** written to *pPgnoNext. If page ovfl is the last page in its linked +// ** list, *pPgnoNext is set to zero. +// ** +// ** If ppPage is not NULL, and a reference to the MemPage object corresponding +// ** to page number pOvfl was obtained, then *ppPage is set to point to that +// ** reference. It is the responsibility of the caller to call releasePage() +// ** on *ppPage to free the reference. In no reference was obtained (because +// ** the pointer-map was used to obtain the value for *pPgnoNext), then +// ** *ppPage is set to zero. +// */ func _getOverflowPage(tls *crt.TLS, _pBt *XBtShared, _ovfl uint32, _ppPage **XMemPage, _pPgnoNext *uint32) (r0 int32) { var _rc int32 var _next, _1_pgno, _1_iGuess uint32 @@ -19498,12 +20610,12 @@ func _getOverflowPage(tls *crt.TLS, _pBt *XBtShared, _ovfl uint32, _ppPage **XMe crt.X__builtin_abort(tls) } }() - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _4 } _1_iGuess = _ovfl + uint32(i32(1)) _5: - if (_ptrmapPageno(tls, _pBt, _1_iGuess) == _1_iGuess) || (_1_iGuess == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_ptrmapPageno(tls, _pBt, _1_iGuess) == _1_iGuess) || (_1_iGuess == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { _1_iGuess += 1 goto _5 } @@ -19563,13 +20675,16 @@ func init() { crt.Xstrncpy(nil, &_getOverflowPageØ00__func__Ø000[0], str(20068), 16) } -// Given a page number of a regular database page, return the page -// number for the pointer-map page that contains the entry for the -// input page number. -// -// Return 0 (not a valid page) for pgno==1 since there is -// no pointer map associated with page 1. The integrity_check logic -// requires that ptrmapPageno(*,1)!=1. +// C comment +// /* +// ** Given a page number of a regular database page, return the page +// ** number for the pointer-map page that contains the entry for the +// ** input page number. +// ** +// ** Return 0 (not a valid page) for pgno==1 since there is +// ** no pointer map associated with page 1. The integrity_check logic +// ** requires that ptrmapPageno(*,1)!=1. +// */ func _ptrmapPageno(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 uint32) { var _nPagesPerMapPage int32 var _iPtrMap, _ret uint32 @@ -19582,10 +20697,10 @@ func _ptrmapPageno(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 uint32) { if _pgno < uint32(i32(2)) { return uint32(i32(0)) } - _nPagesPerMapPage = int32(((_pBt.X16) / uint32(i32(5))) + uint32(i32(1))) + _nPagesPerMapPage = int32((_pBt.X16 / uint32(i32(5))) + uint32(i32(1))) _iPtrMap = (_pgno - uint32(i32(2))) / uint32(_nPagesPerMapPage) _ret = (_iPtrMap * uint32(_nPagesPerMapPage)) + uint32(i32(2)) - if _ret == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { + if _ret == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { _ret += 1 } return _ret @@ -19597,11 +20712,14 @@ func init() { crt.Xstrncpy(nil, &_ptrmapPagenoØ00__func__Ø000[0], str(20084), 13) } -// Read an entry from the pointer map. -// -// This routine retrieves the pointer map entry for page 'key', writing -// the type and parent page number to *pEType and *pPgno respectively. -// An error code is returned if something goes wrong, otherwise SQLITE_OK. +// C comment +// /* +// ** Read an entry from the pointer map. +// ** +// ** This routine retrieves the pointer map entry for page 'key', writing +// ** the type and parent page number to *pEType and *pPgno respectively. +// ** An error code is returned if something goes wrong, otherwise SQLITE_OK. +// */ func _ptrmapGet(tls *crt.TLS, _pBt *XBtShared, _key uint32, _pEType *uint8, _pPgno *uint32) (r0 int32) { var _iPtrmap, _offset, _rc int32 var _pPtrmap *uint8 @@ -19635,9 +20753,9 @@ func _ptrmapGet(tls *crt.TLS, _pBt *XBtShared, _key uint32, _pEType *uint8, _pPg crt.X__builtin_abort(tls) } }() - *_pEType = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset))) + *_pEType = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap)) + 1*uintptr(_offset))) if _pPgno != nil { - *_pPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1))))) + *_pPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap))+1*uintptr(_offset+i32(1))))) } _sqlite3PagerUnref(tls, _pDbPage) if (int32(*_pEType) < i32(1)) || (int32(*_pEType) > i32(5)) { @@ -19652,15 +20770,18 @@ func init() { crt.Xstrncpy(nil, &_ptrmapGetØ00__func__Ø000[0], str(20140), 10) } -// Get a page from the pager. Initialize the MemPage.pBt and -// MemPage.aData elements if needed. See also: btreeGetUnusedPage(). -// -// If the PAGER_GET_NOCONTENT flag is set, it means that we do not care -// about the content of the page at this time. So do not go to the disk -// to fetch the content. Just fill in the content with zeros for now. -// If in the future we call sqlite3PagerWrite() on this page, that -// means we have started to be concerned about content and the disk -// read should occur at that point. +// C comment +// /* +// ** Get a page from the pager. Initialize the MemPage.pBt and +// ** MemPage.aData elements if needed. See also: btreeGetUnusedPage(). +// ** +// ** If the PAGER_GET_NOCONTENT flag is set, it means that we do not care +// ** about the content of the page at this time. So do not go to the disk +// ** to fetch the content. Just fill in the content with zeros for now. +// ** If in the future we call sqlite3PagerWrite() on this page, that +// ** means we have started to be concerned about content and the disk +// ** read should occur at that point. +// */ func _btreeGetPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) { var _rc int32 var _pDbPage *XPgHdr @@ -19690,17 +20811,20 @@ func init() { crt.Xstrncpy(nil, &_btreeGetPageØ00__func__Ø000[0], str(20218), 13) } -// Convert a DbPage obtained from the pager into a MemPage used by -// the btree layer. +// C comment +// /* +// ** Convert a DbPage obtained from the pager into a MemPage used by +// ** the btree layer. +// */ func _btreePageFromDbPage(tls *crt.TLS, _pDbPage *XPgHdr, _pgno uint32, _pBt *XBtShared) (r0 *XMemPage) { var _pPage *XMemPage _pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage)) - if _pgno != (_pPage.X4) { - *(**uint8)(unsafe.Pointer(&(_pPage.X19))) = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X23))))) = _pDbPage - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X18))))) = _pBt - *(*uint32)(unsafe.Pointer(&(_pPage.X4))) = _pgno - *(*uint8)(unsafe.Pointer(&(_pPage.X6))) = uint8(func() int32 { + if _pgno != _pPage.X4 { + *(**uint8)(unsafe.Pointer(&_pPage.X19)) = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X23)))) = _pDbPage + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPage.X18)))) = _pBt + *(*uint32)(unsafe.Pointer(&_pPage.X4)) = _pgno + *(*uint8)(unsafe.Pointer(&_pPage.X6)) = uint8(func() int32 { if _pgno == uint32(i32(1)) { return i32(100) } @@ -19708,7 +20832,7 @@ func _btreePageFromDbPage(tls *crt.TLS, _pDbPage *XPgHdr, _pgno uint32, _pBt *XB }()) } func() { - if (_pPage.X19) != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) { + if _pPage.X19 != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60999), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePageFromDbPageØ00__func__Ø000))), unsafe.Pointer(str(20231))) crt.X__builtin_abort(tls) } @@ -19728,17 +20852,20 @@ func _releasePage(tls *crt.TLS, _pPage *XMemPage) { } } -// Release a MemPage. This should be called once for each prior -// call to btreeGetPage. +// C comment +// /* +// ** Release a MemPage. This should be called once for each prior +// ** call to btreeGetPage. +// */ func _releasePageNotNull(tls *crt.TLS, _pPage *XMemPage) { func() { - if (_pPage.X19) == nil { + if _pPage.X19 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61127), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20294))) crt.X__builtin_abort(tls) } }() func() { - if (*XBtShared)(_pPage.X18) == nil { + if _pPage.X18 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61128), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20307))) crt.X__builtin_abort(tls) } @@ -19750,13 +20877,13 @@ func _releasePageNotNull(tls *crt.TLS, _pPage *XMemPage) { } }() func() { - if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage) { + if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != unsafe.Pointer(_pPage) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61130), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20336))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage.X19) { + if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != unsafe.Pointer(_pPage.X19) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61131), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20389))) crt.X__builtin_abort(tls) } @@ -19776,7 +20903,10 @@ func init() { crt.Xstrncpy(nil, &_releasePageNotNullØ00__func__Ø000[0], str(20477), 19) } -// Release all of the apPage[] pages for a cursor. +// C comment +// /* +// ** Release all of the apPage[] pages for a cursor. +// */ func _btreeReleaseAllCursorPages(tls *crt.TLS, _pCur *XBtCursor) { var _i int32 _i = i32(0) @@ -19784,38 +20914,41 @@ _0: if _i > int32(_pCur.X14) { goto _3 } - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_i)))) - *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_i))) = nil + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_i)))) + *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_i))) = nil _i += 1 goto _0 _3: - *(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(-1)) -} - -// This routine sets the state to CURSOR_FAULT and the error -// code to errCode for every cursor on any BtShared that pBtree -// references. Or if the writeOnly flag is set to 1, then only -// trip write cursors and leave read cursors unchanged. -// -// Every cursor is a candidate to be tripped, including cursors -// that belong to other database connections that happen to be -// sharing the cache with pBtree. -// -// This routine gets called when a rollback occurs. If the writeOnly -// flag is true, then only write-cursors need be tripped - read-only -// cursors save their current positions so that they may continue -// following the rollback. Or, if writeOnly is false, all cursors are -// tripped. In general, writeOnly is false if the transaction being -// rolled back modified the database schema. In this case b-tree root -// pages may be moved or deleted from the database altogether, making -// it unsafe for read cursors to continue. -// -// If the writeOnly flag is true and an error is encountered while -// saving the current position of a read-only cursor, all cursors, -// including all read-cursors are tripped. -// -// SQLITE_OK is returned if successful, or if an error occurs while -// saving a cursor position, an SQLite error code. + *(*int8)(unsafe.Pointer(&_pCur.X14)) = int8(i32(-1)) +} + +// C comment +// /* +// ** This routine sets the state to CURSOR_FAULT and the error +// ** code to errCode for every cursor on any BtShared that pBtree +// ** references. Or if the writeOnly flag is set to 1, then only +// ** trip write cursors and leave read cursors unchanged. +// ** +// ** Every cursor is a candidate to be tripped, including cursors +// ** that belong to other database connections that happen to be +// ** sharing the cache with pBtree. +// ** +// ** This routine gets called when a rollback occurs. If the writeOnly +// ** flag is true, then only write-cursors need be tripped - read-only +// ** cursors save their current positions so that they may continue +// ** following the rollback. Or, if writeOnly is false, all cursors are +// ** tripped. In general, writeOnly is false if the transaction being +// ** rolled back modified the database schema. In this case b-tree root +// ** pages may be moved or deleted from the database altogether, making +// ** it unsafe for read cursors to continue. +// ** +// ** If the writeOnly flag is true and an error is encountered while +// ** saving the current position of a read-only cursor, all cursors, +// ** including all read-cursors are tripped. +// ** +// ** SQLITE_OK is returned if successful, or if an error occurs while +// ** saving a cursor position, an SQLite error code. +// */ func _sqlite3BtreeTripAllCursors(tls *crt.TLS, _pBtree *XBtree, _errCode int32, _writeOnly int32) (r0 int32) { var _rc, _2_i int32 var _p *XBtCursor @@ -19850,16 +20983,16 @@ _12: goto _14 _10: _sqlite3BtreeClearCursor(tls, _p) - *(*uint8)(unsafe.Pointer(&(_p.X12))) = uint8(i32(4)) - *(*int32)(unsafe.Pointer(&(_p.X9))) = _errCode + *(*uint8)(unsafe.Pointer(&_p.X12)) = uint8(i32(4)) + *(*int32)(unsafe.Pointer(&_p.X9)) = _errCode _14: _2_i = i32(0) _15: if _2_i > int32(_p.X14) { goto _18 } - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) + 8*uintptr(_2_i)))) - *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) + 8*uintptr(_2_i))) = nil + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_p.X19)))) + 8*uintptr(_2_i)))) + *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_p.X19)))) + 8*uintptr(_2_i))) = nil _2_i += 1 goto _15 _18: @@ -19877,7 +21010,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeTripAllCursorsØ00__func__Ø000[0], str(20548), 27) } -// Clear the current cursor position. +// C comment +// /* +// ** Clear the current cursor position. +// */ func _sqlite3BtreeClearCursor(tls *crt.TLS, _pCur *XBtCursor) { func() { if _cursorHoldsMutex(tls, _pCur) == 0 { @@ -19886,8 +21022,8 @@ func _sqlite3BtreeClearCursor(tls *crt.TLS, _pCur *XBtCursor) { } }() Xsqlite3_free(tls, _pCur.X6) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = nil - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer(&_pCur.X6)) = nil + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) } var _sqlite3BtreeClearCursorØ00__func__Ø000 [24]int8 @@ -19896,11 +21032,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeClearCursorØ00__func__Ø000[0], str(20575), 24) } -// This function may only be called when a read-transaction is open on -// the pager. It returns the total number of pages in the database. -// -// However, if the file is between 1 and <page-size> bytes in size, then -// this is considered a 1 page file. +// C comment +// /* +// ** This function may only be called when a read-transaction is open on +// ** the pager. It returns the total number of pages in the database. +// ** +// ** However, if the file is between 1 and <page-size> bytes in size, then +// ** this is considered a 1 page file. +// */ func _sqlite3PagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *int32) { func() { if int32(_pPager.X14) < i32(1) { @@ -19923,16 +21062,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerPagecountØ00__func__Ø000[0], str(20637), 22) } -// Return the number of cursors open on pBt. This is for use -// in assert() expressions, so it is only compiled if NDEBUG is not -// defined. -// -// Only write cursors are counted if wrOnly is true. If wrOnly is -// false then all cursors are counted. -// -// For the purposes of this routine, a cursor is any cursor that -// is capable of reading or writing to the database. Cursors that -// have been tripped into the CURSOR_FAULT state are not counted. +// C comment +// /* +// ** Return the number of cursors open on pBt. This is for use +// ** in assert() expressions, so it is only compiled if NDEBUG is not +// ** defined. +// ** +// ** Only write cursors are counted if wrOnly is true. If wrOnly is +// ** false then all cursors are counted. +// ** +// ** For the purposes of this routine, a cursor is any cursor that +// ** is capable of reading or writing to the database. Cursors that +// ** have been tripped into the CURSOR_FAULT state are not counted. +// */ func _countValidCursors(tls *crt.TLS, _pBt *XBtShared, _wrOnly int32) (r0 int32) { var _r int32 var _pCur *XBtCursor @@ -19951,15 +21093,21 @@ _3: return _r } -// Clear (destroy) the BtShared.pHasContent bitvec. This should be -// invoked at the conclusion of each write-transaction. +// C comment +// /* +// ** Clear (destroy) the BtShared.pHasContent bitvec. This should be +// ** invoked at the conclusion of each write-transaction. +// */ func _btreeClearHasContent(tls *crt.TLS, _pBt *XBtShared) { _sqlite3BitvecDestroy(tls, (*XBitvec)(_pBt.X22)) - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X22))))) = nil + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X22)))) = nil } -// This function is called from both BtreeCommitPhaseTwo() and BtreeRollback() -// at the conclusion of a transaction. +// C comment +// /* +// ** This function is called from both BtreeCommitPhaseTwo() and BtreeRollback() +// ** at the conclusion of a transaction. +// */ func _btreeEndTransaction(tls *crt.TLS, _p *XBtree) { var _db *Xsqlite3 var _pBt *XBtShared @@ -19971,22 +21119,22 @@ func _btreeEndTransaction(tls *crt.TLS, _p *XBtree) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(0)) - if (int32(_p.X2) > i32(0)) && ((_db.X35) > i32(1)) { + *(*uint8)(unsafe.Pointer(&_pBt.X7)) = uint8(i32(0)) + if (int32(_p.X2) > i32(0)) && (_db.X35 > i32(1)) { _downgradeAllSharedCacheTableLocks(tls, _p) - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(1)) goto _4 } if int32(_p.X2) == i32(0) { goto _5 } _clearAllSharedCacheTableLocks(tls, _p) - *(*int32)(unsafe.Pointer(&(_pBt.X17))) -= 1 - if i32(0) == (_pBt.X17) { - *(*uint8)(unsafe.Pointer(&(_pBt.X8))) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_pBt.X17)) -= 1 + if i32(0) == _pBt.X17 { + *(*uint8)(unsafe.Pointer(&_pBt.X8)) = uint8(i32(0)) } _5: - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(0)) _unlockBtreeIfUnused(tls, _pBt) _4: func() { @@ -20009,7 +21157,10 @@ func init() { crt.Xstrncpy(nil, &_btreeEndTransactionØ00__func__Ø000[0], str(20659), 20) } -// This function changes all write-locks held by Btree p into read-locks. +// C comment +// /* +// ** This function changes all write-locks held by Btree p into read-locks. +// */ func _downgradeAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) { var _pBt *XBtShared var _1_pLock *XBtLock @@ -20017,9 +21168,9 @@ func _downgradeAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) { if (*XBtree)(_pBt.X26) != _p { goto _0 } - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X26)))) = nil { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-97)) sink14(*p) } @@ -20034,7 +21185,7 @@ _1: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_1_pLock.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_1_pLock.X2)) = uint8(i32(1)) _1_pLock = (*XBtLock)(_1_pLock.X3) goto _1 _4: @@ -20047,18 +21198,21 @@ func init() { crt.Xstrncpy(nil, &_downgradeAllSharedCacheTableLocksØ00__func__Ø000[0], str(20723), 34) } -// Release all the table locks (locks obtained via calls to -// the setSharedCacheTableLock() procedure) held by Btree object p. -// -// This function assumes that Btree p has an open read or write -// transaction. If it does not, then the BTS_PENDING flag -// may be incorrectly cleared. +// C comment +// /* +// ** Release all the table locks (locks obtained via calls to +// ** the setSharedCacheTableLock() procedure) held by Btree object p. +// ** +// ** This function assumes that Btree p has an open read or write +// ** transaction. If it does not, then the BTS_PENDING flag +// ** may be incorrectly cleared. +// */ func _clearAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) { var _pBt *XBtShared var _1_pLock *XBtLock var _ppIter **XBtLock _pBt = (*XBtShared)(_p.X1) - _ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25))))) + _ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X25)))) func() { if _sqlite3BtreeHoldsMutex(tls, _p) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59421), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(17487))) @@ -20066,7 +21220,7 @@ func _clearAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) { } }() func() { - if (_p.X3) == 0 && nil != (*_ppIter) { + if _p.X3 == 0 && nil != (*_ppIter) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59422), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20757))) crt.X__builtin_abort(tls) } @@ -20099,38 +21253,38 @@ _7: } *_ppIter = (*XBtLock)(_1_pLock.X3) func() { - if (_1_pLock.X1) == uint32(i32(1)) && _1_pLock != (*XBtLock)(unsafe.Pointer(&(_p.X11))) { + if _1_pLock.X1 == uint32(i32(1)) && _1_pLock != (*XBtLock)(unsafe.Pointer(&_p.X11)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59431), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20899))) crt.X__builtin_abort(tls) } }() - if (_1_pLock.X1) != uint32(i32(1)) { - Xsqlite3_free(tls, (unsafe.Pointer)(_1_pLock)) + if _1_pLock.X1 != uint32(i32(1)) { + Xsqlite3_free(tls, unsafe.Pointer(_1_pLock)) } goto _19 _14: - _ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pLock.X3))))) + _ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pLock.X3)))) _19: goto _7 _8: func() { - if (int32(_pBt.X10)&i32(64)) != i32(0) && (*XBtree)(_pBt.X26) == nil { + if (int32(_pBt.X10)&i32(64)) != i32(0) && _pBt.X26 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59440), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20935))) crt.X__builtin_abort(tls) } }() if (*XBtree)(_pBt.X26) == _p { - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X26)))) = nil { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-97)) sink14(*p) } goto _25 } - if (_pBt.X17) == i32(2) { + if _pBt.X17 == i32(2) { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-65)) sink14(*p) } @@ -20144,12 +21298,15 @@ func init() { crt.Xstrncpy(nil, &_clearAllSharedCacheTableLocksØ00__func__Ø000[0], str(20984), 30) } -// If there are no outstanding cursors and we are not in the middle -// of a transaction but there is a read lock on the database, then -// this routine unrefs the first page of the database file which -// has the effect of releasing the read lock. -// -// If there is a transaction in progress, this routine is a no-op. +// C comment +// /* +// ** If there are no outstanding cursors and we are not in the middle +// ** of a transaction but there is a read lock on the database, then +// ** this routine unrefs the first page of the database file which +// ** has the effect of releasing the read lock. +// ** +// ** If there is a transaction in progress, this routine is a no-op. +// */ func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) { var _1_pPage1 *XMemPage func() { @@ -20167,7 +21324,7 @@ func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) { if (int32(_pBt.X8) == i32(0)) && ((*XMemPage)(_pBt.X3) != nil) { _1_pPage1 = (*XMemPage)(_pBt.X3) func() { - if (_1_pPage1.X19) == nil { + if _1_pPage1.X19 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62142), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000))), unsafe.Pointer(str(21075))) crt.X__builtin_abort(tls) } @@ -20178,7 +21335,7 @@ func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) { crt.X__builtin_abort(tls) } }() - *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil + *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X3)))) = nil _releasePageNotNull(tls, _1_pPage1) } } @@ -20189,31 +21346,37 @@ func init() { crt.Xstrncpy(nil, &_unlockBtreeIfUnusedØ00__func__Ø000[0], str(21126), 20) } -// Return the sum of the reference counts for all pages held by pPager. +// C comment +// /* +// ** Return the sum of the reference counts for all pages held by pPager. +// */ func _sqlite3PagerRefcount(tls *crt.TLS, _pPager *XPager) (r0 int32) { return _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) } -// Erase all schema information from all attached databases (including -// "main" and "temp") for a single database connection. +// C comment +// /* +// ** Erase all schema information from all attached databases (including +// ** "main" and "temp") for a single database connection. +// */ func _sqlite3ResetAllSchemasOfConnection(tls *crt.TLS, _db *Xsqlite3) { var _i int32 var _1_pDb *XDb _sqlite3BtreeEnterAll(tls, _db) _i = i32(0) _0: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _3 } _1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) - if (*XSchema)(_1_pDb.X4) != nil { + if _1_pDb.X4 != nil { _sqlite3SchemaClear(tls, _1_pDb.X4) } _i += 1 goto _0 _3: { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-3) sink1(*p) } @@ -20222,12 +21385,15 @@ _3: _sqlite3CollapseDatabaseArray(tls, _db) } -// Free all resources held by the schema structure. The void* argument points -// at a Schema struct. This function does not call sqlite3DbFree(db, ) on the -// pointer itself, it just cleans up subsidiary resources (i.e. the contents -// of the schema hash tables). -// -// The Schema.cache_size variable is not cleared. +// C comment +// /* +// ** Free all resources held by the schema structure. The void* argument points +// ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the +// ** pointer itself, it just cleans up subsidiary resources (i.e. the contents +// ** of the schema hash tables). +// ** +// ** The Schema.cache_size variable is not cleared. +// */ func _sqlite3SchemaClear(tls *crt.TLS, _p unsafe.Pointer) { var _temp1, _temp2 XHash var _pSchema *XSchema @@ -20236,8 +21402,8 @@ func _sqlite3SchemaClear(tls *crt.TLS, _p unsafe.Pointer) { _pSchema = (*XSchema)(_p) _temp1 = _pSchema.X2 _temp2 = _pSchema.X4 - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X4)))) - _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X3)))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_pSchema.X4))) + _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&_pSchema.X3))) _pElem = (*XHashElem)(_temp2.X2) _0: if _pElem == nil { @@ -20248,7 +21414,7 @@ _0: goto _0 _3: _sqlite3HashClear(tls, &_temp2) - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X2)))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_pSchema.X2))) _pElem = (*XHashElem)(_temp1.X2) _4: if _pElem == nil { @@ -20260,12 +21426,12 @@ _4: goto _4 _7: _sqlite3HashClear(tls, &_temp1) - _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X5)))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSchema.X6))))) = nil + _sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&_pSchema.X5))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSchema.X6)))) = nil if (int32(_pSchema.X9) & i32(1)) != 0 { - *(*int32)(unsafe.Pointer(&(_pSchema.X1))) += 1 + *(*int32)(unsafe.Pointer(&_pSchema.X1)) += 1 { - p := (*uint16)(unsafe.Pointer(&(_pSchema.X9))) + p := (*uint16)(unsafe.Pointer(&_pSchema.X9)) *p = uint16(int32(*p) & i32(-2)) sink14(*p) } @@ -20274,10 +21440,12 @@ _7: _ = _temp2 } -// Turn bulk memory into a hash table object by initializing the -// fields of the Hash structure. -// -// "pNew" is a pointer to the hash table that is to be initialized. +// C comment +// /* Turn bulk memory into a hash table object by initializing the +// ** fields of the Hash structure. +// ** +// ** "pNew" is a pointer to the hash table that is to be initialized. +// */ func _sqlite3HashInit(tls *crt.TLS, _pNew *XHash) { func() { if _pNew == nil { @@ -20285,10 +21453,10 @@ func _sqlite3HashInit(tls *crt.TLS, _pNew *XHash) { crt.X__builtin_abort(tls) } }() - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2))))) = nil - *(*uint32)(unsafe.Pointer(&(_pNew.X1))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_pNew.X0))) = uint32(i32(0)) - *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X3))))) = nil + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X2)))) = nil + *(*uint32)(unsafe.Pointer(&_pNew.X1)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pNew.X0)) = uint32(i32(0)) + *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X3)))) = nil } var _sqlite3HashInitØ00__func__Ø000 [16]int8 @@ -20297,9 +21465,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3HashInitØ00__func__Ø000[0], str(21154), 16) } -// Remove all entries from a hash table. Reclaim all memory. -// Call this routine to delete a hash table or to reset a hash table -// to the empty state. +// C comment +// /* Remove all entries from a hash table. Reclaim all memory. +// ** Call this routine to delete a hash table or to reset a hash table +// ** to the empty state. +// */ func _sqlite3HashClear(tls *crt.TLS, _pH *XHash) { var _elem, _1_next_elem *XHashElem func() { @@ -20309,18 +21479,18 @@ func _sqlite3HashClear(tls *crt.TLS, _pH *XHash) { } }() _elem = (*XHashElem)(_pH.X2) - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = nil + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X2)))) = nil Xsqlite3_free(tls, _pH.X3) - *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X3))))) = nil - *(*uint32)(unsafe.Pointer(&(_pH.X0))) = uint32(i32(0)) + *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X3)))) = nil + *(*uint32)(unsafe.Pointer(&_pH.X0)) = uint32(i32(0)) _2: if _elem != nil { _1_next_elem = (*XHashElem)(_elem.X0) - Xsqlite3_free(tls, (unsafe.Pointer)(_elem)) + Xsqlite3_free(tls, unsafe.Pointer(_elem)) _elem = _1_next_elem goto _2 } - *(*uint32)(unsafe.Pointer(&(_pH.X1))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pH.X1)) = uint32(i32(0)) } var _sqlite3HashClearØ00__func__Ø000 [17]int8 @@ -20329,20 +21499,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3HashClearØ00__func__Ø000[0], str(21176), 17) } -// Recursively delete a Trigger structure +// C comment +// /* +// ** Recursively delete a Trigger structure +// */ func _sqlite3DeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _pTrigger *XTrigger) { if _pTrigger == nil { return } _sqlite3DeleteTriggerStep(tls, _db, (*XTriggerStep)(_pTrigger.X8)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger.X0)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger.X1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger.X1)) _sqlite3ExprDelete(tls, _db, (*XExpr)(_pTrigger.X4)) _sqlite3IdListDelete(tls, _db, (*XIdList)(_pTrigger.X5)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTrigger)) } -// Delete a linked list of TriggerStep structures. +// C comment +// /* +// ** Delete a linked list of TriggerStep structures. +// */ func _sqlite3DeleteTriggerStep(tls *crt.TLS, _db *Xsqlite3, _pTriggerStep *XTriggerStep) { var _1_pTmp *XTriggerStep _0: @@ -20353,7 +21529,7 @@ _0: _sqlite3ExprListDelete(tls, _db, (*XExprList)(_1_pTmp.X6)) _sqlite3SelectDelete(tls, _db, (*XSelect)(_1_pTmp.X3)) _sqlite3IdListDelete(tls, _db, (*XIdList)(_1_pTmp.X7)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pTmp)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp)) goto _0 } } @@ -20364,7 +21540,10 @@ func _sqlite3ExprDelete(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) { } } -// Recursively delete an expression tree. +// C comment +// /* +// ** Recursively delete an expression tree. +// */ func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) { func() { if _p == nil { @@ -20373,12 +21552,12 @@ func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) { } }() func() { - if ((_p.X2)&uint32(i32(1024))) != uint32(i32(0)) && (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) < i32(0) { + if (_p.X2&uint32(i32(1024))) != uint32(i32(0)) && (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21193))) crt.X__builtin_abort(tls) } }() - if (((_p.X2) & uint32(i32(8388608))) != uint32(i32(0))) && (((_p.X2) & uint32(i32(16384))) == uint32(i32(0))) { + if ((_p.X2 & uint32(i32(8388608))) != uint32(i32(0))) && ((_p.X2 & uint32(i32(16384))) == uint32(i32(0))) { func() { if (*XExpr)(_p.X4) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91917), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21244))) @@ -20392,37 +21571,37 @@ func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) { } }() func() { - if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil { + if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21269))) crt.X__builtin_abort(tls) } }() } - if ((_p.X2) & uint32(i32(8404992))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(8404992))) != uint32(i32(0)) { goto _13 } func() { - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil && (*XExpr)(_p.X5) != nil { + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil && (*XExpr)(_p.X5) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21285))) crt.X__builtin_abort(tls) } }() - if ((*XExpr)(_p.X4) != nil) && (int32(_p.X0) != i32(159)) { + if (_p.X4 != nil) && (int32(_p.X0) != i32(159)) { _sqlite3ExprDeleteNN(tls, _db, (*XExpr)(_p.X4)) } _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X5)) - if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) { - _sqlite3SelectDelete(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))) + if (_p.X2 & uint32(i32(2048))) != uint32(i32(0)) { + _sqlite3SelectDelete(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6)))))) goto _20 } - _sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))) + _sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6)))))) _20: _13: - if ((_p.X2) & uint32(i32(65536))) != uint32(i32(0)) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + if (_p.X2 & uint32(i32(65536))) != uint32(i32(0)) { + _sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))))) } - if ((_p.X2) & uint32(i32(32768))) == uint32(i32(0)) { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) + if (_p.X2 & uint32(i32(32768))) == uint32(i32(0)) { + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) } } @@ -20432,15 +21611,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprDeleteNNØ00__func__Ø000[0], str(21315), 20) } -// Delete the given Select structure and all of its substructures. +// C comment +// /* +// ** Delete the given Select structure and all of its substructures. +// */ func _sqlite3SelectDelete(tls *crt.TLS, _db *Xsqlite3, _p *XSelect) { if _p != nil { _clearSelect(tls, _db, _p, i32(1)) } } -// Delete all the content of a Select structure. Deallocate the structure -// itself only if bFree is true. +// C comment +// /* +// ** Delete all the content of a Select structure. Deallocate the structure +// ** itself only if bFree is true. +// */ func _clearSelect(tls *crt.TLS, _db *Xsqlite3, _p *XSelect, _bFree int32) { var _1_pPrior *XSelect _0: @@ -20456,11 +21641,11 @@ _0: _sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12)) _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15)) _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X16)) - if (*XWith)(_p.X17) != nil { + if _p.X17 != nil { _sqlite3WithDelete(tls, _db, (*XWith)(_p.X17)) } if _bFree != 0 { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) } _p = _1_pPrior _bFree = i32(1) @@ -20474,27 +21659,30 @@ func _sqlite3ExprListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) { } } -// Delete an entire expression list. +// C comment +// /* +// ** Delete an entire expression list. +// */ func _exprListDeleteNN(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) { var _i int32 var _pItem *TExprList_item _i = _pList.X0 - _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) func() { - if (_pList.X0) <= i32(0) { + if _pList.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92555), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprListDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21335))) crt.X__builtin_abort(tls) } }() _2: _sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.X0)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X2)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.X1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.X2)) *(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(32) if preInc1(&_i, -1) > i32(0) { goto _2 } - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList)) _ = _i } @@ -20504,7 +21692,10 @@ func init() { crt.Xstrncpy(nil, &_exprListDeleteNNØ00__func__Ø000[0], str(21350), 17) } -// Delete an entire SrcList including all its substructure. +// C comment +// /* +// ** Delete an entire SrcList including all its substructure. +// */ func _sqlite3SrcListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList) { var _i int32 var _pItem *TSrcList_item @@ -20512,21 +21703,21 @@ func _sqlite3SrcListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList) { return } *func() *int32 { - _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) return &_i }() = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X2)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X3)) - if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.X1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.X2)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pItem.X3)) + if ((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pItem.X15)))))) } - if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))) + if ((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pItem.X15)))))) } _sqlite3DeleteTable(tls, _db, (*XTable)(_pItem.X4)) _sqlite3SelectDelete(tls, _db, (*XSelect)(_pItem.X5)) @@ -20535,39 +21726,42 @@ _1: *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112) goto _1 _4: - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList)) } func _sqlite3DeleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) { if _pTable == nil { return } - if ((_db == nil) || ((_db.X79) == nil)) && (preInc5((*uint32)(unsafe.Pointer(&(_pTable.X8))), uint32(4294967295)) > uint32(i32(0))) { + if ((_db == nil) || (_db.X79 == nil)) && (preInc5((*uint32)(unsafe.Pointer(&_pTable.X8)), uint32(4294967295)) > uint32(i32(0))) { return } _deleteTable(tls, _db, _pTable) } -// Remove the memory data structures associated with the given -// Table. No changes are made to disk by this routine. -// -// This routine just deletes the data structure. It does not unlink -// the table data structure from the hash table. But it does destroy -// memory structures of the indices and foreign keys associated with -// the table. -// -// The db parameter is optional. It is needed if the Table object -// contains lookaside memory. (Table objects in the schema do not use -// lookaside memory, but some ephemeral Table objects do.) Or the -// db parameter can be used with db->pnBytesFreed to measure the memory -// used by the Table object. +// C comment +// /* +// ** Remove the memory data structures associated with the given +// ** Table. No changes are made to disk by this routine. +// ** +// ** This routine just deletes the data structure. It does not unlink +// ** the table data structure from the hash table. But it does destroy +// ** memory structures of the indices and foreign keys associated with +// ** the table. +// ** +// ** The db parameter is optional. It is needed if the Table object +// ** contains lookaside memory. (Table objects in the schema do not use +// ** lookaside memory, but some ephemeral Table objects do.) Or the +// ** db parameter can be used with db->pnBytesFreed to measure the memory +// ** used by the Table object. +// */ func _deleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) { var _nLookaside int32 var _2_zName *int8 var _pIndex, _pNext, _2_pOld *XIndex _nLookaside = func() int32 { - if (_db != nil) && (((_pTable.X9) & uint32(i32(2))) == uint32(i32(0))) { - return ((*t7)(unsafe.Pointer(&(_db.X58))).X3) + if (_db != nil) && ((_pTable.X9 & uint32(i32(2))) == uint32(i32(0))) { + return ((*t7)(unsafe.Pointer(&_db.X58)).X3) } return i32(0) }() @@ -20578,12 +21772,12 @@ _3: } _pNext = (*XIndex)(_pIndex.X5) func() { - if (*XSchema)(_pIndex.X6) != (*XSchema)(_pTable.X20) && ((_pTable.X16) == 0 || int32((uint32(_pIndex.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(0)) { + if (*XSchema)(_pIndex.X6) != (*XSchema)(_pTable.X20) && (_pTable.X16 == 0 || int32((uint32(_pIndex.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100309), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21367))) crt.X__builtin_abort(tls) } }() - if ((_db == nil) || ((_db.X79) == nil)) && ((_pTable.X16) == 0) { + if ((_db == nil) || (_db.X79 == nil)) && (_pTable.X16 == 0) { _2_zName = _pIndex.X0 _2_pOld = (*XIndex)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pIndex.X6).X3))), _2_zName, nil)) func() { @@ -20605,14 +21799,14 @@ _3: _6: _sqlite3FkDelete(tls, _db, _pTable) _sqlite3DeleteColumnNames(tls, _db, _pTable) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable.X0)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable.X5)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable.X5)) _sqlite3SelectDelete(tls, _db, (*XSelect)(_pTable.X3)) _sqlite3ExprListDelete(tls, _db, (*XExprList)(_pTable.X6)) _sqlite3VtabClear(tls, _db, _pTable) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTable)) func() { - if _nLookaside != i32(0) && _nLookaside != ((*t7)(unsafe.Pointer(&(_db.X58))).X3) { + if _nLookaside != i32(0) && _nLookaside != ((*t7)(unsafe.Pointer(&_db.X58)).X3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100338), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21545))) crt.X__builtin_abort(tls) } @@ -20625,19 +21819,21 @@ func init() { crt.Xstrncpy(nil, &_deleteTableØ00__func__Ø000[0], str(21593), 12) } -// Insert an element into the hash table pH. The key is pKey -// and the data is "data". -// -// If no element exists with a matching key, then a new -// element is created and NULL is returned. -// -// If another element already exists with the same key, then the -// new data replaces the old data and the old data is returned. -// The key is not copied in this instance. If a malloc fails, then -// the new data is returned and the hash table is unchanged. -// -// If the "data" parameter to this function is NULL, then the -// element corresponding to "key" is removed from the hash table. +// C comment +// /* Insert an element into the hash table pH. The key is pKey +// ** and the data is "data". +// ** +// ** If no element exists with a matching key, then a new +// ** element is created and NULL is returned. +// ** +// ** If another element already exists with the same key, then the +// ** new data replaces the old data and the old data is returned. +// ** The key is not copied in this instance. If a malloc fails, then +// ** the new data is returned and the hash table is unchanged. +// ** +// ** If the "data" parameter to this function is NULL, then the +// ** element corresponding to "key" is removed from the hash table. +// */ func _sqlite3HashInsert(tls *crt.TLS, _pH *XHash, _pKey *int8, _data unsafe.Pointer) (r0 unsafe.Pointer) { var _h uint32 var _1_old_data unsafe.Pointer @@ -20663,8 +21859,8 @@ func _sqlite3HashInsert(tls *crt.TLS, _pH *XHash, _pKey *int8, _data unsafe.Poin _removeElementGivenHash(tls, _pH, _elem, _h) goto _6 } - *(*unsafe.Pointer)(unsafe.Pointer(&(_elem.X2))) = _data - *(**int8)(unsafe.Pointer(&(_elem.X3))) = _pKey + *(*unsafe.Pointer)(unsafe.Pointer(&_elem.X2)) = _data + *(**int8)(unsafe.Pointer(&_elem.X3)) = _pKey _6: return _1_old_data @@ -20676,24 +21872,24 @@ _4: if _new_elem == nil { return _data } - *(**int8)(unsafe.Pointer(&(_new_elem.X3))) = _pKey - *(*unsafe.Pointer)(unsafe.Pointer(&(_new_elem.X2))) = _data - *(*uint32)(unsafe.Pointer(&(_pH.X1))) += 1 - if (_pH.X1) < uint32(i32(10)) || (_pH.X1) <= (uint32(i32(2))*(_pH.X0)) { + *(**int8)(unsafe.Pointer(&_new_elem.X3)) = _pKey + *(*unsafe.Pointer)(unsafe.Pointer(&_new_elem.X2)) = _data + *(*uint32)(unsafe.Pointer(&_pH.X1)) += 1 + if _pH.X1 < uint32(i32(10)) || _pH.X1 <= (uint32(i32(2))*_pH.X0) { goto _10 } - if _rehash(tls, _pH, (_pH.X1)*uint32(i32(2))) != 0 { + if _rehash(tls, _pH, _pH.X1*uint32(i32(2))) != 0 { func() { - if (_pH.X0) <= uint32(i32(0)) { + if _pH.X0 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29491), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000))), unsafe.Pointer(str(21613))) crt.X__builtin_abort(tls) } }() - _h = _strHash(tls, _pKey) % (_pH.X0) + _h = _strHash(tls, _pKey) % _pH.X0 } _10: _insertElement(tls, _pH, func() *T_ht { - if (*T_ht)(_pH.X3) != nil { + if _pH.X3 != nil { return (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 16*uintptr(_h))) } return nil @@ -20707,16 +21903,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3HashInsertØ00__func__Ø000[0], str(21626), 18) } -// This function (for internal use only) locates an element in an -// hash table that matches the given key. The hash for this key is -// also computed and returned in the *pH parameter. +// C comment +// /* This function (for internal use only) locates an element in an +// ** hash table that matches the given key. The hash for this key is +// ** also computed and returned in the *pH parameter. +// */ func _findElementWithHash(tls *crt.TLS, _pH *XHash, _pKey *int8, _pHash *uint32) (r0 *XHashElem) { var _count int32 var _h uint32 var _elem *XHashElem var _1_pEntry *T_ht - if (*T_ht)(_pH.X3) != nil { - _h = _strHash(tls, _pKey) % (_pH.X0) + if _pH.X3 != nil { + _h = _strHash(tls, _pKey) % _pH.X0 _1_pEntry = (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 16*uintptr(_h))) _elem = (*XHashElem)(_1_pEntry.X1) _count = _1_pEntry.X0 @@ -20728,7 +21926,7 @@ func _findElementWithHash(tls *crt.TLS, _pH *XHash, _pKey *int8, _pHash *uint32) _1: *_pHash = _h _2: - if postInc1(&_count, int32(-1)) == 0 { + if postInc1(&_count, -1) == 0 { goto _3 } func() { @@ -20749,7 +21947,10 @@ _3: panic(0) } -// The hashing function. +// C comment +// /* +// ** The hashing function. +// */ func _strHash(tls *crt.TLS, _z *int8) (r0 uint32) { var _h uint32 var _c uint8 @@ -20758,7 +21959,7 @@ _0: if int32(store2(&_c, uint8(*postInc0(&_z, 1)))) != i32(0) { { p := &_h - *p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(_c)))) + *p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(_c)))) sink5(*p) } { @@ -20777,37 +21978,39 @@ func init() { crt.Xstrncpy(nil, &_findElementWithHashØ00__func__Ø000[0], str(21652), 20) } -// Remove a single entry from the hash table given a pointer to that -// element and a hash on the element's key. +// C comment +// /* Remove a single entry from the hash table given a pointer to that +// ** element and a hash on the element's key. +// */ func _removeElementGivenHash(tls *crt.TLS, _pH *XHash, _elem *XHashElem, _h uint32) { var _pEntry *T_ht - if (*XHashElem)(_elem.X1) != nil { + if _elem.X1 != nil { *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_elem.X1).X0))))) = (*XHashElem)(_elem.X0) goto _1 } - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = (*XHashElem)(_elem.X0) + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X2)))) = (*XHashElem)(_elem.X0) _1: - if (*XHashElem)(_elem.X0) != nil { + if _elem.X0 != nil { *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_elem.X0).X1))))) = (*XHashElem)(_elem.X1) } - if (*T_ht)(_pH.X3) == nil { + if _pH.X3 == nil { goto _3 } _pEntry = (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 16*uintptr(_h))) if (*XHashElem)(_pEntry.X1) == _elem { - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = (*XHashElem)(_elem.X0) + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pEntry.X1)))) = (*XHashElem)(_elem.X0) } - *(*int32)(unsafe.Pointer(&(_pEntry.X0))) -= 1 + *(*int32)(unsafe.Pointer(&_pEntry.X0)) -= 1 func() { - if (_pEntry.X0) < i32(0) { + if _pEntry.X0 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29426), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21672))) crt.X__builtin_abort(tls) } }() _3: - Xsqlite3_free(tls, (unsafe.Pointer)(_elem)) - *(*uint32)(unsafe.Pointer(&(_pH.X1))) -= 1 - if (_pH.X1) == uint32(i32(0)) { + Xsqlite3_free(tls, unsafe.Pointer(_elem)) + *(*uint32)(unsafe.Pointer(&_pH.X1)) -= 1 + if _pH.X1 == uint32(i32(0)) { func() { if (*XHashElem)(_pH.X2) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29431), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21689))) @@ -20815,7 +22018,7 @@ _3: } }() func() { - if (_pH.X1) != uint32(i32(0)) { + if _pH.X1 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29432), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21702))) crt.X__builtin_abort(tls) } @@ -20830,11 +22033,13 @@ func init() { crt.Xstrncpy(nil, &_removeElementGivenHashØ00__func__Ø000[0], str(21715), 23) } -// Resize the hash table so that it cantains "new_size" buckets. -// -// The hash table might fail to resize if sqlite3_malloc() fails or -// if the new size is the same as the prior size. -// Return TRUE if the resize occurs and false if not. +// C comment +// /* Resize the hash table so that it cantains "new_size" buckets. +// ** +// ** The hash table might fail to resize if sqlite3_malloc() fails or +// ** if the new size is the same as the prior size. +// ** Return TRUE if the resize occurs and false if not. +// */ func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) { var _2_h uint32 var _elem, _next_elem *XHashElem @@ -20842,7 +22047,7 @@ func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) { if (uint64(_new_size) * u64(16)) > uint64(i32(1024)) { _new_size = uint32(u64(64)) } - if _new_size == (_pH.X0) { + if _new_size == _pH.X0 { return i32(0) } _sqlite3BeginBenignMalloc(tls) @@ -20852,9 +22057,9 @@ func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) { return i32(0) } Xsqlite3_free(tls, _pH.X3) - *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X3))))) = _new_ht - *(*uint32)(unsafe.Pointer(&(_pH.X0))) = store5(&_new_size, uint32(uint64(_sqlite3MallocSize(tls, (unsafe.Pointer)(_new_ht)))/u64(16))) - crt.Xmemset(tls, (unsafe.Pointer)(_new_ht), i32(0), uint64(_new_size)*u64(16)) + *(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X3)))) = _new_ht + *(*uint32)(unsafe.Pointer(&_pH.X0)) = store5(&_new_size, uint32(uint64(_sqlite3MallocSize(tls, unsafe.Pointer(_new_ht)))/u64(16))) + crt.Xmemset(tls, unsafe.Pointer(_new_ht), i32(0), uint64(_new_size)*u64(16)) *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(func() *XHash { _elem = (*XHashElem)(_pH.X2); return _pH }().X2))))) = nil _3: if _elem == nil { @@ -20862,26 +22067,28 @@ _3: } _2_h = _strHash(tls, _elem.X3) % _new_size _next_elem = (*XHashElem)(_elem.X0) - _insertElement(tls, _pH, (*T_ht)(unsafe.Pointer(uintptr((unsafe.Pointer)(_new_ht))+16*uintptr(_2_h))), _elem) + _insertElement(tls, _pH, (*T_ht)(unsafe.Pointer(uintptr(unsafe.Pointer(_new_ht))+16*uintptr(_2_h))), _elem) _elem = _next_elem goto _3 _6: return i32(1) } -// Link pNew element into the hash table pH. If pEntry!=0 then also -// insert pNew into the pEntry hash bucket. +// C comment +// /* Link pNew element into the hash table pH. If pEntry!=0 then also +// ** insert pNew into the pEntry hash bucket. +// */ func _insertElement(tls *crt.TLS, _pH *XHash, _pEntry *T_ht, _pNew *XHashElem) { var _pHead *XHashElem if _pEntry != nil { _pHead = func() *XHashElem { - if (_pEntry.X0) != 0 { + if _pEntry.X0 != 0 { return (*XHashElem)(_pEntry.X1) } return nil }() - *(*int32)(unsafe.Pointer(&(_pEntry.X0))) += 1 - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = _pNew + *(*int32)(unsafe.Pointer(&_pEntry.X0)) += 1 + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pEntry.X1)))) = _pNew goto _3 } _pHead = nil @@ -20889,35 +22096,38 @@ _3: if _pHead == nil { goto _4 } - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pHead - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = (*XHashElem)(_pHead.X1) - if (*XHashElem)(_pHead.X1) != nil { + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X0)))) = _pHead + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X1)))) = (*XHashElem)(_pHead.X1) + if _pHead.X1 != nil { *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_pHead.X1).X0))))) = _pNew goto _6 } - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = _pNew + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X2)))) = _pNew _6: - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pHead.X1))))) = _pNew + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pHead.X1)))) = _pNew goto _7 _4: - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = (*XHashElem)(_pH.X2) - if (*XHashElem)(_pH.X2) != nil { + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X0)))) = (*XHashElem)(_pH.X2) + if _pH.X2 != nil { *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_pH.X2).X1))))) = _pNew } - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = nil - *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = _pNew + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X1)))) = nil + *(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pH.X2)))) = _pNew _7: } -// Return true if the correct mutexes are held for accessing the -// db->aDb[iDb].pSchema structure. The mutexes required for schema -// access are: -// -// (1) The mutex on db -// (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt. -// -// If pSchema is not NULL, then iDb is computed from pSchema and -// db using sqlite3SchemaToIndex(). +// C comment +// /* +// ** Return true if the correct mutexes are held for accessing the +// ** db->aDb[iDb].pSchema structure. The mutexes required for schema +// ** access are: +// ** +// ** (1) The mutex on db +// ** (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt. +// ** +// ** If pSchema is not NULL, then iDb is computed from pSchema and +// ** db using sqlite3SchemaToIndex(). +// */ func _sqlite3SchemaMutexHeld(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pSchema *XSchema) (r0 int32) { var _p *XBtree func() { @@ -20930,7 +22140,7 @@ func _sqlite3SchemaMutexHeld(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pSchema * _iDb = _sqlite3SchemaToIndex(tls, _db, _pSchema) } func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58979), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -20957,11 +22167,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SchemaMutexHeldØ00__func__Ø000[0], str(21760), 23) } -// Convert a schema pointer into the iDb index that indicates -// which database file in db->aDb[] the schema refers to. -// -// If the same database is attached more than once, the first -// attached database is returned. +// C comment +// /* +// ** Convert a schema pointer into the iDb index that indicates +// ** which database file in db->aDb[] the schema refers to. +// ** +// ** If the same database is attached more than once, the first +// ** attached database is returned. +// */ func _sqlite3SchemaToIndex(tls *crt.TLS, _db *Xsqlite3, _pSchema *XSchema) (r0 int32) { var _i int32 _i = i32(-1000000) @@ -20977,7 +22190,7 @@ func _sqlite3SchemaToIndex(tls *crt.TLS, _db *Xsqlite3, _pSchema *XSchema) (r0 i _i = i32(0) _3: if func() int32 { - if _i < (_db.X5) { + if _i < _db.X5 { return i32(1) } return func() int32 { @@ -20995,7 +22208,7 @@ _3: goto _3 _8: func() { - if _i < i32(0) || _i >= (_db.X5) { + if _i < i32(0) || _i >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116154), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000))), unsafe.Pointer(str(21783))) crt.X__builtin_abort(tls) } @@ -21010,32 +22223,41 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SchemaToIndexØ00__func__Ø000[0], str(21801), 21) } -// Reclaim the memory used by an index +// C comment +// /* +// ** Reclaim the memory used by an index +// */ func _freeIndex(tls *crt.TLS, _db *Xsqlite3, _p *XIndex) { _sqlite3DeleteIndexSamples(tls, _db, _p) _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X9)) _sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X10)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X4)) - if ((uint32((_p.X16)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X8)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X4)) + if ((uint32(_p.X16>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X8)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p)) } -// If the Index.aSample variable is not NULL, delete the aSample[] array -// and its contents. +// C comment +// /* +// ** If the Index.aSample variable is not NULL, delete the aSample[] array +// ** and its contents. +// */ func _sqlite3DeleteIndexSamples(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) { } -// Free all memory associated with foreign key definitions attached to -// table pTab. Remove the deleted foreign keys from the Schema.fkeyHash -// hash table. +// C comment +// /* +// ** Free all memory associated with foreign key definitions attached to +// ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash +// ** hash table. +// */ func _sqlite3FkDelete(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) { var _4_z *int8 var _4_p unsafe.Pointer var _pFKey, _pNext *XFKey func() { - if _db != nil && (_pTab.X16) == 0 && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pTab.X20)) == 0 { + if _db != nil && _pTab.X16 == 0 && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pTab.X20)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000))), unsafe.Pointer(str(21822))) crt.X__builtin_abort(tls) } @@ -21045,10 +22267,10 @@ _4: if _pFKey == nil { goto _7 } - if _db != nil && (_db.X79) != nil { + if _db != nil && _db.X79 != nil { goto _9 } - if (*XFKey)(_pFKey.X4) != nil { + if _pFKey.X4 != nil { *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFKey)(_pFKey.X4).X3))))) = (*XFKey)(_pFKey.X3) goto _11 } @@ -21057,11 +22279,11 @@ _4: if _4_p != nil { return ((*XFKey)(_pFKey.X3).X2) } - return (_pFKey.X2) + return _pFKey.X2 }() _sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTab.X20).X5))), _4_z, _4_p) _11: - if (*XFKey)(_pFKey.X3) != nil { + if _pFKey.X3 != nil { *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFKey)(_pFKey.X3).X4))))) = (*XFKey)(_pFKey.X4) } _9: @@ -21071,10 +22293,10 @@ _9: crt.X__builtin_abort(tls) } }() - _fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(i32(0))))) - _fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(i32(1))))) + _fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(i32(0))))) + _fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(i32(1))))) _pNext = (*XFKey)(_pFKey.X1) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pFKey)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey)) _pFKey = _pNext goto _4 _7: @@ -21086,12 +22308,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FkDeleteØ00__func__Ø000[0], str(21940), 16) } -// The second argument is a Trigger structure allocated by the -// fkActionTrigger() routine. This function deletes the Trigger structure -// and all of its sub-components. -// -// The Trigger structure or any of its sub-components may be allocated from -// the lookaside buffer belonging to database handle dbMem. +// C comment +// /* +// ** The second argument is a Trigger structure allocated by the +// ** fkActionTrigger() routine. This function deletes the Trigger structure +// ** and all of its sub-components. +// ** +// ** The Trigger structure or any of its sub-components may be allocated from +// ** the lookaside buffer belonging to database handle dbMem. +// */ func _fkTriggerDelete(tls *crt.TLS, _dbMem *Xsqlite3, _p *XTrigger) { var _1_pStep *XTriggerStep if _p != nil { @@ -21100,12 +22325,15 @@ func _fkTriggerDelete(tls *crt.TLS, _dbMem *Xsqlite3, _p *XTrigger) { _sqlite3ExprListDelete(tls, _dbMem, (*XExprList)(_1_pStep.X6)) _sqlite3SelectDelete(tls, _dbMem, (*XSelect)(_1_pStep.X3)) _sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_p.X4)) - _sqlite3DbFree(tls, _dbMem, (unsafe.Pointer)(_p)) + _sqlite3DbFree(tls, _dbMem, unsafe.Pointer(_p)) } } -// Delete memory allocated for the column names of a table or view (the -// Table.aCol[] array). +// C comment +// /* +// ** Delete memory allocated for the column names of a table or view (the +// ** Table.aCol[] array). +// */ func _sqlite3DeleteColumnNames(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) { var _i int32 var _pCol *XColumn @@ -21123,9 +22351,9 @@ _3: if _i >= int32(_pTable.X11) { goto _6 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pCol.X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.X0)) _sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.X1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pCol.X2)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pCol.X2)) *(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32) goto _3 _6: @@ -21139,52 +22367,58 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DeleteColumnNamesØ00__func__Ø000[0], str(21966), 25) } -// Clear any and all virtual-table information from the Table record. -// This routine is called, for example, just before deleting the Table -// record. -// -// Since it is a virtual-table, the Table structure contains a pointer -// to the head of a linked list of VTable structures. Each VTable -// structure is associated with a single sqlite3* user of the schema. -// The reference count of the VTable structure associated with database -// connection db is decremented immediately (which may lead to the -// structure being xDisconnected and free). Any other VTable structures -// in the list are moved to the sqlite3.pDisconnect list of the associated -// database connection. +// C comment +// /* +// ** Clear any and all virtual-table information from the Table record. +// ** This routine is called, for example, just before deleting the Table +// ** record. +// ** +// ** Since it is a virtual-table, the Table structure contains a pointer +// ** to the head of a linked list of VTable structures. Each VTable +// ** structure is associated with a single sqlite3* user of the schema. +// ** The reference count of the VTable structure associated with database +// ** connection db is decremented immediately (which may lead to the +// ** structure being xDisconnected and free). Any other VTable structures +// ** in the list are moved to the sqlite3.pDisconnect list of the associated +// ** database connection. +// */ func _sqlite3VtabClear(tls *crt.TLS, _db *Xsqlite3, _p *XTable) { var _1_i int32 - if (_db == nil) || ((_db.X79) == nil) { + if (_db == nil) || (_db.X79 == nil) { _vtabDisconnectAll(tls, nil, _p) } - if (_p.X17) == nil { + if _p.X17 == nil { goto _2 } _1_i = i32(0) _3: - if _1_i >= (_p.X16) { + if _1_i >= _p.X16 { goto _6 } if _1_i != i32(1) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X17)) + 8*uintptr(_1_i))))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X17)) + 8*uintptr(_1_i))))) } _1_i += 1 goto _3 _6: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X17)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X17)) _2: } -// Table p is a virtual table. This function moves all elements in the -// p->pVTable list to the sqlite3.pDisconnect lists of their associated -// database connections to be disconnected at the next opportunity. -// Except, if argument db is not NULL, then the entry associated with -// connection db is left in the p->pVTable list. +// C comment +// /* +// ** Table p is a virtual table. This function moves all elements in the +// ** p->pVTable list to the sqlite3.pDisconnect lists of their associated +// ** database connections to be disconnected at the next opportunity. +// ** Except, if argument db is not NULL, then the entry associated with +// ** connection db is left in the p->pVTable list. +// */ func _vtabDisconnectAll(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *XVTable) { var _1_db2 *Xsqlite3 var _pRet, _pVTable, _1_pNext *XVTable _pRet = nil _pVTable = (*XVTable)(_p.X18) - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = nil + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X18)))) = nil func() { if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_p.X20)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125175), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000))), unsafe.Pointer(str(21991))) @@ -21205,12 +22439,12 @@ _3: }() if _1_db2 == _db { _pRet = _pVTable - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = _pRet - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X6))))) = nil + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X18)))) = _pRet + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X6)))) = nil goto _8 } - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X6))))) = (*XVTable)(_1_db2.X68) - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_db2.X68))))) = _pVTable + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVTable.X6)))) = (*XVTable)(_1_db2.X68) + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_db2.X68)))) = _pVTable _8: _pVTable = _1_pNext goto _3 @@ -21230,7 +22464,10 @@ func init() { crt.Xstrncpy(nil, &_vtabDisconnectAllØ00__func__Ø000[0], str(22058), 18) } -// Delete an IdList. +// C comment +// /* +// ** Delete an IdList. +// */ func _sqlite3IdListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList) { var _i int32 if _pList == nil { @@ -21238,18 +22475,21 @@ func _sqlite3IdListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList) { } _i = i32(0) _1: - if _i >= (_pList.X1) { + if _i >= _pList.X1 { goto _4 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)((*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0)+16*uintptr(_i))).X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer((*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0)+16*uintptr(_i))).X0)) _i += 1 goto _1 _4: _sqlite3DbFree(tls, _db, _pList.X0) - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pList)) } -// Free the contents of the With object passed as the second argument. +// C comment +// /* +// ** Free the contents of the With object passed as the second argument. +// */ func _sqlite3WithDelete(tls *crt.TLS, _db *Xsqlite3, _pWith *XWith) { var _1_i int32 var _2_pCte *TCte @@ -21258,38 +22498,41 @@ func _sqlite3WithDelete(tls *crt.TLS, _db *Xsqlite3, _pWith *XWith) { } _1_i = i32(0) _1: - if _1_i >= (_pWith.X0) { + if _1_i >= _pWith.X0 { goto _4 } - _2_pCte = (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2))))) + 32*uintptr(_1_i))) + _2_pCte = (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pWith.X2)))) + 32*uintptr(_1_i))) _sqlite3ExprListDelete(tls, _db, (*XExprList)(_2_pCte.X1)) _sqlite3SelectDelete(tls, _db, (*XSelect)(_2_pCte.X2)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_pCte.X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pCte.X0)) _1_i += 1 goto _1 _4: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pWith)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pWith)) _0: } -// Look through the list of open database files in db->aDb[] and if -// any have been closed, remove them from the list. Reallocate the -// db->aDb[] structure to a smaller size, if possible. -// -// Entry 0 (the "main" database) and entry 1 (the "temp" database) -// are never candidates for being collapsed. +// C comment +// /* +// ** Look through the list of open database files in db->aDb[] and if +// ** any have been closed, remove them from the list. Reallocate the +// ** db->aDb[] structure to a smaller size, if possible. +// ** +// ** Entry 0 (the "main" database) and entry 1 (the "temp" database) +// ** are never candidates for being collapsed. +// */ func _sqlite3CollapseDatabaseArray(tls *crt.TLS, _db *Xsqlite3) { var _i, _j int32 var _1_pDb *XDb _i = store1(&_j, i32(2)) _0: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _3 } _1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) if (*XBtree)(_1_pDb.X1) == nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pDb.X0)) - *(**int8)(unsafe.Pointer(&(_1_pDb.X0))) = nil + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDb.X0)) + *(**int8)(unsafe.Pointer(&_1_pDb.X0)) = nil goto _1 } if _j < _i { @@ -21300,32 +22543,38 @@ _1: _i += 1 goto _0 _3: - *(*int32)(unsafe.Pointer(&(_db.X5))) = _j - if ((_db.X5) <= i32(2)) && ((*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72)))))) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*[2]XDb)(unsafe.Pointer(&(_db.X72)))), _db.X4, u64(64)) + *(*int32)(unsafe.Pointer(&_db.X5)) = _j + if (_db.X5 <= i32(2)) && ((*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72))))) { + crt.Xmemcpy(tls, unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72))), _db.X4, u64(64)) _sqlite3DbFree(tls, _db, _db.X4) - *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) + *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X4)))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72)))) } } -// Close all open savepoints. This function only manipulates fields of the -// database handle object, it does not close any savepoints that may be open -// at the b-tree/pager level. +// C comment +// /* +// ** Close all open savepoints. This function only manipulates fields of the +// ** database handle object, it does not close any savepoints that may be open +// ** at the b-tree/pager level. +// */ func _sqlite3CloseSavepoints(tls *crt.TLS, _db *Xsqlite3) { var _1_pTmp *XSavepoint _0: - if (*XSavepoint)(_db.X73) != nil { + if _db.X73 != nil { _1_pTmp = (*XSavepoint)(_db.X73) - *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_1_pTmp.X3) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pTmp)) + *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X73)))) = (*XSavepoint)(_1_pTmp.X3) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pTmp)) goto _0 } - *(*int32)(unsafe.Pointer(&(_db.X75))) = i32(0) - *(*int32)(unsafe.Pointer(&(_db.X76))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_db.X75)) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X76)) = i32(0) + *(*uint8)(unsafe.Pointer(&_db.X23)) = uint8(i32(0)) } -// Close an open database and invalidate all cursors. +// C comment +// /* +// ** Close an open database and invalidate all cursors. +// */ func _sqlite3BtreeClose(tls *crt.TLS, _p *XBtree) (r0 int32) { var _pBt *XBtShared var _pCur, _1_pTmp *XBtCursor @@ -21352,30 +22601,30 @@ _3: _sqlite3BtreeRollback(tls, _p, i32(0), i32(0)) _sqlite3BtreeLeave(tls, _p) func() { - if (_p.X6) != i32(0) || int32(_p.X4) != i32(0) { + if _p.X6 != i32(0) || int32(_p.X4) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61625), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22076))) crt.X__builtin_abort(tls) } }() - if (_p.X3) != 0 && _removeFromSharingList(tls, _pBt) == 0 { + if _p.X3 != 0 && _removeFromSharingList(tls, _pBt) == 0 { goto _9 } func() { - if (*XBtCursor)(_pBt.X2) != nil { + if _pBt.X2 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61632), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22109))) crt.X__builtin_abort(tls) } }() _sqlite3PagerClose(tls, (*XPager)(_pBt.X0), (*Xsqlite3)(_p.X0)) - if ((_pBt.X20) != nil) && ((_pBt.X19) != nil) { - (_pBt.X20)(tls, _pBt.X19) + if (_pBt.X20 != nil) && (_pBt.X19 != nil) { + _pBt.X20(tls, _pBt.X19) } _sqlite3DbFree(tls, nil, _pBt.X19) _freeTempSpace(tls, _pBt) - Xsqlite3_free(tls, (unsafe.Pointer)(_pBt)) + Xsqlite3_free(tls, unsafe.Pointer(_pBt)) _9: func() { - if (_p.X6) != i32(0) { + if _p.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22123))) crt.X__builtin_abort(tls) } @@ -21386,13 +22635,13 @@ _9: crt.X__builtin_abort(tls) } }() - if (*XBtree)(_p.X10) != nil { + if _p.X10 != nil { *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X10).X9))))) = (*XBtree)(_p.X9) } - if (*XBtree)(_p.X9) != nil { + if _p.X9 != nil { *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X9).X10))))) = (*XBtree)(_p.X10) } - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) return i32(0) } @@ -21402,8 +22651,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCloseØ00__func__Ø000[0], str(22140), 18) } -// Close a cursor. The read lock on the database file is released -// when the last cursor is closed. +// C comment +// /* +// ** Close a cursor. The read lock on the database file is released +// ** when the last cursor is closed. +// */ func _sqlite3BtreeCloseCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _1_i int32 var _pBtree *XBtree @@ -21423,13 +22675,13 @@ func _sqlite3BtreeCloseCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() if (*XBtCursor)(_1_pBt.X2) == _pCur { - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pBt.X2))))) = (*XBtCursor)(_pCur.X2) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pBt.X2)))) = (*XBtCursor)(_pCur.X2) goto _4 } _3_pPrev = (*XBtCursor)(_1_pBt.X2) _5: if (*XBtCursor)(_3_pPrev.X2) == _pCur { - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pPrev.X2))))) = (*XBtCursor)(_pCur.X2) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pPrev.X2)))) = (*XBtCursor)(_pCur.X2) goto _7 } _3_pPrev = (*XBtCursor)(_3_pPrev.X2) @@ -21452,12 +22704,12 @@ _10: if _1_i > int32(_pCur.X14) { goto _13 } - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_1_i)))) + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_1_i)))) _1_i += 1 goto _10 _13: _unlockBtreeIfUnused(tls, _1_pBt) - Xsqlite3_free(tls, (unsafe.Pointer)(_pCur.X3)) + Xsqlite3_free(tls, unsafe.Pointer(_pCur.X3)) _sqlite3BtreeLeave(tls, _pBtree) _0: return i32(0) @@ -21469,10 +22721,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCloseCursorØ00__func__Ø000[0], str(22174), 24) } -// Decrement the BtShared.nRef counter. When it reaches zero, -// remove the BtShared structure from the sharing list. Return -// true if the BtShared.nRef counter reaches zero and return -// false if it is still positive. +// C comment +// /* +// ** Decrement the BtShared.nRef counter. When it reaches zero, +// ** remove the BtShared structure from the sharing list. Return +// ** true if the BtShared.nRef counter reaches zero and return +// ** false if it is still positive. +// */ func _removeFromSharingList(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { var _removed int32 var _pMaster *Xsqlite3_mutex @@ -21486,8 +22741,8 @@ func _removeFromSharingList(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { }() _pMaster = _sqlite3MutexAlloc(tls, i32(2)) Xsqlite3_mutex_enter(tls, _pMaster) - *(*int32)(unsafe.Pointer(&(_pBt.X23))) -= 1 - if (_pBt.X23) > i32(0) { + *(*int32)(unsafe.Pointer(&_pBt.X23)) -= 1 + if _pBt.X23 > i32(0) { goto _2 } if _sqlite3SharedCacheList == _pBt { @@ -21520,7 +22775,7 @@ _5: return i32(0) }() }() != 0 { - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X24))))) = (*XBtShared)(_pBt.X24) + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pList.X24)))) = (*XBtShared)(_pBt.X24) } _4: Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_pBt.X21)) @@ -21538,20 +22793,22 @@ func init() { var _sqlite3SharedCacheList *XBtShared -// Free a dynamic mutex. +// C comment +// /* +// ** Free a dynamic mutex. +// */ func Xsqlite3_mutex_free(tls *crt.TLS, _p *Xsqlite3_mutex) { if _p != nil { func() { - if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X3)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X3) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_freeØ00__func__Ø000))), unsafe.Pointer(str(22254))) crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X3)})))(tls, _p) + func() func(*crt.TLS, *Xsqlite3_mutex) { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X3 + return *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&v)) + }()(tls, _p) } } @@ -21561,18 +22818,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_mutex_freeØ00__func__Ø000[0], str(22291), 19) } -// Shutdown the page cache. Free all memory and close all files. -// -// If a transaction was in progress when this routine is called, that -// transaction is rolled back. All outstanding pages are invalidated -// and their memory is freed. Any attempt to use a page associated -// with this page cache after this function returns will likely -// result in a coredump. -// -// This function always succeeds. If a transaction is active an attempt -// is made to roll it back. If an error occurs during the rollback -// a hot journal may be left in the filesystem but no error is returned -// to the caller. +// C comment +// /* +// ** Shutdown the page cache. Free all memory and close all files. +// ** +// ** If a transaction was in progress when this routine is called, that +// ** transaction is rolled back. All outstanding pages are invalidated +// ** and their memory is freed. Any attempt to use a page associated +// ** with this page cache after this function returns will likely +// ** result in a coredump. +// ** +// ** This function always succeeds. If a transaction is active an attempt +// ** is made to roll it back. If an error occurs during the rollback +// ** a hot journal may be left in the filesystem but no error is returned +// ** to the caller. +// */ func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) { var _pTmp *uint8 _pTmp = (*uint8)(unsafe.Pointer(_pPager.X58)) @@ -21590,7 +22850,7 @@ func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) }() _sqlite3BeginBenignMalloc(tls) _pagerFreeMapHdrs(tls, _pPager) - *(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X1)) = uint8(i32(0)) func() { if _db == nil && (*XWal)(_pPager.X60) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51020), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22339))) @@ -21603,9 +22863,9 @@ func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) } return _pTmp }()) - *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60))))) = nil + *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X60)))) = nil _pager_reset(tls, _pPager) - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { _pager_unlock(tls, _pPager) goto _12 } @@ -21617,10 +22877,10 @@ _12: _sqlite3EndBenignMalloc(tls) _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32)) _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X31)) - _sqlite3PageFree(tls, (unsafe.Pointer)(_pTmp)) + _sqlite3PageFree(tls, unsafe.Pointer(_pTmp)) _sqlite3PcacheClose(tls, (*XPCache)(_pPager.X59)) func() { - if (*XPagerSavepoint)(_pPager.X37) != nil || (*XBitvec)(_pPager.X30) != nil { + if _pPager.X37 != nil || _pPager.X30 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22361))) crt.X__builtin_abort(tls) } @@ -21631,7 +22891,7 @@ _12: crt.X__builtin_abort(tls) } }() - Xsqlite3_free(tls, (unsafe.Pointer)(_pPager)) + Xsqlite3_free(tls, unsafe.Pointer(_pPager)) return i32(0) } @@ -21641,7 +22901,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerCloseØ00__func__Ø000[0], str(22450), 18) } -// Free all PgHdr objects stored in the Pager.pMmapFreelist list. +// C comment +// /* +// ** Free all PgHdr objects stored in the Pager.pMmapFreelist list. +// */ func _pagerFreeMapHdrs(tls *crt.TLS, _pPager *XPager) { var _p, _pNext *XPgHdr _p = (*XPgHdr)(_pPager.X43) @@ -21650,13 +22913,16 @@ _0: goto _3 } _pNext = (*XPgHdr)(_p.X3) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) _p = _pNext goto _0 _3: } -// Close a connection to a log file. +// C comment +// /* +// ** Close a connection to a log file. +// */ func _sqlite3WalClose(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _sync_flags int32, _nBuf int32, _zBuf *uint8) (r0 int32) { var _rc, _1_isDelete, _4_bPersist int32 _rc = i32(0) @@ -21668,19 +22934,19 @@ func _sqlite3WalClose(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _sync_flags int3 goto _2 } if int32(_pWal.X11) == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X11)) = uint8(i32(1)) } _rc = _sqlite3WalCheckpoint(tls, _pWal, _db, i32(0), nil, nil, _sync_flags, _nBuf, _zBuf, nil, nil) if _rc != i32(0) { goto _4 } _4_bPersist = i32(-1) - _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(10), (unsafe.Pointer)(&_4_bPersist)) + _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(10), unsafe.Pointer(&_4_bPersist)) if _4_bPersist != i32(1) { _1_isDelete = i32(1) goto _7 } - if (_pWal.X4) >= int64(i32(0)) { + if _pWal.X4 >= int64(i32(0)) { _walLimitSize(tls, _pWal, int64(i32(0))) } _7: @@ -21693,26 +22959,30 @@ _2: _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pWal.X0), _pWal.X21, i32(0)) _sqlite3EndBenignMalloc(tls) } - Xsqlite3_free(tls, (unsafe.Pointer)(_pWal.X7)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pWal)) + Xsqlite3_free(tls, unsafe.Pointer(_pWal.X7)) + Xsqlite3_free(tls, unsafe.Pointer(_pWal)) _0: return _rc } func _sqlite3OsLock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X7)})))(tls, _id, _lockType) -} - -// This routine is called to implement sqlite3_wal_checkpoint() and -// related interfaces. -// -// Obtain a CHECKPOINT lock and then backfill as much information as -// we can from WAL into the database. -// -// If parameter xBusy is not NULL, it is a pointer to a busy-handler -// callback. In this case this function runs a blocking checkpoint. + return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X7 + return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _lockType) +} + +// C comment +// /* +// ** This routine is called to implement sqlite3_wal_checkpoint() and +// ** related interfaces. +// ** +// ** Obtain a CHECKPOINT lock and then backfill as much information as +// ** we can from WAL into the database. +// ** +// ** If parameter xBusy is not NULL, it is a pointer to a busy-handler +// ** callback. In this case this function runs a blocking checkpoint. +// */ func _sqlite3WalCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _nBuf int32, _zBuf *uint8, _pnLog *int32, _pnCkpt *int32) (r0 int32) { var _rc, _isChanged, _eMode2 int32 var _xBusy2 func(*crt.TLS, unsafe.Pointer) int32 @@ -21741,20 +23011,20 @@ func _sqlite3WalCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int3 crt.X__builtin_abort(tls) } }() - if (_pWal.X14) != 0 { + if _pWal.X14 != 0 { return i32(8) } _rc = _walLockExclusive(tls, _pWal, i32(1), i32(1)) if _rc != 0 { return _rc } - *(*uint8)(unsafe.Pointer(&(_pWal.X13))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X13)) = uint8(i32(1)) if _eMode == i32(0) { goto _9 } _rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(0), i32(1)) if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(1)) goto _12 } if _rc == i32(5) { @@ -21775,7 +23045,7 @@ _13: if _rc != i32(0) { goto _16 } - if (((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) != 0) && (_walPagesize(tls, _pWal) != _nBuf) { + if (((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) != 0) && (_walPagesize(tls, _pWal) != _nBuf) { _rc = _sqlite3CorruptError(tls, i32(57832)) goto _19 } @@ -21785,7 +23055,7 @@ _19: goto _21 } if _pnLog != nil { - *_pnLog = int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) + *_pnLog = int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) } if _pnCkpt != nil { *_pnCkpt = int32(_walCkptInfo(tls, _pWal).X0) @@ -21793,11 +23063,11 @@ _19: _21: _16: if _isChanged != 0 { - crt.Xmemset(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), i32(0), u64(48)) + crt.Xmemset(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), i32(0), u64(48)) } _sqlite3WalEndWriteTransaction(tls, _pWal) _walUnlockExclusive(tls, _pWal, i32(1), i32(1)) - *(*uint8)(unsafe.Pointer(&(_pWal.X13))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X13)) = uint8(i32(0)) return func() int32 { if (_rc == i32(0)) && (_eMode != _eMode2) { return i32(5) @@ -21814,18 +23084,21 @@ func init() { func _walLockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) (r0 int32) { var _rc int32 - if (_pWal.X11) != 0 { + if _pWal.X11 != 0 { return i32(0) } _rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, _n, i32(10)) - *(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5)))) + *(*uint8)(unsafe.Pointer(&_pWal.X23)) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5)))) return _rc } -// Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and -// n. If the attempt fails and parameter xBusy is not NULL, then it is a -// busy-handler function. Invoke it and retry the lock until either the -// lock is successfully obtained or the busy-handler returns 0. +// C comment +// /* +// ** Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and +// ** n. If the attempt fails and parameter xBusy is not NULL, then it is a +// ** busy-handler function. Invoke it and retry the lock until either the +// ** lock is successfully obtained or the busy-handler returns 0. +// */ func _walBusyLock(tls *crt.TLS, _pWal *XWal, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _lockIdx int32, _n int32) (r0 int32) { var _rc int32 _0: @@ -21836,16 +23109,19 @@ _0: return _rc } -// Read the wal-index header from the wal-index and into pWal->hdr. -// If the wal-header appears to be corrupt, try to reconstruct the -// wal-index from the WAL before returning. -// -// Set *pChanged to 1 if the wal-index header value in pWal->hdr is -// changed by this operation. If pWal->hdr is unchanged, set *pChanged -// to 0. -// -// If the wal-index header is successfully read, return SQLITE_OK. -// Otherwise an SQLite error code. +// C comment +// /* +// ** Read the wal-index header from the wal-index and into pWal->hdr. +// ** If the wal-header appears to be corrupt, try to reconstruct the +// ** wal-index from the WAL before returning. +// ** +// ** Set *pChanged to 1 if the wal-index header value in pWal->hdr is +// ** changed by this operation. If pWal->hdr is unchanged, set *pChanged +// ** to 0. +// ** +// ** If the wal-index header is successfully read, return SQLITE_OK. +// ** Otherwise an SQLite error code. +// */ func _walIndexReadHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) { var _rc, _badHdr int32 var _page0 *uint32 @@ -21892,7 +23168,7 @@ _12: if i32(0) != store1(&_rc, _walLockExclusive(tls, _pWal, i32(0), i32(1))) { goto _15 } - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(1)) if i32(0) != store1(&_rc, _walIndexPage(tls, _pWal, i32(0), &_page0)) { goto _16 } @@ -21902,11 +23178,11 @@ _12: *_pChanged = i32(1) } _16: - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(0)) _walUnlockExclusive(tls, _pWal, i32(0), i32(1)) _15: _11: - if (_badHdr == i32(0)) && (((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X0) != uint32(i32(3007000))) { + if (_badHdr == i32(0)) && (((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X0) != uint32(i32(3007000))) { _rc = _sqlite3CantopenError(tls, i32(56597)) } return _rc @@ -21918,49 +23194,52 @@ func init() { crt.Xstrncpy(nil, &_walIndexReadHdrØ00__func__Ø000[0], str(22621), 16) } -// Try to read the wal-index header. Return 0 on success and 1 if -// there is a problem. -// -// The wal-index is in shared memory. Another thread or process might -// be writing the header at the same time this procedure is trying to -// read it, which might result in inconsistency. A dirty read is detected -// by verifying that both copies of the header are the same and also by -// a checksum on the header. -// -// If and only if the read is consistent and the header is different from -// pWal->hdr, then pWal->hdr is updated to the content of the new header -// and *pChanged is set to 1. -// -// If the checksum cannot be verified return non-zero. If the header -// is read successfully and the checksum verified, return zero. +// C comment +// /* +// ** Try to read the wal-index header. Return 0 on success and 1 if +// ** there is a problem. +// ** +// ** The wal-index is in shared memory. Another thread or process might +// ** be writing the header at the same time this procedure is trying to +// ** read it, which might result in inconsistency. A dirty read is detected +// ** by verifying that both copies of the header are the same and also by +// ** a checksum on the header. +// ** +// ** If and only if the read is consistent and the header is different from +// ** pWal->hdr, then pWal->hdr is updated to the content of the new header +// ** and *pChanged is set to 1. +// ** +// ** If the checksum cannot be verified return non-zero. If the header +// ** is read successfully and the checksum verified, return zero. +// */ func _walIndexTryHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) { var _aCksum [2]uint32 var _h1, _h2 XWalIndexHdr var _aHdr *XWalIndexHdr func() { - if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { + if _pWal.X5 <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56490), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexTryHdrØ00__func__Ø000))), unsafe.Pointer(str(15271))) crt.X__builtin_abort(tls) } }() _aHdr = _walIndexHdr(tls, _pWal) - crt.Xmemcpy(tls, (unsafe.Pointer)(&_h1), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(0))))), u64(48)) + crt.Xmemcpy(tls, unsafe.Pointer(&_h1), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHdr))+48*uintptr(i32(0))))), u64(48)) _walShmBarrier(tls, _pWal) - crt.Xmemcpy(tls, (unsafe.Pointer)(&_h2), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(1))))), u64(48)) - if crt.Xmemcmp(tls, (unsafe.Pointer)(&_h1), (unsafe.Pointer)(&_h2), u64(48)) != i32(0) { + crt.Xmemcpy(tls, unsafe.Pointer(&_h2), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHdr))+48*uintptr(i32(1))))), u64(48)) + if crt.Xmemcmp(tls, unsafe.Pointer(&_h1), unsafe.Pointer(&_h2), u64(48)) != i32(0) { return i32(1) } if int32(_h1.X3) == i32(0) { return i32(1) } _walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer(&_h1)), int32(u64(40)), nil, (*uint32)(unsafe.Pointer(&_aCksum))) - if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCksum)) + 4*uintptr(i32(0))))) != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_h1.X10))))) + 4*uintptr(i32(0)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCksum)) + 4*uintptr(i32(1))))) != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_h1.X10))))) + 4*uintptr(i32(1)))))) { + if ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aCksum)) + 4*uintptr(i32(0))))) != (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_h1.X10)))) + 4*uintptr(i32(0)))))) || ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aCksum)) + 4*uintptr(i32(1))))) != (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_h1.X10)))) + 4*uintptr(i32(1)))))) { return i32(1) } - if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(&_h1), u64(48)) != 0 { + if crt.Xmemcmp(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), unsafe.Pointer(&_h1), u64(48)) != 0 { *_pChanged = i32(1) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(&_h1), u64(48)) - *(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(1)) << uint(i32(16)))) + crt.Xmemcpy(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), unsafe.Pointer(&_h1), u64(48)) + *(*uint32)(unsafe.Pointer(&_pWal.X8)) = uint32((int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5) & i32(1)) << uint(i32(16)))) } return i32(0) @@ -21983,26 +23262,30 @@ func _walShmBarrier(tls *crt.TLS, _pWal *XWal) { } func _sqlite3OsShmBarrier(tls *crt.TLS, _id *Xsqlite3_file) { - (*(*func(*crt.TLS, *Xsqlite3_file))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*Xsqlite3_io_methods)(_id.X0).X15)})))(tls, _id) -} - -// Generate or extend an 8 byte checksum based on the data in -// array aByte[] and the initial values of aIn[0] and aIn[1] (or -// initial values of 0 and 0 if aIn==NULL). -// -// The checksum is written back into aOut[] before returning. -// -// nByte must be a positive multiple of 8. + func() func(*crt.TLS, *Xsqlite3_file) { + v := (*Xsqlite3_io_methods)(_id.X0).X15 + return *(*func(*crt.TLS, *Xsqlite3_file))(unsafe.Pointer(&v)) + }()(tls, _id) +} + +// C comment +// /* +// ** Generate or extend an 8 byte checksum based on the data in +// ** array aByte[] and the initial values of aIn[0] and aIn[1] (or +// ** initial values of 0 and 0 if aIn==NULL). +// ** +// ** The checksum is written back into aOut[] before returning. +// ** +// ** nByte must be a positive multiple of 8. +// */ func _walChecksumBytes(tls *crt.TLS, _nativeCksum int32, _a *uint8, _nByte int32, _aIn *uint32, _aOut *uint32) { var _s1, _s2 uint32 var _aData, _aEnd *uint32 _aData = (*uint32)(unsafe.Pointer(_a)) - _aEnd = (*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 1*uintptr(_nByte))))) + _aEnd = (*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 1*uintptr(_nByte))))) if _aIn != nil { - _s1 = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aIn)) + 4*uintptr(i32(0)))) - _s2 = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aIn)) + 4*uintptr(i32(1)))) + _s1 = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aIn)) + 4*uintptr(i32(0)))) + _s2 = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aIn)) + 4*uintptr(i32(1)))) goto _1 } _s1 = store5(&_s2, uint32(i32(0))) @@ -22041,25 +23324,25 @@ _6: _9: { p := &_s1 - *p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & u32(4278190080)) >> uint(i32(24)))) + _s2) + *p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(0))))) & u32(4278190080)) >> uint(i32(24)))) + _s2) sink5(*p) } { p := &_s2 - *p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & u32(4278190080)) >> uint(i32(24)))) + _s1) + *p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 4*uintptr(i32(1))))) & u32(4278190080)) >> uint(i32(24)))) + _s1) sink5(*p) } { p := &_aData - *p = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 4*uintptr(i32(2)))) + *p = (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 4*uintptr(i32(2)))) sink31(*p) } if crt.P2U(unsafe.Pointer(_aData)) < crt.P2U(unsafe.Pointer(_aEnd)) { goto _9 } _8: - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOut)) + 4*uintptr(i32(0)))) = _s1 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOut)) + 4*uintptr(i32(1)))) = _s2 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOut)) + 4*uintptr(i32(0)))) = _s1 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOut)) + 4*uintptr(i32(1)))) = _s2 } var _walChecksumBytesØ00__func__Ø000 [17]int8 @@ -22068,14 +23351,17 @@ func init() { crt.Xstrncpy(nil, &_walChecksumBytesØ00__func__Ø000[0], str(22683), 17) } -// Recover the wal-index by reading the write-ahead log file. -// -// This routine first tries to establish an exclusive lock on the -// wal-index to prevent other threads/processes from doing anything -// with the WAL or wal-index while recovery is running. The -// WAL_RECOVER_LOCK is also held so that other threads will know -// that this thread is running recovery. If unable to establish -// the necessary locks, this routine returns SQLITE_BUSY. +// C comment +// /* +// ** Recover the wal-index by reading the write-ahead log file. +// ** +// ** This routine first tries to establish an exclusive lock on the +// ** wal-index to prevent other threads/processes from doing anything +// ** with the WAL or wal-index while recovery is running. The +// ** WAL_RECOVER_LOCK is also held so that other threads will know +// ** that this thread is running recovery. If unable to establish +// ** the necessary locks, this routine returns SQLITE_BUSY. +// */ func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) { var _rc, _iLock, _nLock, _3_szFrame, _3_iFrame, _3_szPage, _3_isValid, _11_i int32 var _nSize, _3_iOffset int64 @@ -22094,7 +23380,7 @@ func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) { i32(0) i32(0) func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55577), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } @@ -22105,7 +23391,7 @@ func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) { if _rc != 0 { return _rc } - crt.Xmemset(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), i32(0), u64(48)) + crt.Xmemset(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), i32(0), u64(48)) _rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.X2), &_nSize) if _rc != i32(0) { goto _recovery_error @@ -22114,24 +23400,24 @@ func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) { goto _finished } _3_aFrame = nil - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_3_aBuf), i32(32), int64(i32(0))) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(&_3_aBuf), i32(32), int64(i32(0))) if _rc != i32(0) { goto _recovery_error } - _3_magic = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(0))))) - _3_szPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(8)))))) + _3_magic = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(0))))) + _3_szPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(8)))))) if ((((_3_magic & u32(4294967294)) != uint32(i32(931071618))) || (_3_szPage&(_3_szPage-i32(1))) != 0) || (_3_szPage > i32(65536))) || (_3_szPage < i32(512)) { goto _finished } - *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4))) = uint8(_3_magic & uint32(i32(1))) - *(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32(_3_szPage) - *(*uint32)(unsafe.Pointer(&(_pWal.X22))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(12))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(16))))), uint64(i32(8))) - _walChecksumBytes(tls, bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0)), (*uint8)(unsafe.Pointer(&_3_aBuf)), i32(24), nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8)))))) - if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(24)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(28)))))) { + *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X4))) = uint8(_3_magic & uint32(i32(1))) + *(*uint32)(unsafe.Pointer(&_pWal.X8)) = uint32(_3_szPage) + *(*uint32)(unsafe.Pointer(&_pWal.X22)) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(12))))) + crt.Xmemcpy(tls, unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(16))))), uint64(i32(8))) + _walChecksumBytes(tls, bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X4) == i32(0)), (*uint8)(unsafe.Pointer(&_3_aBuf)), i32(24), nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8)))))) + if ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(24)))))) || ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(28)))))) { goto _finished } - _3_version = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(4))))) + _3_version = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aBuf))+1*uintptr(i32(4))))) if _3_version != uint32(i32(3007000)) { _rc = _sqlite3CantopenError(tls, i32(55644)) goto _finished @@ -22142,7 +23428,7 @@ func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) { _rc = _sqlite3NomemError(tls, i32(55652)) goto _recovery_error } - _3_aData = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_aFrame)) + 1*uintptr(i32(24)))) + _3_aData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_aFrame)) + 1*uintptr(i32(24)))) _3_iFrame = i32(0) _3_iOffset = int64(i32(32)) _17: @@ -22150,7 +23436,7 @@ _17: goto _20 } _3_iFrame += 1 - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_3_aFrame), _3_szFrame, _3_iOffset) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(_3_aFrame), _3_szFrame, _3_iOffset) if _rc != i32(0) { goto _20 } @@ -22163,11 +23449,11 @@ _17: goto _20 } if _9_nTruncate != 0 { - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = uint32(_3_iFrame) - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7))) = _9_nTruncate - *(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5))) = uint16((_3_szPage & i32(65280)) | (_3_szPage >> uint(i32(16)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6))) = uint32(_3_iFrame) + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7))) = _9_nTruncate + *(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5))) = uint16((_3_szPage & i32(65280)) | (_3_szPage >> uint(i32(16)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFrameCksum)) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFrameCksum)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) } { p := &_3_iOffset @@ -22176,32 +23462,32 @@ _17: } goto _17 _20: - Xsqlite3_free(tls, (unsafe.Pointer)(_3_aFrame)) + Xsqlite3_free(tls, unsafe.Pointer(_3_aFrame)) _finished: if _rc != i32(0) { goto _recovery_error } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(1)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFrameCksum)) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFrameCksum)) + 4*uintptr(i32(1)))) _walIndexWriteHdr(tls, _pWal) _11_pInfo = _walCkptInfo(tls, _pWal) - *(*uint32)(unsafe.Pointer(&(_11_pInfo.X0))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_11_pInfo.X3))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(i32(0)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_11_pInfo.X0)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_11_pInfo.X3)) = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_11_pInfo.X1)))) + 4*uintptr(i32(0)))) = uint32(i32(0)) _11_i = i32(1) _26: if _11_i >= i32(5) { goto _29 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(_11_i))) = u32(4294967295) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_11_pInfo.X1)))) + 4*uintptr(_11_i))) = u32(4294967295) _11_i += 1 goto _26 _29: - if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) != 0 { - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(i32(1)))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + if ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) != 0 { + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_11_pInfo.X1)))) + 4*uintptr(i32(1)))) = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 } - if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7) != 0 { - Xsqlite3_log(tls, i32(283), str(22739), (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6, unsafe.Pointer(_pWal.X21)) + if ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7) != 0 { + Xsqlite3_log(tls, i32(283), str(22739), (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6, unsafe.Pointer(_pWal.X21)) } _recovery_error: _walUnlockExclusive(tls, _pWal, _iLock, _nLock) @@ -22222,35 +23508,41 @@ func _sqlite3CantopenError(tls *crt.TLS, _lineno int32) (r0 int32) { return _reportError(tls, i32(14), _lineno, str(22792)) } -// Check to see if the frame with header in aFrame[] and content -// in aData[] is valid. If it is a valid frame, fill *piPage and -// *pnTruncate and return true. Return if the frame is not valid. +// C comment +// /* +// ** Check to see if the frame with header in aFrame[] and content +// ** in aData[] is valid. If it is a valid frame, fill *piPage and +// ** *pnTruncate and return true. Return if the frame is not valid. +// */ func _walDecodeFrame(tls *crt.TLS, _pWal *XWal, _piPage *uint32, _pnTruncate *uint32, _aData *uint8, _aFrame *uint8) (r0 int32) { var _nativeCksum int32 var _pgno uint32 var _aCksum *uint32 - _aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + _aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) i32(0) - if crt.Xmemcmp(tls, (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), uint64(i32(8))) != i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(8))))), uint64(i32(8))) != i32(0) { return i32(0) } - _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(0))))) + _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(0))))) if _pgno == uint32(i32(0)) { return i32(0) } - _nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0)) + _nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X4) == i32(0)) _walChecksumBytes(tls, _nativeCksum, _aFrame, i32(8), _aCksum, _aCksum) _walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.X8), _aCksum, _aCksum) - if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(16)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(20)))))) { + if ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCksum)) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(16)))))) || ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCksum)) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(20)))))) { return i32(0) } *_piPage = _pgno - *_pnTruncate = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(4))))) + *_pnTruncate = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(4))))) return i32(1) } -// Set an entry in the wal-index that will map database page number -// pPage into WAL frame iFrame. +// C comment +// /* +// ** Set an entry in the wal-index that will map database page number +// ** pPage into WAL frame iFrame. +// */ func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) (r0 int32) { var _rc, _1_iKey, _1_idx, _1_nCollide, _2_nByte int32 var _iZero uint32 @@ -22271,13 +23563,13 @@ func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) ( } }() if _1_idx == i32(1) { - _2_nByte = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash))+2*uintptr(i32(8192)))))))) - uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(i32(1))))))))) / 1)) - crt.Xmemset(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(i32(1))))), i32(0), uint64(_2_nByte)) + _2_nByte = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHash))+2*uintptr(i32(8192)))))))) - uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno))+4*uintptr(i32(1))))))))) / 1)) + crt.Xmemset(tls, unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno))+4*uintptr(i32(1))))), i32(0), uint64(_2_nByte)) } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(_1_idx)))) != 0 { _walCleanupHash(tls, _pWal) func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx)))) != 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(_1_idx)))) != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55507), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexAppendØ00__func__Ø000))), unsafe.Pointer(str(22838))) crt.X__builtin_abort(tls) } @@ -22286,17 +23578,17 @@ func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) ( _1_nCollide = _1_idx _1_iKey = _walHash(tls, _iPage) _7: - if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_1_iKey)))) == 0 { + if (*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHash)) + 2*uintptr(_1_iKey)))) == 0 { goto _10 } - if postInc1(&_1_nCollide, int32(-1)) == i32(0) { + if postInc1(&_1_nCollide, -1) == i32(0) { return _sqlite3CorruptError(tls, i32(55513)) } _1_iKey = _walNextHash(tls, _1_iKey) goto _7 _10: - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx))) = _iPage - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_1_iKey))) = uint16(_1_idx) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPgno)) + 4*uintptr(_1_idx))) = _iPage + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHash)) + 2*uintptr(_1_iKey))) = uint16(_1_idx) _0: return _rc @@ -22310,26 +23602,29 @@ func init() { crt.Xstrncpy(nil, &_walIndexAppendØ00__func__Ø000[0], str(22850), 15) } -// Write the header information in pWal->hdr into the wal-index. -// -// The checksum on pWal->hdr is updated before it is written. +// C comment +// /* +// ** Write the header information in pWal->hdr into the wal-index. +// ** +// ** The checksum on pWal->hdr is updated before it is written. +// */ func _walIndexWriteHdr(tls *crt.TLS, _pWal *XWal) { var _nCksum int32 var _aHdr *XWalIndexHdr _aHdr = _walIndexHdr(tls, _pWal) _nCksum = i32(40) func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55144), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexWriteHdrØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X3))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X0))) = uint32(i32(3007000)) - _walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))))), _nCksum, nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X10)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(1))))), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u64(48)) + *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X3))) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X0))) = uint32(i32(3007000)) + _walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)))), _nCksum, nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X10)))))) + crt.Xmemcpy(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHdr))+48*uintptr(i32(1))))), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), u64(48)) _walShmBarrier(tls, _pWal) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(0))))), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u64(48)) + crt.Xmemcpy(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHdr))+48*uintptr(i32(0))))), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), u64(48)) } var _walIndexWriteHdrØ00__func__Ø000 [17]int8 @@ -22338,15 +23633,18 @@ func init() { crt.Xstrncpy(nil, &_walIndexWriteHdrØ00__func__Ø000[0], str(22865), 17) } -// Return a pointer to the WalCkptInfo structure in the wal-index. +// C comment +// /* +// ** Return a pointer to the WalCkptInfo structure in the wal-index. +// */ func _walCkptInfo(tls *crt.TLS, _pWal *XWal) (r0 *XWalCkptInfo) { func() { - if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { + if _pWal.X5 <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55058), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCkptInfoØ00__func__Ø000))), unsafe.Pointer(str(15271))) crt.X__builtin_abort(tls) } }() - return (*XWalCkptInfo)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0)))))) + 4*uintptr(u64(24)))))) + return (*XWalCkptInfo)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0)))))) + 4*uintptr(u64(24)))))) } var _walCkptInfoØ00__func__Ø000 [12]int8 @@ -22355,41 +23653,47 @@ func init() { crt.Xstrncpy(nil, &_walCkptInfoØ00__func__Ø000[0], str(22882), 12) } -// The cache of the wal-index header must be valid to call this function. -// Return the page-size in bytes used by the database. +// C comment +// /* +// ** The cache of the wal-index header must be valid to call this function. +// ** Return the page-size in bytes used by the database. +// */ func _walPagesize(tls *crt.TLS, _pWal *XWal) (r0 int32) { - return (int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(1)) << uint(i32(16))) -} - -// Copy as much content as we can from the WAL back into the database file -// in response to an sqlite3_wal_checkpoint() request or the equivalent. -// -// The amount of information copies from WAL to database might be limited -// by active readers. This routine will never overwrite a database page -// that a concurrent reader might be using. -// -// All I/O barrier operations (a.k.a fsyncs) occur in this routine when -// SQLite is in WAL-mode in synchronous=NORMAL. That means that if -// checkpoints are always run by a background thread or background -// process, foreground threads will never block on a lengthy fsync call. -// -// Fsync is called on the WAL before writing content out of the WAL and -// into the database. This ensures that if the new content is persistent -// in the WAL and can be recovered following a power-loss or hard reset. -// -// Fsync is also called on the database file if (and only if) the entire -// WAL content is copied into the database file. This second fsync makes -// it safe to delete the WAL since the new content will persist in the -// database file. -// -// This routine uses and updates the nBackfill field of the wal-index header. -// This is the only routine that will increase the value of nBackfill. -// (A WAL reset or recovery will revert nBackfill to zero, but not increase -// its value.) -// -// The caller must be holding sufficient locks to ensure that no other -// checkpoint is running (in any other thread or process) at the same -// time. + return (int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5) & i32(1)) << uint(i32(16))) +} + +// C comment +// /* +// ** Copy as much content as we can from the WAL back into the database file +// ** in response to an sqlite3_wal_checkpoint() request or the equivalent. +// ** +// ** The amount of information copies from WAL to database might be limited +// ** by active readers. This routine will never overwrite a database page +// ** that a concurrent reader might be using. +// ** +// ** All I/O barrier operations (a.k.a fsyncs) occur in this routine when +// ** SQLite is in WAL-mode in synchronous=NORMAL. That means that if +// ** checkpoints are always run by a background thread or background +// ** process, foreground threads will never block on a lengthy fsync call. +// ** +// ** Fsync is called on the WAL before writing content out of the WAL and +// ** into the database. This ensures that if the new content is persistent +// ** in the WAL and can be recovered following a power-loss or hard reset. +// ** +// ** Fsync is also called on the database file if (and only if) the entire +// ** WAL content is copied into the database file. This second fsync makes +// ** it safe to delete the WAL since the new content will persist in the +// ** database file. +// ** +// ** This routine uses and updates the nBackfill field of the wal-index header. +// ** This is the only routine that will increase the value of nBackfill. +// ** (A WAL reset or recovery will revert nBackfill to zero, but not increase +// ** its value.) +// ** +// ** The caller must be holding sufficient locks to ensure that no other +// ** checkpoint is running (in any other thread or process) at the same +// ** time. +// */ func _walCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _zBuf *uint8) (r0 int32) { var _rc, _szPage, _i int32 var _8_nSize, _10_nReq, _12_iOffset, _16_szDb int64 @@ -22402,7 +23706,7 @@ func _walCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBu _iFrame = u32(0) _szPage = _walPagesize(tls, _pWal) _pInfo = _walCkptInfo(tls, _pWal) - if (_pInfo.X0) >= ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _pInfo.X0 >= ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { goto _0 } _rc = _walIteratorInit(tls, _pWal, &_pIter) @@ -22425,26 +23729,26 @@ func _walCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBu crt.X__builtin_abort(tls) } }() - _mxSafeFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 - _mxPage = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7 + _mxSafeFrame = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 + _mxPage = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7 _i = i32(1) _7: if _i >= i32(5) { goto _10 } - _3_y = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) + _3_y = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(_i))) if _mxSafeFrame <= _3_y { goto _11 } func() { - if _3_y > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _3_y > ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56254), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22900))) crt.X__builtin_abort(tls) } }() _rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(3)+_i, i32(1)) if _rc == i32(0) { - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) = func() uint32 { + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(_i))) = func() uint32 { if _i == i32(1) { return _mxSafeFrame } @@ -22464,11 +23768,11 @@ _11: _i += 1 goto _7 _10: - if (_pInfo.X0) >= _mxSafeFrame || store1(&_rc, _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(3), i32(1))) != i32(0) { + if _pInfo.X0 >= _mxSafeFrame || store1(&_rc, _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(3), i32(1))) != i32(0) { goto _21 } _8_nBackfill = _pInfo.X0 - *(*uint32)(unsafe.Pointer(&(_pInfo.X3))) = _mxSafeFrame + *(*uint32)(unsafe.Pointer(&_pInfo.X3)) = _mxSafeFrame if _sync_flags != 0 { _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X2), _sync_flags) } @@ -22478,7 +23782,7 @@ _10: _10_nReq = int64(_mxPage) * int64(_szPage) _rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.X1), &_8_nSize) if (_rc == i32(0)) && (_8_nSize < _10_nReq) { - _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(5), (unsafe.Pointer)(&_10_nReq)) + _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(5), unsafe.Pointer(&_10_nReq)) } _23: if _rc != i32(0) || i32(0) != _walIteratorNext(tls, _pIter, &_iDbpage, &_iFrame) { @@ -22490,9 +23794,9 @@ _23: crt.X__builtin_abort(tls) } }() - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 { + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) != 0 { _rc = func() int32 { - if (_db.X17) != 0 { + if _db.X17 != 0 { return _sqlite3NomemError(tls, i32(56298)) } return i32(9) @@ -22503,12 +23807,12 @@ _23: goto _23 } _12_iOffset = (int64(i32(32)) + (int64(_iFrame-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(24)) - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_zBuf), _szPage, _12_iOffset) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(_zBuf), _szPage, _12_iOffset) if _rc != i32(0) { goto _27 } _12_iOffset = int64(_iDbpage-uint32(i32(1))) * int64(_szPage) - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X1), (unsafe.Pointer)(_zBuf), _szPage, _12_iOffset) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X1), unsafe.Pointer(_zBuf), _szPage, _12_iOffset) if _rc != i32(0) { goto _27 } @@ -22520,14 +23824,14 @@ _27: if _mxSafeFrame != (_walIndexHdr(tls, _pWal).X6) { goto _40 } - _16_szDb = int64((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7) * int64(_szPage) + _16_szDb = int64((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7) * int64(_szPage) _rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.X1), _16_szDb) if (_rc == i32(0)) && _sync_flags != 0 { _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X1), _sync_flags) } _40: if _rc == i32(0) { - *(*uint32)(unsafe.Pointer(&(_pInfo.X0))) = _mxSafeFrame + *(*uint32)(unsafe.Pointer(&_pInfo.X0)) = _mxSafeFrame } _39: _walUnlockExclusive(tls, _pWal, i32(3), i32(1)) @@ -22540,21 +23844,21 @@ _0: goto _walcheckpoint_out } func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56346), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } }() - if (_pInfo.X0) < ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _pInfo.X0 < ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { _rc = i32(5) goto _51 } if _eMode < i32(2) { goto _51 } - Xsqlite3_randomness(tls, i32(4), (unsafe.Pointer)(&_22_salt1)) + Xsqlite3_randomness(tls, i32(4), unsafe.Pointer(&_22_salt1)) func() { - if (_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _pInfo.X0 != ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56352), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22957))) crt.X__builtin_abort(tls) } @@ -22575,16 +23879,19 @@ _walcheckpoint_out: return _rc } -// Construct a WalInterator object that can be used to loop over all -// pages in the WAL in ascending order. The caller must hold the checkpoint -// lock. -// -// On success, make *pp point to the newly allocated WalInterator object -// return SQLITE_OK. Otherwise, return an error code. If this routine -// returns an error, the value of *pp is undefined. -// -// The calling routine should invoke walIteratorFree() to destroy the -// WalIterator object when it has finished with it. +// C comment +// /* +// ** Construct a WalInterator object that can be used to loop over all +// ** pages in the WAL in ascending order. The caller must hold the checkpoint +// ** lock. +// ** +// ** On success, make *pp point to the newly allocated WalInterator object +// ** return SQLITE_OK. Otherwise, return an error code. If this routine +// ** returns an error, the value of *pp is undefined. +// ** +// ** The calling routine should invoke walIteratorFree() to destroy the +// ** WalIterator object when it has finished with it. +// */ func _walIteratorInit(tls *crt.TLS, _pWal *XWal, _pp **XWalIterator) (r0 int32) { var _nSegment, _nByte, _i, _rc, _4_j, _4_nEntry int32 var _iLast, _3_iZero uint32 @@ -22593,20 +23900,20 @@ func _walIteratorInit(tls *crt.TLS, _pWal *XWal, _pp **XWalIterator) (r0 int32) var _p *XWalIterator _rc = i32(0) func() { - if (_pWal.X13) == 0 || ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) <= uint32(i32(0)) { + if _pWal.X13 == 0 || ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56044), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIteratorInitØ00__func__Ø000))), unsafe.Pointer(str(22993))) crt.X__builtin_abort(tls) } }() - _iLast = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + _iLast = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 _nSegment = _walFramePage(tls, _iLast) + i32(1) _nByte = int32((u64(40) + (uint64(_nSegment-i32(1)) * u64(32))) + (uint64(_iLast) * u64(2))) _p = (*XWalIterator)(Xsqlite3_malloc64(tls, uint64(_nByte))) if _p == nil { return _sqlite3NomemError(tls, i32(56054)) } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), uint64(_nByte)) - *(*int32)(unsafe.Pointer(&(_p.X1))) = _nSegment + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), uint64(_nByte)) + *(*int32)(unsafe.Pointer(&_p.X1)) = _nSegment _aTmp = (*uint16)(Xsqlite3_malloc64(tls, u64(2)*uint64(func() uint32 { if _iLast > uint32(i32(4096)) { return uint32(i32(4096)) @@ -22632,27 +23939,27 @@ _7: } _4_nEntry = int32(int64((uintptr(unsafe.Pointer((*uint32)(unsafe.Pointer(_3_aHash)))) - uintptr(unsafe.Pointer(_3_aPgno))) / 4)) _14: - _4_aIndex = (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2)))))+32*uintptr(_p.X1))))) + 2*uintptr(_3_iZero))) + _4_aIndex = (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2))))+32*uintptr(_p.X1))))) + 2*uintptr(_3_iZero))) _3_iZero += 1 _4_j = i32(0) _15: if _4_j >= _4_nEntry { goto _18 } - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aIndex)) + 2*uintptr(_4_j))) = uint16(_4_j) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_aIndex)) + 2*uintptr(_4_j))) = uint16(_4_j) _4_j += 1 goto _15 _18: _walMergesort(tls, _3_aPgno, _aTmp, _4_aIndex, &_4_nEntry) - *(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr(_i))).X4))) = int32(_3_iZero) - *(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr(_i))).X3))) = _4_nEntry - *(**uint16)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr(_i))).X1))) = _4_aIndex - *(**uint32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr(_i))).X2))) = _3_aPgno + *(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_i))).X4))) = int32(_3_iZero) + *(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_i))).X3))) = _4_nEntry + *(**uint16)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_i))).X1))) = _4_aIndex + *(**uint32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_i))).X2))) = _3_aPgno _12: _i += 1 goto _7 _11: - Xsqlite3_free(tls, (unsafe.Pointer)(_aTmp)) + Xsqlite3_free(tls, unsafe.Pointer(_aTmp)) if _rc != i32(0) { _walIteratorFree(tls, _p) } @@ -22666,21 +23973,24 @@ func init() { crt.Xstrncpy(nil, &_walIteratorInitØ00__func__Ø000[0], str(23031), 16) } -// Sort the elements in list aList using aContent[] as the sort key. -// Remove elements with duplicate keys, preferring to keep the -// larger aList[] values. -// -// The aList[] entries are indices into aContent[]. The values in -// aList[] are to be sorted so that for all J<K: -// -// aContent[aList[J]] < aContent[aList[K]] -// -// For any X and Y such that -// -// aContent[aList[X]] == aContent[aList[Y]] -// -// Keep the larger of the two values aList[X] and aList[Y] and discard -// the smaller. +// C comment +// /* +// ** Sort the elements in list aList using aContent[] as the sort key. +// ** Remove elements with duplicate keys, preferring to keep the +// ** larger aList[] values. +// ** +// ** The aList[] entries are indices into aContent[]. The values in +// ** aList[] are to be sorted so that for all J<K: +// ** +// ** aContent[aList[J]] < aContent[aList[K]] +// ** +// ** For any X and Y such that +// ** +// ** aContent[aList[X]] == aContent[aList[Y]] +// ** +// ** Keep the larger of the two values aList[X] and aList[Y] and discard +// ** the smaller. +// */ func _walMergesort(tls *crt.TLS, _aContent *uint32, _aBuffer *uint16, _aList *uint16, _pnList *int32) { var _nList, _nMerge, _iList, _5_i int32 var _iSub uint32 @@ -22691,7 +24001,7 @@ func _walMergesort(tls *crt.TLS, _aContent *uint32, _aBuffer *uint16, _aList *ui _nMerge = i32(0) _aMerge = nil _iSub = u32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_aSub), i32(0), u64(208)) + crt.Xmemset(tls, unsafe.Pointer(&_aSub), i32(0), u64(208)) func() { if _nList > i32(4096) || _nList <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55972), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23047))) @@ -22705,7 +24015,7 @@ _3: goto _6 } _nMerge = i32(1) - _aMerge = (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_iList))) + _aMerge = (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aList)) + 2*uintptr(_iList))) _iSub = uint32(i32(0)) _7: if (_iList & (i32(1) << uint(int32(_iSub)))) == 0 { @@ -22717,15 +24027,15 @@ _7: crt.X__builtin_abort(tls) } }() - _2_p = (*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 16*uintptr(_iSub))) + _2_p = (*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSub)) + 16*uintptr(_iSub))) func() { - if (_2_p.X1) == nil || (_2_p.X0) > (i32(1)<<uint(int32(_iSub))) { + if _2_p.X1 == nil || _2_p.X0 > (i32(1)<<uint(int32(_iSub))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55982), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23102))) crt.X__builtin_abort(tls) } }() func() { - if (_2_p.X1) != (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList))+2*uintptr(_iList&(^((i32(2)<<uint(int32(_iSub)))-i32(1)))))) { + if _2_p.X1 != (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aList))+2*uintptr(_iList&(^((i32(2)<<uint(int32(_iSub)))-i32(1)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55983), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23134))) crt.X__builtin_abort(tls) } @@ -22734,8 +24044,8 @@ _7: _iSub += 1 goto _7 _10: - *(**uint16)(unsafe.Pointer(&((*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 16*uintptr(_iSub))).X1))) = _aMerge - *(*int32)(unsafe.Pointer(&((*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 16*uintptr(_iSub))).X0))) = _nMerge + *(**uint16)(unsafe.Pointer(&((*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSub)) + 16*uintptr(_iSub))).X1))) = _aMerge + *(*int32)(unsafe.Pointer(&((*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSub)) + 16*uintptr(_iSub))).X0))) = _nMerge _iList += 1 goto _3 _6: @@ -22751,15 +24061,15 @@ _18: crt.X__builtin_abort(tls) } }() - _4_p = (*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 16*uintptr(_iSub))) + _4_p = (*TSublist)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSub)) + 16*uintptr(_iSub))) func() { - if (_4_p.X0) > (i32(1) << uint(int32(_iSub))) { + if _4_p.X0 > (i32(1) << uint(int32(_iSub))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55995), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23173))) crt.X__builtin_abort(tls) } }() func() { - if (_4_p.X1) != (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList))+2*uintptr(_nList&(^((i32(2)<<uint(int32(_iSub)))-i32(1)))))) { + if _4_p.X1 != (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aList))+2*uintptr(_nList&(^((i32(2)<<uint(int32(_iSub)))-i32(1)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55996), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23193))) crt.X__builtin_abort(tls) } @@ -22782,7 +24092,7 @@ _31: goto _34 } func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_5_i))))))) <= (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_5_i-i32(1)))))))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aList)) + 2*uintptr(_5_i))))))) <= (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aList)) + 2*uintptr(_5_i-i32(1)))))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56007), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23246))) crt.X__builtin_abort(tls) } @@ -22799,27 +24109,30 @@ func init() { crt.Xstrncpy(nil, &_walMergesortØ00__func__Ø000[0], str(23288), 13) } -// This function merges two sorted lists into a single sorted list. -// -// aLeft[] and aRight[] are arrays of indices. The sort key is -// aContent[aLeft[]] and aContent[aRight[]]. Upon entry, the following -// is guaranteed for all J<K: -// -// aContent[aLeft[J]] < aContent[aLeft[K]] -// aContent[aRight[J]] < aContent[aRight[K]] -// -// This routine overwrites aRight[] with a new (probably longer) sequence -// of indices such that the aRight[] contains every index that appears in -// either aLeft[] or the old aRight[] and such that the second condition -// above is still met. -// -// The aContent[aLeft[X]] values will be unique for all X. And the -// aContent[aRight[X]] values will be unique too. But there might be -// one or more combinations of X and Y such that -// -// aLeft[X]!=aRight[Y] && aContent[aLeft[X]] == aContent[aRight[Y]] -// -// When that happens, omit the aLeft[X] and use the aRight[Y] index. +// C comment +// /* +// ** This function merges two sorted lists into a single sorted list. +// ** +// ** aLeft[] and aRight[] are arrays of indices. The sort key is +// ** aContent[aLeft[]] and aContent[aRight[]]. Upon entry, the following +// ** is guaranteed for all J<K: +// ** +// ** aContent[aLeft[J]] < aContent[aLeft[K]] +// ** aContent[aRight[J]] < aContent[aRight[K]] +// ** +// ** This routine overwrites aRight[] with a new (probably longer) sequence +// ** of indices such that the aRight[] contains every index that appears in +// ** either aLeft[] or the old aRight[] and such that the second condition +// ** above is still met. +// ** +// ** The aContent[aLeft[X]] values will be unique for all X. And the +// ** aContent[aRight[X]] values will be unique too. But there might be +// ** one or more combinations of X and Y such that +// ** +// ** 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 *crt.TLS, _aContent *uint32, _aLeft *uint16, _nLeft int32, _paRight **uint16, _pnRight *int32, _aTmp *uint16) { var _iLeft, _iRight, _iOut, _nRight int32 var _1_dbpage uint32 @@ -22840,25 +24153,25 @@ _3: if _iRight >= _nRight && _iLeft >= _nLeft { goto _4 } - if (_iLeft < _nLeft) && ((_iRight >= _nRight) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(_iRight))))))))) { - _1_logpage = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(postInc1(&_iLeft, int32(1))))) + if (_iLeft < _nLeft) && ((_iRight >= _nRight) || ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLeft)) + 2*uintptr(_iLeft))))))) < (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRight)) + 2*uintptr(_iRight))))))))) { + _1_logpage = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLeft)) + 2*uintptr(postInc1(&_iLeft, 1)))) goto _9 } - _1_logpage = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(postInc1(&_iRight, int32(1))))) + _1_logpage = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRight)) + 2*uintptr(postInc1(&_iRight, 1)))) _9: - _1_dbpage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(_1_logpage))) - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTmp)) + 2*uintptr(postInc1(&_iOut, int32(1))))) = _1_logpage - if (_iLeft < _nLeft) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) == _1_dbpage) { + _1_dbpage = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(_1_logpage))) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTmp)) + 2*uintptr(postInc1(&_iOut, 1)))) = _1_logpage + if (_iLeft < _nLeft) && ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLeft)) + 2*uintptr(_iLeft))))))) == _1_dbpage) { _iLeft += 1 } func() { - if _iLeft < _nLeft && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) <= _1_dbpage { + if _iLeft < _nLeft && (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLeft)) + 2*uintptr(_iLeft))))))) <= _1_dbpage { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55927), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergeØ00__func__Ø000))), unsafe.Pointer(str(23321))) crt.X__builtin_abort(tls) } }() func() { - if _iRight < _nRight && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(_iRight))))))) <= _1_dbpage { + if _iRight < _nRight && (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRight)) + 2*uintptr(_iRight))))))) <= _1_dbpage { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55928), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergeØ00__func__Ø000))), unsafe.Pointer(str(23367))) crt.X__builtin_abort(tls) } @@ -22867,7 +24180,7 @@ _9: _4: *_paRight = _aLeft *_pnRight = _iOut - crt.Xmemcpy(tls, (unsafe.Pointer)(_aLeft), (unsafe.Pointer)(_aTmp), u64(2)*uint64(_iOut)) + crt.Xmemcpy(tls, unsafe.Pointer(_aLeft), unsafe.Pointer(_aTmp), u64(2)*uint64(_iOut)) } var _walMergeØ00__func__Ø000 [9]int8 @@ -22876,9 +24189,12 @@ func init() { crt.Xstrncpy(nil, &_walMergeØ00__func__Ø000[0], str(23417), 9) } -// Free an iterator allocated by walIteratorInit(). +// C comment +// /* +// ** Free an iterator allocated by walIteratorInit(). +// */ func _walIteratorFree(tls *crt.TLS, _p *XWalIterator) { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) } var _walCheckpointØ00__func__Ø000 [14]int8 @@ -22887,14 +24203,17 @@ func init() { crt.Xstrncpy(nil, &_walCheckpointØ00__func__Ø000[0], str(23426), 14) } -// Find the smallest page number out of all pages held in the WAL that -// has not been returned by any prior invocation of this method on the -// same WalIterator object. Write into *piFrame the frame index where -// that page was last written into the WAL. Write into *piPage the page -// number. -// -// Return 0 on success. If there are no pages in the WAL with a page -// number larger than *piPage, then return 1. +// C comment +// /* +// ** Find the smallest page number out of all pages held in the WAL that +// ** has not been returned by any prior invocation of this method on the +// ** same WalIterator object. Write into *piFrame the frame index where +// ** that page was last written into the WAL. Write into *piPage the page +// ** number. +// ** +// ** Return 0 on success. If there are no pages in the WAL with a page +// ** number larger than *piPage, then return 1. +// */ func _walIteratorNext(tls *crt.TLS, _p *XWalIterator, _piPage *uint32, _piFrame *uint32) (r0 int32) { var _i int32 var _iMin, _iRet, _2_iPg uint32 @@ -22907,33 +24226,33 @@ func _walIteratorNext(tls *crt.TLS, _p *XWalIterator, _piPage *uint32, _piFrame crt.X__builtin_abort(tls) } }() - _i = (_p.X1) - i32(1) + _i = _p.X1 - i32(1) _2: if _i < i32(0) { goto _5 } - _1_pSegment = (*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr(_i))) + _1_pSegment = (*TWalSegment)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TWalSegment)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_i))) _6: - if (_1_pSegment.X0) >= (_1_pSegment.X3) { + if _1_pSegment.X0 >= _1_pSegment.X3 { goto _7 } - _2_iPg = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X2)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0)))))) + _2_iPg = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSegment.X2)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0)))))) if _2_iPg <= _iMin { goto _8 } if _2_iPg < _iRet { _iRet = _2_iPg - *_piFrame = uint32((_1_pSegment.X4) + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0))))) + *_piFrame = uint32(_1_pSegment.X4 + int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0))))) } goto _7 _8: - *(*int32)(unsafe.Pointer(&(_1_pSegment.X0))) += 1 + *(*int32)(unsafe.Pointer(&_1_pSegment.X0)) += 1 goto _6 _7: _i -= 1 goto _2 _5: - *_piPage = uint32(store1((*int32)(unsafe.Pointer(&(_p.X0))), int32(_iRet))) + *_piPage = uint32(store1((*int32)(unsafe.Pointer(&_p.X0)), int32(_iRet))) return bool2int(_iRet == u32(4294967295)) } @@ -22943,46 +24262,49 @@ func init() { crt.Xstrncpy(nil, &_walIteratorNextØ00__func__Ø000[0], str(23456), 16) } -// The following is guaranteed when this function is called: -// -// a) the WRITER lock is held, -// b) the entire log file has been checkpointed, and -// c) any existing readers are reading exclusively from the database -// file - there are no readers that may attempt to read a frame from -// the log file. -// -// This function updates the shared-memory structures so that the next -// client to write to the database (which may be this one) does so by -// writing frames into the start of the log file. -// -// The value of parameter salt1 is used as the aSalt[1] value in the -// new wal-index header. It should be passed a pseudo-random value (i.e. -// one obtained from sqlite3_randomness()). +// C comment +// /* +// ** The following is guaranteed when this function is called: +// ** +// ** a) the WRITER lock is held, +// ** b) the entire log file has been checkpointed, and +// ** c) any existing readers are reading exclusively from the database +// ** file - there are no readers that may attempt to read a frame from +// ** the log file. +// ** +// ** This function updates the shared-memory structures so that the next +// ** client to write to the database (which may be this one) does so by +// ** writing frames into the start of the log file. +// ** +// ** The value of parameter salt1 is used as the aSalt[1] value in the +// ** new wal-index header. It should be passed a pseudo-random value (i.e. +// ** one obtained from sqlite3_randomness()). +// */ func _walRestartHdr(tls *crt.TLS, _pWal *XWal, _salt1 uint32) { var _i int32 var _aSalt *uint32 var _pInfo *XWalCkptInfo _pInfo = _walCkptInfo(tls, _pWal) - _aSalt = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9))))) - *(*uint32)(unsafe.Pointer(&(_pWal.X22))) += 1 - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = uint32(i32(0)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSalt))+4*uintptr(i32(0)))))), uint32(i32(1))+_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSalt))+4*uintptr(i32(0)))))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))))+4*uintptr(i32(1))))), (unsafe.Pointer)(&_salt1), uint64(i32(4))) + _aSalt = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9))))) + *(*uint32)(unsafe.Pointer(&_pWal.X22)) += 1 + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6))) = uint32(i32(0)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSalt))+4*uintptr(i32(0)))))), uint32(i32(1))+_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSalt))+4*uintptr(i32(0)))))))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9)))))+4*uintptr(i32(1))))), unsafe.Pointer(&_salt1), uint64(i32(4))) _walIndexWriteHdr(tls, _pWal) - *(*uint32)(unsafe.Pointer(&(_pInfo.X0))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_pInfo.X3))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(i32(1)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pInfo.X0)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pInfo.X3)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(i32(1)))) = uint32(i32(0)) _i = i32(2) _0: if _i >= i32(5) { goto _3 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) = u32(4294967295) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(_i))) = u32(4294967295) _i += 1 goto _0 _3: func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(i32(0))))) != uint32(i32(0)) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(i32(0))))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56166), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRestartHdrØ00__func__Ø000))), unsafe.Pointer(str(23472))) crt.X__builtin_abort(tls) } @@ -22995,8 +24317,11 @@ func init() { crt.Xstrncpy(nil, &_walRestartHdrØ00__func__Ø000[0], str(23495), 14) } -// If the WAL file is currently larger than nMax bytes in size, truncate -// it to exactly nMax bytes. If an error occurs while doing so, ignore it. +// C comment +// /* +// ** If the WAL file is currently larger than nMax bytes in size, truncate +// ** it to exactly nMax bytes. If an error occurs while doing so, ignore it. +// */ func _walLimitSize(tls *crt.TLS, _pWal *XWal, _nMax int64) { var _rx int32 var _sz int64 @@ -23011,7 +24336,10 @@ func _walLimitSize(tls *crt.TLS, _pWal *XWal, _nMax int64) { } } -// Close an open wal-index. +// C comment +// /* +// ** Close an open wal-index. +// */ func _walIndexClose(tls *crt.TLS, _pWal *XWal, _isDelete int32) { var _1_i int32 if int32(_pWal.X11) != i32(2) { @@ -23019,11 +24347,11 @@ func _walIndexClose(tls *crt.TLS, _pWal *XWal, _isDelete int32) { } _1_i = i32(0) _1: - if _1_i >= (_pWal.X5) { + if _1_i >= _pWal.X5 { goto _4 } - Xsqlite3_free(tls, (unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_1_i))))) - *(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(_1_i))) = nil + Xsqlite3_free(tls, unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_1_i))))) + *(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(_1_i))) = nil _1_i += 1 goto _1 _4: @@ -23034,44 +24362,51 @@ _5: } func _sqlite3OsShmUnmap(tls *crt.TLS, _id *Xsqlite3_file, _deleteFlag int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X16)})))(tls, _id, _deleteFlag) -} - -// This function is called before attempting a hot-journal rollback. It -// syncs the journal file to disk, then sets pPager->journalHdr to the -// size of the journal file so that the pager_playback() routine knows -// that the entire journal file has been synced. -// -// Syncing a hot-journal to disk before attempting to roll it back ensures -// that if a power-failure occurs during the rollback, the process that -// attempts rollback following system recovery sees the same journal -// content as this process. -// -// If everything goes as planned, SQLITE_OK is returned. Otherwise, -// an SQLite error code. + return func() func(*crt.TLS, *Xsqlite3_file, int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X16 + return *(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _deleteFlag) +} + +// C comment +// /* +// ** This function is called before attempting a hot-journal rollback. It +// ** syncs the journal file to disk, then sets pPager->journalHdr to the +// ** size of the journal file so that the pager_playback() routine knows +// ** that the entire journal file has been synced. +// ** +// ** Syncing a hot-journal to disk before attempting to roll it back ensures +// ** that if a power-failure occurs during the rollback, the process that +// ** attempts rollback following system recovery sees the same journal +// ** content as this process. +// ** +// ** If everything goes as planned, SQLITE_OK is returned. Otherwise, +// ** an SQLite error code. +// */ func _pagerSyncHotJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 _rc = i32(0) - if (_pPager.X4) == 0 { + if _pPager.X4 == 0 { _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), i32(2)) } if _rc == i32(0) { - _rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), (*int64)(unsafe.Pointer(&(_pPager.X35)))) + _rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), (*int64)(unsafe.Pointer(&_pPager.X35))) } return _rc } -// Close a cache. +// C comment +// /* +// ** Close a cache. +// */ func _sqlite3PcacheClose(tls *crt.TLS, _pCache *XPCache) { func() { - if (_pCache.X12) == nil { + if _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44805), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheCloseØ00__func__Ø000))), unsafe.Pointer(str(15958))) crt.X__builtin_abort(tls) } }() - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X11)(tls, _pCache.X12) + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X11)(tls, _pCache.X12) } var _sqlite3PcacheCloseØ00__func__Ø000 [19]int8 @@ -23080,16 +24415,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheCloseØ00__func__Ø000[0], str(23535), 19) } -// Free the pBt->pTmpSpace allocation +// C comment +// /* +// ** Free the pBt->pTmpSpace allocation +// */ func _freeTempSpace(tls *crt.TLS, _pBt *XBtShared) { - if (_pBt.X27) != nil { + if _pBt.X27 != nil { { - p := (**uint8)(unsafe.Pointer(&(_pBt.X27))) - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(4)))) + p := (**uint8)(unsafe.Pointer(&_pBt.X27)) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(i32(4)))) sink13(*p) } - _sqlite3PageFree(tls, (unsafe.Pointer)(_pBt.X27)) - *(**uint8)(unsafe.Pointer(&(_pBt.X27))) = nil + _sqlite3PageFree(tls, unsafe.Pointer(_pBt.X27)) + *(**uint8)(unsafe.Pointer(&_pBt.X27)) = nil } } @@ -23099,51 +24437,63 @@ func init() { crt.Xstrncpy(nil, &_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000[0], str(23554), 32) } -// Invoke the destructor function associated with FuncDef p, if any. Except, -// if this is not the last copy of the function, do not invoke it. Multiple -// copies of a single function are created when create_function() is called -// with SQLITE_ANY as the encoding. +// C comment +// /* +// ** Invoke the destructor function associated with FuncDef p, if any. Except, +// ** if this is not the last copy of the function, do not invoke it. Multiple +// ** copies of a single function are created when create_function() is called +// ** with SQLITE_ANY as the encoding. +// */ func _functionDestroy(tls *crt.TLS, _db *Xsqlite3, _p *XFuncDef) { var _pDestructor *XFuncDestructor - _pDestructor = (*XFuncDestructor)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7)))))) + _pDestructor = (*XFuncDestructor)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X7))))) if _pDestructor == nil { goto _0 } - *(*int32)(unsafe.Pointer(&(_pDestructor.X0))) -= 1 - if (_pDestructor.X0) == i32(0) { - (_pDestructor.X1)(tls, _pDestructor.X2) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pDestructor)) + *(*int32)(unsafe.Pointer(&_pDestructor.X0)) -= 1 + if _pDestructor.X0 == i32(0) { + _pDestructor.X1(tls, _pDestructor.X2) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pDestructor)) } _0: } -// Erase the eponymous virtual table instance associated with -// virtual table module pMod, if it exists. +// C comment +// /* +// ** Erase the eponymous virtual table instance associated with +// ** virtual table module pMod, if it exists. +// */ func _sqlite3VtabEponymousTableClear(tls *crt.TLS, _db *Xsqlite3, _pMod *XModule) { var _pTab *XTable _pTab = (*XTable)(_pMod.X4) if _pTab != nil { { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) *p = (*p) | uint32(i32(2)) sink5(*p) } _sqlite3DeleteTable(tls, _db, _pTab) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMod.X4)))) = nil } } -// Free an sqlite3_value object +// C comment +// /* +// ** Free an sqlite3_value object +// */ func _sqlite3ValueFree(tls *crt.TLS, _v *XMem) { if _v == nil { return } _sqlite3VdbeMemRelease(tls, _v) - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_v.X9), (unsafe.Pointer)(_v)) + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_v.X9), unsafe.Pointer(_v)) } -// Call this routine when the database connection is closing in order -// to clean up loaded extensions +// C comment +// /* +// ** Call this routine when the database connection is closing in order +// ** to clean up loaded extensions +// */ func _sqlite3CloseExtensions(tls *crt.TLS, _db *Xsqlite3) { var _i int32 func() { @@ -23154,14 +24504,14 @@ func _sqlite3CloseExtensions(tls *crt.TLS, _db *Xsqlite3) { }() _i = i32(0) _2: - if _i >= (_db.X39) { + if _i >= _db.X39 { goto _5 } - _sqlite3OsDlClose(tls, (*Xsqlite3_vfs)(_db.X0), *(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X40)) + 8*uintptr(_i)))) + _sqlite3OsDlClose(tls, (*Xsqlite3_vfs)(_db.X0), *(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_db.X40)) + 8*uintptr(_i)))) _i += 1 goto _2 _5: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_db.X40)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_db.X40)) } var _sqlite3CloseExtensionsØ00__func__Ø000 [23]int8 @@ -23170,37 +24520,45 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CloseExtensionsØ00__func__Ø000[0], str(23586), 23) } -// Register a collation sequence factory callback with the database handle -// db. Replace any previously installed collation sequence factory. +// C comment +// /* +// ** Register a collation sequence factory callback with the database handle +// ** db. Replace any previously installed collation sequence factory. +// */ func Xsqlite3_collation_needed(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(143721)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_db.X53))))) = _xCollNeeded - *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&(_db.X54))))) = nil - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X55))) = _pCollNeededArg + *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&_db.X53)))) = _xCollNeeded + *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&_db.X54)))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X55)) = _pCollNeededArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(0) } -// Register a collation sequence factory callback with the database handle -// db. Replace any previously installed collation sequence factory. +// C comment +// /* +// ** Register a collation sequence factory callback with the database handle +// ** db. Replace any previously installed collation sequence factory. +// */ func Xsqlite3_collation_needed16(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded16 func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(143742)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_db.X53))))) = nil - *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&(_db.X54))))) = _xCollNeeded16 - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X55))) = _pCollNeededArg + *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&_db.X53)))) = nil + *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&_db.X54)))) = _xCollNeeded16 + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X55)) = _pCollNeededArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(0) } -// *************************** sqlite3_column_ ******************************* -// The following routines are used to access elements of the current row -// in the result set. +// C comment +// /**************************** sqlite3_column_ ******************************* +// ** The following routines are used to access elements of the current row +// ** in the result set. +// */ func Xsqlite3_column_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) { var _val unsafe.Pointer _val = Xsqlite3_value_blob(tls, _columnMem(tls, _pStmt, _i)) @@ -23208,9 +24566,11 @@ func Xsqlite3_column_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 uns return _val } -// *************************** sqlite3_value_ ******************************* -// The following routines extract information from a Mem or sqlite3_value -// structure. +// C comment +// /**************************** sqlite3_value_ ******************************* +// ** The following routines extract information from a Mem or sqlite3_value +// ** structure. +// */ func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) { var _p *XMem _p = _pVal @@ -23224,7 +24584,7 @@ func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) { return i32(0) }() != i32(0) { func() { - if int32(_p.X1) != i32(1) || (_p.X5) != nil { + if int32(_p.X1) != i32(1) || _p.X5 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_value_blobØ00__func__Ø000))), unsafe.Pointer(str(23609))) crt.X__builtin_abort(tls) } @@ -23232,19 +24592,19 @@ func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) { return nil } { - p := (*uint16)(unsafe.Pointer(&(_p.X1))) + p := (*uint16)(unsafe.Pointer(&_p.X1)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } - return (unsafe.Pointer)(func() *int8 { - if (_p.X4) != 0 { - return (_p.X5) + return unsafe.Pointer(func() *int8 { + if _p.X4 != 0 { + return _p.X5 } return nil }()) _0: - return (unsafe.Pointer)(Xsqlite3_value_text(tls, _pVal)) + return unsafe.Pointer(Xsqlite3_value_text(tls, _pVal)) } var _sqlite3_value_blobØ00__func__Ø000 [19]int8 @@ -23253,10 +24613,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_value_blobØ00__func__Ø000[0], str(23639), 19) } -// Check to see if column iCol of the given statement is valid. If -// it is, return a pointer to the Mem for the value of that column. -// If iCol is not valid, return a pointer to a Mem which has a value -// of NULL. +// C comment +// /* +// ** Check to see if column iCol of the given statement is valid. If +// ** it is, return a pointer to the Mem for the value of that column. +// ** If iCol is not valid, return a pointer to a Mem which has a value +// ** of NULL. +// */ func _columnMem(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) { var _pVm *TVdbe var _pOut *XMem @@ -23265,7 +24628,7 @@ func _columnMem(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) { return _columnNullValue(tls) } func() { - if (*Xsqlite3)(_pVm.X0) == nil { + if _pVm.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77067), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnMemØ00__func__Ø000))), unsafe.Pointer(str(23658))) crt.X__builtin_abort(tls) } @@ -23281,7 +24644,10 @@ _6: return _pOut } -// Return a pointer to static memory containing an SQL NULL value. +// C comment +// /* +// ** Return a pointer to static memory containing an SQL NULL value. +// */ func _columnNullValue(tls *crt.TLS) (r0 *XMem) { return &_columnNullValueØ00nullMemØ001 } @@ -23298,22 +24664,25 @@ func init() { crt.Xstrncpy(nil, &_columnMemØ00__func__Ø000[0], str(23666), 10) } -// This function is called after invoking an sqlite3_value_XXX function on a -// column value (i.e. a value returned by evaluating an SQL expression in the -// select list of a SELECT statement) that may cause a malloc() failure. If -// malloc() has failed, the threads mallocFailed flag is cleared and the result -// code of statement pStmt set to SQLITE_NOMEM. -// -// Specifically, this is called from within: -// -// sqlite3_column_int() -// sqlite3_column_int64() -// sqlite3_column_text() -// sqlite3_column_text16() -// sqlite3_column_real() -// sqlite3_column_bytes() -// sqlite3_column_bytes16() -// sqiite3_column_blob() +// C comment +// /* +// ** This function is called after invoking an sqlite3_value_XXX function on a +// ** column value (i.e. a value returned by evaluating an SQL expression in the +// ** select list of a SELECT statement) that may cause a malloc() failure. If +// ** malloc() has failed, the threads mallocFailed flag is cleared and the result +// ** code of statement pStmt set to SQLITE_NOMEM. +// ** +// ** Specifically, this is called from within: +// ** +// ** sqlite3_column_int() +// ** sqlite3_column_int64() +// ** sqlite3_column_text() +// ** sqlite3_column_text16() +// ** sqlite3_column_real() +// ** sqlite3_column_bytes() +// ** sqlite3_column_bytes16() +// ** sqiite3_column_blob() +// */ func _columnMallocFailure(tls *crt.TLS, _pStmt unsafe.Pointer) { var _p *TVdbe _p = (*TVdbe)(_pStmt) @@ -23330,7 +24699,7 @@ func _columnMallocFailure(tls *crt.TLS, _pStmt unsafe.Pointer) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _p.X10) + *(*int32)(unsafe.Pointer(&_p.X10)) = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _p.X10) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) } } @@ -23359,7 +24728,10 @@ func Xsqlite3_value_bytes16(tls *crt.TLS, _pVal *XMem) (r0 int32) { return _sqlite3ValueBytes(tls, _pVal, uint8(i32(2))) } -// Return the number of columns in the result set for the statement pStmt. +// C comment +// /* +// ** Return the number of columns in the result set for the statement pStmt. +// */ func Xsqlite3_column_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _pVm *TVdbe _pVm = (*TVdbe)(_pStmt) @@ -23371,26 +24743,35 @@ func Xsqlite3_column_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { }() } -// Return the column declaration type (if applicable) of the 'i'th column -// of the result set of SQL statement pStmt. +// C comment +// /* +// ** Return the column declaration type (if applicable) of the 'i'th column +// ** of the result set of SQL statement pStmt. +// */ func Xsqlite3_column_decltype(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) { - return (*int8)(_columnName(tls, _pStmt, _N, *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), i32(1))) -} - -// Convert the N-th element of pStmt->pColName[] into a string using -// xFunc() then return that string. If N is out of range, return 0. -// -// There are up to 5 names for each column. useType determines which -// name is returned. Here are the names: -// -// 0 The column name as it should be displayed for output -// 1 The datatype name for the column -// 2 The name of the database that the column derives from -// 3 The name of the table that the column derives from -// 4 The name of the table column that the result column derives from -// -// If the result is not a simple column reference (if it is an expression -// or a constant) then useTypes 2, 3, and 4 return NULL. + return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer { + v := Xsqlite3_value_text + return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v)) + }(), i32(1))) +} + +// C comment +// /* +// ** Convert the N-th element of pStmt->pColName[] into a string using +// ** xFunc() then return that string. If N is out of range, return 0. +// ** +// ** There are up to 5 names for each column. useType determines which +// ** name is returned. Here are the names: +// ** +// ** 0 The column name as it should be displayed for output +// ** 1 The datatype name for the column +// ** 2 The name of the database that the column derives from +// ** 3 The name of the table that the column derives from +// ** 4 The name of the table column that the result column derives from +// ** +// ** If the result is not a simple column reference (if it is an expression +// ** or a constant) then useTypes 2, 3, and 4 return NULL. +// */ func _columnName(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32, _xFunc func(*crt.TLS, *XMem) unsafe.Pointer, _useType int32) (r0 unsafe.Pointer) { var _n int32 var _ret unsafe.Pointer @@ -23426,7 +24807,7 @@ func _columnName(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32, _xFunc func(*crt } }() _ret = _xFunc(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X20)+72*uintptr(_N)))) - if (_db.X17) != 0 { + if _db.X17 != 0 { _sqlite3OomClear(tls, _db) _ret = nil } @@ -23483,14 +24864,14 @@ func _sqlite3VdbeIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) { }() _flags = int32(_pMem.X1) if (_flags & i32(4)) != 0 { - return *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) + return *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) } if (_flags & i32(8)) != 0 { - return _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + return _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) } if (_flags & i32(18)) != 0 { func() { - if (_pMem.X5) == nil && (_pMem.X4) != i32(0) { + if _pMem.X5 == nil && _pMem.X4 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70177), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000))), unsafe.Pointer(str(23716))) crt.X__builtin_abort(tls) } @@ -23506,9 +24887,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeIntValueØ00__func__Ø000[0], str(23738), 20) } -// Convert a 64-bit IEEE double into a 64-bit signed integer. -// If the double is out of range of a 64-bit signed integer then -// return the closest available 64-bit signed integer. +// C comment +// /* +// ** Convert a 64-bit IEEE double into a 64-bit signed integer. +// ** If the double is out of range of a 64-bit signed integer then +// ** return the closest available 64-bit signed integer. +// */ func _doubleToInt64(tls *crt.TLS, _r float64) (r0 int64) { if _r <= float64(_doubleToInt64Ø00minIntØ002) { return _doubleToInt64Ø00minIntØ002 @@ -23531,15 +24915,18 @@ func init() { _doubleToInt64Ø00maxIntØ001 = i64(9223372036854775807) } -// Return some kind of integer value which is the best we can do -// at representing the value that *pMem describes as an integer. -// If pMem is an integer, then the value is exact. If pMem is -// a floating-point then the value returned is the integer part. -// If pMem is a string or blob, then we make an attempt to convert -// it into an integer and return that. If pMem represents an -// an SQL-NULL value, return 0. -// -// If pMem represents a string value, its encoding might be changed. +// C comment +// /* +// ** Return some kind of integer value which is the best we can do +// ** at representing the value that *pMem describes as an integer. +// ** If pMem is an integer, then the value is exact. If pMem is +// ** a floating-point then the value returned is the integer part. +// ** If pMem is a string or blob, then we make an attempt to convert +// ** it into an integer and return that. If pMem represents an +// ** an SQL-NULL value, return 0. +// ** +// ** If pMem represents a string value, its encoding might be changed. +// */ func _memIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) { var _value int64 _value = i64(0) @@ -23547,23 +24934,26 @@ func _memIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) { return _value } -// Convert zNum to a 64-bit signed integer. zNum must be decimal. This -// routine does *not* accept hexadecimal notation. -// -// If the zNum value is representable as a 64-bit twos-complement -// integer, then write that value into *pNum and return 0. -// -// If zNum is exactly 9223372036854775808, return 2. This special -// case is broken out because while 9223372036854775808 cannot be a -// signed 64-bit integer, its negative -9223372036854775808 can be. -// -// If zNum is too big for a 64-bit integer and is not -// 9223372036854775808 or if zNum contains any non-numeric text, -// then return 1. -// -// length is the number of bytes in the string (bytes, not characters). -// The string is not necessarily zero-terminated. The encoding is -// given by enc. +// C comment +// /* +// ** Convert zNum to a 64-bit signed integer. zNum must be decimal. This +// ** routine does *not* accept hexadecimal notation. +// ** +// ** If the zNum value is representable as a 64-bit twos-complement +// ** integer, then write that value into *pNum and return 0. +// ** +// ** If zNum is exactly 9223372036854775808, return 2. This special +// ** case is broken out because while 9223372036854775808 cannot be a +// ** signed 64-bit integer, its negative -9223372036854775808 can be. +// ** +// ** If zNum is too big for a 64-bit integer and is not +// ** 9223372036854775808 or if zNum contains any non-numeric text, +// ** then return 1. +// ** +// ** length is the number of bytes in the string (bytes, not characters). +// ** The string is not necessarily zero-terminated. The encoding is +// ** given by enc. +// */ func _sqlite3Atoi64(tls *crt.TLS, _zNum *int8, _pNum *int64, _length int32, _enc uint8) (r0 int32) { var _incr, _neg, _i, _c, _nonNum int32 var _u uint64 @@ -23587,7 +24977,7 @@ func _sqlite3Atoi64(tls *crt.TLS, _zNum *int8, _pNum *int64, _length int32, _enc i32(0) _i = i32(3) - int32(_enc) _6: - if _i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i)))) != i32(0) { + if _i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i)))) != i32(0) { goto _10 } { @@ -23598,17 +24988,17 @@ _6: goto _6 _10: _nonNum = bool2int(_i < _length) - _zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i^i32(1)))) + _zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i^i32(1)))) { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(int32(_enc)&i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(int32(_enc)&i32(1)))) sink0(*p) } _5: - if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zNum)))))&i32(1)) != 0 { + if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zNum)))))&i32(1)) != 0 { { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _5 @@ -23620,7 +25010,7 @@ _5: _neg = i32(1) { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _17 @@ -23628,7 +25018,7 @@ _5: if int32(*_zNum) == i32(43) { { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } } @@ -23636,17 +25026,17 @@ _17: _14: _zStart = _zNum _18: - if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48)) { + if (crt.P2U(unsafe.Pointer(_zNum)) < crt.P2U(unsafe.Pointer(_zEnd))) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) == i32(48)) { { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_incr))) sink0(*p) } goto _18 } _i = i32(0) _21: - if crt.P2U(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum))+1*uintptr(_i))))) >= crt.P2U(unsafe.Pointer(_zEnd)) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))) < i32(48) || _c > i32(57) { + if crt.P2U(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum))+1*uintptr(_i))))) >= crt.P2U(unsafe.Pointer(_zEnd)) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i))))) < i32(48) || _c > i32(57) { goto _26 } _u = ((_u * uint64(i32(10))) + uint64(_c)) - uint64(i32(48)) @@ -23672,7 +25062,7 @@ _26: } *_pNum = int64(_u) _32: - if (((crt.P2U(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum))+1*uintptr(_i))))) < crt.P2U(unsafe.Pointer(_zEnd))) || ((_i == i32(0)) && (_zStart == _zNum))) || (_i > (i32(19) * _incr))) || _nonNum != 0 { + if (((crt.P2U(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum))+1*uintptr(_i))))) < crt.P2U(unsafe.Pointer(_zEnd))) || ((_i == i32(0)) && (_zStart == _zNum))) || (_i > (i32(19) * _incr))) || _nonNum != 0 { return i32(1) } if _i < (i32(19) * _incr) { @@ -23717,18 +25107,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3Atoi64Ø00__func__Ø000[0], str(23794), 14) } -// Compare the 19-character string zNum against the text representation -// value 2^63: 9223372036854775808. Return negative, zero, or positive -// if zNum is less than, equal to, or greater than the string. -// Note that zNum must contain exactly 19 characters. -// -// Unlike memcmp() this routine is guaranteed to return the difference -// in the values of the last digit if the only difference is in the -// last digit. So, for example, -// -// compare2pow63("9223372036854775800", 1) -// -// will return -8. +// C comment +// /* +// ** Compare the 19-character string zNum against the text representation +// ** value 2^63: 9223372036854775808. Return negative, zero, or positive +// ** if zNum is less than, equal to, or greater than the string. +// ** Note that zNum must contain exactly 19 characters. +// ** +// ** Unlike memcmp() this routine is guaranteed to return the difference +// ** in the values of the last digit if the only difference is in the +// ** last digit. So, for example, +// ** +// ** compare2pow63("9223372036854775800", 1) +// ** +// ** will return -8. +// */ func _compare2pow63(tls *crt.TLS, _zNum *int8, _incr int32) (r0 int32) { var _c, _i int32 var _pow63 *int8 @@ -23739,12 +25132,12 @@ _0: if _c != i32(0) || _i >= i32(18) { goto _4 } - _c = (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i*_incr)))) - int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pow63)) + 1*uintptr(_i))))) * i32(10) + _c = (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i*_incr)))) - int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pow63)) + 1*uintptr(_i))))) * i32(10) _i += 1 goto _0 _4: if _c == i32(0) { - _c = int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(18)*_incr)))) - i32(56) + _c = int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(18)*_incr)))) - i32(56) } return _c } @@ -23760,10 +25153,16 @@ func Xsqlite3_value_int64(tls *crt.TLS, _pVal *XMem) (r0 int64) { return _sqlite3VdbeIntValue(tls, _pVal) } -// Return the name of the Nth column of the result set returned by SQL -// statement pStmt. +// C comment +// /* +// ** Return the name of the Nth column of the result set returned by SQL +// ** statement pStmt. +// */ func Xsqlite3_column_name(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) { - return (*int8)(_columnName(tls, _pStmt, _N, *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), i32(0))) + return (*int8)(_columnName(tls, _pStmt, _N, func() func(*crt.TLS, *XMem) unsafe.Pointer { + v := Xsqlite3_value_text + return *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&v)) + }(), i32(0))) } func Xsqlite3_column_name16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) { @@ -23784,7 +25183,8 @@ func Xsqlite3_column_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 u return _val } -// SQLITE_OMIT_UTF16 +// C comment +// /* SQLITE_OMIT_UTF16 */ func Xsqlite3_column_type(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) { var _iType int32 _iType = Xsqlite3_value_type(tls, _columnMem(tls, _pStmt, _i)) @@ -23797,12 +25197,12 @@ func Xsqlite3_column_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *X _pOut = _columnMem(tls, _pStmt, _i) if (int32(_pOut.X1) & i32(2048)) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) & i32(-2049)) sink14(*p) } { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) | i32(4096)) sink14(*p) } @@ -23811,9 +25211,12 @@ func Xsqlite3_column_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *X return _pOut } -// Register a function to be invoked when a transaction commits. -// If the invoked function returns non-zero, then the commit becomes a -// rollback. +// C comment +// /* +// ** Register a function to be invoked when a transaction commits. +// ** If the invoked function returns non-zero, then the commit becomes a +// ** rollback. +// */ func Xsqlite3_commit_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _pOld unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -23822,63 +25225,66 @@ func Xsqlite3_commit_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pOld = _db.X45 - *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X46))) = _xCallback - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X45))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_db.X46)) = _xCallback + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X45)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pOld } -// Return TRUE if the given SQL string ends in a semicolon. -// -// Special handling is require for CREATE TRIGGER statements. -// Whenever the CREATE TRIGGER keywords are seen, the statement -// must end with ";END;". -// -// This implementation uses a state machine with 8 states: -// -// (0) INVALID We have not yet seen a non-whitespace character. -// -// (1) START At the beginning or end of an SQL statement. This routine -// returns 1 if it ends in the START state and 0 if it ends -// in any other state. -// -// (2) NORMAL We are in the middle of statement which ends with a single -// semicolon. -// -// (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of -// a statement. -// -// (4) CREATE The keyword CREATE has been seen at the beginning of a -// statement, possibly preceded by EXPLAIN and/or followed by -// TEMP or TEMPORARY -// -// (5) TRIGGER We are in the middle of a trigger definition that must be -// ended by a semicolon, the keyword END, and another semicolon. -// -// (6) SEMI We've seen the first semicolon in the ";END;" that occurs at -// the end of a trigger definition. -// -// (7) END We've seen the ";END" of the ";END;" that occurs at the end -// of a trigger definition. -// -// Transitions between states above are determined by tokens extracted -// from the input. The following tokens are significant: -// -// (0) tkSEMI A semicolon. -// (1) tkWS Whitespace. -// (2) tkOTHER Any other SQL token. -// (3) tkEXPLAIN The "explain" keyword. -// (4) tkCREATE The "create" keyword. -// (5) tkTEMP The "temp" or "temporary" keyword. -// (6) tkTRIGGER The "trigger" keyword. -// (7) tkEND The "end" keyword. -// -// Whitespace never causes a state transition and is always ignored. -// This means that a SQL string of all whitespace is invalid. -// -// If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed -// to recognize the end of a trigger can be omitted. All we have to do -// is look for a semicolon that is not part of an string or comment. +// C comment +// /* +// ** Return TRUE if the given SQL string ends in a semicolon. +// ** +// ** Special handling is require for CREATE TRIGGER statements. +// ** Whenever the CREATE TRIGGER keywords are seen, the statement +// ** must end with ";END;". +// ** +// ** This implementation uses a state machine with 8 states: +// ** +// ** (0) INVALID We have not yet seen a non-whitespace character. +// ** +// ** (1) START At the beginning or end of an SQL statement. This routine +// ** returns 1 if it ends in the START state and 0 if it ends +// ** in any other state. +// ** +// ** (2) NORMAL We are in the middle of statement which ends with a single +// ** semicolon. +// ** +// ** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of +// ** a statement. +// ** +// ** (4) CREATE The keyword CREATE has been seen at the beginning of a +// ** statement, possibly preceded by EXPLAIN and/or followed by +// ** TEMP or TEMPORARY +// ** +// ** (5) TRIGGER We are in the middle of a trigger definition that must be +// ** ended by a semicolon, the keyword END, and another semicolon. +// ** +// ** (6) SEMI We've seen the first semicolon in the ";END;" that occurs at +// ** the end of a trigger definition. +// ** +// ** (7) END We've seen the ";END" of the ";END;" that occurs at the end +// ** of a trigger definition. +// ** +// ** Transitions between states above are determined by tokens extracted +// ** from the input. The following tokens are significant: +// ** +// ** (0) tkSEMI A semicolon. +// ** (1) tkWS Whitespace. +// ** (2) tkOTHER Any other SQL token. +// ** (3) tkEXPLAIN The "explain" keyword. +// ** (4) tkCREATE The "create" keyword. +// ** (5) tkTEMP The "temp" or "temporary" keyword. +// ** (6) tkTRIGGER The "trigger" keyword. +// ** (7) tkEND The "end" keyword. +// ** +// ** Whitespace never causes a state transition and is always ignored. +// ** This means that a SQL string of all whitespace is invalid. +// ** +// ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed +// ** to recognize the end of a trigger can be omitted. All we have to do +// ** is look for a semicolon that is not part of an string or comment. +// */ func Xsqlite3_complete(tls *crt.TLS, _zSql *int8) (r0 int32) { var _14_c, _17_nId int32 var _state, _token uint8 @@ -23927,28 +25333,28 @@ _5: _token = uint8(i32(1)) goto _17 _10: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(42) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(1))))) != i32(42) { _token = uint8(i32(2)) goto _17 } { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink0(*p) } _19: - if ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) != 0) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) != i32(42)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(47))) { + if ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) != 0) && ((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) != i32(42)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(1))))) != i32(47))) { *(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1) goto _19 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) == i32(0) { return i32(0) } *(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1) _token = uint8(i32(1)) goto _17 _11: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(1))))) != i32(45) { _token = uint8(i32(2)) goto _17 } @@ -23988,12 +25394,12 @@ _33: _token = uint8(i32(2)) goto _17 _16: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zSql))))) & i32(70)) == i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zSql))))) & i32(70)) == i32(0) { goto _37 } _17_nId = i32(1) _38: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_17_nId)))))))) & i32(70)) == i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(_17_nId)))))))) & i32(70)) == i32(0) { goto _41 } _17_nId += 1 @@ -24058,7 +25464,7 @@ _49: _53: { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_17_nId-i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_17_nId-i32(1)))) sink0(*p) } goto _69 @@ -24067,7 +25473,7 @@ _37: _69: goto _17 _17: - _state = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_completeØ00transØ001))+8*uintptr(_state))))) + 1*uintptr(_token))) + _state = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_completeØ00transØ001))+8*uintptr(_state))))) + 1*uintptr(_token))) *(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1) goto _0 _2: @@ -24080,9 +25486,12 @@ func init() { _sqlite3_completeØ00transØ001 = [8][8]uint8{[8]uint8{u8(1), u8(0), u8(2), u8(3), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(1), u8(2), u8(3), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(2), u8(2), u8(2), u8(2), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(3), u8(3), u8(2), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(4), u8(2), u8(2), u8(2), u8(4), u8(5), u8(2)}, [8]uint8{u8(6), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5)}, [8]uint8{u8(6), u8(6), u8(5), u8(5), u8(5), u8(5), u8(5), u8(7)}, [8]uint8{u8(1), u8(7), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5)}} } -// This routine is the same as the sqlite3_complete() routine described -// above, except that the parameter is required to be UTF-16 encoded, not -// UTF-8. +// C comment +// /* +// ** This routine is the same as the sqlite3_complete() routine described +// ** above, except that the parameter is required to be UTF-16 encoded, not +// ** UTF-8. +// */ func Xsqlite3_complete16(tls *crt.TLS, _zSql unsafe.Pointer) (r0 int32) { var _rc int32 var _zSql8 *int8 @@ -24104,12 +25513,18 @@ _2: return _rc & i32(255) } -// Register a new collation sequence with the database handle db. +// C comment +// /* +// ** Register a new collation sequence with the database handle db. +// */ func Xsqlite3_create_collation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) { return Xsqlite3_create_collation_v2(tls, _db, _zName, _enc, _pCtx, _xCompare, nil) } -// Register a new collation sequence with the database handle db. +// C comment +// /* +// ** Register a new collation sequence with the database handle db. +// */ func Xsqlite3_create_collation_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { var _rc int32 if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) { @@ -24117,7 +25532,7 @@ func Xsqlite3_create_collation_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _en } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_collation_v2Ø00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } @@ -24134,8 +25549,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_create_collation_v2Ø00__func__Ø000[0], str(23887), 28) } -// Create a new collating function for database "db". The name is zName -// and the encoding is enc. +// C comment +// /* +// ** Create a new collating function for database "db". The name is zName +// ** and the encoding is enc. +// */ func _createCollation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc uint8, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { var _enc2, _5_j int32 var _pColl, _5_aColl, _6_p *XCollSeq @@ -24153,10 +25571,10 @@ func _createCollation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc uint8, _pC return _sqlite3MisuseError(tls, i32(142834)) } _pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, i32(0)) - if _pColl == nil || (_pColl.X3) == nil { + if _pColl == nil || _pColl.X3 == nil { goto _7 } - if (_db.X34) != 0 { + if _db.X34 != 0 { _sqlite3ErrorWithMsg(tls, _db, i32(5), str(23915)) return i32(5) } @@ -24164,20 +25582,20 @@ func _createCollation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc uint8, _pC if (int32(_pColl.X1) & i32(-9)) != _enc2 { goto _9 } - _5_aColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), _zName)) + _5_aColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X70)), _zName)) _5_j = i32(0) _10: if _5_j >= i32(3) { goto _13 } - _6_p = (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_aColl)) + 40*uintptr(_5_j))) + _6_p = (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_aColl)) + 40*uintptr(_5_j))) if int32(_6_p.X1) != int32(_pColl.X1) { goto _14 } - if (_6_p.X4) != nil { - (_6_p.X4)(tls, _6_p.X2) + if _6_p.X4 != nil { + _6_p.X4(tls, _6_p.X2) } - *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&(_6_p.X3))) = nil + *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&_6_p.X3)) = nil _14: _5_j += 1 goto _10 @@ -24188,10 +25606,10 @@ _7: if _pColl == nil { return _sqlite3NomemError(tls, i32(142872)) } - *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&(_pColl.X3))) = _xCompare - *(*unsafe.Pointer)(unsafe.Pointer(&(_pColl.X2))) = _pCtx - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pColl.X4))) = _xDel - *(*uint8)(unsafe.Pointer(&(_pColl.X1))) = uint8(_enc2 | (int32(_enc) & i32(8))) + *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&_pColl.X3)) = _xCompare + *(*unsafe.Pointer)(unsafe.Pointer(&_pColl.X2)) = _pCtx + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pColl.X4)) = _xDel + *(*uint8)(unsafe.Pointer(&_pColl.X1)) = uint8(_enc2 | (int32(_enc) & i32(8))) _sqlite3Error(tls, _db, i32(0)) return i32(0) } @@ -24202,19 +25620,22 @@ func init() { crt.Xstrncpy(nil, &_createCollationØ00__func__Ø000[0], str(23983), 16) } -// Parameter zName points to a UTF-8 encoded string nName bytes long. -// Return the CollSeq* pointer for the collation sequence named zName -// for the encoding 'enc' from the database 'db'. -// -// If the entry specified is not found and 'create' is true, then create a -// new entry. Otherwise return NULL. -// -// A separate function sqlite3LocateCollSeq() is a wrapper around -// this routine. sqlite3LocateCollSeq() invokes the collation factory -// if necessary and generates an error message if the collating sequence -// cannot be found. -// -// See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq() +// C comment +// /* +// ** Parameter zName points to a UTF-8 encoded string nName bytes long. +// ** Return the CollSeq* pointer for the collation sequence named zName +// ** for the encoding 'enc' from the database 'db'. +// ** +// ** If the entry specified is not found and 'create' is true, then create a +// ** new entry. Otherwise return NULL. +// ** +// ** A separate function sqlite3LocateCollSeq() is a wrapper around +// ** this routine. sqlite3LocateCollSeq() invokes the collation factory +// ** if necessary and generates an error message if the collating sequence +// ** cannot be found. +// ** +// ** See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq() +// */ func _sqlite3FindCollSeq(tls *crt.TLS, _db *Xsqlite3, _enc uint8, _zName *int8, _create int32) (r0 *XCollSeq) { var _pColl *XCollSeq if _zName != nil { @@ -24233,28 +25654,31 @@ _1: if _pColl != nil { { p := &_pColl - *p = (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 40*uintptr(int32(_enc)-i32(1)))) + *p = (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 40*uintptr(int32(_enc)-i32(1)))) sink32(*p) } } return _pColl } -// Locate and return an entry from the db.aCollSeq hash table. If the entry -// specified by zName and nName is not found and parameter 'create' is -// true, then create a new entry. Otherwise return NULL. -// -// Each pointer stored in the sqlite3.aCollSeq hash table contains an -// array of three CollSeq structures. The first is the collation sequence -// preferred for UTF-8, the second UTF-16le, and the third UTF-16be. -// -// Stored immediately after the three collation sequences is a copy of -// the collation sequence name. A pointer to this string is stored in -// each collation sequence structure. +// C comment +// /* +// ** Locate and return an entry from the db.aCollSeq hash table. If the entry +// ** specified by zName and nName is not found and parameter 'create' is +// ** true, then create a new entry. Otherwise return NULL. +// ** +// ** Each pointer stored in the sqlite3.aCollSeq hash table contains an +// ** array of three CollSeq structures. The first is the collation sequence +// ** preferred for UTF-8, the second UTF-16le, and the third UTF-16be. +// ** +// ** Stored immediately after the three collation sequences is a copy of +// ** the collation sequence name. A pointer to this string is stored in +// ** each collation sequence structure. +// */ func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) (r0 *XCollSeq) { var _1_nName int32 var _pColl, _2_pDel *XCollSeq - _pColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), _zName)) + _pColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X70)), _zName)) if nil != _pColl || _create == 0 { goto _1 } @@ -24264,15 +25688,15 @@ func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) goto _2 } _2_pDel = nil - *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(0)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(3)))))) - *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(0)))).X1))) = uint8(i32(1)) - *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(1)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(3)))))) - *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(1)))).X1))) = uint8(i32(2)) - *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(2)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(3)))))) - *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 40*uintptr(i32(2)))).X1))) = uint8(i32(3)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+40*uintptr(i32(0)))).X0), (unsafe.Pointer)(_zName), uint64(_1_nName)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+40*uintptr(i32(0)))).X0)) + 1*uintptr(_1_nName))) = int8(i32(0)) - _2_pDel = (*XCollSeq)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+40*uintptr(i32(0)))).X0, (unsafe.Pointer)(_pColl))) + *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(0)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(3)))))) + *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(0)))).X1))) = uint8(i32(1)) + *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(1)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(3)))))) + *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(1)))).X1))) = uint8(i32(2)) + *(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(2)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(3)))))) + *(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl)) + 40*uintptr(i32(2)))).X1))) = uint8(i32(3)) + crt.Xmemcpy(tls, unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl))+40*uintptr(i32(0)))).X0), unsafe.Pointer(_zName), uint64(_1_nName)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl))+40*uintptr(i32(0)))).X0)) + 1*uintptr(_1_nName))) = int8(i32(0)) + _2_pDel = (*XCollSeq)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&_db.X70)), (*XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer(_pColl))+40*uintptr(i32(0)))).X0, unsafe.Pointer(_pColl))) func() { if _2_pDel != nil && _2_pDel != _pColl { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104323), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCollSeqEntryØ00__func__Ø000))), unsafe.Pointer(str(24039))) @@ -24281,7 +25705,7 @@ func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) }() if _2_pDel != nil { _sqlite3OomFault(tls, _db) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_pDel)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_2_pDel)) _pColl = nil } _2: @@ -24289,9 +25713,11 @@ _1: return _pColl } -// Attempt to locate an element of the hash table pH with a key -// that matches pKey. Return the data for this element if it is -// found, or NULL if there is no match. +// C comment +// /* Attempt to locate an element of the hash table pH with a key +// ** that matches pKey. Return the data for this element if it is +// ** found, or NULL if there is no match. +// */ func _sqlite3HashFind(tls *crt.TLS, _pH *XHash, _pKey *int8) (r0 unsafe.Pointer) { var _h uint32 var _elem *XHashElem @@ -24337,7 +25763,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FindCollSeqØ00__func__Ø000[0], str(24095), 19) } -// Register a new collation sequence with the database handle db. +// C comment +// /* +// ** Register a new collation sequence with the database handle db. +// */ func Xsqlite3_create_collation16(tls *crt.TLS, _db *Xsqlite3, _zName unsafe.Pointer, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) { var _rc int32 var _zName8 *int8 @@ -24347,7 +25776,7 @@ func Xsqlite3_create_collation16(tls *crt.TLS, _db *Xsqlite3, _zName unsafe.Poin } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143699), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_collation16Ø00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } @@ -24355,7 +25784,7 @@ func Xsqlite3_create_collation16(tls *crt.TLS, _db *Xsqlite3, _zName unsafe.Poin _zName8 = _sqlite3Utf16to8(tls, _db, _zName, i32(-1), uint8(i32(2))) if _zName8 != nil { _rc = _createCollation(tls, _db, _zName8, uint8(_enc), _pCtx, _xCompare, nil) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName8)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName8)) } _rc = _sqlite3ApiExit(tls, _db, _rc) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) @@ -24368,35 +25797,38 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_create_collation16Ø00__func__Ø000[0], str(24114), 27) } -// Convert a UTF-16 string in the native encoding into a UTF-8 string. -// Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must -// be freed by the calling function. -// -// NULL is returned if there is an allocation error. +// C comment +// /* +// ** Convert a UTF-16 string in the native encoding into a UTF-8 string. +// ** Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must +// ** be freed by the calling function. +// ** +// ** NULL is returned if there is an allocation error. +// */ func _sqlite3Utf16to8(tls *crt.TLS, _db *Xsqlite3, _z unsafe.Pointer, _nByte int32, _enc uint8) (r0 *int8) { var _m XMem - crt.Xmemset(tls, (unsafe.Pointer)(&_m), i32(0), u64(72)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_m.X9))))) = _db + crt.Xmemset(tls, unsafe.Pointer(&_m), i32(0), u64(72)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_m.X9)))) = _db _sqlite3VdbeMemSetStr(tls, &_m, (*int8)(_z), _nByte, _enc, nil) _sqlite3VdbeChangeEncoding(tls, &_m, i32(1)) - if (_db.X17) != 0 { + if _db.X17 != 0 { _sqlite3VdbeMemRelease(tls, &_m) - *(**int8)(unsafe.Pointer(&(_m.X5))) = nil + *(**int8)(unsafe.Pointer(&_m.X5)) = nil } func() { - if (int32(_m.X1)&i32(512)) == i32(0) && (_db.X17) == 0 { + if (int32(_m.X1)&i32(512)) == i32(0) && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27570), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24141))) crt.X__builtin_abort(tls) } }() func() { - if (int32(_m.X1)&i32(2)) == i32(0) && (_db.X17) == 0 { + if (int32(_m.X1)&i32(2)) == i32(0) && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24185))) crt.X__builtin_abort(tls) } }() func() { - if (_m.X5) == nil && (_db.X17) == 0 { + if _m.X5 == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24228))) crt.X__builtin_abort(tls) } @@ -24413,7 +25845,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3Utf16to8Ø00__func__Ø000[0], str(24252), 16) } -// Create new user functions. +// C comment +// /* +// ** Create new user functions. +// */ func Xsqlite3_create_function(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nArg int32, _enc int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context)) (r0 int32) { return Xsqlite3_create_function_v2(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, nil) } @@ -24435,11 +25870,11 @@ func Xsqlite3_create_function_v2(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nAr _xDestroy(tls, _p) goto _out } - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pArg.X1))) = _xDestroy - *(*unsafe.Pointer)(unsafe.Pointer(&(_pArg.X2))) = _p + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pArg.X1)) = _xDestroy + *(*unsafe.Pointer)(unsafe.Pointer(&_pArg.X2)) = _p _1: _rc = _sqlite3CreateFunc(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, _pArg) - if (_pArg != nil) && ((_pArg.X0) == i32(0)) { + if (_pArg != nil) && (_pArg.X0 == i32(0)) { func() { if _rc == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142213), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_function_v2Ø00__func__Ø000))), unsafe.Pointer(str(18512))) @@ -24447,7 +25882,7 @@ _1: } }() _xDestroy(tls, _p) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pArg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pArg)) } _out: _rc = _sqlite3ApiExit(tls, _db, _rc) @@ -24455,10 +25890,13 @@ _out: return _rc } -// This function is exactly the same as sqlite3_create_function(), except -// that it is designed to be called by internal code. The difference is -// that if a malloc() fails in sqlite3_create_function(), an error code -// is returned and the mallocFailed flag cleared. +// C comment +// /* +// ** This function is exactly the same as sqlite3_create_function(), except +// ** that it is designed to be called by internal code. The difference is +// ** that if a malloc() fails in sqlite3_create_function(), an error code +// ** is returned and the mallocFailed flag cleared. +// */ func _sqlite3CreateFunc(tls *crt.TLS, _db *Xsqlite3, _zFunctionName *int8, _nArg int32, _enc int32, _pUserData unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context), _pDestructor *XFuncDestructor) (r0 int32) { var _nName, _extraFlags, _3_rc int32 var _p *XFuncDef @@ -24498,10 +25936,10 @@ _17: if _p == nil || (int32(_p.X1)&i32(3)) != _enc || int32(_p.X0) != _nArg { goto _22 } - if (_db.X34) != 0 { + if _db.X34 != 0 { _sqlite3ErrorWithMsg(tls, _db, i32(5), str(24268)) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } @@ -24512,7 +25950,7 @@ _17: _22: _p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), uint8(i32(1))) func() { - if _p == nil && (_db.X17) == 0 { + if _p == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142143), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000))), unsafe.Pointer(str(24331))) crt.X__builtin_abort(tls) } @@ -24522,19 +25960,19 @@ _22: } _functionDestroy(tls, _db, _p) if _pDestructor != nil { - *(*int32)(unsafe.Pointer(&(_pDestructor.X0))) += 1 + *(*int32)(unsafe.Pointer(&_pDestructor.X0)) += 1 } - *(**XFuncDestructor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7))))))) = _pDestructor - *(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16((int32(_p.X1) & i32(3)) | _extraFlags) - *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&(_p.X4))))) = func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) { + *(**XFuncDestructor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X7)))))) = _pDestructor + *(*uint16)(unsafe.Pointer(&_p.X1)) = uint16((int32(_p.X1) & i32(3)) | _extraFlags) + *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&_p.X4)))) = func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) { if _xSFunc != nil { return _xSFunc } return _xStep }() - *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_p.X5))))) = _xFinal - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = _pUserData - *(*int8)(unsafe.Pointer(&(_p.X0))) = int8(uint16(_nArg)) + *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_p.X5)))) = _xFinal + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X2)) = _pUserData + *(*int8)(unsafe.Pointer(&_p.X0)) = int8(uint16(_nArg)) return i32(0) _ = _nName @@ -24547,23 +25985,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CreateFuncØ00__func__Ø000[0], str(24353), 18) } -// Locate a user function given a name, a number of arguments and a flag -// indicating whether the function prefers UTF-16 over UTF-8. Return a -// pointer to the FuncDef structure that defines that function, or return -// NULL if the function does not exist. -// -// If the createFlag argument is true, then a new (blank) FuncDef -// structure is created and liked into the "db" structure if a -// no matching function previously existed. -// -// If nArg is -2, then the first valid function found is returned. A -// function is valid if xSFunc is non-zero. The nArg==(-2) -// case is used to see if zName is a valid function name for some number -// of arguments. If nArg is -2, then createFlag must be 0. -// -// If createFlag is false, then a function with the required name and -// number of arguments may be returned even if the eTextRep flag does not -// match that requested. +// C comment +// /* +// ** Locate a user function given a name, a number of arguments and a flag +// ** indicating whether the function prefers UTF-16 over UTF-8. Return a +// ** pointer to the FuncDef structure that defines that function, or return +// ** NULL if the function does not exist. +// ** +// ** If the createFlag argument is true, then a new (blank) FuncDef +// ** structure is created and liked into the "db" structure if a +// ** no matching function previously existed. +// ** +// ** If nArg is -2, then the first valid function found is returned. A +// ** function is valid if xSFunc is non-zero. The nArg==(-2) +// ** case is used to see if zName is a valid function name for some number +// ** of arguments. If nArg is -2, then createFlag must be 0. +// ** +// ** If createFlag is false, then a function with the required name and +// ** number of arguments may be returned even if the eTextRep flag does not +// ** match that requested. +// */ func _sqlite3FindFunction(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32, _enc uint8, _createFlag uint8) (r0 *XFuncDef) { var _bestScore, _h, _nName, _1_score, _4_score int32 var _p, _pBest, _6_pOther *XFuncDef @@ -24582,7 +26023,7 @@ func _sqlite3FindFunction(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32 } }() _nName = _sqlite3Strlen30(tls, _zName) - _p = (*XFuncDef)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X69))), _zName)) + _p = (*XFuncDef)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X69)), _zName)) _5: if _p == nil { goto _6 @@ -24595,11 +26036,11 @@ _5: _p = (*XFuncDef)(_p.X3) goto _5 _6: - if _createFlag != 0 || _pBest != nil && ((_db.X6)&i32(2097152)) == i32(0) { + if _createFlag != 0 || _pBest != nil && (_db.X6&i32(2097152)) == i32(0) { goto _10 } _bestScore = i32(0) - _h = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(i32(0))))))))) + _nName) % i32(23) + _h = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(i32(0))))))))) + _nName) % i32(23) _p = _functionSearch(tls, _h, _zName) _11: if _p == nil { @@ -24617,21 +26058,19 @@ _10: if _createFlag == 0 || _bestScore >= i32(6) || store33(&_pBest, (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, (u64(56)+uint64(_nName))+uint64(i32(1))))) == nil { goto _16 } - *(**int8)(unsafe.Pointer(&(_pBest.X6))) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pBest)) + 56*uintptr(i32(1)))))) - *(*int8)(unsafe.Pointer(&(_pBest.X0))) = int8(uint16(_nArg)) - *(*uint16)(unsafe.Pointer(&(_pBest.X1))) = uint16(_enc) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pBest))+56*uintptr(i32(1))))), (unsafe.Pointer)(_zName), uint64(_nName+i32(1))) - _6_pOther = (*XFuncDef)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X69))), _pBest.X6, (unsafe.Pointer)(_pBest))) + *(**int8)(unsafe.Pointer(&_pBest.X6)) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_pBest)) + 56*uintptr(i32(1)))))) + *(*int8)(unsafe.Pointer(&_pBest.X0)) = int8(uint16(_nArg)) + *(*uint16)(unsafe.Pointer(&_pBest.X1)) = uint16(_enc) + crt.Xmemcpy(tls, unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_pBest))+56*uintptr(i32(1))))), unsafe.Pointer(_zName), uint64(_nName+i32(1))) + _6_pOther = (*XFuncDef)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&_db.X69)), _pBest.X6, unsafe.Pointer(_pBest))) if _6_pOther == _pBest { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pBest)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pBest)) _sqlite3OomFault(tls, _db) return nil } - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBest.X3))))) = _6_pOther + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBest.X3)))) = _6_pOther _16: - if (_pBest != nil) && (((*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{(_pBest.X4)}))) != nil) || (_createFlag != 0)) { + if (_pBest != nil) && ((_pBest.X4 != nil) || (_createFlag != 0)) { return _pBest } return nil @@ -24643,16 +26082,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FindFunctionØ00__func__Ø000[0], str(24410), 20) } -// The score for a perfect match +// C comment +// /* The score for a perfect match */ func _matchQuality(tls *crt.TLS, _p *XFuncDef, _nArg int32, _enc uint8) (r0 int32) { var _match int32 if _nArg == i32(-2) { return func() int32 { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context, int32, **XMem) - }{(*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{(_p.X4)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) { + v := _p.X4 + return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context, int32, **XMem) }{nil})) { return i32(0) @@ -24702,14 +26143,14 @@ func Xsqlite3_create_function16(tls *crt.TLS, _db *Xsqlite3, _zFunctionName unsa } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142242), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_function16Ø00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } }() _zFunc8 = _sqlite3Utf16to8(tls, _db, _zFunctionName, i32(-1), uint8(i32(2))) _rc = _sqlite3CreateFunc(tls, _db, _zFunc8, _nArg, _eTextRep, _p, _xSFunc, _xStep, _xFinal, nil) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zFunc8)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zFunc8)) _rc = _sqlite3ApiExit(tls, _db, _rc) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _rc @@ -24721,7 +26162,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_create_function16Ø00__func__Ø000[0], str(24457), 26) } -// External API function used to create a new virtual-table module. +// C comment +// /* +// ** External API function used to create a new virtual-table module. +// */ func Xsqlite3_create_module(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer) (r0 int32) { if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) { return _sqlite3MisuseError(tls, i32(125090)) @@ -24729,14 +26173,17 @@ func Xsqlite3_create_module(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule return _createModule(tls, _db, _zName, _pModule, _pAux, nil) } -// The actual function that does the work of creating a new module. -// This function implements the sqlite3_create_module() and -// sqlite3_create_module_v2() interfaces. +// C comment +// /* +// ** The actual function that does the work of creating a new module. +// ** This function implements the sqlite3_create_module() and +// ** sqlite3_create_module_v2() interfaces. +// */ func _createModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) { var _rc int32 _rc = i32(0) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zName) != nil { + if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X65)), _zName) != nil { _rc = _sqlite3MisuseError(tls, i32(125069)) goto _1 } @@ -24750,9 +26197,12 @@ _1: return _rc } -// Construct and install a Module object for a virtual table. When this -// routine is called, it is guaranteed that all appropriate locks are held -// and the module is not already part of the connection. +// C comment +// /* +// ** Construct and install a Module object for a virtual table. When this +// ** routine is called, it is guaranteed that all appropriate locks are held +// ** and the module is not already part of the connection. +// */ func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 *XModule) { var _nName int32 var _1_zCopy *int8 @@ -24762,14 +26212,14 @@ func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModul if _pMod == nil { goto _0 } - _1_zCopy = (*int8)(unsafe.Pointer((*XModule)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMod)) + 40*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_1_zCopy), (unsafe.Pointer)(_zName), uint64(_nName+i32(1))) - *(**int8)(unsafe.Pointer(&(_pMod.X1))) = _1_zCopy - *(**Xsqlite3_module)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X0))))) = _pModule - *(*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X2))) = _pAux - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pMod.X3))) = _xDestroy - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = nil - _1_pDel = (*XModule)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _1_zCopy, (unsafe.Pointer)(_pMod))) + _1_zCopy = (*int8)(unsafe.Pointer((*XModule)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMod)) + 40*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_1_zCopy), unsafe.Pointer(_zName), uint64(_nName+i32(1))) + *(**int8)(unsafe.Pointer(&_pMod.X1)) = _1_zCopy + *(**Xsqlite3_module)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMod.X0)))) = _pModule + *(*unsafe.Pointer)(unsafe.Pointer(&_pMod.X2)) = _pAux + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pMod.X3)) = _xDestroy + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMod.X4)))) = nil + _1_pDel = (*XModule)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&_db.X65)), _1_zCopy, unsafe.Pointer(_pMod))) func() { if _1_pDel != nil && _1_pDel != _pMod { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125043), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCreateModuleØ00__func__Ø000))), unsafe.Pointer(str(24483))) @@ -24778,7 +26228,7 @@ func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModul }() if _1_pDel != nil { _sqlite3OomFault(tls, _db) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pDel)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pDel)) _pMod = nil } _0: @@ -24791,8 +26241,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabCreateModuleØ00__func__Ø000[0], str(24505), 24) } -// Return the number of values available from the current row of the -// currently executing statement pStmt. +// C comment +// /* +// ** Return the number of values available from the current row of the +// ** currently executing statement pStmt. +// */ func Xsqlite3_data_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _pVm *TVdbe _pVm = (*TVdbe)(_pStmt) @@ -24802,10 +26255,13 @@ func Xsqlite3_data_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { return int32(_pVm.X29) } -// Return the sqlite3* database handle to which the prepared statement given -// in the argument belongs. This is the same database handle that was -// the first argument to the sqlite3_prepare() that was used to create -// the statement in the first place. +// C comment +// /* +// ** Return the sqlite3* database handle to which the prepared statement given +// ** in the argument belongs. This is the same database handle that was +// ** the first argument to the sqlite3_prepare() that was used to create +// ** the statement in the first place. +// */ func Xsqlite3_db_handle(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *Xsqlite3) { return func() *Xsqlite3 { if _pStmt != nil { @@ -24815,9 +26271,12 @@ func Xsqlite3_db_handle(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *Xsqlite3) { }() } -// 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. +// C comment +// /* +// ** This function is used to set the schema of a virtual table. It is only +// ** valid to call this function from within the xCreate() or xConnect() of a +// ** virtual table module. +// */ func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 int32) { var _rc int32 var _zErr *int8 @@ -24832,14 +26291,14 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pCtx = (*XVtabCtx)(_db.X66) - if (_pCtx == nil) || (_pCtx.X3) != 0 { + if (_pCtx == nil) || _pCtx.X3 != 0 { _sqlite3Error(tls, _db, i32(21)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _sqlite3MisuseError(tls, i32(125738)) } _pTab = (*XTable)(_pCtx.X1) func() { - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125741), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24529))) crt.X__builtin_abort(tls) } @@ -24849,36 +26308,37 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 _rc = _sqlite3NomemError(tls, i32(125745)) goto _7 } - *(*uint8)(unsafe.Pointer(&(_pParse.X55))) = uint8(i32(1)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X0))))) = _db - *(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(i32(1)) - if i32(0) != _sqlite3RunParser(tls, _pParse, _zCreateTable, &_zErr) || (*XTable)(_pParse.X63) == nil || (_db.X17) != 0 || (*XSelect)((*XTable)(_pParse.X63).X3) != nil || ((*XTable)(_pParse.X63).X16) != 0 { + *(*uint8)(unsafe.Pointer(&_pParse.X55)) = uint8(i32(1)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X0)))) = _db + *(*uint32)(unsafe.Pointer(&_pParse.X42)) = uint32(i32(1)) + if i32(0) != _sqlite3RunParser(tls, _pParse, _zCreateTable, &_zErr) || _pParse.X63 == nil || _db.X17 != 0 || ((*XTable)(_pParse.X63).X3) != nil || ((*XTable)(_pParse.X63).X16) != 0 { goto _12 } - if (*XColumn)(_pTab.X1) != nil { + if _pTab.X1 != nil { goto _13 } _6_pNew = (*XTable)(_pParse.X63) - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1))))) = (*XColumn)(_6_pNew.X1) - *(*int16)(unsafe.Pointer(&(_pTab.X11))) = _6_pNew.X11 + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X1)))) = (*XColumn)(_6_pNew.X1) + *(*int16)(unsafe.Pointer(&_pTab.X11)) = _6_pNew.X11 { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) - *p = (*p) | ((_6_pNew.X9) & uint32(i32(96))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) + *p = (*p) | (_6_pNew.X9 & uint32(i32(96))) sink5(*p) } - *(*int16)(unsafe.Pointer(&(_6_pNew.X11))) = int16(i32(0)) - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X1))))) = nil + *(*int16)(unsafe.Pointer(&_6_pNew.X11)) = int16(i32(0)) + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pNew.X1)))) = nil func() { if (*XIndex)(_pTab.X2) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24545))) crt.X__builtin_abort(tls) } }() - if (((_6_pNew.X9) & uint32(i32(32))) != uint32(i32(0))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { + if ((_6_pNew.X9 & uint32(i32(32))) != uint32(i32(0))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 - }{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32 - }{((*Xsqlite3_module)((*XModule)((*XVTable)(_pCtx.X0).X1).X0).X13)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 { + v := (*Xsqlite3_module)((*XModule)((*XVTable)(_pCtx.X0).X1).X0).X13 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 }{nil}))) { _rc = i32(1) @@ -24891,12 +26351,12 @@ func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 crt.X__builtin_abort(tls) } }() - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _6_pIdx - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X2))))) = nil - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pIdx.X3))))) = _pTab + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X2)))) = _6_pIdx + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pNew.X2)))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pIdx.X3)))) = _pTab } _13: - *(*int32)(unsafe.Pointer(&(_pCtx.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_pCtx.X3)) = i32(1) goto _21 _12: _sqlite3ErrorWithMsg(tls, _db, i32(1), func() *int8 { @@ -24905,16 +26365,16 @@ _12: } return nil }(), unsafe.Pointer(_zErr)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _rc = i32(1) _21: - *(*uint8)(unsafe.Pointer(&(_pParse.X55))) = uint8(i32(0)) - if (*TVdbe)(_pParse.X2) != nil { + *(*uint8)(unsafe.Pointer(&_pParse.X55)) = uint8(i32(0)) + if _pParse.X2 != nil { _sqlite3VdbeFinalize(tls, (*TVdbe)(_pParse.X2)) } _sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.X63)) _sqlite3ParserReset(tls, _pParse) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse)) _7: func() { if (_rc & i32(255)) != _rc { @@ -24933,11 +26393,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_declare_vtabØ00__func__Ø000[0], str(24593), 21) } -// Run the parser on the given SQL string. The parser structure is -// passed in. An SQLITE_ status code is returned. If an error occurs -// then an and attempt is made to write an error message into -// memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that -// error message. +// C comment +// /* +// ** Run the parser on the given SQL string. The parser structure is +// ** passed in. An SQLITE_ status code is returned. If an error occurs +// ** then an and attempt is made to write an error message into +// ** memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that +// ** error message. +// */ func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **int8) (r0 int32) { var _nErr, _n, _tokenType, _lastTokenParsed, _mxSqlLen int32 var _pEngine unsafe.Pointer @@ -24955,19 +26418,19 @@ func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **i crt.X__builtin_abort(tls) } }() - _mxSqlLen = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(1)))) - if (_db.X34) == i32(0) { - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0) + _mxSqlLen = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(1)))) + if _db.X34 == i32(0) { + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(0) } - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(0) - *(**int8)(unsafe.Pointer(&(_pParse.X62))) = _zSql + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(0) + *(**int8)(unsafe.Pointer(&_pParse.X62)) = _zSql func() { if _pzErrMsg == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24622))) crt.X__builtin_abort(tls) } }() - _pEngine = (unsafe.Pointer)(&_sEngine) + _pEngine = unsafe.Pointer(&_sEngine) _sqlite3ParserInit(tls, _pEngine) func() { if (*XTable)(_pParse.X63) != nil { @@ -24988,13 +26451,13 @@ func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **i } }() func() { - if (_pParse.X60) != nil { + if _pParse.X60 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24694))) crt.X__builtin_abort(tls) } }() _13: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) == i32(0) { goto _15 } _n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType) @@ -25004,7 +26467,7 @@ _13: sink1(*p) } if _mxSqlLen < i32(0) { - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(18) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(18) goto _14 } goto _17 @@ -25020,7 +26483,7 @@ _15: _21: { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(_n))) sink0(*p) } _17: @@ -25033,8 +26496,8 @@ _17: crt.X__builtin_abort(tls) } }() - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 { - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(9) + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) != 0 { + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(9) goto _14 } if _tokenType == i32(164) { @@ -25043,21 +26506,21 @@ _17: } { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink0(*p) } goto _28 _22: - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))) = _zSql - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1))) = uint32(_n) + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X51)).X0))) = _zSql + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X51)).X1))) = uint32(_n) _sqlite3Parser(tls, _pEngine, _tokenType, _pParse.X51, _pParse) _lastTokenParsed = _tokenType { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink0(*p) } - if ((_pParse.X3) != i32(0)) || ((_db.X17) != 0) { + if (_pParse.X3 != i32(0)) || (_db.X17 != 0) { goto _14 } _28: @@ -25069,13 +26532,13 @@ _14: crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pParse.X62))) = _zSql + *(**int8)(unsafe.Pointer(&_pParse.X62)) = _zSql _sqlite3ParserFinalize(tls, _pEngine) - if (_db.X17) != 0 { - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _sqlite3NomemError(tls, i32(140031)) + if _db.X17 != 0 { + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _sqlite3NomemError(tls, i32(140031)) } - if (((_pParse.X3) != i32(0)) && ((_pParse.X3) != i32(101))) && ((_pParse.X1) == nil) { - *(**int8)(unsafe.Pointer(&(_pParse.X1))) = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _pParse.X3))) + if ((_pParse.X3 != i32(0)) && (_pParse.X3 != i32(101))) && (_pParse.X1 == nil) { + *(**int8)(unsafe.Pointer(&_pParse.X1)) = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _pParse.X3))) } func() { if _pzErrMsg == nil { @@ -25083,46 +26546,46 @@ _14: crt.X__builtin_abort(tls) } }() - if (_pParse.X1) != nil { + if _pParse.X1 != nil { *_pzErrMsg = _pParse.X1 Xsqlite3_log(tls, _pParse.X3, str(24576), unsafe.Pointer(*_pzErrMsg)) - *(**int8)(unsafe.Pointer(&(_pParse.X1))) = nil + *(**int8)(unsafe.Pointer(&_pParse.X1)) = nil _nErr += 1 } - if (((*TVdbe)(_pParse.X2) != nil) && ((_pParse.X16) > i32(0))) && (int32(_pParse.X6) == i32(0)) { + if ((_pParse.X2 != nil) && (_pParse.X16 > i32(0))) && (int32(_pParse.X6) == i32(0)) { _sqlite3VdbeDelete(tls, (*TVdbe)(_pParse.X2)) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X2))))) = nil + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X2)))) = nil } if int32(_pParse.X6) == i32(0) { _sqlite3DbFree(tls, _db, _pParse.X37) - *(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X37))))) = nil - *(*int32)(unsafe.Pointer(&(_pParse.X36))) = i32(0) + *(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X37)))) = nil + *(*int32)(unsafe.Pointer(&_pParse.X36)) = i32(0) } - Xsqlite3_free(tls, (unsafe.Pointer)(_pParse.X67)) - if (_pParse.X55) == 0 { + Xsqlite3_free(tls, unsafe.Pointer(_pParse.X67)) + if _pParse.X55 == 0 { _sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.X63)) } - if (*XWith)(_pParse.X71) != nil { + if _pParse.X71 != nil { _sqlite3WithDelete(tls, _db, (*XWith)(_pParse.X71)) } _sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_pParse.X64)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse.X60)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.X60)) _46: - if (*TAggInfo_func)(_pParse.X38) != nil { + if _pParse.X38 != nil { _19_p = (*TAggInfo_func)(_pParse.X38) - *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X38))))) = (*TAggInfo_func)(_19_p.X0) - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_19_p)) + *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X38)))) = (*TAggInfo_func)(_19_p.X0) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_19_p)) goto _46 } _47: - if (*XTable)(_pParse.X68) != nil { + if _pParse.X68 != nil { _20_p = (*XTable)(_pParse.X68) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X68))))) = (*XTable)(_20_p.X21) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X68)))) = (*XTable)(_20_p.X21) _sqlite3DeleteTable(tls, _db, _20_p) goto _47 } func() { - if _nErr != i32(0) && (_pParse.X3) == i32(0) { + if _nErr != i32(0) && _pParse.X3 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140079), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24792))) crt.X__builtin_abort(tls) } @@ -25139,30 +26602,35 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RunParserØ00__func__Ø000[0], str(24825), 17) } -// Initialize a new parser that has already been allocated. +// C comment +// /* Initialize a new parser that has already been allocated. +// */ func _sqlite3ParserInit(tls *crt.TLS, _yypParser unsafe.Pointer) { var _pParser *XyyParser _pParser = (*XyyParser)(_yypParser) - *(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParser.X0))))) = (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))) - *(*uint16)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))) + 32*uintptr(i32(0)))).X0))) = uint16(i32(0)) - *(*uint8)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))) + 32*uintptr(i32(0)))).X1))) = uint8(i32(0)) -} - -// Add an error message to pParse->zErrMsg and increment pParse->nErr. -// The following formatting characters are allowed: -// -// %s Insert a string -// %z A string that should be freed after use -// %d Insert an integer -// %T Insert a token -// %S Insert the first element of a SrcList -// -// This function should be used to report any error that occurs while -// compiling an SQL statement (i.e. within sqlite3_prepare()). The -// last thing the sqlite3_prepare() function does is copy the error -// stored by this function into the database handle using sqlite3Error(). -// Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used -// during statement execution (sqlite3_step() etc.). + *(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParser.X0)))) = (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_pParser.X2)))) + *(*uint16)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_pParser.X2)))) + 32*uintptr(i32(0)))).X0))) = uint16(i32(0)) + *(*uint8)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_pParser.X2)))) + 32*uintptr(i32(0)))).X1))) = uint8(i32(0)) +} + +// C comment +// /* +// ** Add an error message to pParse->zErrMsg and increment pParse->nErr. +// ** The following formatting characters are allowed: +// ** +// ** %s Insert a string +// ** %z A string that should be freed after use +// ** %d Insert an integer +// ** %T Insert a token +// ** %S Insert the first element of a SrcList +// ** +// ** This function should be used to report any error that occurs while +// ** compiling an SQL statement (i.e. within sqlite3_prepare()). The +// ** last thing the sqlite3_prepare() function does is copy the error +// ** stored by this function into the database handle using sqlite3Error(). +// ** Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used +// ** during statement execution (sqlite3_step() etc.). +// */ func _sqlite3ErrorMsg(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) { var _zMsg *int8 var _ap []interface{} @@ -25171,35 +26639,37 @@ func _sqlite3ErrorMsg(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...int _ap = args _zMsg = _sqlite3VMPrintf(tls, _db, _zFormat, _ap) _ap = nil - if (_db.X21) != 0 { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zMsg)) + if _db.X21 != 0 { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zMsg)) goto _1 } - *(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1 - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse.X1)) - *(**int8)(unsafe.Pointer(&(_pParse.X1))) = _zMsg - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X16)) += 1 + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse.X1)) + *(**int8)(unsafe.Pointer(&_pParse.X1)) = _zMsg + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(1) _1: } -// The main parser program. -// The first argument is a pointer to a structure obtained from -// "sqlite3ParserAlloc" which describes the current state of the parser. -// The second argument is the major token number. The third is -// the minor token. The fourth optional argument is whatever the -// user wants (and specified in the grammar) and is available for -// use by the action routines. -// -// Inputs: -// <ul> -// <li> A pointer to the parser (an opaque structure.) -// <li> The major token number. -// <li> The minor token number. -// <li> An option argument of a grammar-specified type. -// </ul> -// -// Outputs: -// None. +// C comment +// /* The main parser program. +// ** The first argument is a pointer to a structure obtained from +// ** "sqlite3ParserAlloc" which describes the current state of the parser. +// ** The second argument is the major token number. The third is +// ** the minor token. The fourth optional argument is whatever the +// ** user wants (and specified in the grammar) and is available for +// ** use by the action routines. +// ** +// ** Inputs: +// ** <ul> +// ** <li> A pointer to the parser (an opaque structure.) +// ** <li> The major token number. +// ** <li> The minor token number. +// ** <li> An option argument of a grammar-specified type. +// ** </ul> +// ** +// ** Outputs: +// ** None. +// */ func _sqlite3Parser(tls *crt.TLS, _yyp unsafe.Pointer, _yymajor int32, _yyminor XToken, _pParse *XParse) { var _7_cDiv int8 var _yyact uint32 @@ -25213,9 +26683,9 @@ func _sqlite3Parser(tls *crt.TLS, _yyp unsafe.Pointer, _yymajor int32, _yyminor crt.X__builtin_abort(tls) } }() - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X1)))) = _pParse if _yyTraceFILE != nil { - crt.Xfprintf(tls, _yyTraceFILE, str(24862), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_yymajor))))) + crt.Xfprintf(tls, _yyTraceFILE, str(24862), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_yymajor))))) } _2: _yyact = _yy_find_shift_action(tls, _yypParser, uint8(_yymajor)) @@ -25242,7 +26712,7 @@ _2: _yy_destructor(tls, _yypParser, uint8(_yymajor), &_yyminorunion) _yymajor = i32(252) _7: - if (_yymajor != i32(252)) && (crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))))) { + if (_yymajor != i32(252)) && (crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2))))))) { goto _2 } if _yyTraceFILE == nil { @@ -25250,12 +26720,12 @@ _7: } _7_cDiv = i8(91) crt.Xfprintf(tls, _yyTraceFILE, str(24918), unsafe.Pointer(_yyTracePrompt)) - _7_i = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))) + 32*uintptr(i32(1)))) + _7_i = (*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2)))) + 32*uintptr(i32(1)))) _13: if crt.P2U(unsafe.Pointer(_7_i)) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) { goto _16 } - crt.Xfprintf(tls, _yyTraceFILE, str(24935), int32(_7_cDiv), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_7_i.X1))))) + crt.Xfprintf(tls, _yyTraceFILE, str(24935), int32(_7_cDiv), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_7_i.X1))))) _7_cDiv = int8(i32(32)) *(*uintptr)(unsafe.Pointer(&_7_i)) += uintptr(32) goto _13 @@ -25281,8 +26751,11 @@ func init() { _yyTokenName = [251]*int8{str(24957), str(24959), str(24964), str(24972), str(24978), str(24983), str(24989), str(25001), str(25010), str(25020), str(25030), str(25037), str(25041), str(25050), str(25060), str(25068), str(25071), str(25077), str(25084), str(25087), str(25091), str(25098), str(25103), str(25106), str(25109), str(25112), str(25120), str(25126), str(25129), str(25135), str(25142), str(25148), str(25156), str(25160), str(25167), str(25174), str(25177), str(25185), str(25190), str(25199), str(25208), str(25217), str(25222), str(25229), str(25234), str(25239), str(25243), str(25250), str(25260), str(25268), str(25276), str(25282), str(25285), str(25289), str(25292), str(25299), str(25306), str(25312), str(25322), str(25330), str(25339), str(25343), str(25351), str(25358), str(25363), str(25371), str(25376), str(25384), str(25391), str(25400), str(25404), str(25407), str(25411), str(25414), str(25422), str(25425), str(25432), str(25440), str(25443), str(25446), str(25449), str(25452), str(25455), str(25458), str(25465), str(25472), str(25478), str(25485), str(25492), str(25497), str(25503), str(25508), str(25514), str(25518), str(25525), str(25533), str(25540), str(25548), str(25555), str(25563), str(25574), str(155), str(25582), str(25590), str(25597), str(25603), str(25614), str(25623), str(25626), str(25633), str(25640), str(25647), str(25651), str(25662), str(25670), str(25675), str(25681), str(25685), str(25692), str(25702), str(25709), str(25716), str(25725), str(25729), str(25734), str(25739), str(25745), str(25751), str(25757), str(25764), str(25770), str(25776), str(25781), str(25787), str(25792), str(25800), str(25809), str(25814), str(25819), str(25824), str(25829), str(25835), str(25841), str(25845), str(25851), str(25857), str(25865), str(23861), str(25870), str(25875), str(25879), str(25889), str(25899), str(25902), str(25916), str(25929), str(25947), str(23842), str(25956), str(25968), str(25973), str(25984), str(25997), str(26011), str(26018), str(26029), str(26038), str(26048), str(26057), str(26064), str(26073), str(26083), str(26089), str(26094), str(26099), str(26106), str(26116), str(26124), str(26136), str(26144), str(26160), str(26167), str(26174), str(26197), str(26206), str(26217), str(26223), str(26232), str(26240), str(26260), str(26267), str(26279), str(26289), str(26298), str(26307), str(26320), str(26330), str(26335), str(26350), str(26359), str(26370), str(26375), str(26385), str(26397), str(26408), str(26420), str(26430), str(26437), str(26447), str(26456), str(26461), str(26464), str(26475), str(26486), str(26493), str(26505), str(26512), str(26522), str(26529), str(26537), str(26548), str(26559), str(26566), str(26577), str(26583), str(26598), str(26611), str(26625), str(26635), str(26646), str(26654), str(26660), str(26673), str(26690), str(26703), str(26717), str(26732), str(26744), str(26756), str(26761), str(26769), str(26785), str(26793), str(26813), str(26826), str(26838), str(26850), str(26858), str(26871), str(26874), str(26882)} } -// Find the appropriate action for a parser given the terminal -// look-ahead token iLookAhead. +// C comment +// /* +// ** Find the appropriate action for a parser given the terminal +// ** look-ahead token iLookAhead. +// */ func _yy_find_shift_action(tls *crt.TLS, _pParser *XyyParser, _iLookAhead uint8) (r0 uint32) { var _i, _stateno, _5_j int32 var _2_iFallback uint8 @@ -25297,7 +26770,7 @@ func _yy_find_shift_action(tls *crt.TLS, _pParser *XyyParser, _iLookAhead uint8) } }() _3: - _i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_shift_ofst)) + 2*uintptr(_stateno)))) + _i = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_shift_ofst)) + 2*uintptr(_stateno)))) func() { if int32(_iLookAhead) == i32(252) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137124), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000))), unsafe.Pointer(str(26915))) @@ -25309,17 +26782,17 @@ _3: *p = (*p) + int32(_iLookAhead) sink1(*p) } - if _i >= i32(0) && _i < i32(1566) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_i)))) == int32(_iLookAhead) { + if _i >= i32(0) && _i < i32(1566) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_lookahead)) + 1*uintptr(_i)))) == int32(_iLookAhead) { goto _8 } - if uint64(_iLookAhead) >= u64(69) || int32(store2(&_2_iFallback, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyFallback)) + 1*uintptr(_iLookAhead))))) == i32(0) { + if uint64(_iLookAhead) >= u64(69) || int32(store2(&_2_iFallback, *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyFallback)) + 1*uintptr(_iLookAhead))))) == i32(0) { goto _10 } if _yyTraceFILE != nil { - crt.Xfprintf(tls, _yyTraceFILE, str(26936), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_2_iFallback))))) + crt.Xfprintf(tls, _yyTraceFILE, str(26936), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_2_iFallback))))) } func() { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyFallback)) + 1*uintptr(_2_iFallback)))) != i32(0) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyFallback)) + 1*uintptr(_2_iFallback)))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137137), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000))), unsafe.Pointer(str(26957))) crt.X__builtin_abort(tls) } @@ -25328,19 +26801,19 @@ _3: goto _3 _10: _5_j = (_i - int32(_iLookAhead)) + i32(69) - if _5_j < i32(0) || _5_j >= i32(1566) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_5_j)))) != i32(69) || int32(_iLookAhead) <= i32(0) { + if _5_j < i32(0) || _5_j >= i32(1566) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_lookahead)) + 1*uintptr(_5_j)))) != i32(69) || int32(_iLookAhead) <= i32(0) { goto _17 } if _yyTraceFILE != nil { - crt.Xfprintf(tls, _yyTraceFILE, str(26982), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(i32(69)))))) + crt.Xfprintf(tls, _yyTraceFILE, str(26982), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(i32(69)))))) } - return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_5_j)))) + return uint32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_action)) + 2*uintptr(_5_j)))) _17: - return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_default)) + 2*uintptr(_stateno)))) + return uint32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_default)) + 2*uintptr(_stateno)))) _8: - return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_i)))) + return uint32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_action)) + 2*uintptr(_i)))) } var _yy_find_shift_actionØ00__func__Ø000 [21]int8 @@ -25379,12 +26852,15 @@ func init() { _yy_default = [456]uint16{u16(1280), u16(1270), u16(1270), u16(1270), u16(1202), u16(1202), u16(1202), u16(1202), u16(1270), u16(1096), u16(1125), u16(1125), u16(1254), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1201), u16(1332), u16(1332), u16(1332), u16(1332), u16(1270), u16(1100), u16(1131), u16(1332), u16(1332), u16(1332), u16(1332), u16(1203), u16(1204), u16(1332), u16(1332), u16(1332), u16(1253), u16(1255), u16(1141), u16(1140), u16(1139), u16(1138), u16(1236), u16(1112), u16(1136), u16(1129), u16(1133), u16(1203), u16(1197), u16(1198), u16(1196), u16(1200), u16(1204), u16(1332), u16(1132), u16(1167), u16(1181), u16(1166), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1175), u16(1180), u16(1187), u16(1179), u16(1176), u16(1169), u16(1168), u16(1170), u16(1171), u16(1332), u16(1019), u16(1067), u16(1332), u16(1332), u16(1332), u16(1172), u16(1332), u16(1173), u16(1184), u16(1183), u16(1182), u16(1261), u16(1288), u16(1287), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1280), u16(1270), u16(1025), u16(1025), u16(1332), u16(1270), u16(1270), u16(1270), u16(1270), u16(1270), u16(1270), u16(1266), u16(1100), u16(1091), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1258), u16(1256), u16(1332), u16(1217), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1096), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1282), u16(1332), u16(1231), u16(1096), u16(1096), u16(1096), u16(1098), u16(1080), u16(1090), u16(1004), u16(1135), u16(1114), u16(1114), u16(1321), u16(1135), u16(1321), u16(1042), u16(1302), u16(1039), u16(1125), u16(1114), u16(1199), u16(1125), u16(1125), u16(1097), u16(1090), u16(1332), u16(1324), u16(1105), u16(1105), u16(1323), u16(1323), u16(1105), u16(1146), u16(1070), u16(1135), u16(1076), u16(1076), u16(1076), u16(1076), u16(1105), u16(1016), u16(1135), u16(1146), u16(1070), u16(1070), u16(1135), u16(1105), u16(1016), u16(1235), u16(1318), u16(1105), u16(1105), u16(1016), u16(1210), u16(1105), u16(1016), u16(1105), u16(1016), u16(1210), u16(1068), u16(1068), u16(1068), u16(1057), u16(1210), u16(1068), u16(1042), u16(1068), u16(1057), u16(1068), u16(1068), u16(1118), u16(1113), u16(1118), u16(1113), u16(1118), u16(1113), u16(1118), u16(1113), u16(1105), u16(1205), u16(1105), u16(1332), u16(1210), u16(1214), u16(1214), u16(1210), u16(1130), u16(1119), u16(1128), u16(1126), u16(1135), u16(1022), u16(1060), u16(1285), u16(1285), u16(1281), u16(1281), u16(1281), u16(1281), u16(1329), u16(1329), u16(1266), u16(1297), u16(1297), u16(1044), u16(1044), u16(1297), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1292), u16(1332), u16(1219), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1152), u16(1332), u16(1000), u16(1263), u16(1332), u16(1332), u16(1262), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1320), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1234), u16(1233), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1082), u16(1332), u16(1332), u16(1332), u16(1306), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1127), u16(1332), u16(1120), u16(1332), u16(1332), u16(1311), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1272), u16(1332), u16(1332), u16(1332), u16(1271), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1154), u16(1332), u16(1153), u16(1157), u16(1332), u16(1010), u16(1332)} } -// Perform a shift action. +// C comment +// /* +// ** Perform a shift action. +// */ func _yy_shift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32, _yyMajor int32, _yyMinor XToken) { var _yytos *XyyStackEntry - *(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))))) += uintptr(32) - if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))+32*uintptr(i32(100)))))) { - *(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))))) += uintptr(18446744073709551584) + *(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X0)))))) += uintptr(32) + if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2))))+32*uintptr(i32(100)))))) { + *(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X0)))))) += uintptr(18446744073709551584) _yyStackOverflow(tls, _yypParser) return } @@ -25396,13 +26872,16 @@ func _yy_shift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32, _yyMajor } } _yytos = (*XyyStackEntry)(_yypParser.X0) - *(*uint16)(unsafe.Pointer(&(_yytos.X0))) = uint16(_yyNewState) - *(*uint8)(unsafe.Pointer(&(_yytos.X1))) = uint8(_yyMajor) - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&(_yytos.X2))))) = _yyMinor + *(*uint16)(unsafe.Pointer(&_yytos.X0)) = uint16(_yyNewState) + *(*uint8)(unsafe.Pointer(&_yytos.X1)) = uint8(_yyMajor) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&_yytos.X2)))) = _yyMinor _yyTraceShift(tls, _yypParser, _yyNewState) } -// The following routine is called if the stack overflows. +// C comment +// /* +// ** The following routine is called if the stack overflows. +// */ func _yyStackOverflow(tls *crt.TLS, _yypParser *XyyParser) { var _pParse *XParse _pParse = (*XParse)(_yypParser.X1) @@ -25410,18 +26889,21 @@ func _yyStackOverflow(tls *crt.TLS, _yypParser *XyyParser) { crt.Xfprintf(tls, _yyTraceFILE, str(27024), unsafe.Pointer(_yyTracePrompt)) } _0: - if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))))) { + if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2)))))) { _yy_pop_parser_stack(tls, _yypParser) goto _0 } _sqlite3ErrorMsg(tls, _pParse, str(27043)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X1)))) = _pParse } -// Pop the parser's stack once. -// -// If there is a destructor routine associated with the token which -// is popped from the stack, then call it. +// C comment +// /* +// ** Pop the parser's stack once. +// ** +// ** If there is a destructor routine associated with the token which +// ** is popped from the stack, then call it. +// */ func _yy_pop_parser_stack(tls *crt.TLS, _pParser *XyyParser) { var _yytos *XyyStackEntry func() { @@ -25431,16 +26913,16 @@ func _yy_pop_parser_stack(tls *crt.TLS, _pParser *XyyParser) { } }() func() { - if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) <= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))))) { + if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) <= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_pParser.X2)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137055), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_pop_parser_stackØ00__func__Ø000))), unsafe.Pointer(str(27083))) crt.X__builtin_abort(tls) } }() - _yytos = postInc34((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParser.X0))))), -32) + _yytos = postInc34((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParser.X0)))), -32) if _yyTraceFILE != nil { - crt.Xfprintf(tls, _yyTraceFILE, str(27117), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr(_yytos.X1))))) + crt.Xfprintf(tls, _yyTraceFILE, str(27117), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr(_yytos.X1))))) } - _yy_destructor(tls, _pParser, _yytos.X1, (*XYYMINORTYPE)(unsafe.Pointer(&(_yytos.X2)))) + _yy_destructor(tls, _pParser, _yytos.X1, (*XYYMINORTYPE)(unsafe.Pointer(&_yytos.X2))) } var _yy_pop_parser_stackØ00__func__Ø000 [20]int8 @@ -25449,12 +26931,14 @@ func init() { crt.Xstrncpy(nil, &_yy_pop_parser_stackØ00__func__Ø000[0], str(27131), 20) } -// The following function deletes the "minor type" or semantic value -// associated with a symbol. The symbol can be either a terminal -// or nonterminal. "yymajor" is the symbol code, and "yypminor" is -// a pointer to the value to be deleted. The code used to do the -// deletions is derived from the %destructor and/or %token_destructor -// directives of the input grammar. +// C comment +// /* The following function deletes the "minor type" or semantic value +// ** associated with a symbol. The symbol can be either a terminal +// ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is +// ** a pointer to the value to be deleted. The code used to do the +// ** deletions is derived from the %destructor and/or %token_destructor +// ** directives of the input grammar. +// */ func _yy_destructor(tls *crt.TLS, _yypParser *XyyParser, _yymajor uint8, _yypminor *XYYMINORTYPE) { var _pParse *XParse _pParse = (*XParse)(_yypParser.X1) @@ -25574,16 +27058,19 @@ func _yyTraceShift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32) { goto _0 } if _yyNewState < i32(456) { - crt.Xfprintf(tls, _yyTraceFILE, str(27151), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr((*XyyStackEntry)(_yypParser.X0).X1)))), _yyNewState) + crt.Xfprintf(tls, _yyTraceFILE, str(27151), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr((*XyyStackEntry)(_yypParser.X0).X1)))), _yyNewState) goto _2 } - crt.Xfprintf(tls, _yyTraceFILE, str(27181), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 8*uintptr((*XyyStackEntry)(_yypParser.X0).X1))))) + crt.Xfprintf(tls, _yyTraceFILE, str(27181), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyTokenName)) + 8*uintptr((*XyyStackEntry)(_yypParser.X0).X1))))) _2: _0: } -// Perform a reduce action and the shift that must immediately -// follow the reduce. +// C comment +// /* +// ** Perform a reduce action and the shift that must immediately +// ** follow the reduce. +// */ func _yy_reduce(tls *crt.TLS, _yypParser *XyyParser, _yyruleno uint32) { var _yygoto, _yyact, _yysize, _81_i, _163_bNot, _164_bNot int32 var _147_n uint32 @@ -25602,13 +27089,13 @@ func _yy_reduce(tls *crt.TLS, _yypParser *XyyParser, _yyruleno uint32) { _pParse = (*XParse)(_yypParser.X1) _yymsp = (*XyyStackEntry)(_yypParser.X0) if (_yyTraceFILE != nil) && (_yyruleno < uint32(i32(332))) { - _yysize = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1) - crt.Xfprintf(tls, _yyTraceFILE, str(27195), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleName)) + 8*uintptr(_yyruleno)))), int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(-_yysize))).X0)) + _yysize = int32((*t35)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1) + crt.Xfprintf(tls, _yyTraceFILE, str(27195), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyRuleName)) + 8*uintptr(_yyruleno)))), int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(-_yysize))).X0)) } - if int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo))+2*uintptr(_yyruleno))).X1) != i32(0) { + if int32((*t35)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyRuleInfo))+2*uintptr(_yyruleno))).X1) != i32(0) { goto _2 } - if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))+32*uintptr(i32(99)))))) { + if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2))))+32*uintptr(i32(99)))))) { _yyStackOverflow(tls, _yypParser) return } @@ -26169,22 +27656,22 @@ _2: } _5: - *(*uint8)(unsafe.Pointer(&(_pParse.X54))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X54)) = uint8(i32(1)) goto _281 _6: - *(*uint8)(unsafe.Pointer(&(_pParse.X54))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pParse.X54)) = uint8(i32(2)) goto _281 _7: _sqlite3FinishCoding(tls, _pParse) goto _281 _8: - _sqlite3BeginTransaction(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3BeginTransaction(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _9: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(7) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(7) goto _281 _10: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X1) goto _281 _13: _sqlite3CommitTransaction(tls, _pParse) @@ -26193,208 +27680,208 @@ _15: _sqlite3RollbackTransaction(tls, _pParse) goto _281 _16: - _sqlite3Savepoint(tls, _pParse, i32(0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Savepoint(tls, _pParse, i32(0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _17: - _sqlite3Savepoint(tls, _pParse, i32(1), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Savepoint(tls, _pParse, i32(1), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _18: - _sqlite3Savepoint(tls, _pParse, i32(2), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Savepoint(tls, _pParse, i32(2), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _19: - _sqlite3StartTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), i32(0), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + _sqlite3StartTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), i32(0), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) goto _281 _20: _disableLookaside(tls, _pParse) goto _281 _21: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) goto _281 _30: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = i32(1) goto _281 _31: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) goto _281 _33: - _sqlite3EndTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), nil) + _sqlite3EndTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), nil) goto _281 _34: - _sqlite3EndTable(tls, _pParse, nil, nil, uint8(i32(0)), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) - _sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3EndTable(tls, _pParse, nil, nil, uint8(i32(0)), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _35: - if (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) == uint32(i32(5))) && (Xsqlite3_strnicmp(tls, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X0, str(27227), i32(5)) == i32(0)) { - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(96) + if (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) == uint32(i32(5))) && (Xsqlite3_strnicmp(tls, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X0, str(27227), i32(5)) == i32(0)) { + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(96) goto _284 } - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) - _sqlite3ErrorMsg(tls, _pParse, str(27233), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1, unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) + _sqlite3ErrorMsg(tls, _pParse, str(27233), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1, unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) _284: goto _281 _36: - _sqlite3AddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3AddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _37: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0)) - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))) = nil + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0)) + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))) = nil goto _281 _40: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))) / 1))) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))) / 1))) goto _281 _41: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))) / 1))) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))) / 1))) goto _281 _42: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) + uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-1)))).X2))))).X0)))/1))) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) + uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-1)))).X2))))).X0)))/1))) goto _281 _43: - *(*XToken)(unsafe.Pointer(&(_pParse.X28))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*XToken)(unsafe.Pointer(&_pParse.X28)) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) goto _281 _45: - _sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _47: - _sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _48: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_34_v.X0))))) = _sqlite3PExpr(tls, _pParse, i32(155), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), nil) - *(**int8)(unsafe.Pointer(&(_34_v.X1))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0 - *(**int8)(unsafe.Pointer(&(_34_v.X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_34_v.X0)))) = _sqlite3PExpr(tls, _pParse, i32(155), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), nil) + *(**int8)(unsafe.Pointer(&_34_v.X1)) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0 + *(**int8)(unsafe.Pointer(&_34_v.X2)) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 _sqlite3AddDefaultValue(tls, _pParse, &_34_v) goto _281 _49: - _spanExpr(tls, &_35_v, _pParse, i32(97), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanExpr(tls, &_35_v, _pParse, i32(97), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) _sqlite3AddDefaultValue(tls, _pParse, &_35_v) goto _281 _50: - _sqlite3AddNotNull(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3AddNotNull(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _51: - _sqlite3AddPrimaryKey(tls, _pParse, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + _sqlite3AddPrimaryKey(tls, _pParse, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) goto _281 _52: - _sqlite3CreateIndex(tls, _pParse, nil, nil, nil, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1))) + _sqlite3CreateIndex(tls, _pParse, nil, nil, nil, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1))) goto _281 _53: - _sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + _sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) goto _281 _54: - _sqlite3CreateForeignKey(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3CreateForeignKey(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _55: - _sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _56: - _sqlite3AddCollateType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3AddCollateType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _57: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) goto _281 _58: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) & (^((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))) | ((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) & (^((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))) | ((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _59: - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))) = i32(0) - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = i32(0) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))) = i32(0) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = i32(0) goto _281 _60: - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = i32(0) - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(0) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = i32(0) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(0) goto _281 _61: - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(255) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(255) goto _281 _62: - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) << uint(i32(8)) - *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(65280) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) << uint(i32(8)) + *(*int32)(unsafe.Pointer(&((*Xsqlite3_debug_mutex)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))) = i32(65280) goto _281 _63: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(7) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(7) goto _281 _64: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(8) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(8) goto _281 _65: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(9) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(9) goto _281 _66: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(6) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(6) goto _281 _67: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) goto _281 _68: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = i32(0) goto _281 _69: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) goto _281 _72: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(1) goto _281 _77: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(0) goto _281 _78: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X28)).X1))) = uint32(i32(0)) goto _281 _79: - _sqlite3AddPrimaryKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(0)) + _sqlite3AddPrimaryKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(0)) goto _281 _80: - _sqlite3CreateIndex(tls, _pParse, nil, nil, nil, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1))) + _sqlite3CreateIndex(tls, _pParse, nil, nil, nil, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1))) goto _281 _81: - _sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + _sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) goto _281 _82: - _sqlite3CreateForeignKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - _sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3CreateForeignKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _83: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(10) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(10) goto _281 _85: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) goto _281 _86: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(4) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(4) goto _281 _87: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(5) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(5) goto _281 _89: - _sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _90: - _sqlite3CreateView(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) + _sqlite3CreateView(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) goto _281 _91: - _sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(1), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(1), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _92: _70_dest = XSelectDest{X0: u8(9), X1: nil, X2: i32(0), X3: i32(0), X4: i32(0), X5: nil} - _sqlite3Select(tls, _pParse, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), &_70_dest) - _sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3Select(tls, _pParse, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), &_70_dest) + _sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _93: - _71_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _71_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) if _71_p != nil { - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_71_p.X17))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_71_p.X17)))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) _parserDoubleLinkSelect(tls, _pParse, _71_p) goto _286 } - _sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.X0), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.X0), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) _286: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _71_p + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _71_p goto _281 _94: - _74_pRhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _74_pLhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) - if (_74_pRhs != nil) && ((*XSelect)(_74_pRhs.X13) != nil) { - *(*uint32)(unsafe.Pointer(&(_75_x.X1))) = uint32(i32(0)) + _74_pRhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _74_pLhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + if (_74_pRhs != nil) && (_74_pRhs.X13 != nil) { + *(*uint32)(unsafe.Pointer(&_75_x.X1)) = uint32(i32(0)) _parserDoubleLinkSelect(tls, _pParse, _74_pRhs) _75_pFrom = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_75_x, _74_pRhs, nil, nil) _74_pRhs = _sqlite3SelectNew(tls, _pParse, nil, _75_pFrom, nil, nil, nil, nil, uint32(i32(0)), nil, nil) @@ -26402,8 +27889,8 @@ _94: if _74_pRhs == nil { goto _289 } - *(*uint8)(unsafe.Pointer(&(_74_pRhs.X1))) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_74_pRhs.X13))))) = _74_pLhs + *(*uint8)(unsafe.Pointer(&_74_pRhs.X1)) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_74_pRhs.X13)))) = _74_pLhs if func() int32 { if _74_pLhs != nil { return i32(1) @@ -26415,75 +27902,75 @@ _94: }() }() != 0 { { - p := (*uint32)(unsafe.Pointer(&(_74_pLhs.X3))) + p := (*uint32)(unsafe.Pointer(&_74_pLhs.X3)) *p = (*p) & uint32(i32(-1025)) sink5(*p) } } { - p := (*uint32)(unsafe.Pointer(&(_74_pRhs.X3))) + p := (*uint32)(unsafe.Pointer(&_74_pRhs.X3)) *p = (*p) & uint32(i32(-1025)) sink5(*p) } - if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != i32(116) { - *(*uint8)(unsafe.Pointer(&(_pParse.X10))) = uint8(i32(1)) + if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != i32(116) { + *(*uint8)(unsafe.Pointer(&_pParse.X10)) = uint8(i32(1)) } goto _294 _289: _sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), _74_pLhs) _294: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _74_pRhs + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _74_pRhs goto _281 _95: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X1) goto _281 _97: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(116) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(116) goto _281 _98: - _80_s = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2))))) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), uint32(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1)) - if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))) == nil { + _80_s = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2))))) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), uint32(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1)) + if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))) == nil { goto _295 } _81_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_80_s.X0)) + uintptr(i32(6)))) - Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))).X6))))), str(27260), preInc1((*int32)(unsafe.Pointer(&(_pParse.X34))), 1)) + Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))).X6))))), str(27260), preInc1((*int32)(unsafe.Pointer(&_pParse.X34)), 1)) _296: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) == i32(32) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_z)) + 1*uintptr(i32(0))))) == i32(32) { *(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1) goto _296 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(1))))) != i32(42) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_z)) + 1*uintptr(i32(0))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_z)) + 1*uintptr(i32(1))))) != i32(42) { goto _299 } { p := &_81_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink0(*p) } _300: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) == i32(32) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_z)) + 1*uintptr(i32(0))))) == i32(32) { *(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1) goto _300 } _81_i = i32(0) _302: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(_81_i)))))))) & i32(6)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_z)) + 1*uintptr(_81_i)))))))) & i32(6)) == 0 { goto _305 } _81_i += 1 goto _302 _305: - Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))).X6))))), str(27264), _81_i, unsafe.Pointer(_81_z)) + Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))).X6))))), str(27264), _81_i, unsafe.Pointer(_81_z)) _299: _295: goto _281 _99: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(512)), nil, nil) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(512)), nil, nil) goto _281 _100: - _85_pLeft = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - _85_pRight = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(1536)), nil, nil) + _85_pLeft = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + _85_pRight = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(1536)), nil, nil) if func() int32 { if _85_pLeft != nil { return i32(1) @@ -26495,59 +27982,59 @@ _100: }() }() != 0 { { - p := (*uint32)(unsafe.Pointer(&(_85_pLeft.X3))) + p := (*uint32)(unsafe.Pointer(&_85_pLeft.X3)) *p = (*p) & uint32(i32(-1025)) sink5(*p) } } if _85_pRight != nil { - *(*uint8)(unsafe.Pointer(&(_85_pRight.X1))) = uint8(i32(116)) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_85_pRight.X13))))) = _85_pLeft - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _85_pRight + *(*uint8)(unsafe.Pointer(&_85_pRight.X1)) = uint8(i32(116)) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_85_pRight.X13)))) = _85_pLeft + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _85_pRight goto _310 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _85_pLeft + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _85_pLeft _310: goto _281 _101: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) goto _281 _102: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(2) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(2) goto _281 _103: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _109: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) - if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) > uint32(i32(0)) { - _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) > uint32(i32(0)) { + _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) } - _sqlite3ExprListSetSpan(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3ExprListSetSpan(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _110: _92_p = _sqlite3Expr(tls, (*Xsqlite3)(_pParse.X0), i32(161), nil) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), _92_p) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), _92_p) goto _281 _111: _93_pRight = _sqlite3PExpr(tls, _pParse, i32(161), nil, nil) - _93_pLeft = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) + _93_pLeft = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) _93_pDot = _sqlite3PExpr(tls, _pParse, i32(122), _93_pLeft, _93_pRight) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), _93_pDot) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), _93_pDot) goto _281 _112: - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) goto _281 _116: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), u64(120))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), u64(120))) goto _281 _117: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) goto _281 _118: if func() int32 { - if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil) && (((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) > i32(0)) { + if ((*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil) && (((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) > i32(0)) { return i32(1) } return func() int32 { @@ -26556,379 +28043,379 @@ _118: return i32(0) }() }() != 0 { - *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 112*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0)-i32(1)))).X9))).X0))) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 112*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0)-i32(1)))).X9))).X0))) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) } goto _281 _119: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _120: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) - _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) goto _281 _121: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) - _sqlite3SrcListFuncArgs(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3SrcListFuncArgs(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) goto _281 _122: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _123: - if ((((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) == nil) && (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1) == uint32(i32(0)))) && ((*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil)) && ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) == nil) { - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + if ((((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) == nil) && (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1) == uint32(i32(0)))) && ((*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil)) && ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) == nil) { + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) goto _323 } - if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))).X0) != i32(1) { + if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))).X0) != i32(1) { goto _321 } - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) - if (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) != nil { - _105_pNew = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))).X2))))) + 112*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))).X0)-i32(1)))) - _105_pOld = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))).X2))))) - *(**int8)(unsafe.Pointer(&(_105_pNew.X2))) = _105_pOld.X2 - *(**int8)(unsafe.Pointer(&(_105_pNew.X1))) = _105_pOld.X1 - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_105_pNew.X5))))) = (*XSelect)(_105_pOld.X5) - *(**int8)(unsafe.Pointer(&(_105_pOld.X2))) = store0((**int8)(unsafe.Pointer(&(_105_pOld.X1))), nil) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_105_pOld.X5))))) = nil - } - _sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + if (*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) != nil { + _105_pNew = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))).X2))))) + 112*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))).X0)-i32(1)))) + _105_pOld = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))).X2))))) + *(**int8)(unsafe.Pointer(&_105_pNew.X2)) = _105_pOld.X2 + *(**int8)(unsafe.Pointer(&_105_pNew.X1)) = _105_pOld.X1 + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_105_pNew.X5)))) = (*XSelect)(_105_pOld.X5) + *(**int8)(unsafe.Pointer(&_105_pOld.X2)) = store0((**int8)(unsafe.Pointer(&_105_pOld.X1)), nil) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_105_pOld.X5)))) = nil + } + _sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) goto _323 _321: - _sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) - _106_pSubquery = _sqlite3SelectNew(tls, _pParse, nil, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), nil, nil, nil, nil, uint32(i32(2048)), nil, nil) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), _106_pSubquery, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) + _106_pSubquery = _sqlite3SelectNew(tls, _pParse, nil, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), nil, nil, nil, nil, uint32(i32(2048)), nil, nil) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), _106_pSubquery, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) _323: goto _281 _124: - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))) = nil - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0)) + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))) = nil + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0)) goto _281 _126: - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _127: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) goto _281 _128: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), nil, nil) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), nil, nil) goto _281 _129: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), nil) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), nil) goto _281 _130: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _131: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _135: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _140: - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) goto _281 _141: - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))) = nil - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = uint32(i32(1)) + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))) = nil + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = uint32(i32(1)) goto _281 _142: - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _143: - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _145: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _147: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) - _sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + _sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _148: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) - _sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + _sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _149: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(0) goto _281 _150: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) goto _281 _151: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(-1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(-1) goto _281 _152: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X0))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))).X1))))) = nil goto _281 _153: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))))) = nil goto _281 _154: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _155: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _156: - _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), uint8(i32(1))) - _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - _sqlite3DeleteFrom(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), uint8(i32(1))) + _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DeleteFrom(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _157: - _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), uint8(i32(1))) - _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) - _sqlite3ExprListCheckLength(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), str(27269)) - _sqlite3Update(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) + _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), uint8(i32(1))) + _sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) + _sqlite3ExprListCheckLength(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), str(27269)) + _sqlite3Update(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) goto _281 _158: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) - _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) goto _281 _159: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _160: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) - _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))) goto _281 _161: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _162: - _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), uint8(i32(1))) - _sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))), uint8(i32(1))) + _sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) goto _281 _163: - _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), uint8(i32(1))) - _sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) + _sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))), uint8(i32(1))) + _sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2)))))) goto _281 _164: - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _165: - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _166: - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _167: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0) goto _281 _168: - _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X1), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X1), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _171: - _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, i32(27), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, i32(27), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _173: - _143_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) - _143_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _143_temp1, _143_temp2) + _143_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) + _143_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _143_temp1, _143_temp2) goto _281 _174: - _144_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), i32(1)) - _144_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) - _144_temp3 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + _144_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), i32(1)) + _144_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), i32(1)) + _144_temp3 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) _144_temp4 = _sqlite3PExpr(tls, _pParse, i32(122), _144_temp2, _144_temp3) - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _144_temp1, _144_temp4) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _144_temp1, _144_temp4) goto _281 _175: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X1))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0 - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))) - if (*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X1))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0 + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))) + if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil { { p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X2))) *p = (*p) | uint32(i32(8388612)) sink5(*p) } } - *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) + *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) goto _281 _176: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(0))))) != i32(35) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 { - _147_n = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1 - _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, i32(135), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _sqlite3ExprAssignVarNumber(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), _147_n) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(0))))) != i32(35) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 { + _147_n = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1 + _spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), _pParse, i32(135), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3ExprAssignVarNumber(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), _147_n) goto _327 } - _148_t = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + _148_t = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) func() { - if (_148_t.X1) < uint32(i32(2)) { + if _148_t.X1 < uint32(i32(2)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138336), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27278))) crt.X__builtin_abort(tls) } }() - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), &_148_t, &_148_t) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), &_148_t, &_148_t) if int32(_pParse.X6) == i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(27285), unsafe.Pointer(&_148_t)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))))) = nil goto _331 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(157), nil, nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) != nil { - _sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_148_t.X0))+1*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0).X8)))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(157), nil, nil) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) != nil { + _sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_148_t.X0))+1*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0).X8)))) } _331: _327: goto _281 _177: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprAddCollateToken(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprAddCollateToken(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) goto _281 _178: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(37), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) - _sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), nil) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(37), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) + _sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), nil) goto _281 _179: - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil) && (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(6)))))) { - _sqlite3ErrorMsg(tls, _pParse, str(27309), unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) + if ((*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil) && (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(6)))))) { + _sqlite3ErrorMsg(tls, _pParse, str(27309), unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - if ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) == i32(1)) && ((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil) { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + if ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) == i32(1)) && (((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil) { { p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X2))) *p = (*p) | uint32(i32(16)) sink5(*p) } } - *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) + *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) goto _281 _180: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) - _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) goto _281 _181: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) goto _281 _182: - _158_pList = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + _158_pList = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3PExpr(tls, _pParse, i32(158), nil, nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil { + if ((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil { *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X6))))))) = _158_pList - _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _338 } _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _158_pList) _338: - *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) + *(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)) goto _281 _183: - _spanBinaryExpr(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanBinaryExpr(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _191: - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) { - p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) + p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) *p = (*p) | u32(2147483648) sink5(*p) } goto _281 _192: - _163_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1) & u32(2147483648)) + _163_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1) & u32(2147483648)) { - p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) + p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) *p = (*p) & uint32(i32(2147483647)) sink5(*p) } - _163_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) - _163_pList = _sqlite3ExprListAppend(tls, _pParse, _163_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _163_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - _exprNot(tls, _pParse, _163_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) != nil { + _163_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + _163_pList = _sqlite3ExprListAppend(tls, _pParse, _163_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _163_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _exprNot(tls, _pParse, _163_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0) != nil { { - p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0).X2))) + p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0).X2))) *p = (*p) | uint32(i32(128)) sink5(*p) } } goto _281 _193: - _164_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1) & u32(2147483648)) + _164_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1) & u32(2147483648)) { - p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))) + p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X1))) *p = (*p) & uint32(i32(2147483647)) sink5(*p) } - _164_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) - _164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) - _164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _164_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) - _exprNot(tls, _pParse, _164_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { + _164_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + _164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) + _164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _164_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) + _exprNot(tls, _pParse, _164_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { { - p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X2))) + p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X2))) *p = (*p) | uint32(i32(128)) sink5(*p) } } goto _281 _194: - _spanUnaryPostfix(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanUnaryPostfix(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _195: - _spanUnaryPostfix(tls, _pParse, i32(76), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _spanUnaryPostfix(tls, _pParse, i32(76), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _196: - _spanBinaryExpr(tls, _pParse, i32(72), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), i32(75)) + _spanBinaryExpr(tls, _pParse, i32(72), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), i32(75)) goto _281 _197: - _spanBinaryExpr(tls, _pParse, i32(148), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), i32(76)) + _spanBinaryExpr(tls, _pParse, i32(148), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), i32(76)) goto _281 _198: - _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _200: - _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, i32(155), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, i32(155), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _201: - _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, i32(156), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), _pParse, i32(156), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _202: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(0) goto _281 _204: - _173_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) - _173_pList = _sqlite3ExprListAppend(tls, _pParse, _173_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(73), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = _173_pList + _173_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + _173_pList = _sqlite3ExprListAppend(tls, _pParse, _173_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(73), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = _173_pList goto _342 } _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _173_pList) _342: - _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 + _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X2 goto _281 _205: - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil { - _sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+16*uintptr(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))))), i32(1)) + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil { + _sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3IntTokens))+16*uintptr(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))))), i32(1)) goto _351 } - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) != i32(1) { + if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X0) != i32(1) { goto _345 } - _178_pRHS = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 32*uintptr(i32(0)))).X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 32*uintptr(i32(0)))).X0))))) = nil - _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _178_pRHS = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 32*uintptr(i32(0)))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X2))))) + 32*uintptr(i32(0)))).X0))))) = nil + _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) if func() int32 { if _178_pRHS != nil { return i32(1) @@ -26940,210 +28427,210 @@ _205: }() }() != 0 { { - p := (*uint32)(unsafe.Pointer(&(_178_pRHS.X2))) + p := (*uint32)(unsafe.Pointer(&_178_pRHS.X2)) *p = (*p) & uint32(i32(-257)) sink5(*p) } { - p := (*uint32)(unsafe.Pointer(&(_178_pRHS.X2))) + p := (*uint32)(unsafe.Pointer(&_178_pRHS.X2)) *p = (*p) | uint32(i32(512)) sink5(*p) } } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, func() int32 { - if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) != 0 { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, func() int32 { + if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) != 0 { return i32(77) } return i32(78) - }(), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), _178_pRHS) + }(), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), _178_pRHS) goto _351 _345: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - _sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) goto _353 } - _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) _353: - _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) _351: - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) goto _281 _206: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(119), nil, nil) - _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(119), nil, nil) + _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) goto _281 _207: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) - _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) - _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) + _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X1))) goto _281 _208: - _185_pSrc = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _185_pSrc = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) _185_pSelect = _sqlite3SelectNew(tls, _pParse, nil, _185_pSrc, nil, nil, nil, nil, uint32(i32(0)), nil, nil) - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) != nil { + if (*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) != nil { _sqlite3SrcListFuncArgs(tls, _pParse, func() *XSrcList { if _185_pSelect != nil { return _185_pSrc } return nil - }(), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + }(), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) - _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), _185_pSelect) - _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) - *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = func() *int8 { - if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0) != nil { - return (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-1)))).X2))))).X1))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), nil) + _sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0), _185_pSelect) + _exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + *(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X2))) = func() *int8 { + if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0) != nil { + return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-1)))).X2))))).X1))) } - return (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-2)))).X2))))).X1))) + return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-2)))).X2))))).X1))) }() goto _281 _209: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - _186_p = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))), _sqlite3PExpr(tls, _pParse, i32(20), nil, nil)) - _sqlite3PExprAddSelect(tls, _pParse, _186_p, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _186_p = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))), _sqlite3PExpr(tls, _pParse, i32(20), nil, nil)) + _sqlite3PExprAddSelect(tls, _pParse, _186_p, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) goto _281 _210: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(136), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = func() *XExprList { - if (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil { - return _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(136), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), nil) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0) != nil { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0).X6))))))) = func() *XExprList { + if (*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) != nil { + return _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) } - return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) + return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) }() - _sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) + _sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0)) goto _362 } - _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) - _sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) + _sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) _362: goto _281 _211: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _212: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _213: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _214: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _215: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _216: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _218: - _sqlite3CreateIndex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-4)))).X2))))), nil), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-10)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-11)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2))))), uint8(i32(0))) + _sqlite3CreateIndex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-4)))).X2))))), nil), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-10)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-11)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2))))), uint8(i32(0))) goto _281 _219: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(2) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(2) goto _281 _221: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(0) goto _281 _222: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _223: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _224: - _sqlite3DropIndex(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DropIndex(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _225: _sqlite3Vacuum(tls, _pParse, nil) goto _281 _226: - _sqlite3Vacuum(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Vacuum(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _227: - _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, i32(0)) + _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), nil, i32(0)) goto _281 _228: - _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(0)) + _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(0)) goto _281 _229: - _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(0)) + _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(0)) goto _281 _230: - _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) + _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), i32(1)) goto _281 _231: - _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) + _sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) goto _281 _232: - *(**int8)(unsafe.Pointer(&(_209_all.X0))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0 - *(*uint32)(unsafe.Pointer(&(_209_all.X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-3)))).X2))))).X0)))/1))) + ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) - _sqlite3FinishTrigger(tls, _pParse, (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), &_209_all) + *(**int8)(unsafe.Pointer(&_209_all.X0)) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0 + *(*uint32)(unsafe.Pointer(&_209_all.X1)) = uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-3)))).X2))))).X0)))/1))) + ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1) + _sqlite3FinishTrigger(tls, _pParse, (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), &_209_all) goto _281 _233: - _sqlite3BeginTrigger(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0, (*XIdList)((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X1), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-10)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))) - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-10)))).X2))))) = func() XToken { - if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))).X1) == uint32(i32(0)) { - return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))) + _sqlite3BeginTrigger(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X0, (*XIdList)((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))).X1), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-10)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-8)))).X2)))))) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-10)))).X2))))) = func() XToken { + if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))).X1) == uint32(i32(0)) { + return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))) } - return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) + return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2)))))) }() goto _281 _234: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(34) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(34) goto _281 _235: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(30) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(30) goto _281 _236: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(48) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))) = i32(48) goto _281 _237: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(34) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))) = i32(34) goto _281 _238: - *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X1) - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))))) = nil + *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X1) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X1))))) = nil goto _281 _240: - *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = i32(110) - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X0))) = i32(110) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))).X1))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _241: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _243: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0) goto _281 _245: func() { - if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) == nil { + if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138703), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27343))) crt.X__builtin_abort(tls) } }() - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))).X9).X8))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))).X9).X8))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _246: func() { - if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil { + if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138710), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27368))) crt.X__builtin_abort(tls) } }() - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _247: - *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) + *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) _sqlite3ErrorMsg(tls, _pParse, str(27393)) goto _281 _248: @@ -27153,98 +28640,98 @@ _249: _sqlite3ErrorMsg(tls, _pParse, str(27572)) goto _281 _250: - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3TriggerUpdateStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-6)))).X2))))))) = _sqlite3TriggerUpdateStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))))) goto _281 _251: - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerInsertStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerInsertStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) goto _281 _252: - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerDeleteStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerDeleteStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _253: - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3TriggerSelectStep(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) = _sqlite3TriggerSelectStep(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _254: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(56), nil, nil) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0) != nil { - *(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0).X1))) = int8(i32(4)) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(56), nil, nil) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0) != nil { + *(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0).X1))) = int8(i32(4)) } goto _281 _255: - _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(56), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) - if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0) != nil { - *(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0).X1))) = int8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) + _spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(56), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), i32(1)) + if ((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0) != nil { + *(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))).X0).X1))) = int8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))) } goto _281 _256: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(1) goto _281 _257: - *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(3) + *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))) = i32(3) goto _281 _258: - _sqlite3DropTrigger(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + _sqlite3DropTrigger(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _259: - _sqlite3Attach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3Attach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _260: - _sqlite3Detach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) + _sqlite3Detach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))).X0)) goto _281 _261: _sqlite3Reindex(tls, _pParse, nil, nil) goto _281 _262: - _sqlite3Reindex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Reindex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _263: _sqlite3Analyze(tls, _pParse, nil, nil) goto _281 _264: - _sqlite3Analyze(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3Analyze(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _265: - _sqlite3AlterRenameTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3AlterRenameTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _266: - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(i32(-1)))).X2))))).X0)))/1))) + ((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1) - _sqlite3AlterFinishAddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X51)).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(i32(-1)))).X2))))).X0)))/1))) + ((*XToken)(unsafe.Pointer(&_pParse.X51)).X1) + _sqlite3AlterFinishAddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2)))))) goto _281 _267: _disableLookaside(tls, _pParse) - _sqlite3AlterBeginAddColumn(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) + _sqlite3AlterBeginAddColumn(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))))) goto _281 _268: _sqlite3VtabFinishParse(tls, _pParse, nil) goto _281 _269: - _sqlite3VtabFinishParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3VtabFinishParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _270: - _sqlite3VtabBeginParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) + _sqlite3VtabBeginParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))) goto _281 _271: _sqlite3VtabArgInit(tls, _pParse) goto _281 _272: - _sqlite3VtabArgExtend(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + _sqlite3VtabArgExtend(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _275: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(1)))).X2))))))) = nil goto _281 _276: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _277: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-2)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(0)))).X2)))))) goto _281 _278: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) goto _281 _279: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-7)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp)) + 32*uintptr(i32(-1)))).X2))))))) goto _281 _280: func() { @@ -27315,9 +28802,9 @@ _281: crt.X__builtin_abort(tls) } }() - _yygoto = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X0) - _yysize = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1) - _yyact = _yy_find_reduce_action(tls, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+32*uintptr(-_yysize))).X0), uint8(_yygoto)) + _yygoto = int32((*t35)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X0) + _yysize = int32((*t35)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1) + _yyact = _yy_find_reduce_action(tls, int32((*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(_yymsp))+32*uintptr(-_yysize))).X0), uint8(_yygoto)) if _yyact > i32(999) { goto _393 } @@ -27330,12 +28817,12 @@ _281: } { p := &_yymsp - *p = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 32*uintptr(_yysize-i32(1)))) + *p = (*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 32*uintptr(_yysize-i32(1)))) sink34(*p) } - *(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))) = _yymsp - *(*uint16)(unsafe.Pointer(&(_yymsp.X0))) = uint16(_yyact) - *(*uint8)(unsafe.Pointer(&(_yymsp.X1))) = uint8(_yygoto) + *(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X0)))) = _yymsp + *(*uint16)(unsafe.Pointer(&_yymsp.X0)) = uint16(_yyact) + *(*uint8)(unsafe.Pointer(&_yymsp.X1)) = uint8(_yygoto) _yyTraceShift(tls, _yypParser, _yyact) goto _395 _393: @@ -27346,8 +28833,8 @@ _393: } }() { - p := (**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))) - *p = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 32*uintptr(_yysize))) + p := (**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X0)))) + *p = (*XyyStackEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 32*uintptr(_yysize))) sink34(*p) } _yy_accept(tls, _yypParser) @@ -27380,14 +28867,17 @@ func init() { _yyRuleName = [332]*int8{str(27873), str(27893), str(27924), str(27937), str(27971), str(27985), str(28008), str(28032), str(28056), str(28081), str(28103), str(28130), str(28151), str(28184), str(28231), str(28288), str(28308), str(28324), str(28354), str(28368), str(28377), str(28443), str(28475), str(28493), str(28522), str(28550), str(28564), str(28600), str(28649), str(28681), str(28705), str(28728), str(28757), str(28785), str(28814), str(28843), str(28869), str(28916), str(28940), str(28967), str(29011), str(29037), str(29065), str(29077), str(29098), str(29110), str(29137), str(29157), str(29185), str(29213), str(29241), str(29261), str(29284), str(29303), str(29323), str(29344), str(29402), str(29456), str(29483), str(29529), str(29576), str(29593), str(29614), str(29638), str(29690), str(29729), str(29763), str(29853), str(29877), str(29888), str(29923), str(29934), str(29960), str(29983), str(30007), str(30044), str(30067), str(30080), str(30149), str(30185), str(30200), str(30229), str(30284), str(30309), str(30338), str(30374), str(30475), str(30509), str(30548), str(30570), str(30587), str(30600), str(30609), str(30637), str(30662), str(30694), str(30707), str(30714), str(30723), str(30748), str(30781), str(30796), str(30862), str(30931), str(30990), str(31053), str(31062), str(31078), str(31099), str(31121), str(31145), str(31172), str(31202), str(31221), str(31232), str(31248), str(31278), str(31306), str(31339), str(31353), str(31369), str(31403), str(31446), str(31474), str(31492), str(31511), str(31525), str(31541), str(31576), str(31591), str(31618), str(31632), str(31657), str(31694), str(31730), str(31786), str(31800), str(31825), str(31895), str(31932), str(31979), str(32002), str(32035), str(32091), str(32155), str(32184), str(32207), str(32222), str(32250), str(32277), str(32291), str(32311), str(32325), str(32345), str(32362), str(32381), str(32407), str(32427), str(32443), str(32460), str(32478), str(32510), str(32548), str(32592), str(32623), str(32641), str(32677), str(32700), str(32722), str(32753), str(32778), str(32824), str(32854), str(32888), str(32914), str(32943), str(32969), str(33007), str(33036), str(33059), str(33081), str(33107), str(33125), str(33146), str(33166), str(33185), str(33208), str(33235), str(33274), str(33287), str(33304), str(33339), str(33361), str(33394), str(33437), str(33466), str(33521), str(33573), str(33611), str(33635), str(33649), str(33671), str(33688), str(33701), str(33736), str(33755), str(33774), str(33808), str(33893), str(33915), str(33930), str(33946), str(33976), str(34023), str(34056), str(34068), str(34098), str(34135), str(34150), str(34168), str(34191), str(34223), str(34258), str(34294), str(34333), str(34365), str(34399), str(34456), str(34572), str(34596), str(34619), str(34647), str(34664), str(34696), str(34721), str(34756), str(34772), str(34798), str(34853), str(34891), str(34910), str(34936), str(34960), str(35025), str(35080), str(35131), str(35154), str(35182), str(35222), str(35245), str(35265), str(35284), str(35323), str(35375), str(35411), str(35423), str(35444), str(35460), str(35484), str(35500), str(35524), str(35566), str(35643), str(35676), str(35696), str(35734), str(35802), str(35814), str(35835), str(35866), str(35876), str(35885), str(35906), str(35937), str(35979), str(36034), str(36052), str(36077), str(36094), str(36108), str(36135), str(36147), str(36161), str(36187), str(36216), str(36244), str(36262), str(36301), str(36353), str(36388), str(36406), str(36420), str(36435), str(36458), str(36481), str(36501), str(36522), str(36550), str(36563), str(36585), str(36617), str(36656), str(36675), str(36690), str(36730), str(36756), str(36783), str(36804), str(36830), str(36847), str(36861), str(36886), str(36909), str(36928), str(36941), str(36954), str(36971), str(36989), str(37016), str(37035), str(37067), str(37079), str(37091), str(37120), str(37140), str(37157), str(37183), str(37207), str(37249), str(37282), str(37294), str(37328)} } -// This routine is called after a single SQL statement has been -// parsed and a VDBE program to execute that statement has been -// prepared. This routine puts the finishing touches on the -// VDBE program and resets the pParse structure for the next -// parse. -// -// Note that if an error occurred, it might be the case that -// no VDBE code was generated. +// C comment +// /* +// ** This routine is called after a single SQL statement has been +// ** parsed and a VDBE program to execute that statement has been +// ** prepared. This routine puts the finishing touches on the +// ** VDBE program and resets the pParse structure for the next +// ** parse. +// ** +// ** Note that if an error occurred, it might be the case that +// ** no VDBE code was generated. +// */ func _sqlite3FinishCoding(tls *crt.TLS, _pParse *XParse) { var _3_iDb, _3_i int32 var _5_vtab *int8 @@ -27402,20 +28892,20 @@ func _sqlite3FinishCoding(tls *crt.TLS, _pParse *XParse) { } }() _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X6) != 0 { + if _pParse.X6 != 0 { return } - if (_db.X17) == 0 && (_pParse.X16) == 0 { + if _db.X17 == 0 && _pParse.X16 == 0 { goto _4 } - if (_pParse.X3) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1) + if _pParse.X3 == i32(0) { + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(1) } return _4: _v = _sqlite3GetVdbe(tls, _pParse) func() { - if (_pParse.X8) != 0 && _sqlite3VdbeAssertMayAbort(tls, _v, int32(_pParse.X9)) == 0 { + if _pParse.X8 != 0 && _sqlite3VdbeAssertMayAbort(tls, _v, int32(_pParse.X9)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99844), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37373))) crt.X__builtin_abort(tls) } @@ -27424,7 +28914,7 @@ _4: goto _9 } _sqlite3VdbeAddOp0(tls, _v, i32(55)) - if int32(_db.X17) != i32(0) || (_pParse.X30) == uint32(i32(0)) && (*XExprList)(_pParse.X27) == nil { + if int32(_db.X17) != i32(0) || _pParse.X30 == uint32(i32(0)) && _pParse.X27 == nil { goto _12 } func() { @@ -27436,47 +28926,47 @@ _4: _sqlite3VdbeJumpHere(tls, _v, i32(0)) _3_iDb = i32(0) _15: - if _3_iDb >= (_db.X5) { + if _3_iDb >= _db.X5 { goto _18 } - if bool2int(((_pParse.X30)&(u32(1)<<uint(_3_iDb))) != uint32(i32(0))) == i32(0) { + if bool2int((_pParse.X30&(u32(1)<<uint(_3_iDb))) != uint32(i32(0))) == i32(0) { goto _16 } _sqlite3VdbeUsesBtree(tls, _v, _3_iDb) _4_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_3_iDb))).X4) - _sqlite3VdbeAddOp4Int(tls, _v, i32(2), _3_iDb, bool2int(((_pParse.X29)&(u32(1)<<uint(_3_iDb))) != uint32(i32(0))), _4_pSchema.X0, _4_pSchema.X1) - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0) { + _sqlite3VdbeAddOp4Int(tls, _v, i32(2), _3_iDb, bool2int((_pParse.X29&(u32(1)<<uint(_3_iDb))) != uint32(i32(0))), _4_pSchema.X0, _4_pSchema.X1) + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0) { _sqlite3VdbeChangeP5(tls, _v, uint16(i32(1))) } - _sqlite3VdbeComment(tls, _v, str(37485), bool2int(((_pParse.X9) != 0) && ((_pParse.X8) != 0))) + _sqlite3VdbeComment(tls, _v, str(37485), bool2int((_pParse.X9 != 0) && (_pParse.X8 != 0))) _16: _3_iDb += 1 goto _15 _18: _3_i = i32(0) _22: - if _3_i >= (_pParse.X56) { + if _3_i >= _pParse.X56 { goto _25 } - _5_vtab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, *(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParse.X67)) + 8*uintptr(_3_i)))))) + _5_vtab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, *(**XTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse.X67)) + 8*uintptr(_3_i)))))) _sqlite3VdbeAddOp4(tls, _v, i32(155), i32(0), i32(0), i32(0), _5_vtab, i32(-8)) _3_i += 1 goto _22 _25: - *(*int32)(unsafe.Pointer(&(_pParse.X56))) = i32(0) + *(*int32)(unsafe.Pointer(&_pParse.X56)) = i32(0) _codeTableLocks(tls, _pParse) _sqlite3AutoincrementBegin(tls, _pParse) - if (*XExprList)(_pParse.X27) == nil { + if _pParse.X27 == nil { goto _26 } _6_pEL = (*XExprList)(_pParse.X27) - *(*uint8)(unsafe.Pointer(&(_pParse.X11))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X11)) = uint8(i32(0)) _3_i = i32(0) _27: - if _3_i >= (_6_pEL.X0) { + if _3_i >= _6_pEL.X0 { goto _30 } - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEL.X2)))))+32*uintptr(_3_i))).X0), *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEL.X2))))) + 32*uintptr(_3_i))).X5)))))) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pEL.X2))))+32*uintptr(_3_i))).X0), *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pEL.X2)))) + 32*uintptr(_3_i))).X5)))))) _3_i += 1 goto _27 _30: @@ -27484,23 +28974,23 @@ _26: _sqlite3VdbeGoto(tls, _v, i32(1)) _12: _9: - if _v == nil || (_pParse.X16) != i32(0) || (_db.X17) != 0 { + if _v == nil || _pParse.X16 != i32(0) || _db.X17 != 0 { goto _33 } func() { - if (_pParse.X23) != i32(0) { + if _pParse.X23 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37504))) crt.X__builtin_abort(tls) } }() - if ((*TAggInfo_func)(_pParse.X38) != nil) && ((_pParse.X17) == i32(0)) { - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(1) + if ((*TAggInfo_func)(_pParse.X38) != nil) && (_pParse.X17 == i32(0)) { + *(*int32)(unsafe.Pointer(&_pParse.X17)) = i32(1) } _sqlite3VdbeMakeReady(tls, _v, _pParse) - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(101) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(101) goto _38 _33: - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(1) _38: } @@ -27521,21 +29011,27 @@ func _sqlite3GetVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) { }() } -// 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. +// C comment +// /* +// ** Get a VDBE for the given parser context. Create a new one if necessary. +// ** If an error occurs, return NULL and leave a message in pParse. +// */ func _allocVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) { var _v *TVdbe - _v = store38((**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X2))))), _sqlite3VdbeCreate(tls, _pParse)) + _v = store38((**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X2)))), _sqlite3VdbeCreate(tls, _pParse)) if _v != nil { _sqlite3VdbeAddOp2(tls, _v, i32(51), i32(0), i32(1)) } if ((*XParse)(_pParse.X39) == nil) && ((int32((*Xsqlite3)(_pParse.X0).X13) & i32(8)) == i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pParse.X11))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X11)) = uint8(i32(1)) } return _v } -// Create a new virtual database engine. +// C comment +// /* +// ** Create a new virtual database engine. +// */ func _sqlite3VdbeCreate(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) { var _db *Xsqlite3 var _p *TVdbe @@ -27544,36 +29040,36 @@ func _sqlite3VdbeCreate(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) { if _p == nil { return nil } - crt.Xmemset(tls, (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17)))), i32(0), u64(184)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db - if (*TVdbe)(_db.X1) != nil { + crt.Xmemset(tls, unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X17))), i32(0), u64(184)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _db + if _db.X1 != nil { *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_db.X1).X1))))) = _p } - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*TVdbe)(_db.X1) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = nil - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X1))))) = _p - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(381479589)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _pParse + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = (*TVdbe)(_db.X1) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = nil + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X1)))) = _p + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(i32(381479589)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = _pParse func() { - if (_pParse.X26) != nil { + if _pParse.X26 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71456), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37547))) crt.X__builtin_abort(tls) } }() func() { - if (_pParse.X25) != i32(0) { + if _pParse.X25 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71457), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37565))) crt.X__builtin_abort(tls) } }() func() { - if (_pParse.X19) != i32(0) { + if _pParse.X19 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71458), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37583))) crt.X__builtin_abort(tls) } }() func() { - if (_pParse.X20) != i32(0) { + if _pParse.X20 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71459), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37603))) crt.X__builtin_abort(tls) } @@ -27598,7 +29094,7 @@ func _sqlite3VdbeAddOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32 var _3_x *TyColCache _i = _p.X27 func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71595), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } @@ -27612,16 +29108,16 @@ func _sqlite3VdbeAddOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32 if ((*XParse)(_p.X3).X19) <= _i { return _growOp3(tls, _p, _op, _p1, _p2, _p3) } - *(*int32)(unsafe.Pointer(&(_p.X27))) += 1 + *(*int32)(unsafe.Pointer(&_p.X27)) += 1 _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_i))) - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(_op) - *(*uint16)(unsafe.Pointer(&(_pOp.X2))) = uint16(i32(0)) - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = _p1 - *(*int32)(unsafe.Pointer(&(_pOp.X4))) = _p2 - *(*int32)(unsafe.Pointer(&(_pOp.X5))) = _p3 - *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0)) - *(**int8)(unsafe.Pointer(&(_pOp.X7))) = nil + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(_op) + *(*uint16)(unsafe.Pointer(&_pOp.X2)) = uint16(i32(0)) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = _p1 + *(*int32)(unsafe.Pointer(&_pOp.X4)) = _p2 + *(*int32)(unsafe.Pointer(&_pOp.X5)) = _p3 + *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = nil + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(0)) + *(**int8)(unsafe.Pointer(&_pOp.X7)) = nil if (((*Xsqlite3)(_p.X0).X6) & i32(4096)) == 0 { goto _6 } @@ -27631,7 +29127,7 @@ _7: if _2_jj >= int32(_2_pParse.X13) { goto _10 } - _3_x = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_2_pParse.X48))))))) + uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(_2_jj)*uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(20))))))))))) + _3_x = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_2_pParse.X48)))))) + uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(_2_jj)*uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(20))))))))))) crt.Xprintf(tls, str(37685), _3_x.X4, _3_x.X0, int32(_3_x.X1)) _2_kk += 1 _2_jj += 1 @@ -27652,23 +29148,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeAddOp3Ø00__func__Ø000[0], str(37702), 18) } -// Add a new instruction to the list of instructions current in the -// VDBE. Return the address of the new instruction. -// -// Parameters: -// -// p Pointer to the VDBE -// -// op The opcode for this instruction -// -// p1, p2, p3 Operands -// -// Use the sqlite3VdbeResolveLabel() function to fix an address and -// the sqlite3VdbeChangeP4() function to change the value of the P4 -// operand. +// C comment +// /* +// ** Add a new instruction to the list of instructions current in the +// ** VDBE. Return the address of the new instruction. +// ** +// ** Parameters: +// ** +// ** p Pointer to the VDBE +// ** +// ** op The opcode for this instruction +// ** +// ** p1, p2, p3 Operands +// ** +// ** Use the sqlite3VdbeResolveLabel() function to fix an address and +// ** the sqlite3VdbeChangeP4() function to change the value of the P4 +// ** operand. +// */ func _growOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) { func() { - if ((*XParse)(_p.X3).X19) > (_p.X27) { + if ((*XParse)(_p.X3).X19) > _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71585), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOp3Ø00__func__Ø000))), unsafe.Pointer(str(37720))) crt.X__builtin_abort(tls) } @@ -27677,7 +29176,7 @@ func _growOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int3 return i32(1) } func() { - if ((*XParse)(_p.X3).X19) <= (_p.X27) { + if ((*XParse)(_p.X3).X19) <= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71587), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOp3Ø00__func__Ø000))), unsafe.Pointer(str(37748))) crt.X__builtin_abort(tls) } @@ -27691,27 +29190,30 @@ func init() { crt.Xstrncpy(nil, &_growOp3Ø00__func__Ø000[0], str(37775), 8) } -// Resize the Vdbe.aOp array so that it is at least nOp elements larger -// than its current size. nOp is guaranteed to be less than or equal -// to 1024/sizeof(Op). -// -// If an out-of-memory error occurs while resizing the array, return -// SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain -// unchanged (this is so that any opcodes already allocated can be -// correctly deallocated along with the rest of the Vdbe). +// C comment +// /* +// ** Resize the Vdbe.aOp array so that it is at least nOp elements larger +// ** than its current size. nOp is guaranteed to be less than or equal +// ** to 1024/sizeof(Op). +// ** +// ** If an out-of-memory error occurs while resizing the array, return +// ** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain +// ** unchanged (this is so that any opcodes already allocated can be +// ** correctly deallocated along with the rest of the Vdbe). +// */ func _growOpArray(tls *crt.TLS, _v *TVdbe, _nOp int32) (r0 int32) { var _nNew int32 var _p *XParse var _pNew *XVdbeOp _p = (*XParse)(_v.X3) _nNew = func() int32 { - if (_p.X19) != 0 { - return ((_p.X19) * i32(2)) + if _p.X19 != 0 { + return (_p.X19 * i32(2)) } return i32(32) }() - if _nNew > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(5))))) { + if _nNew > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(5))))) { _sqlite3OomFault(tls, (*Xsqlite3)(_p.X0)) return i32(7) } @@ -27722,16 +29224,16 @@ func _growOpArray(tls *crt.TLS, _v *TVdbe, _nOp int32) (r0 int32) { } }() func() { - if _nNew < ((_p.X19) + _nOp) { + if _nNew < (_p.X19 + _nOp) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71547), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOpArrayØ00__func__Ø000))), unsafe.Pointer(str(37806))) crt.X__builtin_abort(tls) } }() _pNew = (*XVdbeOp)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.X0), _v.X17, uint64(_nNew)*u64(32))) if _pNew != nil { - *(*int32)(unsafe.Pointer(&(_p.X20))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_pNew)) - *(*int32)(unsafe.Pointer(&(_p.X19))) = int32(uint64(_p.X20) / u64(32)) - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X17))))) = _pNew + *(*int32)(unsafe.Pointer(&_p.X20)) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_pNew)) + *(*int32)(unsafe.Pointer(&_p.X19)) = int32(uint64(_p.X20) / u64(32)) + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_v.X17)))) = _pNew } return func() int32 { if _pNew != nil { @@ -27747,7 +29249,10 @@ func init() { crt.Xstrncpy(nil, &_growOpArrayØ00__func__Ø000[0], str(37830), 12) } -// Print a single opcode. This routine is used for debugging only. +// C comment +// /* +// ** Print a single opcode. This routine is used for debugging only. +// */ func _sqlite3VdbePrintOp(tls *crt.TLS, _pOut *crt.XFILE, _pc int32, _pOp *XVdbeOp) { var _zP4 *int8 var _zCom [100]int8 @@ -27763,8 +29268,11 @@ func _sqlite3VdbePrintOp(tls *crt.TLS, _pOut *crt.XFILE, _pc int32, _pOp *XVdbeO _ = _zCom } -// Compute a string that describes the P4 parameter for an opcode. -// Use zTemp for any required temporary buffer space. +// C comment +// /* +// ** Compute a string that describes the P4 parameter for an opcode. +// ** Use zTemp for any required temporary buffer space. +// */ func _displayP4(tls *crt.TLS, _pOp *XVdbeOp, _zTemp *int8, _nTemp int32) (r0 *int8) { var _2_j, _17_i, _17_n int32 var _17_ai *int32 @@ -27815,9 +29323,9 @@ func _displayP4(tls *crt.TLS, _pOp *XVdbeOp, _zTemp *int8, _nTemp int32) (r0 *in } _3: - _2_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _2_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) func() { - if (_2_pKeyInfo.X5) == nil { + if _2_pKeyInfo.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72717), unsafe.Pointer((*int8)(unsafe.Pointer(&_displayP4Ø00__func__Ø000))), unsafe.Pointer(str(37852))) crt.X__builtin_abort(tls) } @@ -27828,10 +29336,10 @@ _19: if _2_j >= int32(_2_pKeyInfo.X2) { goto _22 } - _3_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_2_pKeyInfo.X6))))) + 8*uintptr(_2_j))) + _3_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_2_pKeyInfo.X6)))) + 8*uintptr(_2_j))) _3_zColl = func() *int8 { if _3_pColl != nil { - return (_3_pColl.X0) + return _3_pColl.X0 } return str(0) }() @@ -27839,7 +29347,7 @@ _19: _3_zColl = str(37888) } _sqlite3XPrintf(tls, &_x, str(37890), unsafe.Pointer(func() *int8 { - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pKeyInfo.X5)) + 1*uintptr(_2_j)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pKeyInfo.X5)) + 1*uintptr(_2_j)))) != 0 { return str(37896) } return str(0) @@ -27850,38 +29358,38 @@ _22: _sqlite3StrAccumAppend(tls, &_x, str(37898), i32(1)) goto _28 _4: - _4_pColl = (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _4_pColl = (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) _sqlite3XPrintf(tls, &_x, str(37900), unsafe.Pointer(_4_pColl.X0)) goto _28 _5: - _5_pDef = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _5_pDef = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) _sqlite3XPrintf(tls, &_x, str(37908), unsafe.Pointer(_5_pDef.X6), int32(_5_pDef.X0)) goto _28 _6: - _6_pDef = (*XFuncDef)((*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X1) + _6_pDef = (*XFuncDef)((*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X1) _sqlite3XPrintf(tls, &_x, str(37908), unsafe.Pointer(_6_pDef.X6), int32(_6_pDef.X0)) goto _28 _7: - _sqlite3XPrintf(tls, &_x, str(6348), *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _sqlite3XPrintf(tls, &_x, str(6348), *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) goto _28 _8: - _sqlite3XPrintf(tls, &_x, str(37915), *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _sqlite3XPrintf(tls, &_x, str(37915), *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _28 _9: - _sqlite3XPrintf(tls, &_x, str(7552), *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _sqlite3XPrintf(tls, &_x, str(7552), *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) goto _28 _10: - _10_pMem = (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _10_pMem = (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) if (int32(_10_pMem.X1) & i32(2)) != 0 { _zP4 = _10_pMem.X5 goto _36 } if (int32(_10_pMem.X1) & i32(4)) != 0 { - _sqlite3XPrintf(tls, &_x, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_10_pMem.X0)))))) + _sqlite3XPrintf(tls, &_x, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_10_pMem.X0))))) goto _36 } if (int32(_10_pMem.X1) & i32(8)) != 0 { - _sqlite3XPrintf(tls, &_x, str(7552), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_10_pMem.X0)))))) + _sqlite3XPrintf(tls, &_x, str(7552), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_10_pMem.X0))))) goto _36 } if (int32(_10_pMem.X1) & i32(1)) != 0 { @@ -27898,38 +29406,38 @@ _10: _36: goto _28 _11: - _16_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2) + _16_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X2) _sqlite3XPrintf(tls, &_x, str(37948), unsafe.Pointer(_16_pVtab)) goto _28 _12: - _17_ai = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) - _17_n = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_ai)) + 4*uintptr(i32(0)))) + _17_ai = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + _17_n = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_ai)) + 4*uintptr(i32(0)))) _17_i = i32(1) _39: if _17_i >= _17_n { goto _42 } - _sqlite3XPrintf(tls, &_x, str(37956), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_ai)) + 4*uintptr(_17_i)))) + _sqlite3XPrintf(tls, &_x, str(37956), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_ai)) + 4*uintptr(_17_i)))) _17_i += 1 goto _39 _42: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(91)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(91)) _sqlite3StrAccumAppend(tls, &_x, str(37960), i32(1)) goto _28 _13: _sqlite3XPrintf(tls, &_x, str(37962)) goto _28 _14: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) goto _28 _15: - _sqlite3XPrintf(tls, &_x, str(24576), unsafe.Pointer((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X0)) + _sqlite3XPrintf(tls, &_x, str(24576), unsafe.Pointer((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X0)) goto _28 _16: - _zP4 = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _zP4 = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) if _zP4 == nil { _zP4 = _zTemp - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) } _28: _sqlite3StrAccumFinish(tls, &_x) @@ -27951,8 +29459,11 @@ func init() { crt.Xstrncpy(nil, &_displayP4Ø00__func__Ø000[0], str(37977), 10) } -// variable-argument wrapper around sqlite3VXPrintf(). The bFlags argument -// can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats. +// C comment +// /* +// ** variable-argument wrapper around sqlite3VXPrintf(). The bFlags argument +// ** can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats. +// */ func _sqlite3XPrintf(tls *crt.TLS, _p *XStrAccum, _zFormat *int8, args ...interface{}) { var _ap []interface{} _ap = args @@ -27960,17 +29471,20 @@ func _sqlite3XPrintf(tls *crt.TLS, _p *XStrAccum, _zFormat *int8, args ...interf _ap = nil } -// Compute a string for the "comment" field of a VDBE opcode listing. -// -// The Synopsis: field in comments in the vdbe.c source file gets converted -// to an extra string that is appended to the sqlite3OpcodeName(). In the -// absence of other comments, this synopsis becomes the comment on the opcode. -// Some translation occurs: -// -// "PX" -> "r[X]" -// "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1 -// "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0 -// "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x +// C comment +// /* +// ** Compute a string for the "comment" field of a VDBE opcode listing. +// ** +// ** The Synopsis: field in comments in the vdbe.c source file gets converted +// ** to an extra string that is appended to the sqlite3OpcodeName(). In the +// ** absence of other comments, this synopsis becomes the comment on the opcode. +// ** Some translation occurs: +// ** +// ** "PX" -> "r[X]" +// ** "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1 +// ** "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0 +// ** "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x +// */ func _displayComment(tls *crt.TLS, _pOp *XVdbeOp, _zP4 *int8, _zTemp *int8, _nTemp int32) (r0 int32) { var _nOpName, _ii, _jj, _1_seenCom, _9_v1, _9_v2 int32 var _1_c int8 @@ -27978,13 +29492,13 @@ func _displayComment(tls *crt.TLS, _pOp *XVdbeOp, _zP4 *int8, _zTemp *int8, _nTe var _zAlt [50]int8 _zOpName = _sqlite3OpcodeName(tls, int32(_pOp.X0)) _nOpName = _sqlite3Strlen30(tls, _zOpName) - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOpName)) + 1*uintptr(_nOpName+i32(1))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOpName)) + 1*uintptr(_nOpName+i32(1))))) == 0 { goto _0 } _1_seenCom = i32(0) _zSynopsis = store0(func() (**int8, *int8) { p := &_zOpName - return p, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nOpName+i32(1)))) + return p, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_nOpName+i32(1)))) }()) if crt.Xstrncmp(tls, _zSynopsis, str(37987), uint64(i32(3))) != i32(0) { goto _1 @@ -27999,13 +29513,13 @@ _3: _1: _ii = store1(&_jj, i32(0)) _4: - if _jj >= (_nTemp-i32(1)) || int32(store3(&_1_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(_ii))))) == i32(0) { + if _jj >= (_nTemp-i32(1)) || int32(store3(&_1_c, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis)) + 1*uintptr(_ii))))) == i32(0) { goto _8 } if int32(_1_c) != i32(80) { goto _9 } - _1_c = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(preInc1(&_ii, 1)))) + _1_c = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis)) + 1*uintptr(preInc1(&_ii, 1)))) if int32(_1_c) == i32(52) { Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(24576), unsafe.Pointer(_zP4)) goto _13 @@ -28030,7 +29544,7 @@ _4: *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj)))) sink1(*p) } - _9_v2 = _translateP(tls, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(_ii))), _pOp) + _9_v2 = _translateP(tls, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis)) + 1*uintptr(_ii))), _pOp) if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(i32(1)))), str(38021), uint64(i32(2))) == i32(0) { { p := &_ii @@ -28044,7 +29558,7 @@ _4: } goto _19 _14: - if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(i32(1)))), str(38029), uint64(i32(4))) == i32(0)) && ((_pOp.X5) == i32(0)) { + if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(_ii)))))+uintptr(i32(1)))), str(38029), uint64(i32(4))) == i32(0)) && (_pOp.X5 == i32(0)) { { p := &_ii *p = (*p) + i32(4) @@ -28060,12 +29574,12 @@ _13: } goto _20 _9: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(postInc1(&_jj, int32(1))))) = _1_c + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(postInc1(&_jj, 1)))) = _1_c _20: _ii += 1 goto _4 _8: - if ((_1_seenCom == 0) && (_jj < (_nTemp - i32(5)))) && ((_pOp.X7) != nil) { + if ((_1_seenCom == 0) && (_jj < (_nTemp - i32(5)))) && (_pOp.X7 != nil) { Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(_jj))), str(38034), unsafe.Pointer(_pOp.X7)) { p := &_jj @@ -28074,16 +29588,16 @@ _8: } } if _jj < _nTemp { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(_jj))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(_jj))) = int8(i32(0)) } goto _27 _0: - if (_pOp.X7) != nil { + if _pOp.X7 != nil { Xsqlite3_snprintf(tls, _nTemp, _zTemp, str(24576), unsafe.Pointer(_pOp.X7)) _jj = _sqlite3Strlen30(tls, _zTemp) goto _27 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0)) _jj = i32(0) _27: return _jj @@ -28093,7 +29607,7 @@ _27: } func _sqlite3OpcodeName(tls *crt.TLS, _i int32) (r0 *int8) { - return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeNameØ00azNameØ001)) + 8*uintptr(_i))) + return *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3OpcodeNameØ00azNameØ001)) + 8*uintptr(_i))) } var _sqlite3OpcodeNameØ00azNameØ001 [166]*int8 @@ -28102,8 +29616,11 @@ func init() { _sqlite3OpcodeNameØ00azNameØ001 = [166]*int8{str(38039), str(38050), str(38062), str(38075), str(38087), str(38099), str(38111), str(38117), str(38123), str(38135), str(38148), str(38156), str(38187), str(38209), str(38215), str(38222), str(38237), str(38244), str(38255), str(38261), str(38279), str(38285), str(38289), str(38296), str(38345), str(38365), str(38385), str(38405), str(38425), str(38449), str(38471), str(38490), str(38513), str(38536), str(38542), str(38553), str(38565), str(38571), str(38579), str(38598), str(38617), str(38636), str(38655), str(38683), str(38725), str(38734), str(38767), str(38808), str(38852), str(38889), str(38901), str(38908), str(38925), str(38933), str(38947), str(38977), str(38983), str(39000), str(39015), str(39042), str(39062), str(39082), str(39105), str(39137), str(39160), str(39187), str(39205), str(39225), str(39251), str(39260), str(39291), str(39317), str(39344), str(39374), str(39396), str(39410), str(39440), str(39471), str(39490), str(39509), str(39527), str(39546), str(39564), str(39583), str(39594), str(39619), str(39643), str(39672), str(39702), str(39724), str(39751), str(39778), str(39803), str(39831), str(39856), str(39877), str(39898), str(39911), str(39930), str(39960), str(39976), str(40004), str(40037), str(40057), str(40069), str(40080), str(40105), str(40129), str(40154), str(40163), str(40188), str(40213), str(40225), str(40269), str(40300), str(40307), str(40320), str(40352), str(40373), str(40404), str(40435), str(40443), str(40455), str(40504), str(40526), str(40545), str(40563), str(40572), str(40595), str(40615), str(40638), str(40663), str(40684), str(40698), str(40707), str(40714), str(40727), str(40757), str(40787), str(40796), str(40809), str(40823), str(40834), str(40845), str(40858), str(40871), str(40898), str(40905), str(40929), str(40959), str(41028), str(41064), str(41099), str(41125), str(41133), str(41167), str(41175), str(41184), str(41194), str(41201), str(41227), str(41236), str(41247), str(41257), str(41269), str(41275)} } -// Return an integer value for one of the parameters to the opcode pOp -// determined by character c. +// C comment +// /* +// ** Return an integer value for one of the parameters to the opcode pOp +// ** determined by character c. +// */ func _translateP(tls *crt.TLS, _c int8, _pOp *XVdbeOp) (r0 int32) { if int32(_c) == i32(49) { return _pOp.X3 @@ -28115,7 +29632,7 @@ func _translateP(tls *crt.TLS, _c int8, _pOp *XVdbeOp) (r0 int32) { return _pOp.X5 } if int32(_c) == i32(52) { - return *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + return *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) } return int32(_pOp.X2) } @@ -28126,34 +29643,39 @@ func init() { _sqlite3VdbePrintOpØ00zFormat1Ø001 = str(41284) } -// This routine is just a convenient place to set a breakpoint that will -// fire after each opcode is inserted and displayed using -// "PRAGMA vdbe_addoptrace=on". +// C comment +// /* This routine is just a convenient place to set a breakpoint that will +// ** fire after each opcode is inserted and displayed using +// ** "PRAGMA vdbe_addoptrace=on". +// */ func _test_addop_breakpoint(tls *crt.TLS) { _test_addop_breakpointØ00nØ001 += 1 } var _test_addop_breakpointØ00nØ001 int32 -// Check if the program stored in the VM associated with pParse may -// throw an ABORT exception (causing the statement, but not entire transaction -// to be rolled back). This condition is true if the main program or any -// sub-programs contains any of the following: -// -// * OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort. -// * OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort. -// * OP_Destroy -// * OP_VUpdate -// * OP_VRename -// * OP_FkCounter with P2==0 (immediate foreign key constraint) -// * OP_CreateTable and OP_InitCoroutine (for CREATE TABLE AS SELECT ...) -// -// Then check that the value of Parse.mayAbort is true if an -// ABORT may be thrown, or false otherwise. Return true if it does -// match, or false otherwise. This function is intended to be used as -// part of an assert statement in the compiler. Similar to: -// -// assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) ); +// C comment +// /* +// ** Check if the program stored in the VM associated with pParse may +// ** throw an ABORT exception (causing the statement, but not entire transaction +// ** to be rolled back). This condition is true if the main program or any +// ** sub-programs contains any of the following: +// ** +// ** * OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort. +// ** * OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort. +// ** * OP_Destroy +// ** * OP_VUpdate +// ** * OP_VRename +// ** * OP_FkCounter with P2==0 (immediate foreign key constraint) +// ** * OP_CreateTable and OP_InitCoroutine (for CREATE TABLE AS SELECT ...) +// ** +// ** Then check that the value of Parse.mayAbort is true if an +// ** ABORT may be thrown, or false otherwise. Return true if it does +// ** match, or false otherwise. This function is intended to be used as +// ** part of an assert statement in the compiler. Similar to: +// ** +// ** assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) ); +// */ func _sqlite3VdbeAssertMayAbort(tls *crt.TLS, _v *TVdbe, _mayAbort int32) (r0 int32) { var _hasAbort, _hasFkCounter, _hasCreateTable, _hasInitCoroutine, _1_opcode int32 var _pOp *XVdbeOp @@ -28162,14 +29684,14 @@ func _sqlite3VdbeAssertMayAbort(tls *crt.TLS, _v *TVdbe, _mayAbort int32) (r0 in _hasFkCounter = i32(0) _hasCreateTable = i32(0) _hasInitCoroutine = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sIter), i32(0), u64(32)) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sIter.X0))))) = _v + crt.Xmemset(tls, unsafe.Pointer(&_sIter), i32(0), u64(32)) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sIter.X0)))) = _v _0: if store40(&_pOp, _opIterNext(tls, &_sIter)) == nil { goto _1 } _1_opcode = int32(_pOp.X0) - if (((_1_opcode == i32(133)) || (_1_opcode == i32(12))) || (_1_opcode == i32(160))) || (((_1_opcode == i32(55)) || (_1_opcode == i32(54))) && ((((_pOp.X3) & i32(255)) == i32(19)) && ((_pOp.X4) == i32(2)))) { + if (((_1_opcode == i32(133)) || (_1_opcode == i32(12))) || (_1_opcode == i32(160))) || (((_1_opcode == i32(55)) || (_1_opcode == i32(54))) && (((_pOp.X3 & i32(255)) == i32(19)) && (_pOp.X4 == i32(2)))) { _hasAbort = i32(1) goto _1 } @@ -28179,12 +29701,12 @@ _0: if _1_opcode == i32(15) { _hasInitCoroutine = i32(1) } - if ((_1_opcode == i32(147)) && ((_pOp.X3) == i32(0))) && ((_pOp.X4) == i32(1)) { + if ((_1_opcode == i32(147)) && (_pOp.X3 == i32(0))) && (_pOp.X4 == i32(1)) { _hasFkCounter = i32(1) } goto _0 _1: - _sqlite3DbFree(tls, (*Xsqlite3)(_v.X0), (unsafe.Pointer)(_sIter.X1)) + _sqlite3DbFree(tls, (*Xsqlite3)(_v.X0), unsafe.Pointer(_sIter.X1)) return bool2int((((((*Xsqlite3)(_v.X0).X17) != 0) || (_hasAbort == _mayAbort)) || _hasFkCounter != 0) || (_hasCreateTable != 0 && _hasInitCoroutine != 0)) _ = _sIter @@ -28197,53 +29719,53 @@ func _opIterNext(tls *crt.TLS, _p *XVdbeOpIter) (r0 *XVdbeOp) { var _pRet, _aOp *XVdbeOp _v = (*TVdbe)(_p.X0) _pRet = nil - if (_p.X4) > (_p.X2) { + if _p.X4 > _p.X2 { goto _0 } - if (_p.X4) == i32(0) { + if _p.X4 == i32(0) { _aOp = (*XVdbeOp)(_v.X17) _nOp = _v.X27 goto _2 } - _aOp = (*XVdbeOp)((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 8*uintptr((_p.X4)-i32(1))))).X0) - _nOp = (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 8*uintptr((_p.X4)-i32(1))))).X1 + _aOp = (*XVdbeOp)((*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1)) + 8*uintptr(_p.X4-i32(1))))).X0) + _nOp = (*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1)) + 8*uintptr(_p.X4-i32(1))))).X1 _2: func() { - if (_p.X3) >= _nOp { + if _p.X3 >= _nOp { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71866), unsafe.Pointer((*int8)(unsafe.Pointer(&_opIterNextØ00__func__Ø000))), unsafe.Pointer(str(41321))) crt.X__builtin_abort(tls) } }() - _pRet = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_p.X3))) - *(*int32)(unsafe.Pointer(&(_p.X3))) += 1 - if (_p.X3) == _nOp { - *(*int32)(unsafe.Pointer(&(_p.X4))) += 1 - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(0) + _pRet = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_p.X3))) + *(*int32)(unsafe.Pointer(&_p.X3)) += 1 + if _p.X3 == _nOp { + *(*int32)(unsafe.Pointer(&_p.X4)) += 1 + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(0) } if int32(_pRet.X1) != i32(-13) { goto _6 } - _5_nByte = int32(uint64((_p.X2)+i32(1)) * u64(8)) + _5_nByte = int32(uint64(_p.X2+i32(1)) * u64(8)) _5_j = i32(0) _7: - if _5_j >= (_p.X2) { + if _5_j >= _p.X2 { goto _10 } - if (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 8*uintptr(_5_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pRet.X6)))))) { + if (*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1)) + 8*uintptr(_5_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pRet.X6))))) { goto _10 } _5_j += 1 goto _7 _10: - if _5_j != (_p.X2) { + if _5_j != _p.X2 { goto _12 } - *(***XSubProgram)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (**XSubProgram)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_v.X0), (unsafe.Pointer)(_p.X1), uint64(_5_nByte))) - if (**XSubProgram)(unsafe.Pointer(_p.X1)) == nil { + *(***XSubProgram)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = (**XSubProgram)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_v.X0), unsafe.Pointer(_p.X1), uint64(_5_nByte))) + if _p.X1 == nil { _pRet = nil goto _14 } - *(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X2))), int32(1))))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pRet.X6)))))) + *(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_p.X2)), 1)))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pRet.X6))))) _14: _12: _6: @@ -28261,29 +29783,32 @@ func _sqlite3VdbeAddOp0(tls *crt.TLS, _p *TVdbe, _op int32) (r0 int32) { return _sqlite3VdbeAddOp3(tls, _p, _op, i32(0), i32(0), i32(0)) } -// Return the opcode for a given address. If the address is -1, then -// return the most recently inserted opcode. -// -// If a memory allocation error has occurred prior to the calling of this -// routine, then a pointer to a dummy VdbeOp will be returned. That opcode -// is readable but not writable, though it is cast to a writable value. -// The return of a dummy opcode allows the call to continue functioning -// after an OOM fault without having to check to see if the return from -// this routine is a valid pointer. But because the dummy.opcode is 0, -// dummy will never be written to. This is verified by code inspection and -// by running with Valgrind. +// C comment +// /* +// ** Return the opcode for a given address. If the address is -1, then +// ** return the most recently inserted opcode. +// ** +// ** If a memory allocation error has occurred prior to the calling of this +// ** routine, then a pointer to a dummy VdbeOp will be returned. That opcode +// ** is readable but not writable, though it is cast to a writable value. +// ** The return of a dummy opcode allows the call to continue functioning +// ** after an OOM fault without having to check to see if the return from +// ** this routine is a valid pointer. But because the dummy.opcode is 0, +// ** dummy will never be written to. This is verified by code inspection and +// ** by running with Valgrind. +// */ func _sqlite3VdbeGetOp(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 *XVdbeOp) { func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72518), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } }() if _addr < i32(0) { - _addr = (_p.X27) - i32(1) + _addr = _p.X27 - i32(1) } func() { - if (_addr < i32(0) || _addr >= (_p.X27)) && ((*Xsqlite3)(_p.X0).X17) == 0 { + if (_addr < i32(0) || _addr >= _p.X27) && ((*Xsqlite3)(_p.X0).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72522), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000))), unsafe.Pointer(str(41345))) crt.X__builtin_abort(tls) } @@ -28302,8 +29827,11 @@ func init() { var _sqlite3VdbeGetOpØ00dummyØ001 XVdbeOp -// Change the P2 operand of instruction addr so that it points to -// the address of the next instruction to be coded. +// C comment +// /* +// ** Change the P2 operand of instruction addr so that it points to +// ** the address of the next instruction to be coded. +// */ func _sqlite3VdbeJumpHere(tls *crt.TLS, _p *TVdbe, _addr int32) { _sqlite3VdbeChangeP2(tls, _p, uint32(_addr), _p.X27) } @@ -28312,12 +29840,15 @@ func _sqlite3VdbeChangeP2(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) { *(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X4))) = _val } -// Declare to the Vdbe that the BTree object at db->aDb[i] is used. -// -// The prepared statements need to know in advance the complete set of -// attached databases that will be use. A mask of these databases -// is maintained in p->btreeMask. The p->lockMask value is the subset of -// p->btreeMask of databases that will require a lock. +// C comment +// /* +// ** Declare to the Vdbe that the BTree object at db->aDb[i] is used. +// ** +// ** The prepared statements need to know in advance the complete set of +// ** attached databases that will be use. A mask of these databases +// ** is maintained in p->btreeMask. The p->lockMask value is the subset of +// ** p->btreeMask of databases that will require a lock. +// */ func _sqlite3VdbeUsesBtree(tls *crt.TLS, _p *TVdbe, _i int32) { func() { if _i < i32(0) || _i >= ((*Xsqlite3)(_p.X0).X5) || _i >= i32(32) { @@ -28332,13 +29863,13 @@ func _sqlite3VdbeUsesBtree(tls *crt.TLS, _p *TVdbe, _i int32) { } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X33))) + p := (*uint32)(unsafe.Pointer(&_p.X33)) *p = (*p) | (u32(1) << uint(_i)) sink5(*p) } if (_i != i32(1)) && _sqlite3BtreeSharable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_p.X0).X4)+32*uintptr(_i))).X1)) != 0 { { - p := (*uint32)(unsafe.Pointer(&(_p.X34))) + p := (*uint32)(unsafe.Pointer(&_p.X34)) *p = (*p) | (u32(1) << uint(_i)) sink5(*p) } @@ -28351,33 +29882,39 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeUsesBtreeØ00__func__Ø000[0], str(41489), 21) } -// Return true if the Btree passed as the only argument is sharable. +// C comment +// /* +// ** Return true if the Btree passed as the only argument is sharable. +// */ func _sqlite3BtreeSharable(tls *crt.TLS, _p *XBtree) (r0 int32) { return int32(_p.X3) } -// Add an opcode that includes the p4 value as an integer. +// C comment +// /* +// ** Add an opcode that includes the p4 value as an integer. +// */ func _sqlite3VdbeAddOp4Int(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _p4 int32) (r0 int32) { var _addr int32 var _1_pOp *XVdbeOp _addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3) if int32((*Xsqlite3)(_p.X0).X17) == i32(0) { _1_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_addr))) - *(*int8)(unsafe.Pointer(&(_1_pOp.X1))) = int8(i32(-11)) - *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6))))) = _p4 + *(*int8)(unsafe.Pointer(&_1_pOp.X1)) = int8(i32(-11)) + *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_1_pOp.X6)))) = _p4 } return _addr } func _sqlite3VdbeChangeP5(tls *crt.TLS, _p *TVdbe, _p5 uint16) { func() { - if (_p.X27) <= i32(0) && ((*Xsqlite3)(_p.X0).X17) == 0 { + if _p.X27 <= i32(0) && ((*Xsqlite3)(_p.X0).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72215), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP5Ø00__func__Ø000))), unsafe.Pointer(str(41510))) crt.X__builtin_abort(tls) } }() - if (_p.X27) > i32(0) { - *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr((_p.X27)-i32(1)))).X2))) = _p5 + if _p.X27 > i32(0) { + *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_p.X27-i32(1)))).X2))) = _p5 } } @@ -28396,32 +29933,35 @@ func _sqlite3VdbeComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interf } } -// Change the comment on the most recently coded instruction. Or -// insert a No-op and add the comment to that new instruction. This -// makes the code easier to read during debugging. None of this happens -// in a production build. +// C comment +// /* +// ** Change the comment on the most recently coded instruction. Or +// ** insert a No-op and add the comment to that new instruction. This +// ** makes the code easier to read during debugging. None of this happens +// ** in a production build. +// */ func _vdbeVComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, _ap []interface{}) { func() { - if (_p.X27) <= i32(0) && (*XVdbeOp)(_p.X17) != nil { + if _p.X27 <= i32(0) && (*XVdbeOp)(_p.X17) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72465), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41562))) crt.X__builtin_abort(tls) } }() func() { - if (*XVdbeOp)(_p.X17) != nil && ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr((_p.X27)-i32(1)))).X7) != nil && ((*Xsqlite3)(_p.X0).X17) == 0 { + if (*XVdbeOp)(_p.X17) != nil && ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_p.X27-i32(1)))).X7) != nil && ((*Xsqlite3)(_p.X0).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72466), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41584))) crt.X__builtin_abort(tls) } }() - if (_p.X27) != 0 { + if _p.X27 != 0 { func() { - if (*XVdbeOp)(_p.X17) == nil { + if _p.X17 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72468), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41649))) crt.X__builtin_abort(tls) } }() - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr((_p.X27)-i32(1)))).X7)) - *(**int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr((_p.X27)-i32(1)))).X7))) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_p.X27-i32(1)))).X7)) + *(**int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_p.X27-i32(1)))).X7))) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap) } } @@ -28431,13 +29971,16 @@ func init() { crt.Xstrncpy(nil, &_vdbeVCommentØ00__func__Ø000[0], str(41656), 13) } -// pTab is a pointer to a Table structure representing a virtual-table. -// Return a pointer to the VTable object used by connection db to access -// this virtual-table, if one has been created, or NULL otherwise. +// C comment +// /* +// ** pTab is a pointer to a Table structure representing a virtual-table. +// ** Return a pointer to the VTable object used by connection db to access +// ** this virtual-table, if one has been created, or NULL otherwise. +// */ func _sqlite3GetVTable(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) (r0 *XVTable) { var _pVtab *XVTable func() { - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125131), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetVTableØ00__func__Ø000))), unsafe.Pointer(str(24529))) crt.X__builtin_abort(tls) } @@ -28459,7 +30002,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GetVTableØ00__func__Ø000[0], str(41669), 17) } -// Add an opcode that includes the p4 value as a pointer. +// C comment +// /* +// ** Add an opcode that includes the p4 value as a pointer. +// */ func _sqlite3VdbeAddOp4(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *int8, _p4type int32) (r0 int32) { var _addr int32 _addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3) @@ -28478,48 +30024,48 @@ func _sqlite3VdbeChangeP4(tls *crt.TLS, _p *TVdbe, _addr int32, _zP4 *int8, _n i }() _db = (*Xsqlite3)(_p.X0) func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72390), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } }() func() { - if (*XVdbeOp)(_p.X17) == nil && (_db.X17) == 0 { + if (*XVdbeOp)(_p.X17) == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72391), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41686))) crt.X__builtin_abort(tls) } }() - if (_db.X17) == 0 { + if _db.X17 == 0 { goto _7 } if _n != i32(-8) { - _freeP4(tls, _db, _n, (unsafe.Pointer)(_zP4)) + _freeP4(tls, _db, _n, unsafe.Pointer(_zP4)) } return _7: func() { - if (_p.X27) <= i32(0) { + if _p.X27 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41716))) crt.X__builtin_abort(tls) } }() func() { - if _addr >= (_p.X27) { + if _addr >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72397), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41725))) crt.X__builtin_abort(tls) } }() if _addr < i32(0) { - _addr = (_p.X27) - i32(1) + _addr = _p.X27 - i32(1) } _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_addr))) - if (_n >= i32(0)) || ((_pOp.X1) != 0) { + if (_n >= i32(0)) || (_pOp.X1 != 0) { _vdbeChangeP4Full(tls, _p, _pOp, _zP4, _n) return } if _n == i32(-11) { - *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = int32(int64(crt.P2U(unsafe.Pointer(_zP4)))) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-11)) + *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = int32(int64(crt.P2U(unsafe.Pointer(_zP4)))) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-11)) goto _18 } if _zP4 == nil { @@ -28531,8 +30077,8 @@ _7: crt.X__builtin_abort(tls) } }() - *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = (unsafe.Pointer)(_zP4) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(_n) + *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = unsafe.Pointer(_zP4) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(_n) if _n == i32(-8) { _sqlite3VtabLock(tls, (*XVTable)(unsafe.Pointer(_zP4))) } @@ -28582,7 +30128,7 @@ _4: _sqlite3DbFree(tls, _db, _p4) goto _12 _8: - if (_db.X79) == nil { + if _db.X79 == nil { _sqlite3KeyInfoUnref(tls, (*XKeyInfo)(_p4)) } goto _12 @@ -28590,7 +30136,7 @@ _9: _freeEphemeralFunction(tls, _db, (*XFuncDef)(_p4)) goto _12 _10: - if (_db.X79) == nil { + if _db.X79 == nil { _sqlite3ValueFree(tls, (*XMem)(_p4)) goto _15 } @@ -28598,7 +30144,7 @@ _10: _15: goto _12 _11: - if (_db.X79) == nil { + if _db.X79 == nil { _sqlite3VtabUnlock(tls, (*XVTable)(_p4)) } goto _12 @@ -28613,31 +30159,37 @@ func init() { func _freeP4FuncCtx(tls *crt.TLS, _db *Xsqlite3, _p *Xsqlite3_context) { _freeEphemeralFunction(tls, _db, (*XFuncDef)(_p.X1)) - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) } -// If the input FuncDef structure is ephemeral, then free it. If -// the FuncDef is not ephermal, then do nothing. +// C comment +// /* +// ** If the input FuncDef structure is ephemeral, then free it. If +// ** the FuncDef is not ephermal, then do nothing. +// */ func _freeEphemeralFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef) { if (int32(_pDef.X1) & i32(16)) != i32(0) { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pDef)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pDef)) } } -// Deallocate a KeyInfo object +// C comment +// /* +// ** Deallocate a KeyInfo object +// */ func _sqlite3KeyInfoUnref(tls *crt.TLS, _p *XKeyInfo) { if _p == nil { goto _0 } func() { - if (_p.X0) <= uint32(i32(0)) { + if _p.X0 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3KeyInfoUnrefØ00__func__Ø000))), unsafe.Pointer(str(13857))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X0))) -= 1 - if (_p.X0) == uint32(i32(0)) { - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X4), (unsafe.Pointer)(_p)) + *(*uint32)(unsafe.Pointer(&_p.X0)) -= 1 + if _p.X0 == uint32(i32(0)) { + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X4), unsafe.Pointer(_p)) } _0: } @@ -28648,34 +30200,40 @@ func init() { crt.Xstrncpy(nil, &_sqlite3KeyInfoUnrefØ00__func__Ø000[0], str(41768), 20) } -// Delete a P4 value if necessary. +// C comment +// /* +// ** Delete a P4 value if necessary. +// */ func _freeP4Mem(tls *crt.TLS, _db *Xsqlite3, _p *XMem) { - if (_p.X7) != 0 { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X6)) - } - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) -} - -// Change the value of the P4 operand for a specific instruction. -// This routine is useful when a large program is loaded from a -// static array using sqlite3VdbeAddOpList but we want to make a -// few minor changes to the program. -// -// If n>=0 then the P4 operand is dynamic, meaning that a copy of -// the string is made into memory obtained from sqlite3_malloc(). -// A value of n==0 means copy bytes of zP4 up to and including the -// first null byte. If n>0 then copy n+1 bytes of zP4. -// -// Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points -// to a string or structure that is guaranteed to exist for the lifetime of -// the Vdbe. In these cases we can just copy the pointer. -// -// If addr<0 then change P4 on the most recently inserted instruction. + if _p.X7 != 0 { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X6)) + } + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) +} + +// C comment +// /* +// ** Change the value of the P4 operand for a specific instruction. +// ** This routine is useful when a large program is loaded from a +// ** static array using sqlite3VdbeAddOpList but we want to make a +// ** few minor changes to the program. +// ** +// ** If n>=0 then the P4 operand is dynamic, meaning that a copy of +// ** the string is made into memory obtained from sqlite3_malloc(). +// ** A value of n==0 means copy bytes of zP4 up to and including the +// ** first null byte. If n>0 then copy n+1 bytes of zP4. +// ** +// ** Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points +// ** to a string or structure that is guaranteed to exist for the lifetime of +// ** the Vdbe. In these cases we can just copy the pointer. +// ** +// ** If addr<0 then change P4 on the most recently inserted instruction. +// */ func _vdbeChangeP4Full(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp, _zP4 *int8, _n int32) { - if (_pOp.X1) != 0 { - _freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0)) - *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil + if _pOp.X1 != 0 { + _freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = nil } if _n < i32(0) { _sqlite3VdbeChangeP4(tls, _p, int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer((*XVdbeOp)(_p.X17))))/32)), _zP4, _n) @@ -28684,23 +30242,29 @@ func _vdbeChangeP4Full(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp, _zP4 *int8, _n in if _n == i32(0) { _n = _sqlite3Strlen30(tls, _zP4) } - *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _zP4, uint64(_n)) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-1)) + *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _zP4, uint64(_n)) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-1)) _2: } -// Lock the virtual table so that it cannot be disconnected. -// Locks nest. Every lock should have a corresponding unlock. -// If an unlock is omitted, resources leaks will occur. -// -// If a disconnect is attempted while a virtual table is locked, -// the disconnect is deferred until all locks have been removed. +// C comment +// /* +// ** Lock the virtual table so that it cannot be disconnected. +// ** Locks nest. Every lock should have a corresponding unlock. +// ** If an unlock is omitted, resources leaks will occur. +// ** +// ** If a disconnect is attempted while a virtual table is locked, +// ** the disconnect is deferred until all locks have been removed. +// */ func _sqlite3VtabLock(tls *crt.TLS, _pVTab *XVTable) { - *(*int32)(unsafe.Pointer(&(_pVTab.X3))) += 1 + *(*int32)(unsafe.Pointer(&_pVTab.X3)) += 1 } -// Code an OP_TableLock instruction for each table locked by the -// statement (configured by calls to sqlite3TableLock()). +// C comment +// /* +// ** Code an OP_TableLock instruction for each table locked by the +// ** statement (configured by calls to sqlite3TableLock()). +// */ func _codeTableLocks(tls *crt.TLS, _pParse *XParse) { var _i, _1_p1 int32 var _pVdbe *TVdbe @@ -28714,7 +30278,7 @@ func _codeTableLocks(tls *crt.TLS, _pParse *XParse) { }() _i = i32(0) _2: - if _i >= (_pParse.X36) { + if _i >= _pParse.X36 { goto _5 } _1_p = (*XTableLock)(unsafe.Pointer(uintptr(_pParse.X37) + 24*uintptr(_i))) @@ -28731,8 +30295,11 @@ func init() { crt.Xstrncpy(nil, &_codeTableLocksØ00__func__Ø000[0], str(41797), 15) } -// This routine generates code that will initialize all of the -// register used by the autoincrement tracker. +// C comment +// /* +// ** This routine generates code that will initialize all of the +// ** register used by the autoincrement tracker. +// */ func _sqlite3AutoincrementBegin(tls *crt.TLS, _pParse *XParse) { var _memId int32 var _db *Xsqlite3 @@ -28779,15 +30346,15 @@ _6: if _1_aOp == nil { goto _9 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(0)))).X4))) = _memId - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(0)))).X5))) = _memId + i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(2)))).X5))) = _memId - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X3))) = _memId - i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X5))) = _memId - *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X2))) = uint16(i32(16)) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(4)))).X4))) = _memId + i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(5)))).X5))) = _memId - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(8)))).X4))) = _memId + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(0)))).X4))) = _memId + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(0)))).X5))) = _memId + i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(2)))).X5))) = _memId + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X3))) = _memId - i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X5))) = _memId + *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X2))) = uint16(i32(16)) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(4)))).X4))) = _memId + i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(5)))).X5))) = _memId + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(8)))).X4))) = _memId _p = (*TAggInfo_func)(_p.X0) goto _6 _9: @@ -28799,18 +30366,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AutoincrementBeginØ00__func__Ø000[0], str(41907), 26) } -// Generate code that will -// -// (1) acquire a lock for table pTab then -// (2) open pTab as cursor iCur. -// -// If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index -// for that table that is actually opened. +// C comment +// /* +// ** Generate code that will +// ** +// ** (1) acquire a lock for table pTab then +// ** (2) open pTab as cursor iCur. +// ** +// ** If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index +// ** for that table that is actually opened. +// */ func _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _pTab *XTable, _opcode int32) { var _v *TVdbe var _2_pPk *XIndex func() { - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108869), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(41933))) crt.X__builtin_abort(tls) } @@ -28828,7 +30398,7 @@ func _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _ } return i32(0) }()), _pTab.X0) - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _sqlite3VdbeAddOp4Int(tls, _v, _opcode, _iCur, _pTab.X7, _iDb, int32(_pTab.X11)) _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pTab.X0)) goto _8 @@ -28841,7 +30411,7 @@ func _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _ } }() func() { - if (_2_pPk.X11) != (_pTab.X7) { + if _2_pPk.X11 != _pTab.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108880), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(42001))) crt.X__builtin_abort(tls) } @@ -28858,20 +30428,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3OpenTableØ00__func__Ø000[0], str(42023), 17) } -// Record the fact that we want to lock a table at run-time. -// -// The table to be locked has root page iTab and is found in database iDb. -// A read or a write lock can be taken depending on isWritelock. -// -// This routine just records the fact that the lock is desired. The -// code to make the lock occur is generated by a later call to -// codeTableLocks() which occurs during sqlite3FinishCoding(). +// C comment +// /* +// ** Record the fact that we want to lock a table at run-time. +// ** +// ** The table to be locked has root page iTab and is found in database iDb. +// ** A read or a write lock can be taken depending on isWritelock. +// ** +// ** This routine just records the fact that the lock is desired. The +// ** code to make the lock occur is generated by a later call to +// ** codeTableLocks() which occurs during sqlite3FinishCoding(). +// */ func _sqlite3TableLock(tls *crt.TLS, _pParse *XParse, _iDb int32, _iTab int32, _isWriteLock uint8, _zName *int8) { var _i, _nBytes int32 var _pToplevel *XParse var _p *XTableLock _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse @@ -28890,28 +30463,28 @@ func _sqlite3TableLock(tls *crt.TLS, _pParse *XParse, _iDb int32, _iTab int32, _ } _i = i32(0) _6: - if _i >= (_pToplevel.X36) { + if _i >= _pToplevel.X36 { goto _9 } _p = (*XTableLock)(unsafe.Pointer(uintptr(_pToplevel.X37) + 24*uintptr(_i))) - if ((_p.X0) == _iDb) && ((_p.X1) == _iTab) { - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(bool2int(((_p.X2) != 0) || (_isWriteLock != 0))) + if (_p.X0 == _iDb) && (_p.X1 == _iTab) { + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(bool2int((_p.X2 != 0) || (_isWriteLock != 0))) return } _i += 1 goto _6 _9: - _nBytes = int32(u64(24) * uint64((_pToplevel.X36)+i32(1))) - *(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pToplevel.X37))))) = (*XTableLock)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pToplevel.X0), _pToplevel.X37, uint64(_nBytes))) - if (*XTableLock)(_pToplevel.X37) != nil { - _p = (*XTableLock)(unsafe.Pointer(uintptr(_pToplevel.X37) + 24*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pToplevel.X36))), int32(1))))) - *(*int32)(unsafe.Pointer(&(_p.X0))) = _iDb - *(*int32)(unsafe.Pointer(&(_p.X1))) = _iTab - *(*uint8)(unsafe.Pointer(&(_p.X2))) = _isWriteLock - *(**int8)(unsafe.Pointer(&(_p.X3))) = _zName + _nBytes = int32(u64(24) * uint64(_pToplevel.X36+i32(1))) + *(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pToplevel.X37)))) = (*XTableLock)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pToplevel.X0), _pToplevel.X37, uint64(_nBytes))) + if _pToplevel.X37 != nil { + _p = (*XTableLock)(unsafe.Pointer(uintptr(_pToplevel.X37) + 24*uintptr(postInc1((*int32)(unsafe.Pointer(&_pToplevel.X36)), 1)))) + *(*int32)(unsafe.Pointer(&_p.X0)) = _iDb + *(*int32)(unsafe.Pointer(&_p.X1)) = _iTab + *(*uint8)(unsafe.Pointer(&_p.X2)) = _isWriteLock + *(**int8)(unsafe.Pointer(&_p.X3)) = _zName goto _14 } - *(*int32)(unsafe.Pointer(&(_pToplevel.X36))) = i32(0) + *(*int32)(unsafe.Pointer(&_pToplevel.X36)) = i32(0) _sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.X0)) _14: } @@ -28922,7 +30495,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TableLockØ00__func__Ø000[0], str(42047), 17) } -// Return the PRIMARY KEY index of a table +// C comment +// /* +// ** Return the PRIMARY KEY index of a table +// */ func _sqlite3PrimaryKeyIndex(tls *crt.TLS, _pTab *XTable) (r0 *XIndex) { var _p *XIndex _p = (*XIndex)(_pTab.X2) @@ -28936,8 +30512,11 @@ _4: return _p } -// Set the P4 on the most recently added opcode to the KeyInfo for the -// index given. +// C comment +// /* +// ** Set the P4 on the most recently added opcode to the KeyInfo for the +// ** index given. +// */ func _sqlite3VdbeSetP4KeyInfo(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) { var _v *TVdbe var _pKeyInfo *XKeyInfo @@ -28956,7 +30535,7 @@ func _sqlite3VdbeSetP4KeyInfo(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) { }() _pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIdx) if _pKeyInfo != nil { - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pKeyInfo), i32(-5)) + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pKeyInfo), i32(-5)) } } @@ -28966,20 +30545,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000[0], str(42077), 24) } -// Return a KeyInfo structure that is appropriate for the given Index. -// -// The caller should invoke sqlite3KeyInfoUnref() on the returned object -// when it has finished using it. +// C comment +// /* +// ** Return a KeyInfo structure that is appropriate for the given Index. +// ** +// ** The caller should invoke sqlite3KeyInfoUnref() on the returned object +// ** when it has finished using it. +// */ func _sqlite3KeyInfoOfIndex(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) (r0 *XKeyInfo) { var _i, _nCol, _nKey int32 var _4_zColl *int8 var _pKey *XKeyInfo _nCol = int32(_pIdx.X14) _nKey = int32(_pIdx.X13) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return nil } - if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { _pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.X0), _nKey, _nCol-_nKey) goto _2 } @@ -28999,18 +30581,18 @@ _6: if _i >= _nCol { goto _9 } - _4_zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_i))) - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKey.X6))))) + 8*uintptr(_i))) = func() *XCollSeq { + _4_zColl = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_i))) + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKey.X6)))) + 8*uintptr(_i))) = func() *XCollSeq { if _4_zColl == (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) { return nil } return _sqlite3LocateCollSeq(tls, _pParse, _4_zColl) }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKey.X5)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_i))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pKey.X5)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X7)) + 1*uintptr(_i))) _i += 1 goto _6 _9: - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { _sqlite3KeyInfoUnref(tls, _pKey) _pKey = nil } @@ -29018,21 +30600,24 @@ _3: return _pKey } -// Allocate a KeyInfo object sufficient for an index of N key columns and -// X extra columns. +// C comment +// /* +// ** Allocate a KeyInfo object sufficient for an index of N key columns and +// ** X extra columns. +// */ func _sqlite3KeyInfoAlloc(tls *crt.TLS, _db *Xsqlite3, _N int32, _X int32) (r0 *XKeyInfo) { var _nExtra int32 var _p *XKeyInfo _nExtra = int32(uint64(_N+_X) * u64(9)) _p = (*XKeyInfo)(_sqlite3DbMallocRawNN(tls, _db, u64(40)+uint64(_nExtra))) if _p != nil { - *(**uint8)(unsafe.Pointer(&(_p.X5))) = (*uint8)(unsafe.Pointer((**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) + 8*uintptr(_N+_X))))) - *(*uint16)(unsafe.Pointer(&(_p.X2))) = uint16(_N) - *(*uint16)(unsafe.Pointer(&(_p.X3))) = uint16(_X) - *(*uint8)(unsafe.Pointer(&(_p.X1))) = _db.X14 - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _db - *(*uint32)(unsafe.Pointer(&(_p.X0))) = uint32(i32(1)) - crt.Xmemset(tls, (unsafe.Pointer)((*XKeyInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+40*uintptr(i32(1))))), i32(0), uint64(_nExtra)) + *(**uint8)(unsafe.Pointer(&_p.X5)) = (*uint8)(unsafe.Pointer((**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_p.X6)))) + 8*uintptr(_N+_X))))) + *(*uint16)(unsafe.Pointer(&_p.X2)) = uint16(_N) + *(*uint16)(unsafe.Pointer(&_p.X3)) = uint16(_X) + *(*uint8)(unsafe.Pointer(&_p.X1)) = _db.X14 + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = _db + *(*uint32)(unsafe.Pointer(&_p.X0)) = uint32(i32(1)) + crt.Xmemset(tls, unsafe.Pointer((*XKeyInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_p))+40*uintptr(i32(1))))), i32(0), uint64(_nExtra)) goto _1 } _sqlite3OomFault(tls, _db) @@ -29040,12 +30625,15 @@ _1: return _p } -// Return TRUE if a KeyInfo object can be change. The KeyInfo object -// can only be changed if this is just a single reference to the object. -// -// This routine is used only inside of assert() statements. +// C comment +// /* +// ** Return TRUE if a KeyInfo object can be change. The KeyInfo object +// ** can only be changed if this is just a single reference to the object. +// ** +// ** This routine is used only inside of assert() statements. +// */ func _sqlite3KeyInfoIsWriteable(tls *crt.TLS, _p *XKeyInfo) (r0 int32) { - return bool2int((_p.X0) == uint32(i32(1))) + return bool2int(_p.X0 == uint32(i32(1))) } var _sqlite3KeyInfoOfIndexØ00__func__Ø000 [22]int8 @@ -29060,50 +30648,56 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StrBINARY[0], str(37881), 7) } -// This function returns the collation sequence for database native text -// encoding identified by the string zName, length nName. -// -// If the requested collation sequence is not available, or not available -// in the database native encoding, the collation factory is invoked to -// request it. If the collation factory does not supply such a sequence, -// and the sequence is available in another text encoding, then that is -// returned instead. -// -// If no versions of the requested collations sequence are available, or -// another error occurs, NULL is returned and an error message written into -// pParse. -// -// This routine is a wrapper around sqlite3FindCollSeq(). This routine -// invokes the collation factory if the named collation cannot be found -// and generates an error message. -// -// See also: sqlite3FindCollSeq(), sqlite3GetCollSeq() +// C comment +// /* +// ** This function returns the collation sequence for database native text +// ** encoding identified by the string zName, length nName. +// ** +// ** If the requested collation sequence is not available, or not available +// ** in the database native encoding, the collation factory is invoked to +// ** request it. If the collation factory does not supply such a sequence, +// ** and the sequence is available in another text encoding, then that is +// ** returned instead. +// ** +// ** If no versions of the requested collations sequence are available, or +// ** another error occurs, NULL is returned and an error message written into +// ** pParse. +// ** +// ** This routine is a wrapper around sqlite3FindCollSeq(). This routine +// ** invokes the collation factory if the named collation cannot be found +// ** and generates an error message. +// ** +// ** See also: sqlite3FindCollSeq(), sqlite3GetCollSeq() +// */ func _sqlite3LocateCollSeq(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 *XCollSeq) { var _enc, _initbusy uint8 var _db *Xsqlite3 var _pColl *XCollSeq _db = (*Xsqlite3)(_pParse.X0) _enc = _db.X14 - _initbusy = (*t21)(unsafe.Pointer(&(_db.X33))).X2 + _initbusy = (*t21)(unsafe.Pointer(&_db.X33)).X2 _pColl = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(_initbusy)) - if (_initbusy == 0) && ((_pColl == nil) || ((_pColl.X3) == nil)) { + if (_initbusy == 0) && ((_pColl == nil) || (_pColl.X3 == nil)) { _pColl = _sqlite3GetCollSeq(tls, _pParse, _enc, _pColl, _zName) } return _pColl } -// This function is responsible for invoking the collation factory callback -// or substituting a collation sequence of a different encoding when the -// requested collation sequence is not available in the desired encoding. -// -// If it is not NULL, then pColl must point to the database native encoding -// collation sequence with name zName, length nName. -// -// The return value is either the collation sequence to be used in database -// db for collation type name zName, length nName, or NULL, if no collation -// sequence can be found. If no collation is found, leave an error message. -// -// See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq() +// C comment +// /* +// ** This function is responsible for invoking the collation factory callback +// ** or substituting a collation sequence of a different encoding when the +// ** requested collation sequence is not available in the desired encoding. +// ** +// ** If it is not NULL, then pColl must point to the database native encoding +// ** collation sequence with name zName, length nName. +// ** +// ** The return value is either the collation sequence to be used in database +// ** db for collation type name zName, length nName, or NULL, if no collation +// ** sequence can be found. If no collation is found, leave an error message. +// ** +// ** See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq() +// */ func _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XCollSeq, _zName *int8) (r0 *XCollSeq) { var _db *Xsqlite3 var _p *XCollSeq @@ -29112,15 +30706,15 @@ func _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XColl if _p == nil { _p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, i32(0)) } - if (_p == nil) || ((_p.X3) == nil) { + if (_p == nil) || (_p.X3 == nil) { _callCollNeeded(tls, _db, int32(_enc), _zName) _p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, i32(0)) } - if ((_p != nil) && ((_p.X3) == nil)) && _synthCollSeq(tls, _db, _p) != 0 { + if ((_p != nil) && (_p.X3 == nil)) && _synthCollSeq(tls, _db, _p) != 0 { _p = nil } func() { - if _p != nil && (_p.X3) == nil { + if _p != nil && _p.X3 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104250), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetCollSeqØ00__func__Ø000))), unsafe.Pointer(str(42155))) crt.X__builtin_abort(tls) } @@ -29131,47 +30725,44 @@ func _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XColl return _p } -// Invoke the 'collation needed' callback to request a collation sequence -// in the encoding enc of name zName, length nName. +// C comment +// /* +// ** Invoke the 'collation needed' callback to request a collation sequence +// ** in the encoding enc of name zName, length nName. +// */ func _callCollNeeded(tls *crt.TLS, _db *Xsqlite3, _enc int32, _zName *int8) { var _1_zExternal, _2_zExternal *int8 var _2_pTmp *XMem func() { - if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8) - }{(_db.X53)}))) != nil && (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer) - }{(_db.X54)}))) != nil { + if _db.X53 != nil && _db.X54 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104169), unsafe.Pointer((*int8)(unsafe.Pointer(&_callCollNeededØ00__func__Ø000))), unsafe.Pointer(str(42200))) crt.X__builtin_abort(tls) } }() - if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8) - }{(_db.X53)}))) == nil { + if _db.X53 == nil { goto _3 } _1_zExternal = _sqlite3DbStrDup(tls, _db, _zName) if _1_zExternal == nil { return } - (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8) - }{(_db.X53)})))(tls, _db.X55, _db, _enc, _1_zExternal) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_zExternal)) + func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8) { + v := _db.X53 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&v)) + }()(tls, _db.X55, _db, _enc, _1_zExternal) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zExternal)) _3: - if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer) - }{(_db.X54)}))) == nil { + if _db.X54 == nil { goto _5 } _2_pTmp = _sqlite3ValueNew(tls, _db) - _sqlite3ValueSetStr(tls, _2_pTmp, i32(-1), (unsafe.Pointer)(_zName), uint8(i32(1)), nil) + _sqlite3ValueSetStr(tls, _2_pTmp, i32(-1), unsafe.Pointer(_zName), uint8(i32(1)), nil) _2_zExternal = (*int8)(_sqlite3ValueText(tls, _2_pTmp, uint8(i32(2)))) if _2_zExternal != nil { - (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer) - }{(_db.X54)})))(tls, _db.X55, _db, int32(_db.X14), (unsafe.Pointer)(_2_zExternal)) + func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer) { + v := _db.X54 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&v)) + }()(tls, _db.X55, _db, int32(_db.X14), unsafe.Pointer(_2_zExternal)) } _sqlite3ValueFree(tls, _2_pTmp) _5: @@ -29183,11 +30774,14 @@ func init() { crt.Xstrncpy(nil, &_callCollNeededØ00__func__Ø000[0], str(42239), 15) } -// Make a copy of a string in memory obtained from sqliteMalloc(). These -// functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This -// is because when memory debugging is turned on, these two functions are -// called via macros that record the current file and line number in the -// ThreadData structure. +// C comment +// /* +// ** Make a copy of a string in memory obtained from sqliteMalloc(). These +// ** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This +// ** is because when memory debugging is turned on, these two functions are +// ** called via macros that record the current file and line number in the +// ** ThreadData structure. +// */ func _sqlite3DbStrDup(tls *crt.TLS, _db *Xsqlite3, _z *int8) (r0 *int8) { var _n uint64 var _zNew *int8 @@ -29197,16 +30791,19 @@ func _sqlite3DbStrDup(tls *crt.TLS, _db *Xsqlite3, _z *int8) (r0 *int8) { _n = crt.Xstrlen(tls, _z) + uint64(i32(1)) _zNew = (*int8)(_sqlite3DbMallocRaw(tls, _db, _n)) if _zNew != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_z), _n) + crt.Xmemcpy(tls, unsafe.Pointer(_zNew), unsafe.Pointer(_z), _n) } return _zNew } -// This routine is called if the collation factory fails to deliver a -// collation function in the best encoding but there may be other versions -// of this collation function (for other text encodings) available. Use one -// of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if -// possible. +// C comment +// /* +// ** This routine is called if the collation factory fails to deliver a +// ** collation function in the best encoding but there may be other versions +// ** of this collation function (for other text encodings) available. Use one +// ** of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if +// ** possible. +// */ func _synthCollSeq(tls *crt.TLS, _db *Xsqlite3, _pColl *XCollSeq) (r0 int32) { var _i int32 var _z *int8 @@ -29217,14 +30814,14 @@ _0: if _i >= i32(3) { goto _3 } - _pColl2 = _sqlite3FindCollSeq(tls, _db, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_synthCollSeqØ00aEncØ001)) + 1*uintptr(_i))), _z, i32(0)) + _pColl2 = _sqlite3FindCollSeq(tls, _db, *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_synthCollSeqØ00aEncØ001)) + 1*uintptr(_i))), _z, i32(0)) if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32 - }{(_pColl2.X3)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_pColl2.X3})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32 }{nil})) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_pColl), (unsafe.Pointer)(_pColl2), u64(40)) - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pColl.X4))) = nil + crt.Xmemcpy(tls, unsafe.Pointer(_pColl), unsafe.Pointer(_pColl2), u64(40)) + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pColl.X4)) = nil return i32(0) } _i += 1 @@ -29245,13 +30842,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GetCollSeqØ00__func__Ø000[0], str(42254), 18) } -// Change the P4 operand of the most recently coded instruction -// to the value defined by the arguments. This is a high-speed -// version of sqlite3VdbeChangeP4(). -// -// The P4 operand must not have been previously defined. And the new -// P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of -// those cases. +// C comment +// /* +// ** Change the P4 operand of the most recently coded instruction +// ** to the value defined by the arguments. This is a high-speed +// ** version of sqlite3VdbeChangeP4(). +// ** +// ** The P4 operand must not have been previously defined. And the new +// ** P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of +// ** those cases. +// */ func _sqlite3VdbeAppendP4(tls *crt.TLS, _p *TVdbe, _pP4 unsafe.Pointer, _n int32) { var _pOp *XVdbeOp func() { @@ -29277,20 +30877,20 @@ func _sqlite3VdbeAppendP4(tls *crt.TLS, _p *TVdbe, _pP4 unsafe.Pointer, _n int32 } }() func() { - if (_p.X27) <= i32(0) { + if _p.X27 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(41716))) crt.X__builtin_abort(tls) } }() - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr((_p.X27)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_p.X27-i32(1)))) func() { if int32(_pOp.X1) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(42310))) crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(_n) - *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _pP4 + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(_n) + *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = _pP4 _6: } @@ -29300,17 +30900,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeAppendP4Ø00__func__Ø000[0], str(42334), 20) } -// Generate code to cause the string zStr to be loaded into -// register iDest +// C comment +// /* Generate code to cause the string zStr to be loaded into +// ** register iDest +// */ func _sqlite3VdbeLoadString(tls *crt.TLS, _p *TVdbe, _iDest int32, _zStr *int8) (r0 int32) { return _sqlite3VdbeAddOp4(tls, _p, i32(97), i32(0), _iDest, i32(0), _zStr, i32(0)) } -// Add a whole list of operations to the operation stack. Return a -// pointer to the first operation inserted. -// -// Non-zero P2 arguments to jump instructions are automatically adjusted -// so that the jump target is relative to the first operation inserted. +// C comment +// /* +// ** Add a whole list of operations to the operation stack. Return a +// ** pointer to the first operation inserted. +// ** +// ** Non-zero P2 arguments to jump instructions are automatically adjusted +// ** so that the jump target is relative to the first operation inserted. +// */ func _sqlite3VdbeAddOpList(tls *crt.TLS, _p *TVdbe, _nOp int32, _aOp *XVdbeOpList, _iLineno int32) (r0 *XVdbeOp) { var _i int32 var _pOut, _pFirst *XVdbeOp @@ -29321,12 +30926,12 @@ func _sqlite3VdbeAddOpList(tls *crt.TLS, _p *TVdbe, _nOp int32, _aOp *XVdbeOpLis } }() func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } }() - if (((_p.X27) + _nOp) > ((*XParse)(_p.X3).X19)) && _growOpArray(tls, _p, _nOp) != 0 { + if ((_p.X27 + _nOp) > ((*XParse)(_p.X3).X19)) && _growOpArray(tls, _p, _nOp) != 0 { return nil } _pFirst = store40(&_pOut, (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_p.X27)))) @@ -29335,30 +30940,30 @@ _6: if _i >= _nOp { goto _9 } - *(*uint8)(unsafe.Pointer(&(_pOut.X0))) = _aOp.X0 - *(*int32)(unsafe.Pointer(&(_pOut.X3))) = int32(_aOp.X1) - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_aOp.X2) + *(*uint8)(unsafe.Pointer(&_pOut.X0)) = _aOp.X0 + *(*int32)(unsafe.Pointer(&_pOut.X3)) = int32(_aOp.X1) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = int32(_aOp.X2) func() { if int32(_aOp.X2) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000))), unsafe.Pointer(str(42360))) crt.X__builtin_abort(tls) } }() - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_aOp.X0)))) & i32(1)) != i32(0)) && (int32(_aOp.X2) > i32(0)) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3OpcodeProperty)) + 1*uintptr(_aOp.X0)))) & i32(1)) != i32(0)) && (int32(_aOp.X2) > i32(0)) { { - p := (*int32)(unsafe.Pointer(&(_pOut.X4))) - *p = (*p) + (_p.X27) + p := (*int32)(unsafe.Pointer(&_pOut.X4)) + *p = (*p) + _p.X27 sink1(*p) } } - *(*int32)(unsafe.Pointer(&(_pOut.X5))) = int32(_aOp.X3) - *(*int8)(unsafe.Pointer(&(_pOut.X1))) = int8(i32(0)) - *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOut.X6))))) = nil - *(*uint16)(unsafe.Pointer(&(_pOut.X2))) = uint16(i32(0)) - *(**int8)(unsafe.Pointer(&(_pOut.X7))) = nil + *(*int32)(unsafe.Pointer(&_pOut.X5)) = int32(_aOp.X3) + *(*int8)(unsafe.Pointer(&_pOut.X1)) = int8(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOut.X6)))) = nil + *(*uint16)(unsafe.Pointer(&_pOut.X2)) = uint16(i32(0)) + *(**int8)(unsafe.Pointer(&_pOut.X7)) = nil if (((*Xsqlite3)(_p.X0).X6) & i32(4096)) != 0 { - _sqlite3VdbePrintOp(tls, nil, _i+(_p.X27), (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_i+(_p.X27))))) + _sqlite3VdbePrintOp(tls, nil, _i+_p.X27, (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_i+_p.X27)))) } *(*uintptr)(unsafe.Pointer(func() **XVdbeOp { *(*uintptr)(unsafe.Pointer(func() **XVdbeOpList { _i += 1; return &_aOp }())) += uintptr(4) @@ -29367,7 +30972,7 @@ _6: goto _6 _9: { - p := (*int32)(unsafe.Pointer(&(_p.X27))) + p := (*int32)(unsafe.Pointer(&_p.X27)) *p = (*p) + _nOp sink1(*p) } @@ -29394,13 +30999,16 @@ func init() { var _sqlite3AutoincrementBeginØ00iLnØ001 int32 -// Generate code that will evaluate expression pExpr and store the -// results in register target. The results are guaranteed to appear -// in register target. +// C comment +// /* +// ** Generate code that will evaluate expression pExpr and store the +// ** results in register target. The results are guaranteed to appear +// ** in register target. +// */ func _sqlite3ExprCode(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) { var _inReg int32 func() { - if _target <= i32(0) || _target > (_pParse.X18) { + if _target <= i32(0) || _target > _pParse.X18 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95060), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000))), unsafe.Pointer(str(42392))) crt.X__builtin_abort(tls) } @@ -29416,7 +31024,7 @@ func _sqlite3ExprCode(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int3 crt.X__builtin_abort(tls) } }() - if (_inReg != _target) && ((*TVdbe)(_pParse.X2) != nil) { + if (_inReg != _target) && (_pParse.X2 != nil) { _sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(65), _inReg, _target) } _5: @@ -29428,15 +31036,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeØ00__func__Ø000[0], str(42470), 16) } -// Generate code into the current Vdbe to evaluate the given -// expression. Attempt to store the results in register "target". -// Return the register where results are stored. -// -// With this routine, there is no guarantee that results will -// be stored in target. The result might be stored in some other -// register if it is convenient to do so. The calling function -// must check the return code and move the results to the desired -// register. +// C comment +// /* +// ** Generate code into the current Vdbe to evaluate the given +// ** expression. Attempt to store the results in register "target". +// ** Return the register where results are stored. +// ** +// ** With this routine, there is no guarantee that results will +// ** be stored in target. The result might be stored in some other +// ** register if it is convenient to do so. The calling function +// ** must check the return code and move the results to the desired +// ** register. +// */ func _sqlite3ExprCodeTarget(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) (r0 int32) { var _op, _inReg, _regFree1, _regFree2, _r1, _r2, _p5, _8_iTab, _16_n, _31_addr, _35_nFarg, _35_i, _40_endCoalesce, _57_nCol, _60_n, _63_destIfFalse, _63_destIfNull, _66_p1, _69_addrINR, _70_endLabel, _70_nextCase, _70_nExpr, _70_i, _70_iCacheLevel int32 var _43_aff int8 @@ -29461,7 +31072,7 @@ func _sqlite3ExprCodeTarget(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _targe _regFree2 = i32(0) _p5 = i32(0) func() { - if _target <= i32(0) || _target > (_pParse.X18) { + if _target <= i32(0) || _target > _pParse.X18 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94349), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42392))) crt.X__builtin_abort(tls) } @@ -29587,16 +31198,16 @@ _7: _9: _5_pAggInfo = (*XAggInfo)(_pExpr.X13) _5_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_5_pAggInfo.X8) + 32*uintptr(_pExpr.X10))) - if (_5_pAggInfo.X0) == 0 { + if _5_pAggInfo.X0 == 0 { func() { - if (_5_pCol.X4) <= i32(0) { + if _5_pCol.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94365), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42511))) crt.X__builtin_abort(tls) } }() return _5_pCol.X4 } - if (_5_pAggInfo.X1) != 0 { + if _5_pAggInfo.X1 != 0 { _sqlite3VdbeAddOp3(tls, _v, i32(99), _5_pAggInfo.X3, _5_pCol.X3, _target) return _target } @@ -29605,8 +31216,8 @@ _10: if _8_iTab >= i32(0) { goto _64 } - if (_pParse.X21) > i32(0) { - return int32(_pExpr.X9) + (_pParse.X21) + if _pParse.X21 > i32(0) { + return int32(_pExpr.X9) + _pParse.X21 } _8_iTab = _pParse.X22 _64: @@ -29618,22 +31229,22 @@ _11: _12: func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - _codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(0), _target) + _codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), i32(0), _target) return _target _13: func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94402), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeLoadString(tls, _v, _target, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) + _sqlite3VdbeLoadString(tls, _v, _target, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) return _target _14: @@ -29642,27 +31253,27 @@ _14: _15: func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94415), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(88) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) != i32(88) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94416), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42561))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(39) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(1))))) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42612))) crt.X__builtin_abort(tls) } }() - _16_z = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(2)))) + _16_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(2)))) _16_n = _sqlite3Strlen30(tls, _16_z) - i32(1) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_16_z)) + 1*uintptr(_16_n)))) != i32(39) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_16_z)) + 1*uintptr(_16_n)))) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94420), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42637))) crt.X__builtin_abort(tls) } @@ -29673,34 +31284,34 @@ _15: _16: func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() func() { - if (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) == nil { + if (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94428), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42648))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94429), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42667))) crt.X__builtin_abort(tls) } }() _sqlite3VdbeAddOp2(tls, _v, i32(62), int32(_pExpr.X9), _target) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(1))))) != i32(0) { _18_z = _sqlite3VListNumToName(tls, _pParse.X60, int32(_pExpr.X9)) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(63) && crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), _18_z) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) != i32(63) && crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), _18_z) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94433), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42689))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParse.X60)) + 4*uintptr(i32(0)))) = i32(0) - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_18_z), i32(-2)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParse.X60)) + 4*uintptr(i32(0)))) = i32(0) + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_18_z), i32(-2)) } return _target @@ -29713,7 +31324,7 @@ _18: _sqlite3VdbeAddOp2(tls, _v, i32(65), _inReg, _target) _inReg = _target } - _sqlite3VdbeAddOp2(tls, _v, i32(94), _target, int32(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil))) + _sqlite3VdbeAddOp2(tls, _v, i32(94), _target, int32(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), nil))) _sqlite3ExprCacheAffinityChange(tls, _pParse, _inReg, i32(1)) return _inReg @@ -29772,17 +31383,17 @@ _39: } if int32(_26_pLeft.X0) == i32(132) { func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94525), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - _codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_26_pLeft.X3))))), i32(1), _target) + _codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_26_pLeft.X3)))), i32(1), _target) return _target } - *(*uint8)(unsafe.Pointer(&(_tempX.X0))) = uint8(i32(134)) - *(*uint32)(unsafe.Pointer(&(_tempX.X2))) = uint32(i32(17408)) - *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_tempX.X3))))) = i32(0) + *(*uint8)(unsafe.Pointer(&_tempX.X0)) = uint8(i32(134)) + *(*uint32)(unsafe.Pointer(&_tempX.X2)) = uint32(i32(17408)) + *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_tempX.X3)))) = i32(0) _r1 = _sqlite3ExprCodeTemp(tls, _pParse, &_tempX, &_regFree1) _r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree2) _sqlite3VdbeAddOp3(tls, _v, i32(89), _r2, _r1, _target) @@ -29806,12 +31417,12 @@ _44: _32_pInfo = (*XAggInfo)(_pExpr.X13) if _32_pInfo == nil { func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94567), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - _sqlite3ErrorMsg(tls, _pParse, str(42752), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3ErrorMsg(tls, _pParse, str(42752), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _107 } return (*TAggInfo_func)(unsafe.Pointer(uintptr(_32_pInfo.X11) + 24*uintptr(_pExpr.X10))).X2 @@ -29823,40 +31434,41 @@ _45: _35_db = (*Xsqlite3)(_pParse.X0) _35_enc = _35_db.X14 _35_pColl = nil - if ((_pParse.X11) != 0) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 { + if (_pParse.X11 != 0) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 { return _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, i32(-1)) } func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94590), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() - if ((_pExpr.X2) & uint32(i32(16384))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(16384))) != uint32(i32(0)) { _35_pFarg = nil goto _113 } - _35_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _35_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _113: _35_nFarg = func() int32 { if _35_pFarg != nil { - return (_35_pFarg.X0) + return _35_pFarg.X0 } return i32(0) }() func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - _35_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _35_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) _35_pDef = _sqlite3FindFunction(tls, _35_db, _35_zId, _35_nFarg, _35_enc, uint8(i32(0))) if (_35_pDef == nil) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context) - }{(*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_35_pDef.X5)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_context) { + v := _35_pDef.X5 + return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context) }{nil}))) { _sqlite3ErrorMsg(tls, _pParse, str(42816), unsafe.Pointer(_35_zId)) @@ -29872,7 +31484,7 @@ _113: crt.X__builtin_abort(tls) } }() - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(0)))).X0), _target) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(0)))).X0), _target) _35_i = i32(1) _123: if _35_i >= _35_nFarg { @@ -29881,7 +31493,7 @@ _123: _sqlite3VdbeAddOp2(tls, _v, i32(76), _target, _40_endCoalesce) _sqlite3ExprCacheRemove(tls, _pParse, _target, i32(1)) _sqlite3ExprCachePush(tls, _pParse) - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(_35_i))).X0), _target) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(_35_i))).X0), _target) _sqlite3ExprCachePop(tls, _pParse) _35_i += 1 goto _123 @@ -29896,25 +31508,25 @@ _120: crt.X__builtin_abort(tls) } }() - return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(0)))).X0), _target) + return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(0)))).X0), _target) } if (int32(_35_pDef.X1) & i32(16384)) != 0 { _43_azAff = [5]*int8{} - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(i32(0)))) = str(42857) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(i32(1)))) = str(42862) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(i32(2)))) = str(42867) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(i32(3)))) = str(42875) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(i32(4)))) = str(42883) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(i32(0)))) = str(42857) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(i32(1)))) = str(42862) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(i32(2)))) = str(42867) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(i32(3)))) = str(42875) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(i32(4)))) = str(42883) func() { if _35_nFarg != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94646), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42888))) crt.X__builtin_abort(tls) } }() - _43_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(0)))).X0)) + _43_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(0)))).X0)) _sqlite3VdbeLoadString(tls, _v, _target, func() *int8 { if _43_aff != 0 { - return (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 8*uintptr(int32(_43_aff)-i32(65))))) + return (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_43_azAff)) + 8*uintptr(int32(_43_aff)-i32(65))))) } return str(42897) }()) @@ -29925,7 +31537,7 @@ _135: if _35_i >= _35_nFarg { goto _138 } - if (_35_i < i32(32)) && _sqlite3ExprIsConstant(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(_35_i))).X0)) != 0 { + if (_35_i < i32(32)) && _sqlite3ExprIsConstant(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(_35_i))).X0)) != 0 { { p := &_35_constMask *p = (*p) | (u32(1) << uint(_35_i)) @@ -29933,7 +31545,7 @@ _135: } } if ((int32(_35_pDef.X1) & i32(32)) != i32(0)) && (_35_pColl == nil) { - _35_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(_35_i))).X0)) + _35_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(_35_i))).X0)) } _35_i += 1 goto _135 @@ -29942,9 +31554,9 @@ _138: goto _143 } if _35_constMask != 0 { - _r1 = (_pParse.X18) + i32(1) + _r1 = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _35_nFarg sink1(*p) } @@ -29962,16 +31574,16 @@ _145: } }() func() { - if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(0)))).X0) == nil { + if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(0)))).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42902))) crt.X__builtin_abort(tls) } }() - _50_exprOp = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2))))) + 32*uintptr(i32(0)))).X0).X0 + _50_exprOp = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2)))) + 32*uintptr(i32(0)))).X0).X0 if (int32(_50_exprOp) == i32(152)) || (int32(_50_exprOp) == i32(154)) { i32(0) i32(0) - *(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2))))) + 32*uintptr(i32(0)))).X0).X12))) = uint8(int32(_35_pDef.X1) & i32(192)) + *(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2)))) + 32*uintptr(i32(0)))).X0).X12))) = uint8(int32(_35_pDef.X1) & i32(192)) } _146: _sqlite3ExprCachePush(tls, _pParse) @@ -29981,12 +31593,12 @@ _146: _143: _r1 = i32(0) _153: - if (_35_nFarg >= i32(2)) && (((_pExpr.X2) & uint32(i32(128))) != 0) { - _35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(1)))).X0)) + if (_35_nFarg >= i32(2)) && ((_pExpr.X2 & uint32(i32(128))) != 0) { + _35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(1)))).X0)) goto _157 } if _35_nFarg > i32(0) { - _35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+32*uintptr(i32(0)))).X0)) + _35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_35_pFarg.X2))))+32*uintptr(i32(0)))).X0)) } _157: if (int32(_35_pDef.X1) & i32(32)) == 0 { @@ -30005,7 +31617,7 @@ _158: return _target _46: - if (_op == i32(119)) && (store1(&_57_nCol, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0) != i32(1)) { + if (_op == i32(119)) && (store1(&_57_nCol, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0).X0) != i32(1)) { _sqlite3SubselectError(tls, _pParse, _57_nCol, i32(1)) goto _164 } @@ -30018,12 +31630,12 @@ _48: *(*int32)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X8))) = _sqlite3CodeSubselect(tls, _pParse, (*XExpr)(_pExpr.X4), i32(0), i32(0)) } func() { - if (_pExpr.X8) != i32(0) && int32((*XExpr)(_pExpr.X4).X0) != i32(119) { + if _pExpr.X8 != i32(0) && int32((*XExpr)(_pExpr.X4).X0) != i32(119) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42923))) crt.X__builtin_abort(tls) } }() - if (_pExpr.X8) != 0 && ((_pExpr.X8) != store1(&_60_n, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4)))) { + if _pExpr.X8 != 0 && (_pExpr.X8 != store1(&_60_n, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4)))) { _sqlite3ErrorMsg(tls, _pParse, str(42971), _pExpr.X8, _60_n) } return ((*XExpr)(_pExpr.X4).X8) + int32(_pExpr.X9) @@ -30048,9 +31660,9 @@ _51: _54: _66_pTab = (*XTable)(_pExpr.X14) - _66_p1 = (((_pExpr.X8) * (int32(_66_pTab.X11) + i32(1))) + i32(1)) + int32(_pExpr.X9) + _66_p1 = ((_pExpr.X8 * (int32(_66_pTab.X11) + i32(1))) + i32(1)) + int32(_pExpr.X9) func() { - if (_pExpr.X8) != i32(0) && (_pExpr.X8) != i32(1) { + if _pExpr.X8 != i32(0) && _pExpr.X8 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94819), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43001))) crt.X__builtin_abort(tls) } @@ -30075,7 +31687,7 @@ _54: }() _sqlite3VdbeAddOp2(tls, _v, i32(146), _66_p1, _target) _sqlite3VdbeComment(tls, _v, str(43160), unsafe.Pointer(func() *int8 { - if (_pExpr.X8) != 0 { + if _pExpr.X8 != 0 { return str(43173) } return str(43177) @@ -30110,27 +31722,27 @@ _57: _70_pTest = nil _70_iCacheLevel = _pParse.X23 func() { - if ((_pExpr.X2)&uint32(i32(2048))) != uint32(i32(0)) || (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil { + if (_pExpr.X2&uint32(i32(2048))) != uint32(i32(0)) || (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94895), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43211))) crt.X__builtin_abort(tls) } }() func() { - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) <= i32(0) { + if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43267))) crt.X__builtin_abort(tls) } }() - _70_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) - _70_aListelem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_70_pEList.X2))))) + _70_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) + _70_aListelem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_70_pEList.X2)))) _70_nExpr = _70_pEList.X0 _70_endLabel = _sqlite3VdbeMakeLabel(tls, _v) if store36(&_70_pX, (*XExpr)(_pExpr.X4)) != nil { _tempX = *_70_pX _exprToRegister(tls, &_tempX, _exprCodeVector(tls, _pParse, &_tempX, &_regFree1)) - crt.Xmemset(tls, (unsafe.Pointer)(&_70_opCompare), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_70_opCompare.X0))) = uint8(i32(78)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_70_opCompare.X4))))) = &_tempX + crt.Xmemset(tls, unsafe.Pointer(&_70_opCompare), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_70_opCompare.X0)) = uint8(i32(78)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_70_opCompare.X4)))) = &_tempX _70_pTest = &_70_opCompare _regFree1 = i32(0) } @@ -30147,14 +31759,14 @@ _197: crt.X__builtin_abort(tls) } }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_70_opCompare.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem)) + 32*uintptr(_70_i))).X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_70_opCompare.X5)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_70_aListelem)) + 32*uintptr(_70_i))).X0) goto _204 } - _70_pTest = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem)) + 32*uintptr(_70_i))).X0) + _70_pTest = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_70_aListelem)) + 32*uintptr(_70_i))).X0) _204: _70_nextCase = _sqlite3VdbeMakeLabel(tls, _v) _sqlite3ExprIfFalse(tls, _pParse, _70_pTest, _70_nextCase, i32(16)) - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem))+32*uintptr(_70_i+i32(1)))).X0), _target) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_70_aListelem))+32*uintptr(_70_i+i32(1)))).X0), _target) _sqlite3VdbeGoto(tls, _v, _70_endLabel) _sqlite3ExprCachePop(tls, _pParse) _sqlite3VdbeResolveLabel(tls, _v, _70_nextCase) @@ -30163,14 +31775,14 @@ _204: _200: if (_70_nExpr & i32(1)) != i32(0) { _sqlite3ExprCachePush(tls, _pParse) - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_70_pEList.X2)))))+32*uintptr(_70_nExpr-i32(1)))).X0), _target) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_70_pEList.X2))))+32*uintptr(_70_nExpr-i32(1)))).X0), _target) _sqlite3ExprCachePop(tls, _pParse) goto _206 } _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _target) _206: func() { - if ((*Xsqlite3)(_pParse.X0).X17) == 0 && (_pParse.X16) <= i32(0) && (_pParse.X23) != _70_iCacheLevel { + if ((*Xsqlite3)(_pParse.X0).X17) == 0 && _pParse.X16 <= i32(0) && _pParse.X23 != _70_iCacheLevel { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94940), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43302))) crt.X__builtin_abort(tls) } @@ -30184,7 +31796,7 @@ _58: crt.X__builtin_abort(tls) } }() - if (*XTable)(_pParse.X40) == nil { + if _pParse.X40 == nil { _sqlite3ErrorMsg(tls, _pParse, str(43497)) return i32(0) } @@ -30192,16 +31804,16 @@ _58: _sqlite3MayAbort(tls, _pParse) } func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() if int32(_pExpr.X1) == i32(4) { - _sqlite3VdbeAddOp4(tls, _v, i32(55), i32(0), i32(4), i32(0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(0)) + _sqlite3VdbeAddOp4(tls, _v, i32(55), i32(0), i32(4), i32(0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), i32(0)) goto _221 } - _sqlite3HaltConstraint(tls, _pParse, i32(1811), int32(_pExpr.X1), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), int8(i32(0)), uint8(i32(0))) + _sqlite3HaltConstraint(tls, _pParse, i32(1811), int32(_pExpr.X1), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), int8(i32(0)), uint8(i32(0))) _221: goto _95 _95: @@ -30221,28 +31833,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeTargetØ00__func__Ø000[0], str(43547), 22) } -// Generate code that will extract the iColumn-th column from -// table pTab and store the column value in a register. -// -// An effort is made to store the column value in register iReg. This -// is not garanteeed for GetColumn() - the result can be stored in -// any register. But the result is guaranteed to land in register iReg -// for GetColumnToReg(). -// -// There must be an open cursor to pTab in iTable when this routine -// is called. If iColumn<0 then code is generated that extracts the rowid. +// C comment +// /* +// ** Generate code that will extract the iColumn-th column from +// ** table pTab and store the column value in a register. +// ** +// ** An effort is made to store the column value in register iReg. This +// ** is not garanteeed for GetColumn() - the result can be stored in +// ** any register. But the result is guaranteed to land in register iReg +// ** for GetColumnToReg(). +// ** +// ** There must be an open cursor to pTab in iTable when this routine +// ** is called. If iColumn<0 then code is generated that extracts the rowid. +// */ func _sqlite3ExprCodeGetColumn(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32, _p5 uint8) (r0 int32) { var _i int32 var _v *TVdbe var _p *TyColCache _v = (*TVdbe)(_pParse.X2) - *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _0: if _i >= int32(_pParse.X13) { goto _3 } - if ((_p.X0) == _iTable) && (int32(_p.X1) == _iColumn) { - *(*int32)(unsafe.Pointer(&(_p.X5))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X24))), int32(1)) + if (_p.X0 == _iTable) && (int32(_p.X1) == _iColumn) { + *(*int32)(unsafe.Pointer(&_p.X5)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X24)), 1) _sqlite3ExprCachePinRegister(tls, _pParse, _p.X4) return _p.X4 } @@ -30265,20 +31880,23 @@ _9: return _iReg } -// When a cached column is reused, make sure that its register is -// no longer available as a temp register. ticket #3879: that same -// register might be in the cache in multiple places, so be sure to -// get them all. +// C comment +// /* +// ** When a cached column is reused, make sure that its register is +// ** no longer available as a temp register. ticket #3879: that same +// ** register might be in the cache in multiple places, so be sure to +// ** get them all. +// */ func _sqlite3ExprCachePinRegister(tls *crt.TLS, _pParse *XParse, _iReg int32) { var _i int32 var _p *TyColCache - *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _0: if _i >= int32(_pParse.X13) { goto _3 } - if (_p.X4) == _iReg { - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0)) + if _p.X4 == _iReg { + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(0)) } *(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20) goto _0 @@ -30291,7 +31909,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeGetColumnØ00__func__Ø000[0], str(43569), 25) } -// Generate code to extract the value of the iCol-th column of a table. +// C comment +// /* +// ** Generate code to extract the value of the iCol-th column of a table. +// */ func _sqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iTabCur int32, _iCol int32, _regOut int32) { var _3_op, _3_x int32 if _pTab == nil { @@ -30303,13 +31924,13 @@ func _sqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i goto _3 } _3_op = func() int32 { - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return i32(159) } return i32(99) }() _3_x = _iCol - if (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && ((_pTab.X16) == 0) { + if ((_pTab.X9 & uint32(i32(32))) != uint32(i32(0))) && (_pTab.X16 == 0) { _3_x = int32(_sqlite3ColumnOfIndex(tls, _sqlite3PrimaryKeyIndex(tls, _pTab), int16(_iCol))) } _sqlite3VdbeAddOp3(tls, _v, _3_op, _iTabCur, _3_x, _regOut) @@ -30319,8 +31940,11 @@ _3: } } -// Return the column of index pIdx that corresponds to table -// column iCol. Return -1 if not found. +// C comment +// /* +// ** Return the column of index pIdx that corresponds to table +// ** column iCol. Return -1 if not found. +// */ func _sqlite3ColumnOfIndex(tls *crt.TLS, _pIdx *XIndex, _iCol int16) (r0 int16) { var _i int32 _i = i32(0) @@ -30328,7 +31952,7 @@ _0: if _i >= int32(_pIdx.X14) { goto _3 } - if int32(_iCol) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) { + if int32(_iCol) == int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) { return int16(_i) } _i += 1 @@ -30337,34 +31961,37 @@ _3: return int16(i32(-1)) } -// The most recently coded instruction was an OP_Column to retrieve the -// i-th column of table pTab. This routine sets the P4 parameter of the -// OP_Column to the default value, if any. -// -// The default value of a column is specified by a DEFAULT clause in the -// column definition. This was either supplied by the user when the table -// was created, or added later to the table definition by an ALTER TABLE -// command. If the latter, then the row-records in the table btree on disk -// may not contain a value for the column and the default value, taken -// from the P4 parameter of the OP_Column instruction, is returned instead. -// If the former, then all row-records are guaranteed to include a value -// for the column and the P4 value is not required. -// -// Column definitions created by an ALTER TABLE command may only have -// literal default values specified: a number, null or a string. (If a more -// complicated default expression value was provided, it is evaluated -// when the ALTER TABLE is executed and one of the literal values written -// into the sqlite_master table.) -// -// Therefore, the P4 parameter is only required if the default value for -// the column is a literal number, string or null. The sqlite3ValueFromExpr() -// function is capable of transforming these types of expressions into -// sqlite3_value objects. -// -// If parameter iReg is not negative, code an OP_RealAffinity instruction -// on register iReg. This is used when an equivalent integer value is -// stored in place of an 8-byte floating point value in order to save -// space. +// C comment +// /* +// ** The most recently coded instruction was an OP_Column to retrieve the +// ** i-th column of table pTab. This routine sets the P4 parameter of the +// ** OP_Column to the default value, if any. +// ** +// ** The default value of a column is specified by a DEFAULT clause in the +// ** column definition. This was either supplied by the user when the table +// ** was created, or added later to the table definition by an ALTER TABLE +// ** command. If the latter, then the row-records in the table btree on disk +// ** may not contain a value for the column and the default value, taken +// ** from the P4 parameter of the OP_Column instruction, is returned instead. +// ** If the former, then all row-records are guaranteed to include a value +// ** for the column and the P4 value is not required. +// ** +// ** Column definitions created by an ALTER TABLE command may only have +// ** literal default values specified: a number, null or a string. (If a more +// ** complicated default expression value was provided, it is evaluated +// ** when the ALTER TABLE is executed and one of the literal values written +// ** into the sqlite_master table.) +// ** +// ** Therefore, the P4 parameter is only required if the default value for +// ** the column is a literal number, string or null. The sqlite3ValueFromExpr() +// ** function is capable of transforming these types of expressions into +// ** sqlite3_value objects. +// ** +// ** If parameter iReg is not negative, code an OP_RealAffinity instruction +// ** on register iReg. This is used when an equivalent integer value is +// ** stored in place of an 8-byte floating point value in order to save +// ** space. +// */ func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iReg int32) { var _1_enc uint8 var _1_pValue *XMem @@ -30375,7 +32002,7 @@ func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iR crt.X__builtin_abort(tls) } }() - if (*XSelect)(_pTab.X3) != nil { + if _pTab.X3 != nil { goto _2 } _1_pValue = nil @@ -30390,7 +32017,7 @@ func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iR }() _sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, _v), (*XExpr)(_1_pCol.X1), _1_enc, uint8(_1_pCol.X4), &_1_pValue) if _1_pValue != nil { - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_1_pValue), i32(-7)) + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_1_pValue), i32(-7)) } _2: if int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_i))).X4) == i32(69) { @@ -30404,19 +32031,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ColumnDefaultØ00__func__Ø000[0], str(43615), 21) } -// Return the database associated with the Vdbe. +// C comment +// /* +// ** Return the database associated with the Vdbe. +// */ func _sqlite3VdbeDb(tls *crt.TLS, _v *TVdbe) (r0 *Xsqlite3) { return (*Xsqlite3)(_v.X0) } -// Create a new sqlite3_value object, containing the value of pExpr. -// -// This only works for very simple expressions that consist of one constant -// token (i.e. "5", "5.1", "'a string'"). If the expression can -// be converted directly into a value, then the value is allocated and -// a pointer written to *ppVal. The caller is responsible for deallocating -// the value by passing it to sqlite3ValueFree() later on. If the expression -// cannot be converted to a value, then *ppVal is set to NULL. +// C comment +// /* +// ** Create a new sqlite3_value object, containing the value of pExpr. +// ** +// ** This only works for very simple expressions that consist of one constant +// ** token (i.e. "5", "5.1", "'a string'"). If the expression can +// ** be converted directly into a value, then the value is allocated and +// ** a pointer written to *ppVal. The caller is responsible for deallocating +// ** the value by passing it to sqlite3ValueFree() later on. If the expression +// ** cannot be converted to a value, then *ppVal is set to NULL. +// */ func _sqlite3ValueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem) (r0 int32) { return func() int32 { if _pExpr != nil { @@ -30426,14 +32059,17 @@ func _sqlite3ValueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint }() } -// Extract a value from the supplied expression in the manner described -// above sqlite3ValueFromExpr(). Allocate the sqlite3_value object -// using valueNew(). -// -// If pCtx is NULL and an error occurs after the sqlite3_value object -// has been allocated, it is freed before returning. Or, if pCtx is not -// NULL, it is assumed that the caller will free any allocated object -// in all cases. +// C comment +// /* +// ** Extract a value from the supplied expression in the manner described +// ** above sqlite3ValueFromExpr(). Allocate the sqlite3_value object +// ** using valueNew(). +// ** +// ** If pCtx is NULL and an error occurs after the sqlite3_value object +// ** has been allocated, it is freed before returning. Or, if pCtx is not +// ** NULL, it is assumed that the caller will free any allocated object +// ** in all cases. +// */ func _valueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem, _pCtx *t41) (r0 int32) { var _op, _negInt, _rc, _16_nVal int32 var _zVal, _zNeg *int8 @@ -30468,7 +32104,7 @@ _2: _op = int32(_pExpr.X12) } func() { - if ((_pExpr.X2)&uint32(i32(16384))) != uint32(i32(0)) && _pCtx != nil { + if (_pExpr.X2&uint32(i32(16384))) != uint32(i32(0)) && _pCtx != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70984), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43645))) crt.X__builtin_abort(tls) } @@ -30476,7 +32112,7 @@ _2: if _op != i32(37) { goto _11 } - _1_aff = uint8(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil)) + _1_aff = uint8(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), nil)) _rc = _valueFromExpr(tls, _db, (*XExpr)(_pExpr.X4), _enc, _1_aff, _ppVal, _pCtx) if (*_ppVal) != nil { _sqlite3VdbeMemCast(tls, *_ppVal, _1_aff, uint8(i32(1))) @@ -30498,17 +32134,18 @@ _11: if _pVal == nil { goto _no_mem } - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { - _sqlite3VdbeMemSetInt64(tls, _pVal, int64(*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))*int64(_negInt)) + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { + _sqlite3VdbeMemSetInt64(tls, _pVal, int64(*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))*int64(_negInt)) goto _21 } - _zVal = _sqlite3MPrintf(tls, _db, str(6890), unsafe.Pointer(_zNeg), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _zVal = _sqlite3MPrintf(tls, _db, str(6890), unsafe.Pointer(_zNeg), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) if _zVal == nil { goto _no_mem } - _sqlite3ValueSetStr(tls, _pVal, i32(-1), (unsafe.Pointer)(_zVal), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3ValueSetStr(tls, _pVal, i32(-1), unsafe.Pointer(_zVal), uint8(i32(1)), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _21: if ((_op == i32(134)) || (_op == i32(132))) && (int32(_affinity) == i32(65)) { _sqlite3ValueApplyAffinity(tls, _pVal, uint8(i32(67)), uint8(i32(1))) @@ -30518,7 +32155,7 @@ _21: _26: if (int32(_pVal.X1) & i32(12)) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pVal.X1))) + p := (*uint16)(unsafe.Pointer(&_pVal.X1)) *p = uint16(int32(*p) & i32(-3)) sink14(*p) } @@ -30536,15 +32173,15 @@ _18: } _sqlite3VdbeMemNumerify(tls, _pVal) if (int32(_pVal.X1) & i32(8)) != 0 { - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = -(*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0)))))) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0)))) = -(*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0))))) goto _36 } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0)))))) == i64(-9223372036854775808) { - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = 9.223372036854776e+18 - *(*uint16)(unsafe.Pointer(&(_pVal.X1))) = uint16((int32(_pVal.X1) & i32(-49664)) | i32(8)) + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0))))) == i64(-9223372036854775808) { + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0)))) = 9.223372036854776e+18 + *(*uint16)(unsafe.Pointer(&_pVal.X1)) = uint16((int32(_pVal.X1) & i32(-49664)) | i32(8)) goto _36 } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = -(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0)))))) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0)))) = -(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVal.X0))))) _36: _sqlite3ValueApplyAffinity(tls, _pVal, _affinity, _enc) _32: @@ -30564,13 +32201,13 @@ _38: goto _41 } func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(88) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(0))))) != i32(88) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71051), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(42561))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(39) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(1))))) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71052), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(42612))) crt.X__builtin_abort(tls) } @@ -30579,24 +32216,25 @@ _38: if _pVal == nil { goto _no_mem } - _zVal = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(2)))) + _zVal = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) + 1*uintptr(i32(2)))) _16_nVal = _sqlite3Strlen30(tls, _zVal) - i32(1) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zVal)) + 1*uintptr(_16_nVal)))) != i32(39) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zVal)) + 1*uintptr(_16_nVal)))) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71057), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43689))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemSetStr(tls, _pVal, (*int8)(_sqlite3HexToBlob(tls, _db, _zVal, _16_nVal)), _16_nVal/i32(2), uint8(i32(0)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3VdbeMemSetStr(tls, _pVal, (*int8)(_sqlite3HexToBlob(tls, _db, _zVal, _16_nVal)), _16_nVal/i32(2), uint8(i32(0)), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _41: *_ppVal = _pVal return _rc _no_mem: _sqlite3OomFault(tls, _db) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zVal)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zVal)) func() { if (*_ppVal) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71075), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43706))) @@ -30619,29 +32257,32 @@ func init() { crt.Xstrncpy(nil, &_valueFromExprØ00__func__Ø000[0], str(43724), 14) } -// Scan the column type name zType (length nType) and return the -// associated affinity type. -// -// This routine does a case-independent search of zType for the -// substrings in the following table. If one of the substrings is -// found, the corresponding affinity is returned. If zType contains -// more than one of the substrings, entries toward the top of -// the table take priority. For example, if zType is 'BLOBINT', -// SQLITE_AFF_INTEGER is returned. -// -// Substring | Affinity -// -------------------------------- -// 'INT' | SQLITE_AFF_INTEGER -// 'CHAR' | SQLITE_AFF_TEXT -// 'CLOB' | SQLITE_AFF_TEXT -// 'TEXT' | SQLITE_AFF_TEXT -// 'BLOB' | SQLITE_AFF_BLOB -// 'REAL' | SQLITE_AFF_REAL -// 'FLOA' | SQLITE_AFF_REAL -// 'DOUB' | SQLITE_AFF_REAL -// -// If none of the substrings in the above table are found, -// SQLITE_AFF_NUMERIC is returned. +// C comment +// /* +// ** Scan the column type name zType (length nType) and return the +// ** associated affinity type. +// ** +// ** This routine does a case-independent search of zType for the +// ** substrings in the following table. If one of the substrings is +// ** found, the corresponding affinity is returned. If zType contains +// ** more than one of the substrings, entries toward the top of +// ** the table take priority. For example, if zType is 'BLOBINT', +// ** SQLITE_AFF_INTEGER is returned. +// ** +// ** Substring | Affinity +// ** -------------------------------- +// ** 'INT' | SQLITE_AFF_INTEGER +// ** 'CHAR' | SQLITE_AFF_TEXT +// ** 'CLOB' | SQLITE_AFF_TEXT +// ** 'TEXT' | SQLITE_AFF_TEXT +// ** 'BLOB' | SQLITE_AFF_BLOB +// ** 'REAL' | SQLITE_AFF_REAL +// ** 'FLOA' | SQLITE_AFF_REAL +// ** 'DOUB' | SQLITE_AFF_REAL +// ** +// ** If none of the substrings in the above table are found, +// ** SQLITE_AFF_NUMERIC is returned. +// */ func _sqlite3AffinityType(tls *crt.TLS, _zIn *int8, _pszEst *uint8) (r0 int8) { var _14_v int32 var _aff int8 @@ -30657,10 +32298,10 @@ func _sqlite3AffinityType(tls *crt.TLS, _zIn *int8, _pszEst *uint8) (r0 int8) { } }() _2: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(i32(0))))) == 0 { goto _3 } - _h = (_h << uint(i32(8))) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(int32(*_zIn)&i32(255))))) + _h = (_h << uint(i32(8))) + uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(int32(*_zIn)&i32(255))))) *(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1) if _h == uint32(i32(1667785074)) { _aff = int8(i32(66)) @@ -30679,7 +32320,7 @@ _2: goto _12 } _aff = int8(i32(65)) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) == i32(40) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(i32(0))))) == i32(40) { _zChar = _zIn } goto _24 @@ -30714,10 +32355,10 @@ _3: goto _27 } _28: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zChar)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zChar)) + 1*uintptr(i32(0))))) == 0 { goto _29 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zChar)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zChar)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 { goto _30 } _14_v = i32(0) @@ -30747,70 +32388,73 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AffinityTypeØ00__func__Ø000[0], str(43745), 20) } -// If zNum represents an integer that will fit in 32-bits, then set -// *pValue to that integer and return true. Otherwise return false. -// -// This routine accepts both decimal and hexadecimal notation for integers. -// -// Any non-numeric characters that following zNum are ignored. -// This is different from sqlite3Atoi64() which requires the -// input number to be zero-terminated. +// C comment +// /* +// ** If zNum represents an integer that will fit in 32-bits, then set +// ** *pValue to that integer and return true. Otherwise return false. +// ** +// ** This routine accepts both decimal and hexadecimal notation for integers. +// ** +// ** Any non-numeric characters that following zNum are ignored. +// ** This is different from sqlite3Atoi64() which requires the +// ** input number to be zero-terminated. +// */ func _sqlite3GetInt32(tls *crt.TLS, _zNum *int8, _pValue *int32) (r0 int32) { var _i, _c, _neg int32 var _v int64 var _3_u uint32 _v = i64(0) _neg = i32(0) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) == i32(45) { _neg = i32(1) *(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1) goto _7 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(43) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) == i32(43) { *(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1) goto _7 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(2)))))))))&i32(8)) == 0 { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(2)))))))))&i32(8)) == 0 { goto _7 } _3_u = u32(0) { p := &_zNum - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink0(*p) } _8: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) == i32(48) { *(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1) goto _8 } _i = i32(0) _10: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))))))&i32(8)) == 0 || _i >= i32(8) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i))))))))&i32(8)) == 0 || _i >= i32(8) { goto _14 } - _3_u = (_3_u * uint32(i32(16))) + uint32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i)))))) + _3_u = (_3_u * uint32(i32(16))) + uint32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i)))))) _i += 1 goto _10 _14: - if ((_3_u & u32(2147483648)) == uint32(i32(0))) && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i)))))))) & i32(8)) == i32(0)) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_pValue), (unsafe.Pointer)(&_3_u), uint64(i32(4))) + if ((_3_u & u32(2147483648)) == uint32(i32(0))) && ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i)))))))) & i32(8)) == i32(0)) { + crt.Xmemcpy(tls, unsafe.Pointer(_pValue), unsafe.Pointer(&_3_u), uint64(i32(4))) return i32(1) } return i32(0) _7: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 { return i32(0) } _18: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(i32(0))))) == i32(48) { *(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1) goto _18 } _i = i32(0) _21: - if _i >= i32(11) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))-i32(48)) < i32(0) || _c > i32(9) { + if _i >= i32(11) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + 1*uintptr(_i))))-i32(48)) < i32(0) || _c > i32(9) { goto _26 } _v = (_v * int64(i32(10))) + int64(_c) @@ -30830,9 +32474,12 @@ _26: return i32(1) } -// Translate a single byte of Hex into an integer. -// This routine only works if h really is a valid hexadecimal -// character: 0..9a..fA..F +// C comment +// /* +// ** Translate a single byte of Hex into an integer. +// ** This routine only works if h really is a valid hexadecimal +// ** character: 0..9a..fA..F +// */ func _sqlite3HexToInt(tls *crt.TLS, _h int32) (r0 uint8) { func() { if (_h < i32(48) || _h > i32(57)) && (_h < i32(97) || _h > i32(102)) && (_h < i32(65) || _h > i32(70)) { @@ -30854,11 +32501,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3HexToIntØ00__func__Ø000[0], str(43828), 16) } -// Cast the datatype of the value in pMem according to the affinity -// "aff". Casting is different from applying affinity in that a cast -// is forced. In other words, the value is converted into the desired -// affinity even if that results in loss of data. This routine is -// used (for example) to implement the SQL "cast()" operator. +// C comment +// /* +// ** Cast the datatype of the value in pMem according to the affinity +// ** "aff". Casting is different from applying affinity in that a cast +// ** is forced. In other words, the value is converted into the desired +// ** affinity even if that results in loss of data. This routine is +// ** used (for example) to implement the SQL "cast()" operator. +// */ func _sqlite3VdbeMemCast(tls *crt.TLS, _pMem *XMem, _aff uint8, _encoding uint8) { if (int32(_pMem.X1) & i32(1)) != 0 { return @@ -30888,12 +32538,12 @@ _2: } }() if (int32(_pMem.X1) & i32(2)) != 0 { - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(16)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(16)) } goto _12 _7: { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-33264)) sink14(*p) } @@ -30917,7 +32567,7 @@ _6: }() i32(0) { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) | ((int32(_pMem.X1) & i32(16)) >> uint(i32(3)))) sink14(*p) } @@ -30929,7 +32579,7 @@ _6: } }() { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-16413)) sink14(*p) } @@ -30937,28 +32587,34 @@ _6: _13: } -// Exported version of applyAffinity(). This one works on sqlite3_value*, -// not the internal Mem* type. +// C comment +// /* +// ** Exported version of applyAffinity(). This one works on sqlite3_value*, +// ** not the internal Mem* type. +// */ func _sqlite3ValueApplyAffinity(tls *crt.TLS, _pVal *XMem, _affinity uint8, _enc uint8) { _applyAffinity(tls, _pVal, int8(_affinity), _enc) } -// Processing is determine by the affinity parameter: -// -// SQLITE_AFF_INTEGER: -// SQLITE_AFF_REAL: -// SQLITE_AFF_NUMERIC: -// Try to convert pRec to an integer representation or a -// floating-point representation if an integer representation -// is not possible. Note that the integer representation is -// always preferred, even if the affinity is REAL, because -// an integer representation is more space efficient on disk. -// -// SQLITE_AFF_TEXT: -// Convert pRec to a text representation. -// -// SQLITE_AFF_BLOB: -// No-op. pRec is unchanged. +// C comment +// /* +// ** Processing is determine by the affinity parameter: +// ** +// ** SQLITE_AFF_INTEGER: +// ** SQLITE_AFF_REAL: +// ** SQLITE_AFF_NUMERIC: +// ** Try to convert pRec to an integer representation or a +// ** floating-point representation if an integer representation +// ** is not possible. Note that the integer representation is +// ** always preferred, even if the affinity is REAL, because +// ** an integer representation is more space efficient on disk. +// ** +// ** SQLITE_AFF_TEXT: +// ** Convert pRec to a text representation. +// ** +// ** SQLITE_AFF_BLOB: +// ** No-op. pRec is unchanged. +// */ func _applyAffinity(tls *crt.TLS, _pRec *XMem, _affinity int8, _enc uint8) { if int32(_affinity) < i32(67) { goto _0 @@ -30996,7 +32652,7 @@ _0: } _11: { - p := (*uint16)(unsafe.Pointer(&(_pRec.X1))) + p := (*uint16)(unsafe.Pointer(&_pRec.X1)) *p = uint16(int32(*p) & i32(-13)) sink14(*p) } @@ -31009,19 +32665,22 @@ func init() { crt.Xstrncpy(nil, &_applyAffinityØ00__func__Ø000[0], str(44003), 14) } -// Try to convert a value into a numeric representation if we can -// do so without loss of information. In other words, if the string -// looks like a number, convert it into a number. If it does not -// look like a number, leave it alone. -// -// If the bTryForInt flag is true, then extra effort is made to give -// an integer representation. Strings that look like floating point -// values but which have no fractional component (example: '48.00') -// will have a MEM_Int representation when bTryForInt is true. -// -// If bTryForInt is false, then if the input string contains a decimal -// point or exponential notation, the result is only MEM_Real, even -// if there is an exact integer representation of the quantity. +// C comment +// /* +// ** Try to convert a value into a numeric representation if we can +// ** do so without loss of information. In other words, if the string +// ** looks like a number, convert it into a number. If it does not +// ** look like a number, leave it alone. +// ** +// ** If the bTryForInt flag is true, then extra effort is made to give +// ** an integer representation. Strings that look like floating point +// ** values but which have no fractional component (example: '48.00') +// ** will have a MEM_Int representation when bTryForInt is true. +// ** +// ** If bTryForInt is false, then if the input string contains a decimal +// ** point or exponential notation, the result is only MEM_Real, even +// ** if there is an exact integer representation of the quantity. +// */ func _applyNumericAffinity(tls *crt.TLS, _pRec *XMem, _bTryForInt int32) { var _iValue int64 var _rValue float64 @@ -31037,17 +32696,17 @@ func _applyNumericAffinity(tls *crt.TLS, _pRec *XMem, _bTryForInt int32) { return } if i32(0) == _sqlite3Atoi64(tls, _pRec.X5, &_iValue, _pRec.X4, _enc) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRec.X0))))) = _iValue + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRec.X0)))) = _iValue { - p := (*uint16)(unsafe.Pointer(&(_pRec.X1))) + p := (*uint16)(unsafe.Pointer(&_pRec.X1)) *p = uint16(int32(*p) | i32(4)) sink14(*p) } goto _4 } - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRec.X0))))) = _rValue + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRec.X0)))) = _rValue { - p := (*uint16)(unsafe.Pointer(&(_pRec.X1))) + p := (*uint16)(unsafe.Pointer(&_pRec.X1)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -31063,8 +32722,11 @@ func init() { crt.Xstrncpy(nil, &_applyNumericAffinityØ00__func__Ø000[0], str(44069), 21) } -// The MEM structure is already a MEM_Real. Try to also make it a -// MEM_Int if we can. +// C comment +// /* +// ** The MEM structure is already a MEM_Real. Try to also make it a +// ** MEM_Int if we can. +// */ func _sqlite3VdbeIntegerAffinity(tls *crt.TLS, _pMem *XMem) { var _ix int64 func() { @@ -31091,10 +32753,10 @@ func _sqlite3VdbeIntegerAffinity(tls *crt.TLS, _pMem *XMem) { crt.X__builtin_abort(tls) } }() - _ix = _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) - if (((*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) == float64(_ix)) && (_ix > i64(-9223372036854775808))) && (_ix < i64(9223372036854775807)) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _ix - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) + _ix = _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) + if (((*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) == float64(_ix)) && (_ix > i64(-9223372036854775808))) && (_ix < i64(9223372036854775807)) { + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _ix + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) } } @@ -31110,12 +32772,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemCastØ00__func__Ø000[0], str(44140), 19) } -// Convert pMem so that it has types MEM_Real or MEM_Int or both. -// Invalidate any prior representations. -// -// Every effort is made to force the conversion, even if the input -// is a string that does not look completely like a number. Convert -// as much of the string as we can and ignore the rest. +// C comment +// /* +// ** Convert pMem so that it has types MEM_Real or MEM_Int or both. +// ** Invalidate any prior representations. +// ** +// ** Every effort is made to force the conversion, even if the input +// ** is a string that does not look completely like a number. Convert +// ** as much of the string as we can and ignore the rest. +// */ func _sqlite3VdbeMemNumerify(tls *crt.TLS, _pMem *XMem) (r0 int32) { if (int32(_pMem.X1) & i32(13)) != i32(0) { goto _0 @@ -31132,12 +32797,12 @@ func _sqlite3VdbeMemNumerify(tls *crt.TLS, _pMem *XMem) (r0 int32) { crt.X__builtin_abort(tls) } }() - if i32(0) == _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) { - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) + if i32(0) == _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))), _pMem.X4, _pMem.X2) { + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) goto _7 } - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeRealValue(tls, _pMem) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8)) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _sqlite3VdbeRealValue(tls, _pMem) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8)) _sqlite3VdbeIntegerAffinity(tls, _pMem) _7: _0: @@ -31148,7 +32813,7 @@ _0: } }() { - p := (*uint16)(unsafe.Pointer(&(_pMem.X1))) + p := (*uint16)(unsafe.Pointer(&_pMem.X1)) *p = uint16(int32(*p) & i32(-16403)) sink14(*p) } @@ -31161,7 +32826,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemNumerifyØ00__func__Ø000[0], str(44244), 23) } -// Convert pMem to type integer. Invalidate any prior representations. +// C comment +// /* +// ** Convert pMem to type integer. Invalidate any prior representations. +// */ func _sqlite3VdbeMemIntegerify(tls *crt.TLS, _pMem *XMem) (r0 int32) { func() { if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 { @@ -31181,8 +32849,8 @@ func _sqlite3VdbeMemIntegerify(tls *crt.TLS, _pMem *XMem) (r0 int32) { crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeIntValue(tls, _pMem) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _sqlite3VdbeIntValue(tls, _pMem) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4)) return i32(0) } @@ -31192,8 +32860,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemIntegerifyØ00__func__Ø000[0], str(44267), 25) } -// Convert pMem so that it is of type MEM_Real. -// Invalidate any prior representations. +// C comment +// /* +// ** Convert pMem so that it is of type MEM_Real. +// ** Invalidate any prior representations. +// */ func _sqlite3VdbeMemRealify(tls *crt.TLS, _pMem *XMem) (r0 int32) { func() { if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 { @@ -31207,8 +32878,8 @@ func _sqlite3VdbeMemRealify(tls *crt.TLS, _pMem *XMem) (r0 int32) { crt.X__builtin_abort(tls) } }() - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeRealValue(tls, _pMem) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8)) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = _sqlite3VdbeRealValue(tls, _pMem) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8)) return i32(0) } @@ -31218,23 +32889,29 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemRealifyØ00__func__Ø000[0], str(44292), 22) } -// Allocate and return a pointer to a new sqlite3_value object. If -// the second argument to this function is NULL, the object is allocated -// by calling sqlite3ValueNew(). -// -// Otherwise, if the second argument is non-zero, then this function is -// being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not -// already been allocated, allocate the UnpackedRecord structure that -// that function will return to its caller here. Then return a pointer to -// an sqlite3_value within the UnpackedRecord.a[] array. +// C comment +// /* +// ** Allocate and return a pointer to a new sqlite3_value object. If +// ** the second argument to this function is NULL, the object is allocated +// ** by calling sqlite3ValueNew(). +// ** +// ** Otherwise, if the second argument is non-zero, then this function is +// ** being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not +// ** already been allocated, allocate the UnpackedRecord structure that +// ** that function will return to its caller here. Then return a pointer to +// ** an sqlite3_value within the UnpackedRecord.a[] array. +// */ func _valueNew(tls *crt.TLS, _db *Xsqlite3, _p *t41) (r0 *XMem) { return _sqlite3ValueNew(tls, _db) } -// Convert a BLOB literal of the form "x'hhhhhh'" into its binary -// value. Return a pointer to its binary value. Space to hold the -// binary value has been obtained from malloc and must be freed by -// the calling routine. +// C comment +// /* +// ** Convert a BLOB literal of the form "x'hhhhhh'" into its binary +// ** value. Return a pointer to its binary value. Space to hold the +// ** binary value has been obtained from malloc and must be freed by +// ** the calling routine. +// */ func _sqlite3HexToBlob(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n int32) (r0 unsafe.Pointer) { var _i int32 var _zBlob *int8 @@ -31248,7 +32925,7 @@ _1: if _i >= _n { goto _4 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8((int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))))) << uint(i32(4))) | int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1)))))))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8((int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))))) << uint(i32(4))) | int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i+i32(1)))))))) { p := &_i *p = (*p) + i32(2) @@ -31256,22 +32933,25 @@ _1: } goto _1 _4: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8(i32(0)) _0: - return (unsafe.Pointer)(_zBlob) + return unsafe.Pointer(_zBlob) } func _sqlite3VdbeAddOp1(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32) (r0 int32) { return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, i32(0), i32(0)) } -// Record in the column cache that a particular column from a -// particular table is stored in a particular register. +// C comment +// /* +// ** Record in the column cache that a particular column from a +// ** particular table is stored in a particular register. +// */ func _sqlite3ExprCacheStore(tls *crt.TLS, _pParse *XParse, _iTab int32, _iCol int32, _iReg int32) { var _i, _minLru, _idxLru int32 var _p *TyColCache func() { - if _iReg <= i32(0) && (_pParse.X16) == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 { + if _iReg <= i32(0) && _pParse.X16 == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94005), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000))), unsafe.Pointer(str(44314))) crt.X__builtin_abort(tls) } @@ -31285,13 +32965,13 @@ func _sqlite3ExprCacheStore(tls *crt.TLS, _pParse *XParse, _iTab int32, _iCol in if (int32((*Xsqlite3)(_pParse.X0).X13) & i32(2)) != i32(0) { return } - *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _8: if _i >= int32(_pParse.X13) { goto _11 } func() { - if (_p.X0) == _iTab && int32(_p.X1) == _iCol { + if _p.X0 == _iTab && int32(_p.X1) == _iCol { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94021), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000))), unsafe.Pointer(str(44388))) crt.X__builtin_abort(tls) } @@ -31304,29 +32984,29 @@ _11: } _minLru = i32(2147483647) _idxLru = i32(-1) - *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _16: if _i >= i32(10) { goto _19 } - if (_p.X5) < _minLru { + if _p.X5 < _minLru { _idxLru = _i _minLru = _p.X5 } *(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20) goto _16 _19: - _p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_idxLru))) + _p = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_idxLru))) goto _21 _15: - _p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X13))), uint8(1))))) + _p = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(postInc2((*uint8)(unsafe.Pointer(&_pParse.X13)), byte(1))))) _21: - *(*int32)(unsafe.Pointer(&(_p.X3))) = _pParse.X23 - *(*int32)(unsafe.Pointer(&(_p.X0))) = _iTab - *(*int16)(unsafe.Pointer(&(_p.X1))) = int16(_iCol) - *(*int32)(unsafe.Pointer(&(_p.X4))) = _iReg - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X5))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X24))), int32(1)) + *(*int32)(unsafe.Pointer(&_p.X3)) = _pParse.X23 + *(*int32)(unsafe.Pointer(&_p.X0)) = _iTab + *(*int16)(unsafe.Pointer(&_p.X1)) = int16(_iCol) + *(*int32)(unsafe.Pointer(&_p.X4)) = _iReg + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X5)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X24)), 1) } var _sqlite3ExprCacheStoreØ00__func__Ø000 [22]int8 @@ -31335,20 +33015,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCacheStoreØ00__func__Ø000[0], str(44424), 22) } -// Generate an instruction that will put the integer describe by -// text z[0..n-1] into register iMem. -// -// Expr.u.zToken is always UTF8 and zero-terminated. +// C comment +// /* +// ** Generate an instruction that will put the integer describe by +// ** text z[0..n-1] into register iMem. +// ** +// ** Expr.u.zToken is always UTF8 and zero-terminated. +// */ func _codeInteger(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _negFlag int32, _iMem int32) { var _1_i, _2_c int32 var _2_value int64 var _2_z *int8 var _v *TVdbe _v = (*TVdbe)(_pParse.X2) - if ((_pExpr.X2) & uint32(i32(1024))) == 0 { + if (_pExpr.X2 & uint32(i32(1024))) == 0 { goto _0 } - _1_i = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _1_i = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) func() { if _1_i < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93949), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeIntegerØ00__func__Ø000))), unsafe.Pointer(str(44446))) @@ -31361,7 +33044,7 @@ func _codeInteger(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _negFlag int32, _sqlite3VdbeAddOp2(tls, _v, i32(56), _1_i, _iMem) goto _4 _0: - _2_z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _2_z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) func() { if _2_z == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93956), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeIntegerØ00__func__Ø000))), unsafe.Pointer(str(44451))) @@ -31404,25 +33087,28 @@ func init() { crt.Xstrncpy(nil, &_codeIntegerØ00__func__Ø000[0], str(44485), 12) } -// Transform a UTF-8 integer literal, in either decimal or hexadecimal, -// into a 64-bit signed integer. This routine accepts hexadecimal literals, -// whereas sqlite3Atoi64() does not. -// -// Returns: -// -// 0 Successful transformation. Fits in a 64-bit signed integer. -// 1 Integer too large for a 64-bit signed integer or is malformed -// 2 Special case of 9223372036854775808 +// C comment +// /* +// ** Transform a UTF-8 integer literal, in either decimal or hexadecimal, +// ** into a 64-bit signed integer. This routine accepts hexadecimal literals, +// ** whereas sqlite3Atoi64() does not. +// ** +// ** Returns: +// ** +// ** 0 Successful transformation. Fits in a 64-bit signed integer. +// ** 1 Integer too large for a 64-bit signed integer or is malformed +// ** 2 Special case of 9223372036854775808 +// */ func _sqlite3DecOrHexToI64(tls *crt.TLS, _z *int8, _pOut *int64) (r0 int32) { var _1_i, _1_k int32 var _1_u uint64 - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(88) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(88) { goto _2 } _1_u = u64(0) _1_i = i32(2) _3: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_i)))) != i32(48) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_1_i)))) != i32(48) { goto _6 } _1_i += 1 @@ -31430,16 +33116,16 @@ _3: _6: _1_k = _1_i _7: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k)))))))) & i32(8)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_1_k)))))))) & i32(8)) == 0 { goto _10 } - _1_u = (_1_u * uint64(i32(16))) + uint64(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k)))))) + _1_u = (_1_u * uint64(i32(16))) + uint64(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_1_k)))))) _1_k += 1 goto _7 _10: - crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut), (unsafe.Pointer)(&_1_u), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer(_pOut), unsafe.Pointer(&_1_u), uint64(i32(8))) return func() int32 { - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k)))) == i32(0)) && ((_1_k - _1_i) <= i32(16)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_1_k)))) == i32(0)) && ((_1_k - _1_i) <= i32(16)) { return i32(0) } return i32(1) @@ -31449,12 +33135,15 @@ _2: return _sqlite3Atoi64(tls, _z, _pOut, _sqlite3Strlen30(tls, _z), uint8(i32(1))) } -// Generate an instruction that will put the floating point -// value described by z[0..n-1] into register iMem. -// -// The z[] string will probably not be zero-terminated. But the -// z[n] character is guaranteed to be something that does not look -// like the continuation of the number. +// C comment +// /* +// ** Generate an instruction that will put the floating point +// ** value described by z[0..n-1] into register iMem. +// ** +// ** The z[] string will probably not be zero-terminated. But the +// ** z[n] character is guaranteed to be something that does not look +// ** like the continuation of the number. +// */ func _codeReal(tls *crt.TLS, _v *TVdbe, _z *int8, _negateFlag int32, _iMem int32) { var _1_value float64 if func() int32 { @@ -31489,25 +33178,34 @@ func init() { crt.Xstrncpy(nil, &_codeRealØ00__func__Ø000[0], str(44518), 9) } -// Add an opcode that includes the p4 value with a P4_INT64 or -// P4_REAL type. +// C comment +// /* +// ** Add an opcode that includes the p4 value with a P4_INT64 or +// ** P4_REAL type. +// */ func _sqlite3VdbeAddOp4Dup8(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *uint8, _p4type int32) (r0 int32) { var _p4copy *int8 _p4copy = (*int8)(_sqlite3DbMallocRawNN(tls, _sqlite3VdbeDb(tls, _p), uint64(i32(8)))) if _p4copy != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(_p4copy), (unsafe.Pointer)(_zP4), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer(_p4copy), unsafe.Pointer(_zP4), uint64(i32(8))) } return _sqlite3VdbeAddOp4(tls, _p, _op, _p1, _p2, _p3, _p4copy, _p4type) } -// Record the fact that an affinity change has occurred on iCount -// registers starting with iStart. +// C comment +// /* +// ** Record the fact that an affinity change has occurred on iCount +// ** registers starting with iStart. +// */ func _sqlite3ExprCacheAffinityChange(tls *crt.TLS, _pParse *XParse, _iStart int32, _iCount int32) { _sqlite3ExprCacheRemove(tls, _pParse, _iStart, _iCount) } -// Indicate that registers between iReg..iReg+nReg-1 are being overwritten. -// Purge the range of registers from the column cache. +// C comment +// /* +// ** Indicate that registers between iReg..iReg+nReg-1 are being overwritten. +// ** Purge the range of registers from the column cache. +// */ func _sqlite3ExprCacheRemove(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) { var _i int32 var _1_p *TyColCache @@ -31516,8 +33214,8 @@ _0: if _i >= int32(_pParse.X13) { goto _1 } - _1_p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))) - if ((_1_p.X4) >= _iReg) && ((_1_p.X4) < (_iReg + _nReg)) { + _1_p = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))) + if (_1_p.X4 >= _iReg) && (_1_p.X4 < (_iReg + _nReg)) { _cacheEntryClear(tls, _pParse, _i) goto _4 } @@ -31527,36 +33225,45 @@ _4: _1: } -// Erase column-cache entry number i +// C comment +// /* +// ** Erase column-cache entry number i +// */ func _cacheEntryClear(tls *crt.TLS, _pParse *XParse, _i int32) { - if ((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X2) == 0 { + if ((*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))).X2) == 0 { goto _0 } if int32(_pParse.X7) < i32(8) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X4 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&_pParse.X7)), byte(1))))) = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))).X4 } _0: - *(*uint8)(unsafe.Pointer(&(_pParse.X13))) -= 1 + *(*uint8)(unsafe.Pointer(&_pParse.X13)) -= 1 if _i < int32(_pParse.X13) { - *(*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))) = *(*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_pParse.X13))) + *(*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))) = *(*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_pParse.X13))) } } -// Return true if expression pExpr is a vector, or false otherwise. -// -// A vector is defined as any expression that results in two or more -// columns of result. Every TK_VECTOR node is an vector because the -// parser will not generate a TK_VECTOR with fewer than two entries. -// But a TK_SELECT might be either a vector or a scalar. It is only -// considered a vector if it has two or more result columns. +// C comment +// /* +// ** Return true if expression pExpr is a vector, or false otherwise. +// ** +// ** A vector is defined as any expression that results in two or more +// ** columns of result. Every TK_VECTOR node is an vector because the +// ** parser will not generate a TK_VECTOR with fewer than two entries. +// ** But a TK_SELECT might be either a vector or a scalar. It is only +// ** considered a vector if it has two or more result columns. +// */ func _sqlite3ExprIsVector(tls *crt.TLS, _pExpr *XExpr) (r0 int32) { return bool2int(_sqlite3ExprVectorSize(tls, _pExpr) > i32(1)) } -// If the expression passed as the only argument is of type TK_VECTOR -// return the number of expressions in the vector. Or, if the expression -// is a sub-select, return the number of columns in the sub-select. For -// any other type of expression, return 1. +// C comment +// /* +// ** If the expression passed as the only argument is of type TK_VECTOR +// ** return the number of expressions in the vector. Or, if the expression +// ** is a sub-select, return the number of columns in the sub-select. For +// ** any other type of expression, return 1. +// */ func _sqlite3ExprVectorSize(tls *crt.TLS, _pExpr *XExpr) (r0 int32) { var _op uint8 _op = _pExpr.X0 @@ -31564,23 +33271,26 @@ func _sqlite3ExprVectorSize(tls *crt.TLS, _pExpr *XExpr) (r0 int32) { _op = _pExpr.X12 } if int32(_op) == i32(158) { - return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0 + return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0 } if int32(_op) == i32(119) { - return (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0 + return (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0).X0 } return i32(1) } -// Expression pExpr is a comparison between two vector values. Compute -// the result of the comparison (1, 0, or NULL) and write that -// result into register dest. -// -// The caller must satisfy the following preconditions: -// -// if pExpr->op==TK_IS: op==TK_EQ and p5==SQLITE_NULLEQ -// if pExpr->op==TK_ISNOT: op==TK_NE and p5==SQLITE_NULLEQ -// otherwise: op==pExpr->op and p5==0 +// C comment +// /* +// ** Expression pExpr is a comparison between two vector values. Compute +// ** the result of the comparison (1, 0, or NULL) and write that +// ** result into register dest. +// ** +// ** The caller must satisfy the following preconditions: +// ** +// ** if pExpr->op==TK_IS: op==TK_EQ and p5==SQLITE_NULLEQ +// ** if pExpr->op==TK_ISNOT: op==TK_NE and p5==SQLITE_NULLEQ +// ** otherwise: op==pExpr->op and p5==0 +// */ func _codeVectorCompare(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _op uint8, _p5 uint8) { var _nLeft, _i, _regLeft, _regRight, _addrDone, _2_regFree1, _2_regFree2, _2_r1, _2_r2 int32 var _opx uint8 @@ -31694,34 +33404,37 @@ _27: _sqlite3VdbeResolveLabel(tls, _v, _addrDone) } -// Create a new symbolic label for an instruction that has yet to be -// coded. The symbolic label is really just a negative number. The -// label can be used as the P2 value of an operation. Later, when -// the label is resolved to a specific address, the VDBE will scan -// through its operation list and change all values of P2 which match -// the label into the resolved address. -// -// The VDBE knows that a P2 value is a label because labels are -// always negative and P2 values are suppose to be non-negative. -// Hence, a negative P2 value is a label that has yet to be resolved. -// -// Zero is returned if a malloc() fails. +// C comment +// /* +// ** Create a new symbolic label for an instruction that has yet to be +// ** coded. The symbolic label is really just a negative number. The +// ** label can be used as the P2 value of an operation. Later, when +// ** the label is resolved to a specific address, the VDBE will scan +// ** through its operation list and change all values of P2 which match +// ** the label into the resolved address. +// ** +// ** The VDBE knows that a P2 value is a label because labels are +// ** always negative and P2 values are suppose to be non-negative. +// ** Hence, a negative P2 value is a label that has yet to be resolved. +// ** +// ** Zero is returned if a malloc() fails. +// */ func _sqlite3VdbeMakeLabel(tls *crt.TLS, _v *TVdbe) (r0 int32) { var _i int32 var _p *XParse _p = (*XParse)(_v.X3) - _i = postInc1((*int32)(unsafe.Pointer(&(_p.X25))), int32(1)) + _i = postInc1((*int32)(unsafe.Pointer(&_p.X25)), 1) func() { - if (_v.X5) != uint32(i32(381479589)) { + if _v.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeLabelØ00__func__Ø000))), unsafe.Pointer(str(44897))) crt.X__builtin_abort(tls) } }() if (_i & (_i - i32(1))) == i32(0) { - *(**int32)(unsafe.Pointer(&(_p.X26))) = (*int32)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X26), uint64((_i*i32(2))+i32(1))*u64(4))) + *(**int32)(unsafe.Pointer(&_p.X26)) = (*int32)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_p.X26), uint64((_i*i32(2))+i32(1))*u64(4))) } - if (_p.X26) != nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X26)) + 4*uintptr(_i))) = i32(-1) + if _p.X26 != nil { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X26)) + 4*uintptr(_i))) = i32(-1) } return i32(-1) - _i } @@ -31738,12 +33451,15 @@ func init() { crt.Xstrncpy(nil, &_codeVectorCompareØ00__func__Ø000[0], str(44944), 18) } -// If expression pExpr is of type TK_SELECT, generate code to evaluate -// it. Return the register in which the result is stored (or, if the -// sub-select returns more than one column, the first in an array -// of registers in which the result is stored). -// -// If pExpr is not a TK_SELECT expression, return 0. +// C comment +// /* +// ** If expression pExpr is of type TK_SELECT, generate code to evaluate +// ** it. Return the register in which the result is stored (or, if the +// ** sub-select returns more than one column, the first in an array +// ** of registers in which the result is stored). +// ** +// ** If pExpr is not a TK_SELECT expression, return 0. +// */ func _exprCodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) { var _reg int32 _reg = i32(0) @@ -31780,7 +33496,7 @@ func _sqlite3CodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _rHasNu return i32(0) } _sqlite3ExprCachePush(tls, _pParse) - if ((_pExpr.X2) & uint32(i32(32))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(32))) == uint32(i32(0)) { _jmpIfDynamic = _sqlite3VdbeAddOp0(tls, _v, i32(20)) } if int32(_pParse.X54) == i32(2) { @@ -31818,7 +33534,7 @@ _10: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _4_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _pExpr.X8, func() int32 { if _isRowid != 0 { return i32(0) @@ -31831,10 +33547,10 @@ _10: } return _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.X0), _4_nVal, i32(1)) }() - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { goto _21 } - _5_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _5_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _5_pEList = (*XExprList)(_5_pSelect.X0) func() { if _isRowid != 0 { @@ -31843,7 +33559,7 @@ _10: } }() if func() int32 { - if (_5_pEList.X0) == _4_nVal { + if _5_pEList.X0 == _4_nVal { return i32(1) } return func() int32 { @@ -31855,14 +33571,14 @@ _10: goto _26 } _sqlite3SelectDestInit(tls, &_6_dest, i32(11), _pExpr.X8) - *(**int8)(unsafe.Pointer(&(_6_dest.X1))) = _exprINAffinity(tls, _pParse, _pExpr) - *(*int32)(unsafe.Pointer(&(_5_pSelect.X4))) = i32(0) + *(**int8)(unsafe.Pointer(&_6_dest.X1)) = _exprINAffinity(tls, _pParse, _pExpr) + *(*int32)(unsafe.Pointer(&_5_pSelect.X4)) = i32(0) if _sqlite3Select(tls, _pParse, _5_pSelect, &_6_dest) != 0 { - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_6_dest.X1)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_6_dest.X1)) _sqlite3KeyInfoUnref(tls, _4_pKeyInfo) return i32(0) } - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_6_dest.X1)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_6_dest.X1)) func() { if _4_pKeyInfo == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45040))) @@ -31876,7 +33592,7 @@ _10: } }() func() { - if (_5_pEList.X0) <= i32(0) { + if _5_pEList.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45062))) crt.X__builtin_abort(tls) } @@ -31893,7 +33609,7 @@ _36: goto _39 } _8_p = _sqlite3VectorFieldSubexpr(tls, _4_pLeft, _6_i) - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_4_pKeyInfo.X6))))) + 8*uintptr(_6_i))) = _sqlite3BinaryCompareCollSeq(tls, _pParse, _8_p, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_5_pEList.X2)))))+32*uintptr(_6_i))).X0)) + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_4_pKeyInfo.X6)))) + 8*uintptr(_6_i))) = _sqlite3BinaryCompareCollSeq(tls, _pParse, _8_p, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_5_pEList.X2))))+32*uintptr(_6_i))).X0)) _6_i += 1 goto _36 _39: @@ -31901,7 +33617,7 @@ _26: goto _43 _21: if func() int32 { - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil { + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) != nil { return i32(1) } return func() int32 { @@ -31912,7 +33628,7 @@ _21: }() == 0 { goto _43 } - _9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _9_affinity = _sqlite3ExprAffinity(tls, _4_pLeft) if _9_affinity == 0 { _9_affinity = int8(i32(65)) @@ -31924,14 +33640,14 @@ _21: crt.X__builtin_abort(tls) } }() - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_4_pKeyInfo.X6))))) + 8*uintptr(i32(0)))) = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4)) + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_4_pKeyInfo.X6)))) + 8*uintptr(i32(0)))) = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4)) } _9_r1 = _sqlite3GetTempReg(tls, _pParse) _9_r2 = _sqlite3GetTempReg(tls, _pParse) if _isRowid != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _9_r2) } - *func() **TExprList_item { _9_i = _9_pList.X0; return &_9_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_9_pList.X2))))) + *func() **TExprList_item { _9_i = _9_pList.X0; return &_9_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pList.X2)))) _49: if _9_i <= i32(0) { goto _52 @@ -31963,7 +33679,7 @@ _52: _sqlite3ReleaseTempReg(tls, _pParse, _9_r2) _43: if _4_pKeyInfo != nil { - _sqlite3VdbeChangeP4(tls, _v, _4_addr, (*int8)((unsafe.Pointer)(_4_pKeyInfo)), i32(-5)) + _sqlite3VdbeChangeP4(tls, _v, _4_addr, (*int8)(unsafe.Pointer(unsafe.Pointer(_4_pKeyInfo))), i32(-5)) } goto _61 _11: @@ -31974,41 +33690,41 @@ _11: } }() func() { - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93594), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45159))) crt.X__builtin_abort(tls) } }() - _19_pSel = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _19_pSel = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _19_nReg = func() int32 { if int32(_pExpr.X0) == i32(119) { return ((*XExprList)(_19_pSel.X0).X0) } return i32(1) }() - _sqlite3SelectDestInit(tls, &_19_dest, i32(0), (_pParse.X18)+i32(1)) + _sqlite3SelectDestInit(tls, &_19_dest, i32(0), _pParse.X18+i32(1)) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _19_nReg sink1(*p) } if int32(_pExpr.X0) == i32(119) { - *(*uint8)(unsafe.Pointer(&(_19_dest.X0))) = uint8(i32(10)) - *(*int32)(unsafe.Pointer(&(_19_dest.X3))) = _19_dest.X2 - *(*int32)(unsafe.Pointer(&(_19_dest.X4))) = _19_nReg - _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _19_dest.X2, ((_19_dest.X2)+_19_nReg)-i32(1)) + *(*uint8)(unsafe.Pointer(&_19_dest.X0)) = uint8(i32(10)) + *(*int32)(unsafe.Pointer(&_19_dest.X3)) = _19_dest.X2 + *(*int32)(unsafe.Pointer(&_19_dest.X4)) = _19_nReg + _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _19_dest.X2, (_19_dest.X2+_19_nReg)-i32(1)) _sqlite3VdbeComment(tls, _v, str(45196)) goto _70 } - *(*uint8)(unsafe.Pointer(&(_19_dest.X0))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_19_dest.X0)) = uint8(i32(3)) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _19_dest.X2) _sqlite3VdbeComment(tls, _v, str(45217)) _70: _sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_19_pSel.X15)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pSel.X15))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+16*uintptr(i32(1)))), i32(0)) - *(*int32)(unsafe.Pointer(&(_19_pSel.X4))) = i32(0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_19_pSel.X15)))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3IntTokens))+16*uintptr(i32(1)))), i32(0)) + *(*int32)(unsafe.Pointer(&_19_pSel.X4)) = i32(0) { - p := (*uint32)(unsafe.Pointer(&(_19_pSel.X3))) + p := (*uint32)(unsafe.Pointer(&_19_pSel.X3)) *p = (*p) & uint32(i32(-1025)) sink5(*p) } @@ -32017,7 +33733,7 @@ _70: } _rReg = _19_dest.X2 { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } @@ -32043,31 +33759,40 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CodeSubselectØ00__func__Ø000[0], str(45236), 21) } -// Remember the current column cache context. Any new entries added -// added to the column cache after this call are removed when the -// corresponding pop occurs. +// C comment +// /* +// ** Remember the current column cache context. Any new entries added +// ** added to the column cache after this call are removed when the +// ** corresponding pop occurs. +// */ func _sqlite3ExprCachePush(tls *crt.TLS, _pParse *XParse) { - *(*int32)(unsafe.Pointer(&(_pParse.X23))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X23)) += 1 if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 { crt.Xprintf(tls, str(45257), _pParse.X23) } } -// Initialize a SelectDest structure. +// C comment +// /* +// ** Initialize a SelectDest structure. +// */ func _sqlite3SelectDestInit(tls *crt.TLS, _pDest *XSelectDest, _eDest int32, _iParm int32) { - *(*uint8)(unsafe.Pointer(&(_pDest.X0))) = uint8(_eDest) - *(*int32)(unsafe.Pointer(&(_pDest.X2))) = _iParm - *(**int8)(unsafe.Pointer(&(_pDest.X1))) = nil - *(*int32)(unsafe.Pointer(&(_pDest.X3))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pDest.X4))) = i32(0) -} - -// Argument pExpr is an (?, ?...) IN(...) expression. This -// function allocates and returns a nul-terminated string containing -// the affinities to be used for each column of the comparison. -// -// It is the responsibility of the caller to ensure that the returned -// string is eventually freed using sqlite3DbFree(). + *(*uint8)(unsafe.Pointer(&_pDest.X0)) = uint8(_eDest) + *(*int32)(unsafe.Pointer(&_pDest.X2)) = _iParm + *(**int8)(unsafe.Pointer(&_pDest.X1)) = nil + *(*int32)(unsafe.Pointer(&_pDest.X3)) = i32(0) + *(*int32)(unsafe.Pointer(&_pDest.X4)) = i32(0) +} + +// C comment +// /* +// ** Argument pExpr is an (?, ?...) IN(...) expression. This +// ** function allocates and returns a nul-terminated string containing +// ** the affinities to be used for each column of the comparison. +// ** +// ** It is the responsibility of the caller to ensure that the returned +// ** string is eventually freed using sqlite3DbFree(). +// */ func _exprINAffinity(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *int8) { var _nVal, _1_i int32 var _2_a int8 @@ -32077,8 +33802,8 @@ func _exprINAffinity(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *int8) { _pLeft = (*XExpr)(_pExpr.X4) _nVal = _sqlite3ExprVectorSize(tls, _pLeft) _pSelect = func() *XSelect { - if ((_pExpr.X2) & uint32(i32(2048))) != 0 { - return (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + if (_pExpr.X2 & uint32(i32(2048))) != 0 { + return (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) } return nil }() @@ -32100,15 +33825,15 @@ _5: _2_pA = _sqlite3VectorFieldSubexpr(tls, _pLeft, _1_i) _2_a = _sqlite3ExprAffinity(tls, _2_pA) if _pSelect != nil { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_1_i))) = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+32*uintptr(_1_i))).X0), _2_a) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRet)) + 1*uintptr(_1_i))) = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+32*uintptr(_1_i))).X0), _2_a) goto _10 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_1_i))) = _2_a + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRet)) + 1*uintptr(_1_i))) = _2_a _10: _1_i += 1 goto _5 _8: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_nVal))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRet)) + 1*uintptr(_nVal))) = int8(i32(0)) _4: return _zRet } @@ -32119,19 +33844,22 @@ func init() { crt.Xstrncpy(nil, &_exprINAffinityØ00__func__Ø000[0], str(45286), 15) } -// Return a pointer to a subexpression of pVector that is the i-th -// column of the vector (numbered starting with 0). The caller must -// ensure that i is within range. -// -// If pVector is really a scalar (and "scalar" here includes subqueries -// that return a single column!) then return pVector unmodified. -// -// pVector retains ownership of the returned subexpression. -// -// If the vector is a (SELECT ...) then the expression returned is -// just the expression for the i-th term of the result set, and may -// not be ready for evaluation because the table cursor has not yet -// been positioned. +// C comment +// /* +// ** Return a pointer to a subexpression of pVector that is the i-th +// ** column of the vector (numbered starting with 0). The caller must +// ** ensure that i is within range. +// ** +// ** If pVector is really a scalar (and "scalar" here includes subqueries +// ** that return a single column!) then return pVector unmodified. +// ** +// ** pVector retains ownership of the returned subexpression. +// ** +// ** If the vector is a (SELECT ...) then the expression returned is +// ** just the expression for the i-th term of the result set, and may +// ** not be ready for evaluation because the table cursor has not yet +// ** been positioned. +// */ func _sqlite3VectorFieldSubexpr(tls *crt.TLS, _pVector *XExpr, _i int32) (r0 *XExpr) { func() { if _i >= _sqlite3ExprVectorSize(tls, _pVector) { @@ -32149,9 +33877,9 @@ func _sqlite3VectorFieldSubexpr(tls *crt.TLS, _pVector *XExpr, _i int32) (r0 *XE } }() if (int32(_pVector.X0) == i32(119)) || (int32(_pVector.X12) == i32(119)) { - return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X0).X2))))) + 32*uintptr(_i))).X0) + return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pVector.X6))))).X0).X2))))) + 32*uintptr(_i))).X0) } - return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 32*uintptr(_i))).X0) + return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pVector.X6))))).X2))))) + 32*uintptr(_i))).X0) _2: return _pVector @@ -32163,49 +33891,52 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VectorFieldSubexprØ00__func__Ø000[0], str(45378), 26) } -// Return the 'affinity' of the expression pExpr if any. -// -// If pExpr is a column, a reference to a column via an 'AS' alias, -// or a sub-select with a column as the return value, then the -// affinity of that column is returned. Otherwise, 0x00 is returned, -// indicating no affinity for the expression. -// -// i.e. the WHERE clause expressions in the following statements all -// have an affinity: -// -// CREATE TABLE t1(a); -// SELECT * FROM t1 WHERE a; -// SELECT a AS b FROM t1 WHERE b; -// SELECT * FROM t1 WHERE (select a from t1); +// C comment +// /* +// ** Return the 'affinity' of the expression pExpr if any. +// ** +// ** If pExpr is a column, a reference to a column via an 'AS' alias, +// ** or a sub-select with a column as the return value, then the +// ** affinity of that column is returned. Otherwise, 0x00 is returned, +// ** indicating no affinity for the expression. +// ** +// ** i.e. the WHERE clause expressions in the following statements all +// ** have an affinity: +// ** +// ** CREATE TABLE t1(a); +// ** SELECT * FROM t1 WHERE a; +// ** SELECT a AS b FROM t1 WHERE b; +// ** SELECT * FROM t1 WHERE (select a from t1); +// */ func _sqlite3ExprAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) { var _op int32 _pExpr = _sqlite3ExprSkipCollate(tls, _pExpr) - if ((_pExpr.X2) & uint32(i32(512))) != 0 { + if (_pExpr.X2 & uint32(i32(512))) != 0 { return int8(i32(0)) } _op = int32(_pExpr.X0) if _op == i32(119) { func() { - if ((_pExpr.X2) & uint32(i32(2048))) == 0 { + if (_pExpr.X2 & uint32(i32(2048))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90949), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000))), unsafe.Pointer(str(45404))) crt.X__builtin_abort(tls) } }() - return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X2)))))+32*uintptr(i32(0)))).X0)) + return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0).X2)))))+32*uintptr(i32(0)))).X0)) } if _op == i32(157) { _op = int32(_pExpr.X12) } if _op == i32(37) { func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90955), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - return _sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil) + return _sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), nil) } - if ((_op == i32(154)) || (_op == i32(152))) && ((*XTable)(_pExpr.X14) != nil) { + if ((_op == i32(154)) || (_op == i32(152))) && (_pExpr.X14 != nil) { return _sqlite3TableColumnAffinity(tls, (*XTable)(_pExpr.X14), int32(_pExpr.X9)) } if _op == i32(159) { @@ -32215,27 +33946,30 @@ func _sqlite3ExprAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) { crt.X__builtin_abort(tls) } }() - return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X6)))))).X0).X2)))))+32*uintptr(_pExpr.X9))).X0)) + return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X6)))))).X0).X2)))))+32*uintptr(_pExpr.X9))).X0)) } return _pExpr.X1 } -// Skip over any TK_COLLATE operators and any unlikely() -// or likelihood() function at the root of an expression. +// C comment +// /* +// ** Skip over any TK_COLLATE operators and any unlikely() +// ** or likelihood() function at the root of an expression. +// */ func _sqlite3ExprSkipCollate(tls *crt.TLS, _pExpr *XExpr) (r0 *XExpr) { _0: - if _pExpr == nil || ((_pExpr.X2)&uint32(i32(4096))) == uint32(i32(0)) { + if _pExpr == nil || (_pExpr.X2&uint32(i32(4096))) == uint32(i32(0)) { goto _1 } - if ((_pExpr.X2) & uint32(i32(262144))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(262144))) != uint32(i32(0)) { func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() func() { - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) <= i32(0) { + if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91010), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(45463))) crt.X__builtin_abort(tls) } @@ -32246,7 +33980,7 @@ _0: crt.X__builtin_abort(tls) } }() - _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(0)))).X0) + _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(0)))).X0) goto _10 } func() { @@ -32274,7 +34008,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprAffinityØ00__func__Ø000[0], str(45555), 20) } -// Return the affinity character for a single column of a table. +// C comment +// /* +// ** Return the affinity character for a single column of a table. +// */ func _sqlite3TableColumnAffinity(tls *crt.TLS, _pTab *XTable, _iCol int32) (r0 int8) { func() { if _iCol >= int32(_pTab.X11) { @@ -32296,9 +34033,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TableColumnAffinityØ00__func__Ø000[0], str(45591), 27) } -// pExpr is an operand of a comparison operator. aff2 is the -// type affinity of the other operand. This routine returns the -// type affinity that should be used for the comparison operator. +// C comment +// /* +// ** pExpr is an operand of a comparison operator. aff2 is the +// ** type affinity of the other operand. This routine returns the +// ** type affinity that should be used for the comparison operator. +// */ func _sqlite3CompareAffinity(tls *crt.TLS, _pExpr *XExpr, _aff2 int8) (r0 int8) { var _aff1 int8 _aff1 = _sqlite3ExprAffinity(tls, _pExpr) @@ -32329,17 +34069,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CompareAffinityØ00__func__Ø000[0], str(45637), 23) } -// Generate code for the SELECT statement given in the p argument. -// -// The results are returned according to the SelectDest structure. -// See comments in sqliteInt.h for further information. -// -// This routine returns the number of errors. If any errors are -// encountered, then an appropriate error message is left in -// pParse->zErrMsg. -// -// This routine does NOT free the Select structure passed in. The -// calling function needs to do that. +// C comment +// /* +// ** Generate code for the SELECT statement given in the p argument. +// ** +// ** The results are returned according to the SelectDest structure. +// ** See comments in sqliteInt.h for further information. +// ** +// ** This routine returns the number of errors. If any errors are +// ** encountered, then an appropriate error message is left in +// ** pParse->zErrMsg. +// ** +// ** This routine does NOT free the Select structure passed in. The +// ** calling function needs to do that. +// */ func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) { var _i, _j, _isAgg, _rc, _iEnd, _iRestoreSelectId, _6_isAggSub, _18_addrTop, _19_topAddr, _19_onceAddr, _19_retAddr, _40_iAMem, _40_iBMem, _40_iUseFlag, _40_iAbortFlag, _40_groupBySort, _40_addrEnd, _40_sortPTab, _40_sortOut, _40_orderByGrp, _41_k, _49_addr1, _49_addrOutputRow, _49_regOutputRow, _49_addrSetAbort, _49_addrTopOfLoop, _49_addrSortingIdx, _49_addrReset, _49_regReset, _51_regBase, _51_regRecord, _51_nCol, _51_nGroupBy, _55_r1, _64_iDb, _64_iCsr, _64_iRoot int32 var _34_wctrlFlags uint16 @@ -32365,19 +34108,19 @@ func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectD _pEList = nil _rc = i32(1) _iRestoreSelectId = _pParse.X58 - *(*int32)(unsafe.Pointer(&(_pParse.X58))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X59))), int32(1)) + *(*int32)(unsafe.Pointer(&_pParse.X58)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X59)), 1) _db = (*Xsqlite3)(_pParse.X0) - if ((_p == nil) || ((_db.X17) != 0)) || (_pParse.X16) != 0 { + if ((_p == nil) || (_db.X17 != 0)) || _pParse.X16 != 0 { return i32(1) } if _sqlite3AuthCheck(tls, _pParse, i32(21), nil, nil, nil) != 0 { return i32(1) } - crt.Xmemset(tls, (unsafe.Pointer)(&_sAggInfo), i32(0), u64(64)) - *(*int32)(unsafe.Pointer(&(_pParse.X35))) += 1 + crt.Xmemset(tls, unsafe.Pointer(&_sAggInfo), i32(0), u64(64)) + *(*int32)(unsafe.Pointer(&_pParse.X35)) += 1 if (Xsqlite3SelectTrace & i32(1)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(45671) }()) } @@ -32416,18 +34159,18 @@ func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectD } }() _sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = nil { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) & uint32(i32(-2)) sink5(*p) } } _sqlite3SelectPrep(tls, _pParse, _p, nil) - crt.Xmemset(tls, (unsafe.Pointer)(&_sSort), i32(0), u64(40)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = (*XExprList)(_p.X12) + crt.Xmemset(tls, unsafe.Pointer(&_sSort), i32(0), u64(40)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSort.X0)))) = (*XExprList)(_p.X12) _pTabList = (*XSrcList)(_p.X8) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { goto _select_end } func() { @@ -32436,13 +34179,13 @@ func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectD crt.X__builtin_abort(tls) } }() - _isAgg = bool2int(((_p.X3) & uint32(i32(8))) != uint32(i32(0))) + _isAgg = bool2int((_p.X3 & uint32(i32(8))) != uint32(i32(0))) if (Xsqlite3SelectTrace & i32(256)) == 0 { goto _32 } if (Xsqlite3SelectTrace & i32(256)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46100) }()) } @@ -32450,10 +34193,10 @@ func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectD _32: _i = i32(0) _34: - if (*XSelect)(_p.X13) != nil || _i >= (_pTabList.X0) { + if _p.X13 != nil || _i >= _pTabList.X0 { goto _38 } - _6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_i))) + _6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_i))) _6_pSub = (*XSelect)(_6_pItem.X5) _6_pTab = (*XTable)(_6_pItem.X4) if _6_pSub == nil { @@ -32463,14 +34206,14 @@ _34: _sqlite3ErrorMsg(tls, _pParse, str(46124), int32(_6_pTab.X11), unsafe.Pointer(_6_pTab.X0), (*XExprList)(_6_pSub.X0).X0) goto _select_end } - _6_isAggSub = bool2int(((_6_pSub.X3) & uint32(i32(8))) != uint32(i32(0))) + _6_isAggSub = bool2int((_6_pSub.X3 & uint32(i32(8))) != uint32(i32(0))) if _flattenSubquery(tls, _pParse, _p, _i, _isAgg, _6_isAggSub) == 0 { goto _41 } if _6_isAggSub != 0 { _isAgg = i32(1) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(8)) sink5(*p) } @@ -32478,11 +34221,11 @@ _34: _i = i32(-1) _41: _pTabList = (*XSrcList)(_p.X8) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _select_end } if int32(_pDest.X0) > i32(8) { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = (*XExprList)(_p.X12) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSort.X0)))) = (*XExprList)(_p.X12) } _35: _i += 1 @@ -32492,48 +34235,48 @@ _38: if _v == nil { goto _select_end } - if (*XSelect)(_p.X13) == nil { + if _p.X13 == nil { goto _46 } _rc = _multiSelect(tls, _pParse, _p, _pDest) - *(*int32)(unsafe.Pointer(&(_pParse.X58))) = _iRestoreSelectId + *(*int32)(unsafe.Pointer(&_pParse.X58)) = _iRestoreSelectId if (Xsqlite3SelectTrace & i32(1)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46164) }()) } - *(*int32)(unsafe.Pointer(&(_pParse.X35))) -= 1 + *(*int32)(unsafe.Pointer(&_pParse.X35)) -= 1 return _rc _46: _i = i32(0) _48: - if _i >= (_pTabList.X0) { + if _i >= _pTabList.X0 { goto _51 } - _12_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_i))) - if (_12_pItem.X14) == uint64(i32(0)) { + _12_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_i))) + if _12_pItem.X14 == uint64(i32(0)) { _sqlite3AuthCheck(tls, _pParse, i32(20), _12_pItem.X2, str(0), _12_pItem.X1) } _12_pSub = (*XSelect)(_12_pItem.X5) if _12_pSub == nil { goto _49 } - if (_12_pItem.X6) == 0 { + if _12_pItem.X6 == 0 { goto _54 } - if int32((uint32(((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1)>>uint(i32(4)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_12_pItem.X9)).X1)>>uint(i32(4)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { _sqlite3VdbeAddOp2(tls, _v, i32(14), _12_pItem.X7, _12_pItem.X6) } goto _49 _54: { - p := (*int32)(unsafe.Pointer(&(_pParse.X57))) + p := (*int32)(unsafe.Pointer(&_pParse.X57)) *p = (*p) + _sqlite3SelectExprHeight(tls, _p) sink1(*p) } - if (int32((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X0)&i32(32)) != i32(0) || _pushDownWhereTerms(tls, _pParse, _12_pSub, (*XExpr)(_p.X9), _12_pItem.X11) == 0 { + if (int32((*t28)(unsafe.Pointer(&_12_pItem.X9)).X0)&i32(32)) != i32(0) || _pushDownWhereTerms(tls, _pParse, _12_pSub, (*XExpr)(_p.X9), _12_pItem.X11) == 0 { goto _57 } if (Xsqlite3SelectTrace & i32(256)) == 0 { @@ -32541,25 +34284,25 @@ _54: } if (Xsqlite3SelectTrace & i32(256)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46196) }()) } _sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0))) _58: _57: - if (((_i == i32(0)) && (((_pTabList.X0) == i32(1)) || ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(1)))).X9))).X0) & i32(10)) != i32(0)))) && (((_p.X3) & uint32(i32(2))) == uint32(i32(0)))) && ((int32(_db.X13) & i32(256)) == i32(0)) { + if (((_i == i32(0)) && ((_pTabList.X0 == i32(1)) || ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(1)))).X9))).X0) & i32(10)) != i32(0)))) && ((_p.X3 & uint32(i32(2))) == uint32(i32(0)))) && ((int32(_db.X13) & i32(256)) == i32(0)) { _18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1) - *(*int32)(unsafe.Pointer(&(_12_pItem.X7))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(*int32)(unsafe.Pointer(&_12_pItem.X7)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp3(tls, _v, i32(15), _12_pItem.X7, i32(0), _18_addrTop) _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer((*XTable)(_12_pItem.X4).X0)) - *(*int32)(unsafe.Pointer(&(_12_pItem.X6))) = _18_addrTop + *(*int32)(unsafe.Pointer(&_12_pItem.X6)) = _18_addrTop _sqlite3SelectDestInit(tls, &_12_dest, i32(13), _12_pItem.X7) - *(*uint8)(unsafe.Pointer(&(_12_pItem.X10))) = uint8(_pParse.X59) + *(*uint8)(unsafe.Pointer(&_12_pItem.X10)) = uint8(_pParse.X59) _sqlite3Select(tls, _pParse, _12_pSub, &_12_dest) *(*int16)(unsafe.Pointer(&((*XTable)(_12_pItem.X4).X12))) = _12_pSub.X2 - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1))), int8(i32(1)), 16, 4) - *(*int32)(unsafe.Pointer(&(_12_pItem.X8))) = _12_dest.X3 + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_12_pItem.X9)).X1))), int8(i32(1)), 16, 4) + *(*int32)(unsafe.Pointer(&_12_pItem.X8)) = _12_dest.X3 _sqlite3VdbeEndCoroutine(tls, _v, _12_pItem.X7) _sqlite3VdbeJumpHere(tls, _v, _18_addrTop-i32(1)) _sqlite3ClearTempRegCache(tls, _pParse) @@ -32567,15 +34310,15 @@ _57: } _19_onceAddr = i32(0) func() { - if (_12_pItem.X6) != i32(0) { + if _12_pItem.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46227))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_12_pItem.X7))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(*int32)(unsafe.Pointer(&_12_pItem.X7)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _19_topAddr = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _12_pItem.X7) - *(*int32)(unsafe.Pointer(&(_12_pItem.X6))) = _19_topAddr + i32(1) - if int32((uint32(((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + *(*int32)(unsafe.Pointer(&_12_pItem.X6)) = _19_topAddr + i32(1) + if int32((uint32(((*t28)(unsafe.Pointer(&_12_pItem.X9)).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { _19_onceAddr = _sqlite3VdbeAddOp0(tls, _v, i32(20)) _sqlite3VdbeComment(tls, _v, str(46249), unsafe.Pointer((*XTable)(_12_pItem.X4).X0)) goto _69 @@ -32588,7 +34331,7 @@ _69: goto _71 } _sqlite3SelectDestInit(tls, &_12_dest, i32(12), _12_pItem.X11) - *(*uint8)(unsafe.Pointer(&(_12_pItem.X10))) = uint8(_pParse.X59) + *(*uint8)(unsafe.Pointer(&_12_pItem.X10)) = uint8(_pParse.X59) _sqlite3Select(tls, _pParse, _12_pSub, &_12_dest) _71: *(*int16)(unsafe.Pointer(&((*XTable)(_12_pItem.X4).X12))) = _12_pSub.X2 @@ -32600,11 +34343,11 @@ _71: _sqlite3VdbeChangeP1(tls, _v, uint32(_19_topAddr), _19_retAddr) _sqlite3ClearTempRegCache(tls, _pParse) _65: - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _select_end } { - p := (*int32)(unsafe.Pointer(&(_pParse.X57))) + p := (*int32)(unsafe.Pointer(&_pParse.X57)) *p = (*p) - _sqlite3SelectExprHeight(tls, _p) sink1(*p) } @@ -32616,29 +34359,29 @@ _51: _pWhere = (*XExpr)(_p.X9) _pGroupBy = (*XExprList)(_p.X10) _pHaving = (*XExpr)(_p.X11) - *(*uint8)(unsafe.Pointer(&(_sDistinct.X0))) = uint8(bool2int(((_p.X3) & uint32(i32(1))) != uint32(i32(0)))) + *(*uint8)(unsafe.Pointer(&_sDistinct.X0)) = uint8(bool2int((_p.X3 & uint32(i32(1))) != uint32(i32(0)))) if (Xsqlite3SelectTrace & i32(1024)) == 0 { goto _74 } if (Xsqlite3SelectTrace & i32(1024)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46273) }()) } _sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0))) _74: - if ((_p.X3)&uint32(i32(9))) != uint32(i32(1)) || _sqlite3ExprListCompare(tls, (*XExprList)(_sSort.X0), _pEList, i32(-1)) != i32(0) { + if (_p.X3&uint32(i32(9))) != uint32(i32(1)) || _sqlite3ExprListCompare(tls, (*XExprList)(_sSort.X0), _pEList, i32(-1)) != i32(0) { goto _77 } { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) & uint32(i32(-2)) sink5(*p) } - _pGroupBy = store42((**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))), _sqlite3ExprListDup(tls, _db, _pEList, i32(0))) + _pGroupBy = store42((**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X10)))), _sqlite3ExprListDup(tls, _db, _pEList, i32(0))) func() { - if (_sDistinct.X0) == 0 { + if _sDistinct.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121849), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46306))) crt.X__builtin_abort(tls) } @@ -32648,51 +34391,51 @@ _74: } if (Xsqlite3SelectTrace & i32(1024)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46323) }()) } _sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0))) _80: _77: - if (*XExprList)(_sSort.X0) != nil { + if _sSort.X0 != nil { _27_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_sSort.X0), i32(0), _pEList.X0) - *(*int32)(unsafe.Pointer(&(_sSort.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - *(*int32)(unsafe.Pointer(&(_sSort.X5))) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sSort.X2, (((*XExprList)(_sSort.X0).X0)+i32(1))+(_pEList.X0), i32(0), (*int8)(unsafe.Pointer(_27_pKeyInfo)), i32(-5)) + *(*int32)(unsafe.Pointer(&_sSort.X2)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + *(*int32)(unsafe.Pointer(&_sSort.X5)) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sSort.X2, (((*XExprList)(_sSort.X0).X0)+i32(1))+_pEList.X0, i32(0), (*int8)(unsafe.Pointer(_27_pKeyInfo)), i32(-5)) goto _83 } - *(*int32)(unsafe.Pointer(&(_sSort.X5))) = i32(-1) + *(*int32)(unsafe.Pointer(&_sSort.X5)) = i32(-1) _83: if int32(_pDest.X0) == i32(12) { _sqlite3VdbeAddOp2(tls, _v, i32(110), _pDest.X2, _pEList.X0) } _iEnd = _sqlite3VdbeMakeLabel(tls, _v) - if ((_p.X3) & uint32(i32(16384))) == uint32(i32(0)) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(320)) + if (_p.X3 & uint32(i32(16384))) == uint32(i32(0)) { + *(*int16)(unsafe.Pointer(&_p.X2)) = int16(i32(320)) } _computeLimitRegisters(tls, _pParse, _p, _iEnd) - if ((_p.X4) == i32(0)) && ((_sSort.X5) >= i32(0)) { + if (_p.X4 == i32(0)) && (_sSort.X5 >= i32(0)) { _sqlite3VdbeChangeOpcode(tls, _v, uint32(_sSort.X5), uint8(i32(111))) { - p := (*uint8)(unsafe.Pointer(&(_sSort.X7))) + p := (*uint8)(unsafe.Pointer(&_sSort.X7)) *p = uint8(int32(*p) | i32(1)) sink2(*p) } } - if ((_p.X3) & uint32(i32(1))) != 0 { - *(*int32)(unsafe.Pointer(&(_sDistinct.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - *(*int32)(unsafe.Pointer(&(_sDistinct.X3))) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sDistinct.X2, i32(0), i32(0), (*int8)(unsafe.Pointer(_keyInfoFromExprList(tls, _pParse, (*XExprList)(_p.X0), i32(0), i32(0)))), i32(-5)) + if (_p.X3 & uint32(i32(1))) != 0 { + *(*int32)(unsafe.Pointer(&_sDistinct.X2)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + *(*int32)(unsafe.Pointer(&_sDistinct.X3)) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sDistinct.X2, i32(0), i32(0), (*int8)(unsafe.Pointer(_keyInfoFromExprList(tls, _pParse, (*XExprList)(_p.X0), i32(0), i32(0)))), i32(-5)) _sqlite3VdbeChangeP5(tls, _v, uint16(i32(8))) - *(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_sDistinct.X1)) = uint8(i32(3)) goto _89 } - *(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_sDistinct.X1)) = uint8(i32(0)) _89: if _isAgg != 0 || _pGroupBy != nil { goto _91 } _34_wctrlFlags = uint16(func() int32 { - if (_sDistinct.X0) != 0 { + if _sDistinct.X0 != 0 { return i32(256) } return i32(0) @@ -32700,7 +34443,7 @@ _89: i32(0) { p := &_34_wctrlFlags - *p = uint16(uint32(*p) | ((_p.X3) & uint32(i32(16384)))) + *p = uint16(uint32(*p) | (_p.X3 & uint32(i32(16384)))) sink14(*p) } _pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, (*XExprList)(_sSort.X0), (*XExprList)(_p.X0), _34_wctrlFlags, int32(_p.X2)) @@ -32708,21 +34451,21 @@ _89: goto _select_end } if int32(_sqlite3WhereOutputRowCount(tls, _pWInfo)) < int32(_p.X2) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3WhereOutputRowCount(tls, _pWInfo) + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3WhereOutputRowCount(tls, _pWInfo) } - if ((_sDistinct.X0) != 0) && _sqlite3WhereIsDistinct(tls, _pWInfo) != 0 { - *(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(_sqlite3WhereIsDistinct(tls, _pWInfo)) + if (_sDistinct.X0 != 0) && _sqlite3WhereIsDistinct(tls, _pWInfo) != 0 { + *(*uint8)(unsafe.Pointer(&_sDistinct.X1)) = uint8(_sqlite3WhereIsDistinct(tls, _pWInfo)) } - if (*XExprList)(_sSort.X0) == nil { + if _sSort.X0 == nil { goto _98 } - *(*int32)(unsafe.Pointer(&(_sSort.X1))) = _sqlite3WhereIsOrdered(tls, _pWInfo) - *(*uint8)(unsafe.Pointer(&(_sSort.X8))) = uint8(_sqlite3WhereOrderedInnerLoop(tls, _pWInfo)) - if (_sSort.X1) == ((*XExprList)(_sSort.X0).X0) { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil + *(*int32)(unsafe.Pointer(&_sSort.X1)) = _sqlite3WhereIsOrdered(tls, _pWInfo) + *(*uint8)(unsafe.Pointer(&_sSort.X8)) = uint8(_sqlite3WhereOrderedInnerLoop(tls, _pWInfo)) + if _sSort.X1 == ((*XExprList)(_sSort.X0).X0) { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSort.X0)))) = nil } _98: - if ((_sSort.X5) >= i32(0)) && ((*XExprList)(_sSort.X0) == nil) { + if (_sSort.X5 >= i32(0)) && ((*XExprList)(_sSort.X0) == nil) { _sqlite3VdbeChangeToNoop(tls, _v, _sSort.X5) } _selectInnerLoop(tls, _pParse, _p, _pEList, i32(-1), &_sSort, &_sDistinct, _pDest, _sqlite3WhereContinueLabel(tls, _pWInfo), _sqlite3WhereBreakLabel(tls, _pWInfo)) @@ -32740,16 +34483,16 @@ _104: if _41_k <= i32(0) { goto _107 } - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_41_pItem.X5))))).X1))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_41_pItem.X5)))).X1))) = uint16(i32(0)) *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(32) goto _104 _107: - *func() **TExprList_item { _41_k = _pGroupBy.X0; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2))))) + *func() **TExprList_item { _41_k = _pGroupBy.X0; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pGroupBy.X2)))) _108: if _41_k <= i32(0) { goto _111 } - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_41_pItem.X5))))).X1))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_41_pItem.X5)))).X1))) = uint16(i32(0)) *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(32) goto _108 _111: @@ -32760,7 +34503,7 @@ _111: } }() if int32(_p.X2) > i32(66) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(66)) + *(*int16)(unsafe.Pointer(&_p.X2)) = int16(i32(66)) } goto _115 _103: @@ -32770,24 +34513,24 @@ _103: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_p.X2)) = int16(i32(0)) _115: if _sqlite3ExprListCompare(tls, _pGroupBy, (*XExprList)(_sSort.X0), i32(-1)) == i32(0) { _40_orderByGrp = i32(1) } _40_addrEnd = _sqlite3VdbeMakeLabel(tls, _v) - crt.Xmemset(tls, (unsafe.Pointer)(&_40_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X1))))) = _pTabList - *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X3))))) = &_sAggInfo - *(*int32)(unsafe.Pointer(&(_sAggInfo.X5))) = (_pParse.X18) + i32(1) - *(*int32)(unsafe.Pointer(&(_sAggInfo.X4))) = func() int32 { + crt.Xmemset(tls, unsafe.Pointer(&_40_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_40_sNC.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_40_sNC.X1)))) = _pTabList + *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_40_sNC.X3)))) = &_sAggInfo + *(*int32)(unsafe.Pointer(&_sAggInfo.X5)) = _pParse.X18 + i32(1) + *(*int32)(unsafe.Pointer(&_sAggInfo.X4)) = func() int32 { if _pGroupBy != nil { - return (_pGroupBy.X0) + return _pGroupBy.X0 } return i32(0) }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sAggInfo.X7))))) = _pGroupBy + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sAggInfo.X7)))) = _pGroupBy _sqlite3ExprAnalyzeAggList(tls, &_40_sNC, _pEList) _sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(_sSort.X0)) if _pHaving == nil { @@ -32800,15 +34543,15 @@ _115: crt.X__builtin_abort(tls) } }() - _havingToWhere(tls, _pParse, _pGroupBy, _pHaving, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9)))))) + _havingToWhere(tls, _pParse, _pGroupBy, _pHaving, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9))))) _pWhere = (*XExpr)(_p.X9) } _sqlite3ExprAnalyzeAggregates(tls, &_40_sNC, _pHaving) _121: - *(*int32)(unsafe.Pointer(&(_sAggInfo.X10))) = _sAggInfo.X9 + *(*int32)(unsafe.Pointer(&_sAggInfo.X10)) = _sAggInfo.X9 _i = i32(0) _125: - if _i >= (_sAggInfo.X12) { + if _i >= _sAggInfo.X12 { goto _128 } func() { @@ -32818,52 +34561,52 @@ _125: } }() { - p := (*uint16)(unsafe.Pointer(&(_40_sNC.X7))) + p := (*uint16)(unsafe.Pointer(&_40_sNC.X7)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } _sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*TAggInfo_func)(unsafe.Pointer(uintptr(_sAggInfo.X11) + 24*uintptr(_i))).X0).X6))))))) { - p := (*uint16)(unsafe.Pointer(&(_40_sNC.X7))) + p := (*uint16)(unsafe.Pointer(&_40_sNC.X7)) *p = uint16(int32(*p) & i32(-9)) sink14(*p) } _i += 1 goto _125 _128: - *(*int32)(unsafe.Pointer(&(_sAggInfo.X6))) = _pParse.X18 - if (_db.X17) != 0 { + *(*int32)(unsafe.Pointer(&_sAggInfo.X6)) = _pParse.X18 + if _db.X17 != 0 { goto _select_end } if _pGroupBy == nil { goto _132 } - *(*int32)(unsafe.Pointer(&(_sAggInfo.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + *(*int32)(unsafe.Pointer(&_sAggInfo.X2)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _49_pKeyInfo = _keyInfoFromExprList(tls, _pParse, _pGroupBy, i32(0), _sAggInfo.X9) _49_addrSortingIdx = _sqlite3VdbeAddOp4(tls, _v, i32(111), _sAggInfo.X2, _sAggInfo.X4, i32(0), (*int8)(unsafe.Pointer(_49_pKeyInfo)), i32(-5)) - _40_iUseFlag = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _40_iAbortFlag = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _49_regOutputRow = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _40_iUseFlag = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _40_iAbortFlag = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _49_regOutputRow = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _49_addrOutputRow = _sqlite3VdbeMakeLabel(tls, _v) - _49_regReset = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _49_regReset = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _49_addrReset = _sqlite3VdbeMakeLabel(tls, _v) - _40_iAMem = (_pParse.X18) + i32(1) + _40_iAMem = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) - *p = (*p) + (_pGroupBy.X0) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) + *p = (*p) + _pGroupBy.X0 sink1(*p) } - _40_iBMem = (_pParse.X18) + i32(1) + _40_iBMem = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) - *p = (*p) + (_pGroupBy.X0) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) + *p = (*p) + _pGroupBy.X0 sink1(*p) } _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _40_iAbortFlag) _sqlite3VdbeComment(tls, _v, str(46475)) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _40_iUseFlag) _sqlite3VdbeComment(tls, _v, str(46492)) - _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _40_iAMem, (_40_iAMem+(_pGroupBy.X0))-i32(1)) + _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _40_iAMem, (_40_iAMem+_pGroupBy.X0)-i32(1)) _sqlite3VdbeAddOp2(tls, _v, i32(14), _49_regReset, _49_addrReset) _pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _pGroupBy, nil, uint16(i32(64)|func() int32 { if _40_orderByGrp != 0 { @@ -32874,12 +34617,12 @@ _128: if _pWInfo == nil { goto _select_end } - if _sqlite3WhereIsOrdered(tls, _pWInfo) == (_pGroupBy.X0) { + if _sqlite3WhereIsOrdered(tls, _pWInfo) == _pGroupBy.X0 { _40_groupBySort = i32(0) goto _137 } _explainTempTable(tls, _pParse, func() *int8 { - if ((_sDistinct.X0) != 0) && (((_p.X3) & uint32(i32(1))) == uint32(i32(0))) { + if (_sDistinct.X0 != 0) && ((_p.X3 & uint32(i32(1))) == uint32(i32(0))) { return str(25716) } return str(46519) @@ -32890,7 +34633,7 @@ _128: _j = _51_nGroupBy _i = i32(0) _141: - if _i >= (_sAggInfo.X9) { + if _i >= _sAggInfo.X9 { goto _144 } if ((*TAggInfo_col)(unsafe.Pointer(uintptr(_sAggInfo.X8) + 32*uintptr(_i))).X3) >= _j { @@ -32906,11 +34649,11 @@ _144: _j = _51_nGroupBy _i = i32(0) _146: - if _i >= (_sAggInfo.X9) { + if _i >= _sAggInfo.X9 { goto _149 } _54_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_sAggInfo.X8) + 32*uintptr(_i))) - if (_54_pCol.X3) >= _j { + if _54_pCol.X3 >= _j { _55_r1 = _j + _51_regBase _sqlite3ExprCodeGetColumnToReg(tls, _pParse, (*XTable)(_54_pCol.X0), _54_pCol.X2, _54_pCol.X1, _55_r1) _j += 1 @@ -32924,16 +34667,16 @@ _149: _sqlite3ReleaseTempReg(tls, _pParse, _51_regRecord) _sqlite3ReleaseTempRange(tls, _pParse, _51_regBase, _51_nCol) _sqlite3WhereEnd(tls, _pWInfo) - *(*int32)(unsafe.Pointer(&(_sAggInfo.X3))) = store1(&_40_sortPTab, postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))) + *(*int32)(unsafe.Pointer(&_sAggInfo.X3)) = store1(&_40_sortPTab, postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1)) _40_sortOut = _sqlite3GetTempReg(tls, _pParse) _sqlite3VdbeAddOp3(tls, _v, i32(113), _40_sortPTab, _40_sortOut, _51_nCol) _sqlite3VdbeAddOp2(tls, _v, i32(35), _sAggInfo.X2, _40_addrEnd) _sqlite3VdbeComment(tls, _v, str(46528)) - *(*uint8)(unsafe.Pointer(&(_sAggInfo.X1))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_sAggInfo.X1)) = uint8(i32(1)) _sqlite3ExprCacheClear(tls, _pParse) _137: if (_40_orderByGrp != 0 && ((int32(_db.X13) & i32(4)) == i32(0))) && (_40_groupBySort != 0 || _sqlite3WhereIsSorted(tls, _pWInfo) != 0) { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSort.X0)))) = nil _sqlite3VdbeChangeToNoop(tls, _v, _sSort.X5) } _49_addrTopOfLoop = _sqlite3VdbeCurrentAddr(tls, _v) @@ -32943,15 +34686,15 @@ _137: } _j = i32(0) _156: - if _j >= (_pGroupBy.X0) { + if _j >= _pGroupBy.X0 { goto _159 } if _40_groupBySort != 0 { _sqlite3VdbeAddOp3(tls, _v, i32(99), _40_sortPTab, _j, _40_iBMem+_j) goto _161 } - *(*uint8)(unsafe.Pointer(&(_sAggInfo.X0))) = uint8(i32(1)) - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2)))))+32*uintptr(_j))).X0), _40_iBMem+_j) + *(*uint8)(unsafe.Pointer(&_sAggInfo.X0)) = uint8(i32(1)) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pGroupBy.X2))))+32*uintptr(_j))).X0), _40_iBMem+_j) _161: _j += 1 goto _156 @@ -33004,13 +34747,13 @@ _132: goto _165 } _64_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_63_pTab.X20)) - _64_iCsr = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _64_iCsr = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _64_pKeyInfo = nil _64_pBest = nil _64_iRoot = _63_pTab.X7 _sqlite3CodeVerifySchema(tls, _pParse, _64_iDb) _sqlite3TableLock(tls, _pParse, _64_iDb, _63_pTab.X7, uint8(i32(0)), _63_pTab.X0) - if ((_63_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_63_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { _64_pBest = _sqlite3PrimaryKeyIndex(tls, _63_pTab) } _64_pIdx = (*XIndex)(_63_pTab.X2) @@ -33018,7 +34761,7 @@ _167: if _64_pIdx == nil { goto _170 } - if (((int32((uint32((_64_pIdx.X16)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) && (int32(_64_pIdx.X12) < int32(_63_pTab.X13))) && ((*XExpr)(_64_pIdx.X9) == nil)) && ((_64_pBest == nil) || (int32(_64_pIdx.X12) < int32(_64_pBest.X12))) { + if (((int32((uint32(_64_pIdx.X16>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) && (int32(_64_pIdx.X12) < int32(_63_pTab.X13))) && ((*XExpr)(_64_pIdx.X9) == nil)) && ((_64_pBest == nil) || (int32(_64_pIdx.X12) < int32(_64_pBest.X12))) { _64_pBest = _64_pIdx } _64_pIdx = (*XIndex)(_64_pIdx.X5) @@ -33055,7 +34798,7 @@ _165: _69_flag = _minMaxQuery(tls, &_sAggInfo, &_69_pMinMax) } func() { - if int32(_69_flag) != i32(0) && (_69_pMinMax == nil || (_69_pMinMax.X0) != i32(1)) { + if int32(_69_flag) != i32(0) && (_69_pMinMax == nil || _69_pMinMax.X0 != i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122357), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46742))) crt.X__builtin_abort(tls) } @@ -33066,19 +34809,19 @@ _165: _69_pMinMax = _sqlite3ExprListDup(tls, _db, _69_pMinMax, i32(0)) _63_pDel = _69_pMinMax func() { - if (_db.X17) == 0 && _69_pMinMax == nil { + if _db.X17 == 0 && _69_pMinMax == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46787))) crt.X__builtin_abort(tls) } }() - if (_db.X17) == 0 { - *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_69_pMinMax.X2))))) + 32*uintptr(i32(0)))).X3))) = uint8(func() int32 { + if _db.X17 == 0 { + *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_69_pMinMax.X2)))) + 32*uintptr(i32(0)))).X3))) = uint8(func() int32 { if int32(_69_flag) != i32(1) { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_69_pMinMax.X2))))) + 32*uintptr(i32(0)))).X0).X0))) = uint8(i32(152)) + *(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_69_pMinMax.X2)))) + 32*uintptr(i32(0)))).X0).X0))) = uint8(i32(152)) } _188: _resetAccumulator(tls, _pParse, &_sAggInfo) @@ -33089,7 +34832,7 @@ _188: } _updateAccumulator(tls, _pParse, &_sAggInfo) func() { - if _69_pMinMax != nil && (_69_pMinMax.X0) != i32(1) { + if _69_pMinMax != nil && _69_pMinMax.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122380), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46818))) crt.X__builtin_abort(tls) } @@ -33106,7 +34849,7 @@ _188: _sqlite3WhereEnd(tls, _pWInfo) _finalizeAggFunctions(tls, _pParse, &_sAggInfo) _178: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSort.X0)))) = nil _sqlite3ExprIfFalse(tls, _pParse, _pHaving, _40_addrEnd, i32(16)) _selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), i32(-1), nil, nil, _pDest, _40_addrEnd, _40_addrEnd) _sqlite3ExprListDelete(tls, _db, _63_pDel) @@ -33116,9 +34859,9 @@ _102: if int32(_sDistinct.X1) == i32(3) { _explainTempTable(tls, _pParse, str(25716)) } - if (*XExprList)(_sSort.X0) != nil { + if _sSort.X0 != nil { _explainTempTable(tls, _pParse, func() *int8 { - if (_sSort.X1) > i32(0) { + if _sSort.X1 > i32(0) { return str(46864) } return str(46887) @@ -33126,9 +34869,9 @@ _102: _generateSortTail(tls, _pParse, _p, &_sSort, _pEList.X0, _pDest) } _sqlite3VdbeResolveLabel(tls, _v, _iEnd) - _rc = bool2int((_pParse.X16) > i32(0)) + _rc = bool2int(_pParse.X16 > i32(0)) _select_end: - *(*int32)(unsafe.Pointer(&(_pParse.X58))) = _iRestoreSelectId + *(*int32)(unsafe.Pointer(&_pParse.X58)) = _iRestoreSelectId if (_rc == i32(0)) && (int32(_pDest.X0) == i32(9)) { _generateColumnNames(tls, _pParse, _pTabList, _pEList) } @@ -33136,11 +34879,11 @@ _select_end: _sqlite3DbFree(tls, _db, _sAggInfo.X11) if (Xsqlite3SelectTrace & i32(1)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(46896) }()) } - *(*int32)(unsafe.Pointer(&(_pParse.X35))) -= 1 + *(*int32)(unsafe.Pointer(&_pParse.X35)) -= 1 return _rc _ = _sDistinct @@ -33151,28 +34894,31 @@ _select_end: panic(0) } -// Do an authorization check using the code and arguments given. Return -// either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY -// is returned, then the error count and error message in pParse are -// modified appropriately. +// C comment +// /* +// ** Do an authorization check using the code and arguments given. Return +// ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY +// ** is returned, then the error count and error message in pParse are +// ** modified appropriately. +// */ func _sqlite3AuthCheck(tls *crt.TLS, _pParse *XParse, _code int32, _zArg1 *int8, _zArg2 *int8, _zArg3 *int8) (r0 int32) { var _rc int32 var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) - if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) || ((_pParse.X55) != 0) { + if (((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0) || (_pParse.X55 != 0) { return i32(0) } if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32 - }{(_db.X59)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_db.X59})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32 }{nil})) { return i32(0) } - _rc = (_db.X59)(tls, _db.X60, _code, _zArg1, _zArg2, _zArg3, _pParse.X65) + _rc = _db.X59(tls, _db.X60, _code, _zArg1, _zArg2, _zArg3, _pParse.X65) if _rc == i32(1) { _sqlite3ErrorMsg(tls, _pParse, str(7980)) - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(23) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(23) goto _6 } if (_rc != i32(0)) && (_rc != i32(2)) { @@ -33183,18 +34929,24 @@ _6: return _rc } -// Write an error message into pParse->zErrMsg that explains that the -// user-supplied authorization function returned an illegal value. +// C comment +// /* +// ** Write an error message into pParse->zErrMsg that explains that the +// ** user-supplied authorization function returned an illegal value. +// */ func _sqliteAuthBadReturnCode(tls *crt.TLS, _pParse *XParse) { _sqlite3ErrorMsg(tls, _pParse, str(46912)) - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(1) } var Xsqlite3SelectTrace int32 -// A version of printf() that understands %lld. Used for debugging. -// The printf() built into some versions of windows does not understand %lld -// and segfaults if you give it a long long int. +// C comment +// /* +// ** A version of printf() that understands %lld. Used for debugging. +// ** The printf() built into some versions of windows does not understand %lld +// ** and segfaults if you give it a long long int. +// */ func _sqlite3DebugPrintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) { var _ap []interface{} var _acc XStrAccum @@ -33210,7 +34962,10 @@ func _sqlite3DebugPrintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) { _ = _zBuf } -// Generate a human-readable description of a Select object. +// C comment +// /* +// ** Generate a human-readable description of a Select object. +// */ func _sqlite3TreeViewSelect(tls *crt.TLS, _pView *t45, _p *XSelect, _moreToFollow uint8) { var _n, _cnt, _6_i int32 var _21_zOp *int8 @@ -33224,91 +34979,91 @@ func _sqlite3TreeViewSelect(tls *crt.TLS, _pView *t45, _p *XSelect, _moreToFollo return } _pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow) - if (*XWith)(_p.X17) != nil { + if _p.X17 != nil { _sqlite3TreeViewWith(tls, _pView, (*XWith)(_p.X17), uint8(i32(1))) _cnt = i32(1) _sqlite3TreeViewPush(tls, _pView, uint8(i32(1))) } _1: _sqlite3TreeViewLine(tls, _pView, str(46946), unsafe.Pointer(func() *int8 { - if ((_p.X3) & uint32(i32(1))) != 0 { + if (_p.X3 & uint32(i32(1))) != 0 { return str(46992) } return str(0) }()), unsafe.Pointer(func() *int8 { - if ((_p.X3) & uint32(i32(8))) != 0 { + if (_p.X3 & uint32(i32(8))) != 0 { return str(47002) } return str(0) }()), unsafe.Pointer(_p), _p.X3, int32(_p.X2)) - if postInc1(&_cnt, int32(1)) != 0 { + if postInc1(&_cnt, 1) != 0 { _sqlite3TreeViewPop(tls, _pView) } - if (*XSelect)(_p.X13) != nil { + if _p.X13 != nil { _n = i32(1000) goto _9 } _n = i32(0) - if ((*XSrcList)(_p.X8) != nil) && ((*XSrcList)(_p.X8).X0) != 0 { + if (_p.X8 != nil) && ((*XSrcList)(_p.X8).X0) != 0 { _n += 1 } - if (*XExpr)(_p.X9) != nil { + if _p.X9 != nil { _n += 1 } - if (*XExprList)(_p.X10) != nil { + if _p.X10 != nil { _n += 1 } - if (*XExpr)(_p.X11) != nil { + if _p.X11 != nil { _n += 1 } - if (*XExprList)(_p.X12) != nil { + if _p.X12 != nil { _n += 1 } - if (*XExpr)(_p.X15) != nil { + if _p.X15 != nil { _n += 1 } - if (*XExpr)(_p.X16) != nil { + if _p.X16 != nil { _n += 1 } _9: - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X0), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47012)) - if (*XSrcList)(_p.X8) == nil || ((*XSrcList)(_p.X8).X0) == 0 { + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X0), uint8(bool2int(postInc1(&_n, -1) > i32(0))), str(47012)) + if _p.X8 == nil || ((*XSrcList)(_p.X8).X0) == 0 { goto _19 } - _pView = _sqlite3TreeViewPush(tls, _pView, uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0)))) + _pView = _sqlite3TreeViewPush(tls, _pView, uint8(bool2int(postInc1(&_n, -1) > i32(0)))) _sqlite3TreeViewLine(tls, _pView, str(25729)) _6_i = i32(0) _20: if _6_i >= ((*XSrcList)(_p.X8).X0) { goto _23 } - _7_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_6_i))) + _7_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_6_i))) _sqlite3StrAccumInit(tls, &_7_x, nil, (*int8)(unsafe.Pointer(&_7_zLine)), int32(u64(100)), i32(0)) _sqlite3XPrintf(tls, &_7_x, str(47023), _7_pItem.X11) - if (_7_pItem.X1) != nil { + if _7_pItem.X1 != nil { _sqlite3XPrintf(tls, &_7_x, str(47030), unsafe.Pointer(_7_pItem.X1), unsafe.Pointer(_7_pItem.X2)) goto _26 } - if (_7_pItem.X2) != nil { + if _7_pItem.X2 != nil { _sqlite3XPrintf(tls, &_7_x, str(47037), unsafe.Pointer(_7_pItem.X2)) } _26: - if (*XTable)(_7_pItem.X4) != nil { + if _7_pItem.X4 != nil { _sqlite3XPrintf(tls, &_7_x, str(47041), unsafe.Pointer((*XTable)(_7_pItem.X4).X0)) } - if (_7_pItem.X3) != nil { + if _7_pItem.X3 != nil { _sqlite3XPrintf(tls, &_7_x, str(47053), unsafe.Pointer(_7_pItem.X3)) } - if (int32((*t28)(unsafe.Pointer(&(_7_pItem.X9))).X0) & i32(8)) != 0 { + if (int32((*t28)(unsafe.Pointer(&_7_pItem.X9)).X0) & i32(8)) != 0 { _sqlite3XPrintf(tls, &_7_x, str(47062)) } _sqlite3StrAccumFinish(tls, &_7_x) _sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_7_zLine)), uint8(bool2int(_6_i < (((*XSrcList)(_p.X8).X0)-i32(1))))) - if (*XSelect)(_7_pItem.X5) != nil { + if _7_pItem.X5 != nil { _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_7_pItem.X5), uint8(i32(0))) } - if ((uint32(((*t28)(unsafe.Pointer(&(_7_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_7_pItem.X15)))))), uint8(i32(0)), str(47073)) + if ((uint32(((*t28)(unsafe.Pointer(&_7_pItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_7_pItem.X15))))), uint8(i32(0)), str(47073)) } _sqlite3TreeViewPop(tls, _pView) _6_i += 1 @@ -33316,33 +35071,33 @@ _26: _23: _sqlite3TreeViewPop(tls, _pView) _19: - if (*XExpr)(_p.X9) != nil { - _sqlite3TreeViewItem(tls, _pView, str(25770), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0)))) + if _p.X9 != nil { + _sqlite3TreeViewItem(tls, _pView, str(25770), uint8(bool2int(postInc1(&_n, -1) > i32(0)))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X9), uint8(i32(0))) _sqlite3TreeViewPop(tls, _pView) } - if (*XExprList)(_p.X10) != nil { - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X10), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47084)) + if _p.X10 != nil { + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X10), uint8(bool2int(postInc1(&_n, -1) > i32(0))), str(47084)) } - if (*XExpr)(_p.X11) != nil { - _sqlite3TreeViewItem(tls, _pView, str(25757), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0)))) + if _p.X11 != nil { + _sqlite3TreeViewItem(tls, _pView, str(25757), uint8(bool2int(postInc1(&_n, -1) > i32(0)))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X11), uint8(i32(0))) _sqlite3TreeViewPop(tls, _pView) } - if (*XExprList)(_p.X12) != nil { - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X12), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47092)) + if _p.X12 != nil { + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X12), uint8(bool2int(postInc1(&_n, -1) > i32(0))), str(47092)) } - if (*XExpr)(_p.X15) != nil { - _sqlite3TreeViewItem(tls, _pView, str(25764), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0)))) + if _p.X15 != nil { + _sqlite3TreeViewItem(tls, _pView, str(25764), uint8(bool2int(postInc1(&_n, -1) > i32(0)))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X15), uint8(i32(0))) _sqlite3TreeViewPop(tls, _pView) } - if (*XExpr)(_p.X16) != nil { - _sqlite3TreeViewItem(tls, _pView, str(25292), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0)))) + if _p.X16 != nil { + _sqlite3TreeViewItem(tls, _pView, str(25292), uint8(bool2int(postInc1(&_n, -1) > i32(0)))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X16), uint8(i32(0))) _sqlite3TreeViewPop(tls, _pView) } - if (*XSelect)(_p.X13) == nil { + if _p.X13 == nil { goto _38 } _21_zOp = str(25675) @@ -33380,8 +35135,11 @@ _38: _ = _7_zLine } -// Generate a single line of output for the tree, with a prefix that contains -// all the appropriate tree lines +// C comment +// /* +// ** Generate a single line of output for the tree, with a prefix that contains +// ** all the appropriate tree lines +// */ func _sqlite3TreeViewLine(tls *crt.TLS, _p *t45, _zFormat *int8, args ...interface{}) { var _i int32 var _ap []interface{} @@ -33393,11 +35151,11 @@ func _sqlite3TreeViewLine(tls *crt.TLS, _p *t45, _zFormat *int8, args ...interfa } _i = i32(0) _1: - if _i >= (_p.X0) || uint64(_i) >= u64(99) { + if _i >= _p.X0 || uint64(_i) >= u64(99) { goto _5 } _sqlite3StrAccumAppend(tls, &_acc, func() *int8 { - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_i)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]uint8)(unsafe.Pointer(&_p.X1)))) + 1*uintptr(_i)))) != 0 { return str(47110) } return str(47115) @@ -33406,7 +35164,7 @@ _1: goto _1 _5: _sqlite3StrAccumAppend(tls, &_acc, func() *int8 { - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_i)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]uint8)(unsafe.Pointer(&_p.X1)))) + 1*uintptr(_i)))) != 0 { return str(47120) } return str(47125) @@ -33416,12 +35174,12 @@ _0: _sqlite3VXPrintf(tls, &_acc, _zFormat, _ap) _ap = nil func() { - if (_acc.X3) <= uint32(i32(0)) { + if _acc.X3 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26243), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TreeViewLineØ00__func__Ø000))), unsafe.Pointer(str(47130))) crt.X__builtin_abort(tls) } }() - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zBuf)) + 1*uintptr((_acc.X3)-uint32(i32(1)))))) != i32(10) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zBuf)) + 1*uintptr(_acc.X3-uint32(i32(1)))))) != i32(10) { _sqlite3StrAccumAppend(tls, &_acc, str(37700), i32(1)) } _sqlite3StrAccumFinish(tls, &_acc) @@ -33437,8 +35195,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TreeViewLineØ00__func__Ø000[0], str(47142), 20) } -// Add a new subitem to the tree. The moreToFollow flag indicates that this -// is not the last item in the tree. +// C comment +// /* +// ** Add a new subitem to the tree. The moreToFollow flag indicates that this +// ** is not the last item in the tree. +// */ func _sqlite3TreeViewPush(tls *crt.TLS, _p *t45, _moreToFollow uint8) (r0 *t45) { if _p != nil { goto _0 @@ -33447,10 +35208,10 @@ func _sqlite3TreeViewPush(tls *crt.TLS, _p *t45, _moreToFollow uint8) (r0 *t45) if _p == nil { return nil } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(104)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(104)) goto _2 _0: - *(*int32)(unsafe.Pointer(&(_p.X0))) += 1 + *(*int32)(unsafe.Pointer(&_p.X0)) += 1 _2: func() { if int32(_moreToFollow) != i32(0) && int32(_moreToFollow) != i32(1) { @@ -33459,7 +35220,7 @@ _2: } }() if uint64(_p.X0) < u64(100) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_p.X0))) = _moreToFollow + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]uint8)(unsafe.Pointer(&_p.X1)))) + 1*uintptr(_p.X0))) = _moreToFollow } return _p } @@ -33470,7 +35231,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TreeViewPushØ00__func__Ø000[0], str(47197), 20) } -// Generate a human-readable description of a WITH clause. +// C comment +// /* +// ** Generate a human-readable description of a WITH clause. +// */ func _sqlite3TreeViewWith(tls *crt.TLS, _pView *t45, _pWith *XWith, _moreToFollow uint8) { var _i, _5_j int32 var _5_cSep int8 @@ -33480,28 +35244,28 @@ func _sqlite3TreeViewWith(tls *crt.TLS, _pView *t45, _pWith *XWith, _moreToFollo if _pWith == nil { return } - if (_pWith.X0) == i32(0) { + if _pWith.X0 == i32(0) { return } - if (*XWith)(_pWith.X1) != nil { + if _pWith.X1 != nil { _sqlite3TreeViewLine(tls, _pView, str(47217), unsafe.Pointer(_pWith), unsafe.Pointer((*XWith)(_pWith.X1))) goto _3 } _sqlite3TreeViewLine(tls, _pView, str(47242), unsafe.Pointer(_pWith)) _3: - if (_pWith.X0) <= i32(0) { + if _pWith.X0 <= i32(0) { goto _4 } _pView = _sqlite3TreeViewPush(tls, _pView, uint8(i32(1))) _i = i32(0) _5: - if _i >= (_pWith.X0) { + if _i >= _pWith.X0 { goto _8 } - _4_pCte = (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2))))) + 32*uintptr(_i))) + _4_pCte = (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pWith.X2)))) + 32*uintptr(_i))) _sqlite3StrAccumInit(tls, &_4_x, nil, (*int8)(unsafe.Pointer(&_4_zLine)), int32(u64(1000)), i32(0)) _sqlite3XPrintf(tls, &_4_x, str(24576), unsafe.Pointer(_4_pCte.X0)) - if (*XExprList)(_4_pCte.X1) == nil || ((*XExprList)(_4_pCte.X1).X0) <= i32(0) { + if _4_pCte.X1 == nil || ((*XExprList)(_4_pCte.X1).X0) <= i32(0) { goto _10 } _5_cSep = int8(i32(40)) @@ -33510,7 +35274,7 @@ _11: if _5_j >= ((*XExprList)(_4_pCte.X1).X0) { goto _14 } - _sqlite3XPrintf(tls, &_4_x, str(24935), int32(_5_cSep), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_4_pCte.X1).X2)))))+32*uintptr(_5_j))).X1)) + _sqlite3XPrintf(tls, &_4_x, str(24935), int32(_5_cSep), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_4_pCte.X1).X2)))))+32*uintptr(_5_j))).X1)) _5_cSep = int8(i32(44)) _5_j += 1 goto _11 @@ -33519,7 +35283,7 @@ _14: _10: _sqlite3XPrintf(tls, &_4_x, str(47254)) _sqlite3StrAccumFinish(tls, &_4_x) - _sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_4_zLine)), uint8(bool2int(_i < ((_pWith.X0)-i32(1))))) + _sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_4_zLine)), uint8(bool2int(_i < (_pWith.X0-i32(1))))) _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_4_pCte.X2), uint8(i32(0))) _sqlite3TreeViewPop(tls, _pView) _i += 1 @@ -33531,20 +35295,26 @@ _4: _ = _4_zLine } -// Shorthand for starting a new tree item that consists of a single label +// C comment +// /* +// ** Shorthand for starting a new tree item that consists of a single label +// */ func _sqlite3TreeViewItem(tls *crt.TLS, _p *t45, _zLabel *int8, _moreFollows uint8) { _p = _sqlite3TreeViewPush(tls, _p, _moreFollows) _sqlite3TreeViewLine(tls, _p, str(24576), unsafe.Pointer(_zLabel)) } -// Finished with one layer of the tree +// C comment +// /* +// ** Finished with one layer of the tree +// */ func _sqlite3TreeViewPop(tls *crt.TLS, _p *t45) { if _p == nil { return } - *(*int32)(unsafe.Pointer(&(_p.X0))) -= 1 - if (_p.X0) < i32(0) { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + *(*int32)(unsafe.Pointer(&_p.X0)) -= 1 + if _p.X0 < i32(0) { + Xsqlite3_free(tls, unsafe.Pointer(_p)) } } @@ -33554,10 +35324,13 @@ func _sqlite3TreeViewExprList(tls *crt.TLS, _pView *t45, _pList *XExprList, _mor _sqlite3TreeViewPop(tls, _pView) } -// Generate a human-readable explanation of an expression list. +// C comment +// /* +// ** Generate a human-readable explanation of an expression list. +// */ func _sqlite3TreeViewBareExprList(tls *crt.TLS, _pView *t45, _pList *XExprList, _zLabel *int8) { var _2_i, _3_j int32 - if (_zLabel == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLabel)) + 1*uintptr(i32(0))))) == i32(0)) { + if (_zLabel == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zLabel)) + 1*uintptr(i32(0))))) == i32(0)) { _zLabel = str(44999) } if _pList == nil { @@ -33567,15 +35340,15 @@ func _sqlite3TreeViewBareExprList(tls *crt.TLS, _pView *t45, _pList *XExprList, _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(_zLabel)) _2_i = i32(0) _4: - if _2_i >= (_pList.X0) { + if _2_i >= _pList.X0 { goto _7 } - _3_j = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_2_i))).X5))))).X0) + _3_j = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_2_i))).X5))))).X0) if _3_j != 0 { _sqlite3TreeViewPush(tls, _pView, uint8(i32(0))) _sqlite3TreeViewLine(tls, _pView, str(47269), _3_j) } - _sqlite3TreeViewExpr(tls, _pView, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_2_i))).X0), uint8(bool2int(_2_i < ((_pList.X0)-i32(1))))) + _sqlite3TreeViewExpr(tls, _pView, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_2_i))).X0), uint8(bool2int(_2_i < (_pList.X0-i32(1))))) if _3_j != 0 { _sqlite3TreeViewPop(tls, _pView) } @@ -33585,7 +35358,10 @@ _7: _3: } -// Generate a human-readable explanation of an expression tree. +// C comment +// /* +// ** Generate a human-readable explanation of an expression tree. +// */ func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t45, _pExpr *XExpr, _moreToFollow uint8) { var _zBinOp, _zUniOp, _38_zType *int8 var _24_pFarg *XExprList @@ -33599,10 +35375,10 @@ func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t45, _pExpr *XExpr, _moreToFollo _sqlite3TreeViewPop(tls, _pView) return } - if (_pExpr.X2) == 0 { + if _pExpr.X2 == 0 { goto _1 } - if ((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1))) != uint32(i32(0)) { Xsqlite3_snprintf(tls, int32(u64(60)), (*int8)(unsafe.Pointer(&_zFlgs)), str(47288), _pExpr.X2, int32(_pExpr.X11)) goto _3 } @@ -33610,7 +35386,7 @@ func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t45, _pExpr *XExpr, _moreToFollo _3: goto _4 _1: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zFlgs)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zFlgs)) + 1*uintptr(i32(0)))) = int8(i32(0)) _4: switch int32(_pExpr.X0) { case i32(19): @@ -33727,7 +35503,7 @@ _6: _sqlite3TreeViewLine(tls, _pView, str(47322), _pExpr.X8, int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs)))) goto _60 _7: - if (_pExpr.X8) < i32(0) { + if _pExpr.X8 < i32(0) { _sqlite3TreeViewLine(tls, _pView, str(47335), int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs)))) goto _62 } @@ -33735,36 +35511,36 @@ _7: _62: goto _60 _8: - if ((_pExpr.X2) & uint32(i32(1024))) != 0 { - _sqlite3TreeViewLine(tls, _pView, str(37915), *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) + if (_pExpr.X2 & uint32(i32(1024))) != 0 { + _sqlite3TreeViewLine(tls, _pView, str(37915), *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) goto _64 } - _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) _64: goto _60 _9: - _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _60 _10: - _sqlite3TreeViewLine(tls, _pView, str(47358), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47358), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _60 _11: _sqlite3TreeViewLine(tls, _pView, str(155)) goto _60 _12: - _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _60 _13: - _sqlite3TreeViewLine(tls, _pView, str(47361), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))), int32(_pExpr.X9)) + _sqlite3TreeViewLine(tls, _pView, str(47361), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))), int32(_pExpr.X9)) goto _60 _14: _sqlite3TreeViewLine(tls, _pView, str(47377), _pExpr.X8) goto _60 _15: - _sqlite3TreeViewLine(tls, _pView, str(47390), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47390), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _60 _16: - _sqlite3TreeViewLine(tls, _pView, str(47398), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47398), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0))) goto _60 _17: @@ -33849,25 +35625,25 @@ _43: _zUniOp = str(25432) goto _60 _44: - _sqlite3TreeViewLine(tls, _pView, str(47437), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47437), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0))) goto _60 _45: - _sqlite3TreeViewLine(tls, _pView, str(47445), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47445), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0))) goto _60 _46: - if ((_pExpr.X2) & uint32(i32(16384))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(16384))) != uint32(i32(0)) { _24_pFarg = nil goto _66 } - _24_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _24_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _66: if int32(_pExpr.X0) == i32(153) { - _sqlite3TreeViewLine(tls, _pView, str(47456), int32(_pExpr.X12), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47456), int32(_pExpr.X12), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _68 } - _sqlite3TreeViewLine(tls, _pView, str(47474), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47474), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) _68: if _24_pFarg != nil { _sqlite3TreeViewExprList(tls, _pView, _24_pFarg, uint8(i32(0)), nil) @@ -33875,26 +35651,26 @@ _68: goto _60 _48: _sqlite3TreeViewLine(tls, _pView, str(47486)) - _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0))) + _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), uint8(i32(0))) goto _60 _49: _sqlite3TreeViewLine(tls, _pView, str(47498)) - _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0))) + _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), uint8(i32(0))) goto _60 _50: _sqlite3TreeViewLine(tls, _pView, str(25422)) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(1))) - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { - _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0))) + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { + _sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), uint8(i32(0))) goto _71 } - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)), nil) + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), uint8(i32(0)), nil) _71: goto _60 _51: _35_pX = (*XExpr)(_pExpr.X4) - _35_pY = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(0)))).X0) - _35_pZ = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(1)))).X0) + _35_pY = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(0)))).X0) + _35_pZ = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(1)))).X0) _sqlite3TreeViewLine(tls, _pView, str(25414)) _sqlite3TreeViewExpr(tls, _pView, _35_pX, uint8(i32(1))) _sqlite3TreeViewExpr(tls, _pView, _35_pY, uint8(i32(1))) @@ -33902,7 +35678,7 @@ _51: goto _60 _52: _sqlite3TreeViewLine(tls, _pView, str(37908), unsafe.Pointer(func() *int8 { - if (_pExpr.X8) != 0 { + if _pExpr.X8 != 0 { return str(47510) } return str(47514) @@ -33911,7 +35687,7 @@ _52: _53: _sqlite3TreeViewLine(tls, _pView, str(25809)) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(1))) - _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)), nil) + _sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), uint8(i32(0)), nil) goto _60 _54: _38_zType = str(47518) @@ -33941,14 +35717,14 @@ _78: _38_zType = str(47542) goto _79 _79: - _sqlite3TreeViewLine(tls, _pView, str(47549), unsafe.Pointer(_38_zType), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + _sqlite3TreeViewLine(tls, _pView, str(47549), unsafe.Pointer(_38_zType), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))))) goto _60 _55: _sqlite3TreeViewLine(tls, _pView, str(47562), _pExpr.X8, int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs)))) _sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X5), uint8(i32(0))) goto _60 _56: - _sqlite3TreeViewBareExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), str(47578)) + _sqlite3TreeViewBareExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), str(47578)) goto _60 _57: _sqlite3TreeViewLine(tls, _pView, str(47585), int32(_pExpr.X9)) @@ -33983,16 +35759,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SelectØ00__func__Ø000[0], str(47623), 14) } -// This routine sets up a SELECT statement for processing. The -// following is accomplished: -// -// * VDBE Cursor numbers are assigned to all FROM-clause terms. -// * Ephemeral Table objects are created for all FROM-clause subqueries. -// * ON and USING clauses are shifted into WHERE statements -// * Wildcards "*" and "TABLE.*" in result sets are expanded. -// * Identifiers in expression are matched to tables. -// -// This routine acts recursively on all subqueries within the SELECT. +// C comment +// /* +// ** This routine sets up a SELECT statement for processing. The +// ** following is accomplished: +// ** +// ** * VDBE Cursor numbers are assigned to all FROM-clause terms. +// ** * Ephemeral Table objects are created for all FROM-clause subqueries. +// ** * ON and USING clauses are shifted into WHERE statements +// ** * Wildcards "*" and "TABLE.*" in result sets are expanded. +// ** * Identifiers in expression are matched to tables. +// ** +// ** This routine acts recursively on all subqueries within the SELECT. +// */ func _sqlite3SelectPrep(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) { var _db *Xsqlite3 if func() int32 { @@ -34008,18 +35787,18 @@ func _sqlite3SelectPrep(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *X return } _db = (*Xsqlite3)(_pParse.X0) - if (_db.X17) != 0 { + if _db.X17 != 0 { return } - if ((_p.X3) & uint32(i32(128))) != 0 { + if (_p.X3 & uint32(i32(128))) != 0 { return } _sqlite3SelectExpand(tls, _pParse, _p) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { return } _sqlite3ResolveSelectNames(tls, _pParse, _p, _pOuterNC) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { return } _sqlite3SelectAddTypeInfo(tls, _pParse, _p) @@ -34031,63 +35810,72 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SelectPrepØ00__func__Ø000[0], str(47637), 18) } -// This routine "expands" a SELECT statement and all of its subqueries. -// For additional information on what it means to "expand" a SELECT -// statement, see the comment on the selectExpand worker callback above. -// -// Expanding a SELECT statement is the first step in processing a -// SELECT statement. The SELECT statement must be expanded before -// name resolution is performed. -// -// If anything goes wrong, an error message is written into pParse. -// The calling function can detect the problem by looking at pParse->nErr -// and/or pParse->db->mallocFailed. +// C comment +// /* +// ** This routine "expands" a SELECT statement and all of its subqueries. +// ** For additional information on what it means to "expand" a SELECT +// ** statement, see the comment on the selectExpand worker callback above. +// ** +// ** Expanding a SELECT statement is the first step in processing a +// ** SELECT statement. The SELECT statement must be expanded before +// ** name resolution is performed. +// ** +// ** If anything goes wrong, an error message is written into pParse. +// ** The calling function can detect the problem by looking at pParse->nErr +// ** and/or pParse->db->mallocFailed. +// */ func _sqlite3SelectExpand(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _sqlite3ExprWalkNoop - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse - if (_pParse.X10) != 0 { - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _convertCompoundSelectToSubquery + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _sqlite3ExprWalkNoop + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = _pParse + if _pParse.X10 != 0 { + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _convertCompoundSelectToSubquery _sqlite3WalkSelect(tls, &_w, _pSelect) } - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _selectExpander - *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = _selectPopWith + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _selectExpander + *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&_w.X3)))) = _selectPopWith _sqlite3WalkSelect(tls, &_w, _pSelect) _ = _w } -// No-op routine for the parse-tree walker. -// -// When this routine is the Walker.xExprCallback then expression trees -// are walked without any actions being taken at each node. Presumably, -// when this routine is used for Walker.xExprCallback then -// Walker.xSelectCallback is set to do something useful for every -// subquery in the parser tree. +// C comment +// /* +// ** No-op routine for the parse-tree walker. +// ** +// ** When this routine is the Walker.xExprCallback then expression trees +// ** are walked without any actions being taken at each node. Presumably, +// ** when this routine is used for Walker.xExprCallback then +// ** Walker.xSelectCallback is set to do something useful for every +// ** subquery in the parser tree. +// */ func _sqlite3ExprWalkNoop(tls *crt.TLS, _NotUsed *XWalker, _NotUsed2 *XExpr) (r0 int32) { _ = _NotUsed2 return i32(0) } -// Detect compound SELECT statements that use an ORDER BY clause with -// an alternative collating sequence. -// -// SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ... -// -// These are rewritten as a subquery: -// -// SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2) -// ORDER BY ... COLLATE ... -// -// This transformation is necessary because the multiSelectOrderBy() routine -// above that generates the code for a compound SELECT with an ORDER BY clause -// uses a merge algorithm that requires the same collating sequence on the -// result columns as on the ORDER BY clause. See ticket -// http://www.sqlite.org/src/info/6709574d2a -// -// This transformation is only needed for EXCEPT, INTERSECT, and UNION. -// The UNION ALL operator works fine with multiSelectOrderBy() even when -// there are COLLATE terms in the ORDER BY. +// C comment +// /* +// ** Detect compound SELECT statements that use an ORDER BY clause with +// ** an alternative collating sequence. +// ** +// ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ... +// ** +// ** These are rewritten as a subquery: +// ** +// ** SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2) +// ** ORDER BY ... COLLATE ... +// ** +// ** This transformation is necessary because the multiSelectOrderBy() routine +// ** above that generates the code for a compound SELECT with an ORDER BY clause +// ** uses a merge algorithm that requires the same collating sequence on the +// ** result columns as on the ORDER BY clause. See ticket +// ** http://www.sqlite.org/src/info/6709574d2a +// ** +// ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. +// ** The UNION ALL operator works fine with multiSelectOrderBy() even when +// ** there are COLLATE terms in the ORDER BY. +// */ func _convertCompoundSelectToSubquery(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { var _i int32 var _dummy XToken @@ -34119,7 +35907,7 @@ _9: if _i < i32(0) { goto _12 } - if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 32*uintptr(_i))).X0).X2) & uint32(i32(256))) != 0 { + if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 32*uintptr(_i))).X0).X2) & uint32(i32(256))) != 0 { goto _12 } _i -= 1 @@ -34134,35 +35922,35 @@ _12: if _pNew == nil { return i32(2) } - crt.Xmemset(tls, (unsafe.Pointer)(&_dummy), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(&_dummy), i32(0), u64(16)) _pNewSrc = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_dummy, _pNew, nil, nil) if _pNewSrc == nil { return i32(2) } *_pNew = *_p - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pNewSrc - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, _db, i32(161), nil)) - *(*uint8)(unsafe.Pointer(&(_p.X1))) = uint8(i32(119)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = nil - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X10))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X11))))) = nil - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X12))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = nil - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = nil - { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X8)))) = _pNewSrc + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, _db, i32(161), nil)) + *(*uint8)(unsafe.Pointer(&_p.X1)) = uint8(i32(119)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X10)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X11)))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X12)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X14)))) = nil + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X17)))) = nil + { + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) & uint32(i32(-257)) sink5(*p) } func() { - if ((_p.X3) & uint32(i32(65536))) != uint32(i32(0)) { + if (_p.X3 & uint32(i32(65536))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120599), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000))), unsafe.Pointer(str(47655))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(65536)) sink5(*p) } @@ -34173,28 +35961,31 @@ _12: } }() *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSelect)(_pNew.X13).X14))))) = _pNew - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X15))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X16))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X15)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X16)))) = nil return i32(0) _ = _dummy panic(0) } -// This routine is called by the parser to add a new term to the -// end of a growing FROM clause. The "p" parameter is the part of -// the FROM clause that has already been constructed. "p" is NULL -// if this is the first term of the FROM clause. pTable and pDatabase -// are the name of the table and database named in the FROM clause term. -// pDatabase is NULL if the database name qualifier is missing - the -// usual case. If the term has an alias, then pAlias points to the -// alias token. If the term is a subquery, then pSubquery is the -// SELECT statement that the subquery encodes. The pTable and -// pDatabase parameters are NULL for subqueries. The pOn and pUsing -// parameters are the content of the ON and USING clauses. -// -// Return a new SrcList which encodes is the FROM with the new -// term added. +// C comment +// /* +// ** This routine is called by the parser to add a new term to the +// ** end of a growing FROM clause. The "p" parameter is the part of +// ** the FROM clause that has already been constructed. "p" is NULL +// ** if this is the first term of the FROM clause. pTable and pDatabase +// ** are the name of the table and database named in the FROM clause term. +// ** pDatabase is NULL if the database name qualifier is missing - the +// ** usual case. If the term has an alias, then pAlias points to the +// ** alias token. If the term is a subquery, then pSubquery is the +// ** SELECT statement that the subquery encodes. The pTable and +// ** pDatabase parameters are NULL for subqueries. The pOn and pUsing +// ** parameters are the content of the ON and USING clauses. +// ** +// ** Return a new SrcList which encodes is the FROM with the new +// ** term added. +// */ func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pTable *XToken, _pDatabase *XToken, _pAlias *XToken, _pSubquery *XSelect, _pOn *XExpr, _pUsing *XIdList) (r0 *XSrcList) { var _db *Xsqlite3 var _pItem *TSrcList_item @@ -34210,7 +36001,7 @@ func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, } _p = _sqlite3SrcListAppend(tls, _db, _p, _pTable, _pDatabase) if (_p == nil) || func() int32 { - if (_p.X0) == i32(0) { + if _p.X0 == i32(0) { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103550), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -34221,19 +36012,19 @@ func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, }() != 0 { goto _append_from_error } - _pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr((_p.X0)-i32(1)))) + _pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_p.X0-i32(1)))) func() { if _pAlias == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103554), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000))), unsafe.Pointer(str(47739))) crt.X__builtin_abort(tls) } }() - if (_pAlias.X1) != 0 { - *(**int8)(unsafe.Pointer(&(_pItem.X3))) = _sqlite3NameFromToken(tls, _db, _pAlias) + if _pAlias.X1 != 0 { + *(**int8)(unsafe.Pointer(&_pItem.X3)) = _sqlite3NameFromToken(tls, _db, _pAlias) } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X5))))) = _pSubquery - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X12))))) = _pOn - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X13))))) = _pUsing + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X5)))) = _pSubquery + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X12)))) = _pOn + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X13)))) = _pUsing return _p _append_from_error: @@ -34249,38 +36040,41 @@ _append_from_error: return nil } -// Append a new table name to the given SrcList. Create a new SrcList if -// need be. A new entry is created in the SrcList even if pTable is NULL. -// -// A SrcList is returned, or NULL if there is an OOM error. The returned -// SrcList might be the same as the SrcList that was input or it might be -// a new one. If an OOM error does occurs, then the prior value of pList -// that is input to this routine is automatically freed. -// -// If pDatabase is not null, it means that the table has an optional -// database name prefix. Like this: "database.table". The pDatabase -// points to the table name and the pTable points to the database name. -// The SrcList.a[].zName field is filled with the table name which might -// come from pTable (if pDatabase is NULL) or from pDatabase. -// SrcList.a[].zDatabase is filled with the database name from pTable, -// or with NULL if no database is specified. -// -// In other words, if call like this: -// -// sqlite3SrcListAppend(D,A,B,0); -// -// Then B is a table name and the database name is unspecified. If called -// like this: -// -// sqlite3SrcListAppend(D,A,B,C); -// -// Then C is the table name and B is the database name. If C is defined -// then so is B. In other words, we never have a case where: -// -// sqlite3SrcListAppend(D,A,0,C); -// -// Both pTable and pDatabase are assumed to be quoted. They are dequoted -// before being added to the SrcList. +// C comment +// /* +// ** Append a new table name to the given SrcList. Create a new SrcList if +// ** need be. A new entry is created in the SrcList even if pTable is NULL. +// ** +// ** A SrcList is returned, or NULL if there is an OOM error. The returned +// ** SrcList might be the same as the SrcList that was input or it might be +// ** a new one. If an OOM error does occurs, then the prior value of pList +// ** that is input to this routine is automatically freed. +// ** +// ** If pDatabase is not null, it means that the table has an optional +// ** database name prefix. Like this: "database.table". The pDatabase +// ** points to the table name and the pTable points to the database name. +// ** The SrcList.a[].zName field is filled with the table name which might +// ** come from pTable (if pDatabase is NULL) or from pDatabase. +// ** SrcList.a[].zDatabase is filled with the database name from pTable, +// ** or with NULL if no database is specified. +// ** +// ** In other words, if call like this: +// ** +// ** sqlite3SrcListAppend(D,A,B,0); +// ** +// ** Then B is a table name and the database name is unspecified. If called +// ** like this: +// ** +// ** sqlite3SrcListAppend(D,A,B,C); +// ** +// ** Then C is the table name and B is the database name. If C is defined +// ** then so is B. In other words, we never have a case where: +// ** +// ** sqlite3SrcListAppend(D,A,0,C); +// ** +// ** Both pTable and pDatabase are assumed to be quoted. They are dequoted +// ** before being added to the SrcList. +// */ func _sqlite3SrcListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList, _pTable *XToken, _pDatabase *XToken) (r0 *XSrcList) { var _5_pTemp *XToken var _pItem *TSrcList_item @@ -34303,20 +36097,20 @@ func _sqlite3SrcListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList, _pTabl if _pList == nil { return nil } - *(*uint32)(unsafe.Pointer(&(_pList.X1))) = uint32(i32(1)) - *(*int32)(unsafe.Pointer(&(_pList.X0))) = i32(1) - crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2)))))+112*uintptr(i32(0))))), i32(0), u64(112)) - *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 112*uintptr(i32(0)))).X11))) = i32(-1) + *(*uint32)(unsafe.Pointer(&_pList.X1)) = uint32(i32(1)) + *(*int32)(unsafe.Pointer(&_pList.X0)) = i32(1) + crt.Xmemset(tls, unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2))))+112*uintptr(i32(0))))), i32(0), u64(112)) + *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) + 112*uintptr(i32(0)))).X11))) = i32(-1) goto _7 _5: _pList = _sqlite3SrcListEnlarge(tls, _db, _pList, i32(1), _pList.X0) _7: - if (_db.X17) != 0 { + if _db.X17 != 0 { _sqlite3SrcListDelete(tls, _db, _pList) return nil } - _pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 112*uintptr((_pList.X0)-i32(1)))) - if (_pDatabase != nil) && ((_pDatabase.X0) == nil) { + _pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) + 112*uintptr(_pList.X0-i32(1)))) + if (_pDatabase != nil) && (_pDatabase.X0 == nil) { _pDatabase = nil } if _pDatabase != nil { @@ -34324,8 +36118,8 @@ _7: _pDatabase = _pTable _pTable = _5_pTemp } - *(**int8)(unsafe.Pointer(&(_pItem.X2))) = _sqlite3NameFromToken(tls, _db, _pTable) - *(**int8)(unsafe.Pointer(&(_pItem.X1))) = _sqlite3NameFromToken(tls, _db, _pDatabase) + *(**int8)(unsafe.Pointer(&_pItem.X2)) = _sqlite3NameFromToken(tls, _db, _pTable) + *(**int8)(unsafe.Pointer(&_pItem.X1)) = _sqlite3NameFromToken(tls, _db, _pDatabase) return _pList } @@ -34335,23 +36129,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListAppendØ00__func__Ø000[0], str(47780), 21) } -// Expand the space allocated for the given SrcList object by -// creating nExtra new slots beginning at iStart. iStart is zero based. -// New slots are zeroed. -// -// For example, suppose a SrcList initially contains two entries: A,B. -// To append 3 new entries onto the end, do this: -// -// sqlite3SrcListEnlarge(db, pSrclist, 3, 2); -// -// After the call above it would contain: A, B, nil, nil, nil. -// If the iStart argument had been 1 instead of 2, then the result -// would have been: A, nil, nil, nil, B. To prepend the new slots, -// the iStart value would be 0. The result then would -// be: nil, nil, nil, A, B. -// -// If a memory allocation fails the SrcList is unchanged. The -// db->mallocFailed flag will be set to true. +// C comment +// /* +// ** Expand the space allocated for the given SrcList object by +// ** creating nExtra new slots beginning at iStart. iStart is zero based. +// ** New slots are zeroed. +// ** +// ** For example, suppose a SrcList initially contains two entries: A,B. +// ** To append 3 new entries onto the end, do this: +// ** +// ** sqlite3SrcListEnlarge(db, pSrclist, 3, 2); +// ** +// ** After the call above it would contain: A, B, nil, nil, nil. +// ** If the iStart argument had been 1 instead of 2, then the result +// ** would have been: A, nil, nil, nil, B. To prepend the new slots, +// ** the iStart value would be 0. The result then would +// ** be: nil, nil, nil, A, B. +// ** +// ** If a memory allocation fails the SrcList is unchanged. The +// ** db->mallocFailed flag will be set to true. +// */ func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtra int32, _iStart int32) (r0 *XSrcList) { var _i, _1_nAlloc, _1_nGot int32 var _1_pNew *XSrcList @@ -34374,19 +36171,19 @@ func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtr } }() func() { - if _iStart > (_pSrc.X0) { + if _iStart > _pSrc.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103369), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47829))) crt.X__builtin_abort(tls) } }() - if (uint32(_pSrc.X0) + uint32(_nExtra)) <= (_pSrc.X1) { + if (uint32(_pSrc.X0) + uint32(_nExtra)) <= _pSrc.X1 { goto _8 } - _1_nAlloc = ((_pSrc.X0) * i32(2)) + _nExtra - _1_pNew = (*XSrcList)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pSrc), u64(120)+(uint64(_1_nAlloc-i32(1))*u64(112)))) + _1_nAlloc = (_pSrc.X0 * i32(2)) + _nExtra + _1_pNew = (*XSrcList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pSrc), u64(120)+(uint64(_1_nAlloc-i32(1))*u64(112)))) if _1_pNew == nil { func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103379), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } @@ -34394,30 +36191,30 @@ func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtr return _pSrc } _pSrc = _1_pNew - _1_nGot = int32(((uint64(_sqlite3DbMallocSize(tls, _db, (unsafe.Pointer)(_1_pNew))) - u64(120)) / u64(112)) + uint64(i32(1))) - *(*uint32)(unsafe.Pointer(&(_pSrc.X1))) = uint32(_1_nGot) + _1_nGot = int32(((uint64(_sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_1_pNew))) - u64(120)) / u64(112)) + uint64(i32(1))) + *(*uint32)(unsafe.Pointer(&_pSrc.X1)) = uint32(_1_nGot) _8: - _i = (_pSrc.X0) - i32(1) + _i = _pSrc.X0 - i32(1) _12: if _i < _iStart { goto _15 } - *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i+_nExtra))) = *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i))) + *(*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i+_nExtra))) = *(*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i))) _i -= 1 goto _12 _15: { - p := (*int32)(unsafe.Pointer(&(_pSrc.X0))) + p := (*int32)(unsafe.Pointer(&_pSrc.X0)) *p = (*p) + _nExtra sink1(*p) } - crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_iStart)))), i32(0), u64(112)*uint64(_nExtra)) + crt.Xmemset(tls, unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(_iStart)))), i32(0), u64(112)*uint64(_nExtra)) _i = _iStart _16: if _i >= (_iStart + _nExtra) { goto _19 } - *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i))).X11))) = i32(-1) + *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i))).X11))) = i32(-1) _i += 1 goto _16 _19: @@ -34430,17 +36227,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListEnlargeØ00__func__Ø000[0], str(47865), 22) } -// Given a token, return a string that consists of the text of that -// token. Space to hold the returned string -// is obtained from sqliteMalloc() and must be freed by the calling -// function. -// -// Any quotation marks (ex: "name", 'name', [name], or `name`) that -// surround the body of the token are removed. -// -// Tokens are often just pointers into the original SQL text and so -// are not \000 terminated and are not persistent. The returned string -// is \000 terminated and is persistent. +// C comment +// /* +// ** Given a token, return a string that consists of the text of that +// ** token. Space to hold the returned string +// ** is obtained from sqliteMalloc() and must be freed by the calling +// ** function. +// ** +// ** Any quotation marks (ex: "name", 'name', [name], or `name`) that +// ** surround the body of the token are removed. +// ** +// ** Tokens are often just pointers into the original SQL text and so +// ** are not \000 terminated and are not persistent. The returned string +// ** is \000 terminated and is persistent. +// */ func _sqlite3NameFromToken(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 *int8) { var _zName *int8 if _pName != nil { @@ -34459,12 +36259,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListAppendFromTermØ00__func__Ø000[0], str(47887), 29) } -// Add a new element to the end of an expression list. If pList is -// initially NULL, then create a new expression list. -// -// If a memory allocation error occurs, the entire list is freed and -// NULL is returned. If non-NULL is returned, then it is guaranteed -// that the new entry was successfully appended. +// C comment +// /* +// ** Add a new element to the end of an expression list. If pList is +// ** initially NULL, then create a new expression list. +// ** +// ** If a memory allocation error occurs, the entire list is freed and +// ** NULL is returned. If non-NULL is returned, then it is guaranteed +// ** that the new entry was successfully appended. +// */ func _sqlite3ExprListAppend(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pExpr *XExpr) (r0 *XExprList) { var _db *Xsqlite3 var _3_pNew *XExprList @@ -34483,27 +36286,27 @@ func _sqlite3ExprListAppend(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _p if _pList == nil { goto _no_mem } - *(*int32)(unsafe.Pointer(&(_pList.X0))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pList.X1))) = i32(1) + *(*int32)(unsafe.Pointer(&_pList.X0)) = i32(0) + *(*int32)(unsafe.Pointer(&_pList.X1)) = i32(1) goto _5 _2: - if (_pList.X0) != (_pList.X1) { + if _pList.X0 != _pList.X1 { goto _5 } - _3_pNew = (*XExprList)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pList), u64(40)+(uint64((i32(2)*(_pList.X1))-i32(1))*u64(32)))) + _3_pNew = (*XExprList)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pList), u64(40)+(uint64((i32(2)*_pList.X1)-i32(1))*u64(32)))) if _3_pNew == nil { goto _no_mem } _pList = _3_pNew { - p := (*int32)(unsafe.Pointer(&(_pList.X1))) + p := (*int32)(unsafe.Pointer(&_pList.X1)) *p = (*p) * i32(2) sink1(*p) } _5: - _pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pList.X0))), int32(1))))) - crt.Xmemset(tls, (unsafe.Pointer)(_pItem), i32(0), u64(32)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = _pExpr + _pItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(postInc1((*int32)(unsafe.Pointer(&_pList.X0)), 1)))) + crt.Xmemset(tls, unsafe.Pointer(_pItem), i32(0), u64(32)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X0)))) = _pExpr return _pList _no_mem: @@ -34518,12 +36321,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListAppendØ00__func__Ø000[0], str(47916), 22) } -// Allocate a new expression node from a zero-terminated token that has -// already been dequoted. +// C comment +// /* +// ** Allocate a new expression node from a zero-terminated token that has +// ** already been dequoted. +// */ func _sqlite3Expr(tls *crt.TLS, _db *Xsqlite3, _op int32, _zToken *int8) (r0 *XExpr) { var _x XToken - *(**int8)(unsafe.Pointer(&(_x.X0))) = _zToken - *(*uint32)(unsafe.Pointer(&(_x.X1))) = uint32(func() int32 { + *(**int8)(unsafe.Pointer(&_x.X0)) = _zToken + *(*uint32)(unsafe.Pointer(&_x.X1)) = uint32(func() int32 { if _zToken != nil { return _sqlite3Strlen30(tls, _zToken) } @@ -34535,24 +36341,27 @@ func _sqlite3Expr(tls *crt.TLS, _db *Xsqlite3, _op int32, _zToken *int8) (r0 *XE panic(0) } -// This routine is the core allocator for Expr nodes. -// -// Construct a new expression node and return a pointer to it. Memory -// for this node and for the pToken argument is a single allocation -// obtained from sqlite3DbMalloc(). The calling function -// is responsible for making sure the node eventually gets freed. -// -// If dequote is true, then the token (if it exists) is dequoted. -// If dequote is false, no dequoting is performed. The deQuote -// parameter is ignored if pToken is NULL or if the token does not -// appear to be quoted. If the quotes were of the form "..." (double-quotes) -// then the EP_DblQuoted flag is set on the expression node. -// -// Special case: If op==TK_INTEGER and pToken points to a string that -// can be translated into a 32-bit integer, then the token is not -// stored in u.zToken. Instead, the integer values is written -// into u.iValue and the EP_IntValue flag is set. No extra storage -// is allocated to hold the integer text and the dequote flag is ignored. +// C comment +// /* +// ** This routine is the core allocator for Expr nodes. +// ** +// ** Construct a new expression node and return a pointer to it. Memory +// ** for this node and for the pToken argument is a single allocation +// ** obtained from sqlite3DbMalloc(). The calling function +// ** is responsible for making sure the node eventually gets freed. +// ** +// ** If dequote is true, then the token (if it exists) is dequoted. +// ** If dequote is false, no dequoting is performed. The deQuote +// ** parameter is ignored if pToken is NULL or if the token does not +// ** appear to be quoted. If the quotes were of the form "..." (double-quotes) +// ** then the EP_DblQuoted flag is set on the expression node. +// ** +// ** Special case: If op==TK_INTEGER and pToken points to a string that +// ** can be translated into a 32-bit integer, then the token is not +// ** stored in u.zToken. Instead, the integer values is written +// ** into u.iValue and the EP_IntValue flag is set. No extra storage +// ** is allocated to hold the integer text and the dequote flag is ignored. +// */ func _sqlite3ExprAlloc(tls *crt.TLS, _db *Xsqlite3, _op int32, _pToken *XToken, _dequote int32) (r0 *XExpr) { var _nExtra, _iValue int32 var _pNew *XExpr @@ -34567,8 +36376,8 @@ func _sqlite3ExprAlloc(tls *crt.TLS, _db *Xsqlite3, _op int32, _pToken *XToken, if _pToken == nil { goto _2 } - if ((_op != i32(134)) || ((_pToken.X0) == nil)) || (_sqlite3GetInt32(tls, _pToken.X0, &_iValue) == i32(0)) { - _nExtra = int32((_pToken.X1) + uint32(i32(1))) + if ((_op != i32(134)) || (_pToken.X0 == nil)) || (_sqlite3GetInt32(tls, _pToken.X0, &_iValue) == i32(0)) { + _nExtra = int32(_pToken.X1 + uint32(i32(1))) func() { if _iValue < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91635), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000))), unsafe.Pointer(str(47938))) @@ -34581,47 +36390,47 @@ _2: if _pNew == nil { goto _8 } - crt.Xmemset(tls, (unsafe.Pointer)(_pNew), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_pNew.X0))) = uint8(_op) - *(*int16)(unsafe.Pointer(&(_pNew.X10))) = int16(i32(-1)) + crt.Xmemset(tls, unsafe.Pointer(_pNew), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_pNew.X0)) = uint8(_op) + *(*int16)(unsafe.Pointer(&_pNew.X10)) = int16(i32(-1)) if _pToken == nil { goto _9 } if _nExtra == i32(0) { { - p := (*uint32)(unsafe.Pointer(&(_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_pNew.X2)) *p = (*p) | uint32(i32(1024)) sink5(*p) } - *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))) = _iValue + *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))) = _iValue goto _11 } - *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 72*uintptr(i32(1)))))) + *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew)) + 72*uintptr(i32(1)))))) func() { - if (_pToken.X0) == nil && (_pToken.X1) != uint32(i32(0)) { + if _pToken.X0 == nil && _pToken.X1 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000))), unsafe.Pointer(str(47948))) crt.X__builtin_abort(tls) } }() - if (_pToken.X1) != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3)))))), (unsafe.Pointer)(_pToken.X0), uint64(_pToken.X1)) + if _pToken.X1 != 0 { + crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3))))), unsafe.Pointer(_pToken.X0), uint64(_pToken.X1)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(_pToken.X1))) = int8(i32(0)) - if _dequote == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(i32(0)))))))))&i32(128)) == 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))))) + 1*uintptr(_pToken.X1))) = int8(i32(0)) + if _dequote == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))))) + 1*uintptr(i32(0)))))))))&i32(128)) == 0 { goto _17 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(i32(0))))) == i32(34) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))))) + 1*uintptr(i32(0))))) == i32(34) { { - p := (*uint32)(unsafe.Pointer(&(_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_pNew.X2)) *p = (*p) | uint32(i32(64)) sink5(*p) } } - _sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3)))))) + _sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3))))) _17: _11: _9: - *(*int32)(unsafe.Pointer(&(_pNew.X7))) = i32(1) + *(*int32)(unsafe.Pointer(&_pNew.X7)) = i32(1) _8: return _pNew } @@ -34638,77 +36447,83 @@ func init() { crt.Xstrncpy(nil, &_convertCompoundSelectToSubqueryØ00__func__Ø000[0], str(47994), 32) } -// Call sqlite3WalkExpr() for every expression in Select statement p. -// Invoke sqlite3WalkSelect() for subqueries in the FROM clause and -// on the compound select chain, p->pPrior. -// -// If it is not NULL, the xSelectCallback() callback is invoked before -// the walk of the expressions and FROM clause. The xSelectCallback2() -// method, if it is not NULL, is invoked following the walk of the -// expressions and FROM clause. -// -// Return WRC_Continue under normal conditions. Return WRC_Abort if -// there is an abort request. -// -// If the Walker does not have an xSelectCallback() then this routine -// is a no-op returning WRC_Continue. +// C comment +// /* +// ** Call sqlite3WalkExpr() for every expression in Select statement p. +// ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and +// ** on the compound select chain, p->pPrior. +// ** +// ** If it is not NULL, the xSelectCallback() callback is invoked before +// ** the walk of the expressions and FROM clause. The xSelectCallback2() +// ** method, if it is not NULL, is invoked following the walk of the +// ** expressions and FROM clause. +// ** +// ** Return WRC_Continue under normal conditions. Return WRC_Abort if +// ** there is an abort request. +// ** +// ** If the Walker does not have an xSelectCallback() then this routine +// ** is a no-op returning WRC_Continue. +// */ func _sqlite3WalkSelect(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { var _rc int32 if (_p == nil) || ((*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XWalker, *XSelect) int32 - }{(*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{(_pWalker.X2)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XWalker, *XSelect) int32 { + v := _pWalker.X2 + return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XWalker, *XSelect) int32 }{nil}))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XWalker, *XSelect) - }{(*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) - }{(_pWalker.X3)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XWalker, *XSelect) { + v := _pWalker.X3 + return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XWalker, *XSelect) }{nil})))) { return i32(0) } _rc = i32(0) - *(*int32)(unsafe.Pointer(&(_pWalker.X4))) += 1 + *(*int32)(unsafe.Pointer(&_pWalker.X4)) += 1 _3: if _p == nil { goto _4 } - if (*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{(_pWalker.X2)}))) == nil { + if _pWalker.X2 == nil { goto _5 } - _rc = (*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{(_pWalker.X2)})))(tls, _pWalker, _p) + _rc = func() func(*crt.TLS, *XWalker, *XSelect) int32 { + v := _pWalker.X2 + return *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&v)) + }()(tls, _pWalker, _p) if _rc != 0 { goto _4 } _5: if _sqlite3WalkSelectExpr(tls, _pWalker, _p) != 0 || _sqlite3WalkSelectFrom(tls, _pWalker, _p) != 0 { - *(*int32)(unsafe.Pointer(&(_pWalker.X4))) -= 1 + *(*int32)(unsafe.Pointer(&_pWalker.X4)) -= 1 return i32(2) } - if (*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) - }{(_pWalker.X3)}))) != nil { - (*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) - }{(_pWalker.X3)})))(tls, _pWalker, _p) + if _pWalker.X3 != nil { + func() func(*crt.TLS, *XWalker, *XSelect) { + v := _pWalker.X3 + return *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&v)) + }()(tls, _pWalker, _p) } _p = (*XSelect)(_p.X13) goto _3 _4: - *(*int32)(unsafe.Pointer(&(_pWalker.X4))) -= 1 + *(*int32)(unsafe.Pointer(&_pWalker.X4)) -= 1 return _rc & i32(2) } -// Walk all expressions associated with SELECT statement p. Do -// not invoke the SELECT callback on p, but do (of course) invoke -// any expr callbacks and SELECT callbacks that come from subqueries. -// Return WRC_Abort or WRC_Continue. +// C comment +// /* +// ** Walk all expressions associated with SELECT statement p. Do +// ** not invoke the SELECT callback on p, but do (of course) invoke +// ** any expr callbacks and SELECT callbacks that come from subqueries. +// ** Return WRC_Abort or WRC_Continue. +// */ func _sqlite3WalkSelectExpr(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.X0)) != 0 { return i32(2) @@ -34734,15 +36549,18 @@ func _sqlite3WalkSelectExpr(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 in return i32(0) } -// Call sqlite3WalkExpr() for every expression in list p or until -// an abort request is seen. +// C comment +// /* +// ** Call sqlite3WalkExpr() for every expression in list p or until +// ** an abort request is seen. +// */ func _sqlite3WalkExprList(tls *crt.TLS, _pWalker *XWalker, _p *XExprList) (r0 int32) { var _i int32 var _pItem *TExprList_item if _p == nil { goto _0 } - *func() **TExprList_item { _i = _p.X0; return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + *func() **TExprList_item { _i = _p.X0; return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2)))) _1: if _i <= i32(0) { goto _4 @@ -34766,60 +36584,67 @@ func _sqlite3WalkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) }() } -// Walk an expression tree. Invoke the callback once for each node -// of the expression, while descending. (In other words, the callback -// is invoked before visiting children.) -// -// The return value from the callback should be one of the WRC_* -// constants to specify how to proceed with the walk. -// -// WRC_Continue Continue descending down the tree. -// -// WRC_Prune Do not descend into child nodes, but allow -// the walk to continue with sibling nodes. -// -// WRC_Abort Do no more callbacks. Unwind the stack and -// return from the top-level walk call. -// -// The return value from this routine is WRC_Abort to abandon the tree walk -// and WRC_Continue to continue. +// C comment +// /* +// ** Walk an expression tree. Invoke the callback once for each node +// ** of the expression, while descending. (In other words, the callback +// ** is invoked before visiting children.) +// ** +// ** The return value from the callback should be one of the WRC_* +// ** constants to specify how to proceed with the walk. +// ** +// ** WRC_Continue Continue descending down the tree. +// ** +// ** WRC_Prune Do not descend into child nodes, but allow +// ** the walk to continue with sibling nodes. +// ** +// ** WRC_Abort Do no more callbacks. Unwind the stack and +// ** return from the top-level walk call. +// ** +// ** The return value from this routine is WRC_Abort to abandon the tree walk +// ** and WRC_Continue to continue. +// */ func _walkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _rc int32 - _rc = (*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{(_pWalker.X1)})))(tls, _pWalker, _pExpr) - if _rc != 0 || (((_pExpr.X2) & uint32(i32(8404992))) != uint32(i32(0))) { + _rc = func() func(*crt.TLS, *XWalker, *XExpr) int32 { + v := _pWalker.X1 + return *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&v)) + }()(tls, _pWalker, _pExpr) + if _rc != 0 || ((_pExpr.X2 & uint32(i32(8404992))) != uint32(i32(0))) { return _rc & i32(2) } - if ((*XExpr)(_pExpr.X4) != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X4)) != 0 { + if (_pExpr.X4 != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X4)) != 0 { return i32(2) } - if ((*XExpr)(_pExpr.X5) != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X5)) != 0 { + if (_pExpr.X5 != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X5)) != 0 { return i32(2) } - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { goto _6 } - if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 { + if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) != 0 { return i32(2) } goto _9 _6: - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil { + if (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) == nil { goto _9 } - if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 { + if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) != 0 { return i32(2) } _9: return i32(0) } -// Walk the parse trees associated with all subqueries in the -// FROM clause of SELECT statement p. Do not invoke the select -// callback on p, but do invoke it on each FROM clause subquery -// and on any subqueries further down in the tree. Return -// WRC_Abort or WRC_Continue; +// C comment +// /* +// ** Walk the parse trees associated with all subqueries in the +// ** FROM clause of SELECT statement p. Do not invoke the select +// ** callback on p, but do invoke it on each FROM clause subquery +// ** and on any subqueries further down in the tree. Return +// ** WRC_Abort or WRC_Continue; +// */ func _sqlite3WalkSelectFrom(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { var _i int32 var _pSrc *XSrcList @@ -34837,7 +36662,7 @@ func _sqlite3WalkSelectFrom(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 in }() == 0 { goto _2 } - *func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + *func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) _3: if _i <= i32(0) { goto _6 @@ -34845,7 +36670,7 @@ _3: if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pItem.X5)) != 0 { return i32(2) } - if (((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))) != 0 { + if (((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pItem.X15)))))) != 0 { return i32(2) } *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(112) @@ -34861,28 +36686,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalkSelectFromØ00__func__Ø000[0], str(48026), 22) } -// This routine is a Walker callback for "expanding" a SELECT statement. -// "Expanding" means to do the following: -// -// (1) Make sure VDBE cursor numbers have been assigned to every -// element of the FROM clause. -// -// (2) Fill in the pTabList->a[].pTab fields in the SrcList that -// defines FROM clause. When views appear in the FROM clause, -// fill pTabList->a[].pSelect with a copy of the SELECT statement -// that implements the view. A copy is made of the view's SELECT -// statement so that we can freely modify or delete that statement -// without worrying about messing up the persistent representation -// of the view. -// -// (3) Add terms to the WHERE clause to accommodate the NATURAL keyword -// on joins and the ON and USING clause of joins. -// -// (4) Scan the list of columns in the result set (pEList) looking -// for instances of the "*" operator or the TABLE.* operator. -// If found, expand each "*" to be every column in every table -// and TABLE.* to be every column in TABLE. -// +// C comment +// /* +// ** This routine is a Walker callback for "expanding" a SELECT statement. +// ** "Expanding" means to do the following: +// ** +// ** (1) Make sure VDBE cursor numbers have been assigned to every +// ** element of the FROM clause. +// ** +// ** (2) Fill in the pTabList->a[].pTab fields in the SrcList that +// ** defines FROM clause. When views appear in the FROM clause, +// ** fill pTabList->a[].pSelect with a copy of the SELECT statement +// ** that implements the view. A copy is made of the view's SELECT +// ** statement so that we can freely modify or delete that statement +// ** without worrying about messing up the persistent representation +// ** of the view. +// ** +// ** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword +// ** on joins and the ON and USING clause of joins. +// ** +// ** (4) Scan the list of columns in the result set (pEList) looking +// ** for instances of the "*" operator or the TABLE.* operator. +// ** If found, expand each "*" to be every column in every table +// ** and TABLE.* to be every column in TABLE. +// ** +// */ func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { var _11_nCol int16 var _i, _j, _k, _15_flags, _15_longNames, _19_tableSeen, _21_iDb int32 @@ -34902,11 +36730,11 @@ func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { _db = (*Xsqlite3)(_pParse.X0) _selFlags = uint16(_p.X3) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(64)) sink5(*p) } - if (_db.X17) != 0 { + if _db.X17 != 0 { return i32(2) } if func() int32 { @@ -34923,22 +36751,22 @@ func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { } _pTabList = (*XSrcList)(_p.X8) _pEList = (*XExprList)(_p.X0) - if (*XWith)(_p.X17) != nil { + if _p.X17 != nil { _sqlite3WithPush(tls, _pParse, (*XWith)(_p.X17), uint8(i32(0))) } _sqlite3SrcListAssignCursors(tls, _pParse, _pTabList) - *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) _6: - if _i >= (_pTabList.X0) { + if _i >= _pTabList.X0 { goto _9 } func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(5)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) && (*XTable)(_pFrom.X4) == nil { + if int32((uint32(((*t28)(unsafe.Pointer(&_pFrom.X9)).X1)>>uint(i32(5)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) && (*XTable)(_pFrom.X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120884), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48048))) crt.X__builtin_abort(tls) } }() - if ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_pFrom.X9)).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { goto _7 } func() { @@ -34950,10 +36778,10 @@ _6: if _withExpand(tls, _pWalker, _pFrom) != 0 { return i32(2) } - if (*XTable)(_pFrom.X4) != nil { + if _pFrom.X4 != nil { goto _30 } - if (_pFrom.X2) != nil { + if _pFrom.X2 != nil { goto _19 } _6_pSel = (*XSelect)(_pFrom.X5) @@ -34972,20 +36800,20 @@ _6: if _sqlite3WalkSelect(tls, _pWalker, _6_pSel) != 0 { return i32(2) } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_4_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128)))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X4)))) = store44(&_4_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128)))) if _4_pTab == nil { return i32(2) } - *(*uint32)(unsafe.Pointer(&(_4_pTab.X8))) = uint32(i32(1)) - *(**int8)(unsafe.Pointer(&(_4_pTab.X0))) = _sqlite3MPrintf(tls, _db, str(48114), (unsafe.Pointer)(_4_pTab)) + *(*uint32)(unsafe.Pointer(&_4_pTab.X8)) = uint32(i32(1)) + *(**int8)(unsafe.Pointer(&_4_pTab.X0)) = _sqlite3MPrintf(tls, _db, str(48114), unsafe.Pointer(unsafe.Pointer(_4_pTab))) _26: - if (*XSelect)(_6_pSel.X13) != nil { + if _6_pSel.X13 != nil { _6_pSel = (*XSelect)(_6_pSel.X13) goto _26 } - _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_6_pSel.X0), (*int16)(unsafe.Pointer(&(_4_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pTab.X1)))))) - *(*int16)(unsafe.Pointer(&(_4_pTab.X10))) = int16(i32(-1)) - *(*int16)(unsafe.Pointer(&(_4_pTab.X12))) = int16(i32(200)) + _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_6_pSel.X0), (*int16)(unsafe.Pointer(&_4_pTab.X11)), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pTab.X1))))) + *(*int16)(unsafe.Pointer(&_4_pTab.X10)) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_4_pTab.X12)) = int16(i32(200)) func() { if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120905), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48127))) @@ -34993,7 +36821,7 @@ _26: } }() { - p := (*uint32)(unsafe.Pointer(&(_4_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_4_pTab.X9)) *p = (*p) | uint32(i32(2)) sink5(*p) } @@ -35005,20 +36833,20 @@ _19: crt.X__builtin_abort(tls) } }() - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_4_pTab, _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pFrom)) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X4)))) = store44(&_4_pTab, _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pFrom)) if _4_pTab == nil { return i32(2) } - if (_4_pTab.X8) >= uint32(i32(65535)) { + if _4_pTab.X8 >= uint32(i32(65535)) { _sqlite3ErrorMsg(tls, _pParse, str(48155), unsafe.Pointer(_4_pTab.X0)) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X4)))) = nil return i32(2) } - *(*uint32)(unsafe.Pointer(&(_4_pTab.X8))) += 1 - if ((_4_pTab.X16) == 0) && _cannotBeFunction(tls, _pParse, _pFrom) != 0 { + *(*uint32)(unsafe.Pointer(&_4_pTab.X8)) += 1 + if (_4_pTab.X16 == 0) && _cannotBeFunction(tls, _pParse, _pFrom) != 0 { return i32(2) } - if (_4_pTab.X16) == 0 && (*XSelect)(_4_pTab.X3) == nil { + if _4_pTab.X16 == 0 && _4_pTab.X3 == nil { goto _38 } if _sqlite3ViewGetColumnNames(tls, _pParse, _4_pTab) != 0 { @@ -35030,12 +36858,12 @@ _19: crt.X__builtin_abort(tls) } }() - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_4_pTab.X3), i32(0)) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X5)))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_4_pTab.X3), i32(0)) _sqlite3SelectSetName(tls, (*XSelect)(_pFrom.X5), _4_pTab.X0) _11_nCol = _4_pTab.X11 - *(*int16)(unsafe.Pointer(&(_4_pTab.X11))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_4_pTab.X11)) = int16(i32(-1)) _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pFrom.X5)) - *(*int16)(unsafe.Pointer(&(_4_pTab.X11))) = _11_nCol + *(*int16)(unsafe.Pointer(&_4_pTab.X11)) = _11_nCol _38: _30: if _sqlite3IndexedByLookup(tls, _pParse, _pFrom) != 0 { @@ -35045,15 +36873,15 @@ _7: *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(112) goto _6 _9: - if ((_db.X17) != 0) || _sqliteProcessJoin(tls, _pParse, _p) != 0 { + if (_db.X17 != 0) || _sqliteProcessJoin(tls, _pParse, _p) != 0 { return i32(2) } _k = i32(0) _45: - if _k >= (_pEList.X0) { + if _k >= _pEList.X0 { goto _48 } - _pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_k))).X0) + _pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_k))).X0) if int32(_pE.X0) == i32(161) { goto _48 } @@ -35075,19 +36903,19 @@ _45: _k += 1 goto _45 _48: - if _k >= (_pEList.X0) { + if _k >= _pEList.X0 { goto _59 } - _15_a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + _15_a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) _15_pNew = nil _15_flags = (*Xsqlite3)(_pParse.X0).X6 _15_longNames = bool2int(((_15_flags & i32(4)) != i32(0)) && ((_15_flags & i32(64)) == i32(0))) _k = i32(0) _61: - if _k >= (_pEList.X0) { + if _k >= _pEList.X0 { goto _64 } - _pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X0) + _pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X0) _pRight = (*XExpr)(_pE.X5) func() { if int32(_pE.X0) == i32(122) && _pRight == nil { @@ -35098,14 +36926,14 @@ _61: if int32(_pE.X0) == i32(161) || int32(_pE.X0) == i32(122) && int32(_pRight.X0) == i32(161) { goto _70 } - _15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a))+32*uintptr(_k))).X0)) + _15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a))+32*uintptr(_k))).X0)) if _15_pNew != nil { - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 32*uintptr((_15_pNew.X0)-i32(1)))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X1 - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 32*uintptr((_15_pNew.X0)-i32(1)))).X2))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X2 - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X1))) = nil - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X2))) = nil + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_15_pNew.X2)))) + 32*uintptr(_15_pNew.X0-i32(1)))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X1 + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_15_pNew.X2)))) + 32*uintptr(_15_pNew.X0-i32(1)))).X2))) = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X2 + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X1))) = nil + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X2))) = nil } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 32*uintptr(_k))).X0))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_a)) + 32*uintptr(_k))).X0))))) = nil goto _72 _70: _19_tableSeen = i32(0) @@ -35125,9 +36953,9 @@ _70: }() _19_zTName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pE.X4).X3))))) } - *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) _78: - if _i >= (_pTabList.X0) { + if _i >= _pTabList.X0 { goto _81 } _21_pTab = (*XTable)(_pFrom.X4) @@ -35137,10 +36965,10 @@ _78: if _21_zTabName == nil { _21_zTabName = _21_pTab.X0 } - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _81 } - if _21_pSub != nil && ((_21_pSub.X3)&uint32(i32(2048))) != uint32(i32(0)) { + if _21_pSub != nil && (_21_pSub.X3&uint32(i32(2048))) != uint32(i32(0)) { goto _85 } _21_pSub = nil @@ -35167,17 +36995,17 @@ _90: crt.X__builtin_abort(tls) } }() - if ((_19_zTName != nil) && (_21_pSub != nil)) && (_sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+32*uintptr(_j))).X2, nil, _19_zTName, nil) == i32(0)) { + if ((_19_zTName != nil) && (_21_pSub != nil)) && (_sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+32*uintptr(_j))).X2, nil, _19_zTName, nil) == i32(0)) { goto _91 } - if (((_p.X3) & uint32(i32(131072))) == uint32(i32(0))) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_21_pTab.X1)+32*uintptr(_j))).X6) & i32(2)) != i32(0)) { + if ((_p.X3 & uint32(i32(131072))) == uint32(i32(0))) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_21_pTab.X1)+32*uintptr(_j))).X6) & i32(2)) != i32(0)) { goto _91 } _19_tableSeen = i32(1) if _i <= i32(0) || _19_zTName != nil { goto _102 } - if ((int32((*t28)(unsafe.Pointer(&(_pFrom.X9))).X0) & i32(4)) != i32(0)) && _tableAndColumnIndex(tls, _pTabList, _i, _25_zName, nil, nil) != 0 { + if ((int32((*t28)(unsafe.Pointer(&_pFrom.X9)).X0) & i32(4)) != i32(0)) && _tableAndColumnIndex(tls, _pTabList, _i, _25_zName, nil, nil) != 0 { goto _91 } if _sqlite3IdListIndex(tls, (*XIdList)(_pFrom.X13), _25_zName) >= i32(0) { @@ -35187,7 +37015,7 @@ _102: _pRight = _sqlite3Expr(tls, _db, i32(27), _25_zName) _25_zColname = _25_zName _25_zToFree = nil - if _15_longNames == 0 && (_pTabList.X0) <= i32(1) { + if _15_longNames == 0 && _pTabList.X0 <= i32(1) { goto _107 } _31_pLeft = _sqlite3Expr(tls, _db, i32(27), _21_zTabName) @@ -35207,19 +37035,19 @@ _110: _15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, _pExpr) _sqlite3TokenInit(tls, &_25_sColname, _25_zColname) _sqlite3ExprListSetName(tls, _pParse, _15_pNew, &_25_sColname, i32(0)) - if _15_pNew == nil || ((_p.X3)&uint32(i32(2048))) == uint32(i32(0)) { + if _15_pNew == nil || (_p.X3&uint32(i32(2048))) == uint32(i32(0)) { goto _112 } - _35_pX = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 32*uintptr((_15_pNew.X0)-i32(1)))) + _35_pX = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_15_pNew.X2)))) + 32*uintptr(_15_pNew.X0-i32(1)))) if _21_pSub != nil { - *(**int8)(unsafe.Pointer(&(_35_pX.X2))) = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+32*uintptr(_j))).X2) + *(**int8)(unsafe.Pointer(&_35_pX.X2)) = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+32*uintptr(_j))).X2) goto _114 } - *(**int8)(unsafe.Pointer(&(_35_pX.X2))) = _sqlite3MPrintf(tls, _db, str(48391), unsafe.Pointer(_21_zSchemaName), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zColname)) + *(**int8)(unsafe.Pointer(&_35_pX.X2)) = _sqlite3MPrintf(tls, _db, str(48391), unsafe.Pointer(_21_zSchemaName), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zColname)) _114: - storebits3((*int8)(unsafe.Pointer(&(_35_pX.X4))), int8(i32(1)), 2, 1) + storebits3((*int8)(unsafe.Pointer(&_35_pX.X4)), int8(i32(1)), 2, 1) _112: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_25_zToFree)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_25_zToFree)) _91: _j += 1 goto _90 @@ -35243,9 +37071,9 @@ _72: goto _61 _64: _sqlite3ExprListDelete(tls, _db, _pEList) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _15_pNew + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _15_pNew _59: - if ((*XExprList)(_p.X0) != nil) && (((*XExprList)(_p.X0).X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2)))))) { + if (_p.X0 != nil) && (((*XExprList)(_p.X0).X0) > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(2)))))) { _sqlite3ErrorMsg(tls, _pParse, str(48438)) return i32(2) } @@ -35261,15 +37089,17 @@ func init() { crt.Xstrncpy(nil, &_selectExpanderØ00__func__Ø000[0], str(48469), 15) } -// The code generator maintains a stack of active WITH clauses -// with the inner-most WITH clause being at the top of the stack. -// -// This routine pushes the WITH clause passed as the second argument -// onto the top of the stack. If argument bFree is true, then this -// WITH clause will never be popped from the stack. In this case it -// should be freed along with the Parse object. In other cases, when -// bFree==0, the With object will be freed along with the SELECT -// statement with which it is associated. +// C comment +// /* The code generator maintains a stack of active WITH clauses +// ** with the inner-most WITH clause being at the top of the stack. +// ** +// ** This routine pushes the WITH clause passed as the second argument +// ** onto the top of the stack. If argument bFree is true, then this +// ** WITH clause will never be popped from the stack. In this case it +// ** should be freed along with the Parse object. In other cases, when +// ** bFree==0, the With object will be freed along with the SELECT +// ** statement with which it is associated. +// */ func _sqlite3WithPush(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _bFree uint8) { func() { if int32(_bFree) != i32(0) && ((*XWith)(_pParse.X70) != nil || (*XWith)(_pParse.X71) != nil) { @@ -35286,10 +37116,10 @@ func _sqlite3WithPush(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _bFree uint8 crt.X__builtin_abort(tls) } }() - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWith.X1))))) = (*XWith)(_pParse.X70) - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWith.X1)))) = (*XWith)(_pParse.X70) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = _pWith if _bFree != 0 { - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X71))))) = _pWith + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X71)))) = _pWith } _4: } @@ -35300,7 +37130,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WithPushØ00__func__Ø000[0], str(48562), 16) } -// Assign VdbeCursor index numbers to all tables in a SrcList +// C comment +// /* +// ** Assign VdbeCursor index numbers to all tables in a SrcList +// */ func _sqlite3SrcListAssignCursors(tls *crt.TLS, _pParse *XParse, _pList *XSrcList) { var _i int32 var _pItem *TSrcList_item @@ -35313,16 +37146,16 @@ func _sqlite3SrcListAssignCursors(tls *crt.TLS, _pParse *XParse, _pList *XSrcLis if _pList == nil { goto _3 } - *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) _4: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _7 } - if (_pItem.X11) >= i32(0) { + if _pItem.X11 >= i32(0) { goto _7 } - *(*int32)(unsafe.Pointer(&(_pItem.X11))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - if (*XSelect)(_pItem.X5) != nil { + *(*int32)(unsafe.Pointer(&_pItem.X11)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + if _pItem.X5 != nil { _sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)((*XSelect)(_pItem.X5).X8)) } *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(112) @@ -35337,19 +37170,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListAssignCursorsØ00__func__Ø000[0], str(48612), 28) } -// This function checks if argument pFrom refers to a CTE declared by -// a WITH clause on the stack currently maintained by the parser. And, -// if currently processing a CTE expression, if it is a recursive -// reference to the current CTE. -// -// If pFrom falls into either of the two categories above, pFrom->pTab -// and other fields are populated accordingly. The caller should check -// (pFrom->pTab!=0) to determine whether or not a successful match -// was found. -// -// Whether or not a match is found, SQLITE_OK is returned if no error -// occurs. If an error does occur, an error message is stored in the -// parser and some error code other than SQLITE_OK returned. +// C comment +// /* +// ** This function checks if argument pFrom refers to a CTE declared by +// ** a WITH clause on the stack currently maintained by the parser. And, +// ** if currently processing a CTE expression, if it is a recursive +// ** reference to the current CTE. +// ** +// ** If pFrom falls into either of the two categories above, pFrom->pTab +// ** and other fields are populated accordingly. The caller should check +// ** (pFrom->pTab!=0) to determine whether or not a successful match +// ** was found. +// ** +// ** Whether or not a match is found, SQLITE_OK is returned if no error +// ** occurs. If an error does occur, an error message is stored in the +// ** parser and some error code other than SQLITE_OK returned. +// */ func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int32) { var _1_bMayRecursive, _3_i int32 var _db *Xsqlite3 @@ -35373,7 +37209,7 @@ func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int if _pCte == nil { goto _2 } - if (_pCte.X3) != nil { + if _pCte.X3 != nil { _sqlite3ErrorMsg(tls, _pParse, _pCte.X3, unsafe.Pointer(_pCte.X0)) return i32(1) } @@ -35386,14 +37222,14 @@ func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int crt.X__builtin_abort(tls) } }() - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_1_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128)))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X4)))) = store44(&_1_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128)))) if _1_pTab == nil { return i32(2) } - *(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) = uint32(i32(1)) - *(**int8)(unsafe.Pointer(&(_1_pTab.X0))) = _sqlite3DbStrDup(tls, _db, _pCte.X0) - *(*int16)(unsafe.Pointer(&(_1_pTab.X10))) = int16(i32(-1)) - *(*int16)(unsafe.Pointer(&(_1_pTab.X12))) = int16(i32(200)) + *(*uint32)(unsafe.Pointer(&_1_pTab.X8)) = uint32(i32(1)) + *(**int8)(unsafe.Pointer(&_1_pTab.X0)) = _sqlite3DbStrDup(tls, _db, _pCte.X0) + *(*int16)(unsafe.Pointer(&_1_pTab.X10)) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_1_pTab.X12)) = int16(i32(200)) func() { if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120724), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48127))) @@ -35401,16 +37237,16 @@ func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int } }() { - p := (*uint32)(unsafe.Pointer(&(_1_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_1_pTab.X9)) *p = (*p) | uint32(i32(66)) sink5(*p) } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_pCte.X2), i32(0)) - if (_db.X17) != 0 { + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X5)))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_pCte.X2), i32(0)) + if _db.X17 != 0 { return _sqlite3NomemError(tls, i32(120727)) } func() { - if (*XSelect)(_pFrom.X5) == nil { + if _pFrom.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120728), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48640))) crt.X__builtin_abort(tls) } @@ -35423,16 +37259,16 @@ func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int _3_pSrc = (*XSrcList)((*XSelect)(_pFrom.X5).X8) _3_i = i32(0) _15: - if _3_i >= (_3_pSrc.X0) { + if _3_i >= _3_pSrc.X0 { goto _18 } - _4_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pSrc.X2))))) + 112*uintptr(_3_i))) - if (((_4_pItem.X1) == nil) && ((_4_pItem.X2) != nil)) && (i32(0) == _sqlite3StrICmp(tls, _4_pItem.X2, _pCte.X0)) { - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pItem.X4))))) = _1_pTab - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_4_pItem.X9))).X1))), int8(i32(1)), 32, 5) - *(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) += 1 + _4_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_3_pSrc.X2)))) + 112*uintptr(_3_i))) + if ((_4_pItem.X1 == nil) && (_4_pItem.X2 != nil)) && (i32(0) == _sqlite3StrICmp(tls, _4_pItem.X2, _pCte.X0)) { + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pItem.X4)))) = _1_pTab + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_4_pItem.X9)).X1))), int8(i32(1)), 32, 5) + *(*uint32)(unsafe.Pointer(&_1_pTab.X8)) += 1 { - p := (*uint32)(unsafe.Pointer(&(_1_pSel.X3))) + p := (*uint32)(unsafe.Pointer(&_1_pSel.X3)) *p = (*p) | uint32(i32(8192)) sink5(*p) } @@ -35441,19 +37277,19 @@ _15: goto _15 _18: _14: - if (_1_pTab.X8) > uint32(i32(2)) { + if _1_pTab.X8 > uint32(i32(2)) { _sqlite3ErrorMsg(tls, _pParse, str(48655), unsafe.Pointer(_pCte.X0)) return i32(1) } func() { - if (_1_pTab.X8) != uint32(i32(1)) && (((_1_pSel.X3)&uint32(i32(8192))) == 0 || (_1_pTab.X8) != uint32(i32(2))) { + if _1_pTab.X8 != uint32(i32(1)) && ((_1_pSel.X3&uint32(i32(8192))) == 0 || _1_pTab.X8 != uint32(i32(2))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120757), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48698))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48771) + *(**int8)(unsafe.Pointer(&_pCte.X3)) = str(48771) _1_pSavedWith = (*XWith)(_pParse.X70) - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = _pWith if _1_bMayRecursive != 0 { _7_pPrior = (*XSelect)(_1_pSel.X13) func() { @@ -35462,47 +37298,47 @@ _14: crt.X__builtin_abort(tls) } }() - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_pPrior.X17))))) = (*XWith)(_1_pSel.X17) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_7_pPrior.X17)))) = (*XWith)(_1_pSel.X17) _sqlite3WalkSelect(tls, _pWalker, _7_pPrior) - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_pPrior.X17))))) = nil + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_7_pPrior.X17)))) = nil goto _30 } _sqlite3WalkSelect(tls, _pWalker, _1_pSel) _30: - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = _pWith _1_pLeft = _1_pSel _31: - if (*XSelect)(_1_pLeft.X13) == nil { + if _1_pLeft.X13 == nil { goto _34 } _1_pLeft = (*XSelect)(_1_pLeft.X13) goto _31 _34: _1_pEList = (*XExprList)(_1_pLeft.X0) - if (*XExprList)(_pCte.X1) == nil { + if _pCte.X1 == nil { goto _35 } - if (_1_pEList != nil) && ((_1_pEList.X0) != ((*XExprList)(_pCte.X1).X0)) { + if (_1_pEList != nil) && (_1_pEList.X0 != ((*XExprList)(_pCte.X1).X0)) { _sqlite3ErrorMsg(tls, _pParse, str(48811), unsafe.Pointer(_pCte.X0), _1_pEList.X0, (*XExprList)(_pCte.X1).X0) - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _1_pSavedWith + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = _1_pSavedWith return i32(1) } _1_pEList = (*XExprList)(_pCte.X1) _35: - _sqlite3ColumnsFromExprList(tls, _pParse, _1_pEList, (*int16)(unsafe.Pointer(&(_1_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pTab.X1)))))) + _sqlite3ColumnsFromExprList(tls, _pParse, _1_pEList, (*int16)(unsafe.Pointer(&_1_pTab.X11)), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pTab.X1))))) if _1_bMayRecursive == 0 { goto _38 } - if ((_1_pSel.X3) & uint32(i32(8192))) != 0 { - *(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48849) + if (_1_pSel.X3 & uint32(i32(8192))) != 0 { + *(**int8)(unsafe.Pointer(&_pCte.X3)) = str(48849) goto _40 } - *(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48883) + *(**int8)(unsafe.Pointer(&_pCte.X3)) = str(48883) _40: _sqlite3WalkSelect(tls, _pWalker, _1_pSel) _38: - *(**int8)(unsafe.Pointer(&(_pCte.X3))) = nil - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _1_pSavedWith + *(**int8)(unsafe.Pointer(&_pCte.X3)) = nil + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = _1_pSavedWith _2: return i32(0) } @@ -35513,19 +37349,22 @@ func init() { crt.Xstrncpy(nil, &_withExpandØ00__func__Ø000[0], str(48921), 11) } -// Argument pWith (which may be NULL) points to a linked list of nested -// WITH contexts, from inner to outermost. If the table identified by -// FROM clause element pItem is really a common-table-expression (CTE) -// then return a pointer to the CTE definition for that table. Otherwise -// return NULL. -// -// If a non-NULL value is returned, set *ppContext to point to the With -// object that the returned CTE belongs to. +// C comment +// /* +// ** Argument pWith (which may be NULL) points to a linked list of nested +// ** WITH contexts, from inner to outermost. If the table identified by +// ** FROM clause element pItem is really a common-table-expression (CTE) +// ** then return a pointer to the CTE definition for that table. Otherwise +// ** return NULL. +// ** +// ** If a non-NULL value is returned, set *ppContext to point to the With +// ** object that the returned CTE belongs to. +// */ func _searchWith(tls *crt.TLS, _pWith *XWith, _pItem *TSrcList_item, _ppContext **XWith) (r0 *TCte) { var _2_i int32 var _zName *int8 var _1_p *XWith - if (_pItem.X1) != nil || store0(&_zName, _pItem.X2) == nil { + if _pItem.X1 != nil || store0(&_zName, _pItem.X2) == nil { goto _1 } _1_p = _pWith @@ -35535,12 +37374,12 @@ _2: } _2_i = i32(0) _6: - if _2_i >= (_1_p.X0) { + if _2_i >= _1_p.X0 { goto _9 } - if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_1_p.X2)))))+32*uintptr(_2_i))).X0) == i32(0) { + if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_1_p.X2))))+32*uintptr(_2_i))).X0) == i32(0) { *_ppContext = _1_p - return (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_1_p.X2))))) + 32*uintptr(_2_i))) + return (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_1_p.X2)))) + 32*uintptr(_2_i))) } _2_i += 1 goto _6 @@ -35552,19 +37391,25 @@ _1: return nil } -// Check to see if the FROM clause term pFrom has table-valued function -// arguments. If it does, leave an error message in pParse and return -// non-zero, since pFrom is not allowed to be a table-valued function. +// C comment +// /* +// ** Check to see if the FROM clause term pFrom has table-valued function +// ** arguments. If it does, leave an error message in pParse and return +// ** non-zero, since pFrom is not allowed to be a table-valued function. +// */ func _cannotBeFunction(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) { - if ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_pFrom.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(48932), unsafe.Pointer(_pFrom.X2)) return i32(1) } return i32(0) } -// Convert an integer into a LogEst. In other words, compute an -// approximation for 10*log2(x). +// C comment +// /* +// ** Convert an integer into a LogEst. In other words, compute an +// ** approximation for 10*log2(x). +// */ func _sqlite3LogEst(tls *crt.TLS, _x uint64) (r0 int16) { var _y int16 _y = i16(40) @@ -35619,7 +37464,7 @@ _6: goto _6 } _4: - return int16((int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstØ00aØ001)) + 2*uintptr(_x&uint64(i32(7)))))) + int32(_y)) - i32(10)) + return int16((int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3LogEstØ00aØ001)) + 2*uintptr(_x&uint64(i32(7)))))) + int32(_y)) - i32(10)) } var _sqlite3LogEstØ00aØ001 [8]int16 @@ -35649,27 +37494,27 @@ _2: if _1_pNew == nil { goto _5 } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X0))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X0), _flags) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X8))))) = _sqlite3SrcListDup(tls, _db, (*XSrcList)(_p.X8), _flags) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X9))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X9), _flags) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X10))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X10), _flags) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X11))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X11), _flags) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X12))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X12), _flags) - *(*uint8)(unsafe.Pointer(&(_1_pNew.X1))) = _p.X1 - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X14))))) = _pNext - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X13))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X15))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X15), _flags) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X16))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X16), _flags) - *(*int32)(unsafe.Pointer(&(_1_pNew.X4))) = i32(0) - *(*int32)(unsafe.Pointer(&(_1_pNew.X5))) = i32(0) - *(*uint32)(unsafe.Pointer(&(_1_pNew.X3))) = (_p.X3) & uint32(i32(-33)) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_1_pNew.X7))))) + 4*uintptr(i32(0)))) = i32(-1) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_1_pNew.X7))))) + 4*uintptr(i32(1)))) = i32(-1) - *(*int16)(unsafe.Pointer(&(_1_pNew.X2))) = _p.X2 - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X17))))) = _withDup(tls, _db, (*XWith)(_p.X17)) - _sqlite3SelectSetName(tls, _1_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X0)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X0), _flags) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X8)))) = _sqlite3SrcListDup(tls, _db, (*XSrcList)(_p.X8), _flags) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X9)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X9), _flags) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X10)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X10), _flags) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X11)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X11), _flags) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X12)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X12), _flags) + *(*uint8)(unsafe.Pointer(&_1_pNew.X1)) = _p.X1 + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X14)))) = _pNext + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X13)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X15)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X15), _flags) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X16)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X16), _flags) + *(*int32)(unsafe.Pointer(&_1_pNew.X4)) = i32(0) + *(*int32)(unsafe.Pointer(&_1_pNew.X5)) = i32(0) + *(*uint32)(unsafe.Pointer(&_1_pNew.X3)) = _p.X3 & uint32(i32(-33)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_1_pNew.X7)))) + 4*uintptr(i32(0)))) = i32(-1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_1_pNew.X7)))) + 4*uintptr(i32(1)))) = i32(-1) + *(*int16)(unsafe.Pointer(&_1_pNew.X2)) = _p.X2 + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X17)))) = _withDup(tls, _db, (*XWith)(_p.X17)) + _sqlite3SelectSetName(tls, _1_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))) *_pp = _1_pNew - _pp = (**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X13))))) + _pp = (**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X13)))) _pNext = _1_pNew _p = (*XSelect)(_p.X13) goto _2 @@ -35698,20 +37543,20 @@ func _sqlite3ExprListDup(tls *crt.TLS, _db *Xsqlite3, _p *XExprList, _flags int3 if _p == nil { return nil } - _pNew = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, u64(40)+(u64(32)*uint64((_p.X0)-i32(1))))) + _pNew = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, u64(40)+(u64(32)*uint64(_p.X0-i32(1))))) if _pNew == nil { return nil } - *(*int32)(unsafe.Pointer(&(_pNew.X1))) = store1((*int32)(unsafe.Pointer(&(_pNew.X0))), _p.X0) - _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pNew.X2))))) - _pOldItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + *(*int32)(unsafe.Pointer(&_pNew.X1)) = store1((*int32)(unsafe.Pointer(&_pNew.X0)), _p.X0) + _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pNew.X2)))) + _pOldItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2)))) _i = i32(0) _4: - if _i >= (_p.X0) { + if _i >= _p.X0 { goto _7 } _1_pOldExpr = (*XExpr)(_pOldItem.X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = _sqlite3ExprDup(tls, _db, _1_pOldExpr, _flags) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X0)))) = _sqlite3ExprDup(tls, _db, _1_pOldExpr, _flags) if _1_pOldExpr == nil || int32(_1_pOldExpr.X0) != i32(159) || store36(&_1_pNewExpr, (*XExpr)(_pItem.X0)) == nil { goto _10 } @@ -35728,7 +37573,7 @@ _4: crt.X__builtin_abort(tls) } }() - _pPriorSelectCol = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewExpr.X4))))), (*XExpr)(_1_pNewExpr.X5)) + _pPriorSelectCol = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewExpr.X4)))), (*XExpr)(_1_pNewExpr.X5)) goto _17 } func() { @@ -35738,32 +37583,32 @@ _4: } }() func() { - if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+32*uintptr(i32(-1)))).X0) == nil { + if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pItem))+32*uintptr(i32(-1)))).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49034))) crt.X__builtin_abort(tls) } }() func() { - if int32(_1_pNewExpr.X9) != (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+32*uintptr(i32(-1)))).X0).X9) + i32(1)) { + if int32(_1_pNewExpr.X9) != (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pItem))+32*uintptr(i32(-1)))).X0).X9) + i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49053))) crt.X__builtin_abort(tls) } }() func() { - if _pPriorSelectCol != (*XExpr)((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+32*uintptr(i32(-1)))).X0).X4) { + if _pPriorSelectCol != (*XExpr)((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pItem))+32*uintptr(i32(-1)))).X0).X4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49099))) crt.X__builtin_abort(tls) } }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewExpr.X4))))) = _pPriorSelectCol + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewExpr.X4)))) = _pPriorSelectCol _17: _10: - *(**int8)(unsafe.Pointer(&(_pItem.X1))) = _sqlite3DbStrDup(tls, _db, _pOldItem.X1) - *(**int8)(unsafe.Pointer(&(_pItem.X2))) = _sqlite3DbStrDup(tls, _db, _pOldItem.X2) - *(*uint8)(unsafe.Pointer(&(_pItem.X3))) = _pOldItem.X3 - storebits3((*int8)(unsafe.Pointer(&(_pItem.X4))), int8(i32(0)), 1, 0) - storebits3((*int8)(unsafe.Pointer(&(_pItem.X4))), int8((uint32((_pOldItem.X4)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))), 2, 1) - *(*t37)(unsafe.Pointer(&(_pItem.X5))) = _pOldItem.X5 + *(**int8)(unsafe.Pointer(&_pItem.X1)) = _sqlite3DbStrDup(tls, _db, _pOldItem.X1) + *(**int8)(unsafe.Pointer(&_pItem.X2)) = _sqlite3DbStrDup(tls, _db, _pOldItem.X2) + *(*uint8)(unsafe.Pointer(&_pItem.X3)) = _pOldItem.X3 + storebits3((*int8)(unsafe.Pointer(&_pItem.X4)), int8(i32(0)), 1, 0) + storebits3((*int8)(unsafe.Pointer(&_pItem.X4)), int8((uint32(_pOldItem.X4>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))), 2, 1) + *(*t37)(unsafe.Pointer(&_pItem.X5)) = _pOldItem.X5 *(*uintptr)(unsafe.Pointer(func() **TExprList_item { *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32) return &_pOldItem @@ -35779,21 +37624,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListDupØ00__func__Ø000[0], str(49139), 19) } -// The following group of routines make deep copies of expressions, -// expression lists, ID lists, and select statements. The copies can -// be deleted (by being passed to their respective ...Delete() routines) -// without effecting the originals. -// -// The expression list, ID, and source lists return by sqlite3ExprListDup(), -// sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded -// by subsequent calls to sqlite*ListAppend() routines. -// -// Any tables that the SrcList might point to are not duplicated. -// -// The flags parameter contains a combination of the EXPRDUP_XXX flags. -// If the EXPRDUP_REDUCE flag is set, then the structure returned is a -// truncated version of the usual Expr structure that will be stored as -// part of the in-memory representation of the database schema. +// C comment +// /* +// ** The following group of routines make deep copies of expressions, +// ** expression lists, ID lists, and select statements. The copies can +// ** be deleted (by being passed to their respective ...Delete() routines) +// ** without effecting the originals. +// ** +// ** The expression list, ID, and source lists return by sqlite3ExprListDup(), +// ** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded +// ** by subsequent calls to sqlite*ListAppend() routines. +// ** +// ** Any tables that the SrcList might point to are not duplicated. +// ** +// ** The flags parameter contains a combination of the EXPRDUP_XXX flags. +// ** If the EXPRDUP_REDUCE flag is set, then the structure returned is a +// ** truncated version of the usual Expr structure that will be stored as +// ** part of the in-memory representation of the database schema. +// */ func _sqlite3ExprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _flags int32) (r0 *XExpr) { func() { if _flags != i32(0) && _flags != i32(1) { @@ -35815,12 +37663,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprDupØ00__func__Ø000[0], str(49192), 15) } -// This function is similar to sqlite3ExprDup(), except that if pzBuffer -// is not NULL then *pzBuffer is assumed to point to a buffer large enough -// to store the copy of expression p, the copies of p->u.zToken -// (if applicable), and the copies of the p->pLeft and p->pRight expressions, -// if any. Before returning, *pzBuffer is set to the first byte past the -// portion of the buffer copied into by this function. +// C comment +// /* +// ** This function is similar to sqlite3ExprDup(), except that if pzBuffer +// ** is not NULL then *pzBuffer is assumed to point to a buffer large enough +// ** to store the copy of expression p, the copies of p->u.zToken +// ** (if applicable), and the copies of the p->pLeft and p->pRight expressions, +// ** if any. Before returning, *pzBuffer is set to the first byte past the +// ** portion of the buffer copied into by this function. +// */ func _exprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _dupFlags int32, _pzBuffer **uint8) (r0 *XExpr) { var _3_nNewSize, _3_nToken int32 var _staticFlag, _3_nStructSize, _7_nSize uint32 @@ -35865,74 +37716,74 @@ _11: } _3_nStructSize = uint32(_dupedExprStructSize(tls, _p, _dupFlags)) _3_nNewSize = int32(_3_nStructSize & uint32(i32(4095))) - if (((_p.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) != nil) { - _3_nToken = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + i32(1) + if ((_p.X2 & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) != nil) { + _3_nToken = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) + i32(1) goto _15 } _3_nToken = i32(0) _15: if _dupFlags != 0 { func() { - if bool2int(((_p.X2)&uint32(i32(8192))) != uint32(i32(0))) != i32(0) { + if bool2int((_p.X2&uint32(i32(8192))) != uint32(i32(0))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92089), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49287))) crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_zAlloc), (unsafe.Pointer)(_p), uint64(_3_nNewSize)) + crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), uint64(_3_nNewSize)) goto _19 } _7_nSize = uint32(_exprStructSize(tls, _p)) - crt.Xmemcpy(tls, (unsafe.Pointer)(_zAlloc), (unsafe.Pointer)(_p), uint64(_7_nSize)) + crt.Xmemcpy(tls, unsafe.Pointer(_zAlloc), unsafe.Pointer(_p), uint64(_7_nSize)) if uint64(_7_nSize) < u64(72) { - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAlloc))+1*uintptr(_7_nSize)))), i32(0), u64(72)-uint64(_7_nSize)) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAlloc))+1*uintptr(_7_nSize)))), i32(0), u64(72)-uint64(_7_nSize)) } _19: { - p := (*uint32)(unsafe.Pointer(&(_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_pNew.X2)) *p = (*p) & uint32(i32(-122881)) sink5(*p) } { - p := (*uint32)(unsafe.Pointer(&(_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_pNew.X2)) *p = (*p) | (_3_nStructSize & uint32(i32(24576))) sink5(*p) } { - p := (*uint32)(unsafe.Pointer(&(_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_pNew.X2)) *p = (*p) | _staticFlag sink5(*p) } if _3_nToken != 0 { - _9_zToken = store0((**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))), (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAlloc))+1*uintptr(_3_nNewSize)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_9_zToken), (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), uint64(_3_nToken)) + _9_zToken = store0((**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pNew.X3)))), (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAlloc))+1*uintptr(_3_nNewSize)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_9_zToken), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))), uint64(_3_nToken)) } - if uint32(i32(0)) != (((_p.X2) | (_pNew.X2)) & uint32(i32(8404992))) { + if uint32(i32(0)) != ((_p.X2 | _pNew.X2) & uint32(i32(8404992))) { goto _22 } - if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) { - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), _dupFlags) + if (_p.X2 & uint32(i32(2048))) != uint32(i32(0)) { + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pNew.X6)))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))), _dupFlags) goto _24 } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), _dupFlags) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pNew.X6)))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))), _dupFlags) _24: _22: - if ((_pNew.X2) & uint32(i32(24576))) == uint32(i32(0)) { + if (_pNew.X2 & uint32(i32(24576))) == uint32(i32(0)) { goto _25 } { p := &_zAlloc - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_dupedExprNodeSize(tls, _p, _dupFlags)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_dupedExprNodeSize(tls, _p, _dupFlags)))) sink13(*p) } - if ((_pNew.X2) & uint32(i32(8404992))) == uint32(i32(0)) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = func() *XExpr { - if (*XExpr)(_p.X4) != nil { + if (_pNew.X2 & uint32(i32(8404992))) == uint32(i32(0)) { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X4)))) = func() *XExpr { + if _p.X4 != nil { return _exprDup(tls, _db, (*XExpr)(_p.X4), i32(1), &_zAlloc) } return nil }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X5))))) = func() *XExpr { - if (*XExpr)(_p.X5) != nil { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X5)))) = func() *XExpr { + if _p.X5 != nil { return _exprDup(tls, _db, (*XExpr)(_p.X5), i32(1), &_zAlloc) } return nil @@ -35943,11 +37794,11 @@ _22: } goto _32 _25: - if ((_p.X2) & uint32(i32(8404992))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(8404992))) != uint32(i32(0)) { goto _33 } if int32(_pNew.X0) == i32(159) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = (*XExpr)(_p.X4) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X4)))) = (*XExpr)(_p.X4) func() { if int32(_p.X9) != i32(0) && (*XExpr)(_p.X5) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92135), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49321))) @@ -35962,9 +37813,9 @@ _25: }() goto _41 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X4), i32(0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X4)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X4), i32(0)) _41: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X5))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X5), i32(0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X5)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X5), i32(0)) _33: _32: _12: @@ -35977,17 +37828,20 @@ func init() { crt.Xstrncpy(nil, &_exprDupØ00__func__Ø000[0], str(49387), 8) } -// Return the number of bytes required to create a duplicate of the -// expression passed as the first argument. The second argument is a -// mask containing EXPRDUP_XXX flags. -// -// The value returned includes space to create a copy of the Expr struct -// itself and the buffer referred to by Expr.u.zToken, if any. -// -// If the EXPRDUP_REDUCE flag is set, then the return value includes -// space to duplicate all Expr nodes in the tree formed by Expr.pLeft -// and Expr.pRight variables (but not for any structures pointed to or -// descended from the Expr.x.pList or Expr.x.pSelect variables). +// C comment +// /* +// ** Return the number of bytes required to create a duplicate of the +// ** expression passed as the first argument. The second argument is a +// ** mask containing EXPRDUP_XXX flags. +// ** +// ** The value returned includes space to create a copy of the Expr struct +// ** itself and the buffer referred to by Expr.u.zToken, if any. +// ** +// ** If the EXPRDUP_REDUCE flag is set, then the return value includes +// ** space to duplicate all Expr nodes in the tree formed by Expr.pLeft +// ** and Expr.pRight variables (but not for any structures pointed to or +// ** descended from the Expr.x.pList or Expr.x.pSelect variables). +// */ func _dupedExprSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) { var _nByte int32 _nByte = i32(0) @@ -36006,54 +37860,60 @@ _0: return _nByte } -// This function returns the space in bytes required to store the copy -// of the Expr structure and a copy of the Expr.u.zToken string (if that -// string is defined.) +// C comment +// /* +// ** This function returns the space in bytes required to store the copy +// ** of the Expr structure and a copy of the Expr.u.zToken string (if that +// ** string is defined.) +// */ func _dupedExprNodeSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) { var _nByte int32 _nByte = _dupedExprStructSize(tls, _p, _flags) & i32(4095) - if (((_p.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) != nil) { + if ((_p.X2 & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) != nil) { { p := &_nByte - *p = (*p) + (_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + i32(1)) + *p = (*p) + (_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) + i32(1)) sink1(*p) } } return (_nByte + i32(7)) & i32(-8) } -// The dupedExpr*Size() routines each return the number of bytes required -// to store a copy of an expression or expression tree. They differ in -// how much of the tree is measured. -// -// dupedExprStructSize() Size of only the Expr structure -// dupedExprNodeSize() Size of Expr + space for token -// dupedExprSize() Expr + token + subtree components -// -// *************************************************************************** -// -// The dupedExprStructSize() function returns two values OR-ed together: -// (1) the space required for a copy of the Expr structure only and -// (2) the EP_xxx flags that indicate what the structure size should be. -// The return values is always one of: -// -// EXPR_FULLSIZE -// EXPR_REDUCEDSIZE | EP_Reduced -// EXPR_TOKENONLYSIZE | EP_TokenOnly -// -// The size of the structure can be found by masking the return value -// of this routine with 0xfff. The flags can be found by masking the -// return value with EP_Reduced|EP_TokenOnly. -// -// Note that with flags==EXPRDUP_REDUCE, this routines works on full-size -// (unreduced) Expr objects as they or originally constructed by the parser. -// During expression analysis, extra information is computed and moved into -// later parts of teh Expr object and that extra information might get chopped -// off if the expression is reduced. Note also that it does not work to -// make an EXPRDUP_REDUCE copy of a reduced expression. It is only legal -// to reduce a pristine expression tree from the parser. The implementation -// of dupedExprStructSize() contain multiple assert() statements that attempt -// to enforce this constraint. +// C comment +// /* +// ** The dupedExpr*Size() routines each return the number of bytes required +// ** to store a copy of an expression or expression tree. They differ in +// ** how much of the tree is measured. +// ** +// ** dupedExprStructSize() Size of only the Expr structure +// ** dupedExprNodeSize() Size of Expr + space for token +// ** dupedExprSize() Expr + token + subtree components +// ** +// *************************************************************************** +// ** +// ** The dupedExprStructSize() function returns two values OR-ed together: +// ** (1) the space required for a copy of the Expr structure only and +// ** (2) the EP_xxx flags that indicate what the structure size should be. +// ** The return values is always one of: +// ** +// ** EXPR_FULLSIZE +// ** EXPR_REDUCEDSIZE | EP_Reduced +// ** EXPR_TOKENONLYSIZE | EP_TokenOnly +// ** +// ** The size of the structure can be found by masking the return value +// ** of this routine with 0xfff. The flags can be found by masking the +// ** return value with EP_Reduced|EP_TokenOnly. +// ** +// ** Note that with flags==EXPRDUP_REDUCE, this routines works on full-size +// ** (unreduced) Expr objects as they or originally constructed by the parser. +// ** During expression analysis, extra information is computed and moved into +// ** later parts of teh Expr object and that extra information might get chopped +// ** off if the expression is reduced. Note also that it does not work to +// ** make an EXPRDUP_REDUCE copy of a reduced expression. It is only legal +// ** to reduce a pristine expression tree from the parser. The implementation +// ** of dupedExprStructSize() contain multiple assert() statements that attempt +// ** to enforce this constraint. +// */ func _dupedExprStructSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) { var _nSize int32 func() { @@ -36069,30 +37929,30 @@ func _dupedExprStructSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) { goto _5 } func() { - if ((_p.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91995), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49429))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(1))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91996), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49474))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X2) & uint32(i32(65536))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(65536))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91997), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49507))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X2) & uint32(i32(131072))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(131072))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91998), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49540))) crt.X__builtin_abort(tls) } }() - if ((*XExpr)(_p.X4) != nil) || ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil) { + if (_p.X4 != nil) || ((*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil) { _nSize = int32(u64(8236)) goto _16 } @@ -36114,14 +37974,17 @@ func init() { crt.Xstrncpy(nil, &_dupedExprStructSizeØ00__func__Ø000[0], str(49573), 20) } -// Return the number of bytes allocated for the expression structure -// passed as the first argument. This is always one of EXPR_FULLSIZE, -// EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. +// C comment +// /* +// ** Return the number of bytes allocated for the expression structure +// ** passed as the first argument. This is always one of EXPR_FULLSIZE, +// ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. +// */ func _exprStructSize(tls *crt.TLS, _p *XExpr) (r0 int32) { - if ((_p.X2) & uint32(i32(16384))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(16384))) != uint32(i32(0)) { return int32(u64(16)) } - if ((_p.X2) & uint32(i32(8192))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(8192))) != uint32(i32(0)) { return int32(u64(44)) } return int32(u64(72)) @@ -36142,8 +38005,8 @@ func _sqlite3SrcListDup(tls *crt.TLS, _db *Xsqlite3, _p *XSrcList, _flags int32) return nil } _nByte = int32(u64(120) + func() uint64 { - if (_p.X0) > i32(0) { - return (u64(112) * uint64((_p.X0)-i32(1))) + if _p.X0 > i32(0) { + return (u64(112) * uint64(_p.X0-i32(1))) } return uint64(i32(0)) }()) @@ -36151,37 +38014,37 @@ func _sqlite3SrcListDup(tls *crt.TLS, _db *Xsqlite3, _p *XSrcList, _flags int32) if _pNew == nil { return nil } - *(*int32)(unsafe.Pointer(&(_pNew.X0))) = int32(store5((*uint32)(unsafe.Pointer(&(_pNew.X1))), uint32(_p.X0))) + *(*int32)(unsafe.Pointer(&_pNew.X0)) = int32(store5((*uint32)(unsafe.Pointer(&_pNew.X1)), uint32(_p.X0))) _i = i32(0) _6: - if _i >= (_p.X0) { + if _i >= _p.X0 { goto _9 } - _1_pNewItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pNew.X2))))) + 112*uintptr(_i))) - _1_pOldItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr(_i))) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X0))))) = (*XSchema)(_1_pOldItem.X0) - *(**int8)(unsafe.Pointer(&(_1_pNewItem.X1))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X1) - *(**int8)(unsafe.Pointer(&(_1_pNewItem.X2))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X2) - *(**int8)(unsafe.Pointer(&(_1_pNewItem.X3))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X3) - *(*t28)(unsafe.Pointer(&(_1_pNewItem.X9))) = _1_pOldItem.X9 - *(*int32)(unsafe.Pointer(&(_1_pNewItem.X11))) = _1_pOldItem.X11 - *(*int32)(unsafe.Pointer(&(_1_pNewItem.X6))) = _1_pOldItem.X6 - *(*int32)(unsafe.Pointer(&(_1_pNewItem.X7))) = _1_pOldItem.X7 - if ((uint32(((*t28)(unsafe.Pointer(&(_1_pNewItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pNewItem.X15))))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pOldItem.X15)))))) - } - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X16))))) = (*XIndex)(_1_pOldItem.X16) - if ((uint32(((*t28)(unsafe.Pointer(&(_1_pNewItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pNewItem.X15))))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pOldItem.X15)))))), _flags) - } - _1_pTab = store44((**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X4))))), (*XTable)(_1_pOldItem.X4)) + _1_pNewItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pNew.X2)))) + 112*uintptr(_i))) + _1_pOldItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_i))) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X0)))) = (*XSchema)(_1_pOldItem.X0) + *(**int8)(unsafe.Pointer(&_1_pNewItem.X1)) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X1) + *(**int8)(unsafe.Pointer(&_1_pNewItem.X2)) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X2) + *(**int8)(unsafe.Pointer(&_1_pNewItem.X3)) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X3) + *(*t28)(unsafe.Pointer(&_1_pNewItem.X9)) = _1_pOldItem.X9 + *(*int32)(unsafe.Pointer(&_1_pNewItem.X11)) = _1_pOldItem.X11 + *(*int32)(unsafe.Pointer(&_1_pNewItem.X6)) = _1_pOldItem.X6 + *(*int32)(unsafe.Pointer(&_1_pNewItem.X7)) = _1_pOldItem.X7 + if ((uint32(((*t28)(unsafe.Pointer(&_1_pNewItem.X9)).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pNewItem.X15)))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pOldItem.X15))))) + } + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X16)))) = (*XIndex)(_1_pOldItem.X16) + if ((uint32(((*t28)(unsafe.Pointer(&_1_pNewItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pNewItem.X15)))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pOldItem.X15))))), _flags) + } + _1_pTab = store44((**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X4)))), (*XTable)(_1_pOldItem.X4)) if _1_pTab != nil { - *(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) += 1 + *(*uint32)(unsafe.Pointer(&_1_pTab.X8)) += 1 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_1_pOldItem.X5), _flags) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X12))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_1_pOldItem.X12), _flags) - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X13))))) = _sqlite3IdListDup(tls, _db, (*XIdList)(_1_pOldItem.X13)) - *(*uint64)(unsafe.Pointer(&(_1_pNewItem.X14))) = _1_pOldItem.X14 + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X5)))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_1_pOldItem.X5), _flags) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X12)))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_1_pOldItem.X12), _flags) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNewItem.X13)))) = _sqlite3IdListDup(tls, _db, (*XIdList)(_1_pOldItem.X13)) + *(*uint64)(unsafe.Pointer(&_1_pNewItem.X14)) = _1_pOldItem.X14 _i += 1 goto _6 _9: @@ -36211,21 +38074,21 @@ func _sqlite3IdListDup(tls *crt.TLS, _db *Xsqlite3, _p *XIdList) (r0 *XIdList) { if _pNew == nil { return nil } - *(*int32)(unsafe.Pointer(&(_pNew.X1))) = _p.X1 - *(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = (*TIdList_item)(_sqlite3DbMallocRawNN(tls, _db, uint64(_p.X1)*u64(16))) + *(*int32)(unsafe.Pointer(&_pNew.X1)) = _p.X1 + *(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X0)))) = (*TIdList_item)(_sqlite3DbMallocRawNN(tls, _db, uint64(_p.X1)*u64(16))) if (*TIdList_item)(_pNew.X0) == nil { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pNew)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pNew)) return nil } _i = i32(0) _5: - if _i >= (_p.X1) { + if _i >= _p.X1 { goto _8 } _2_pNewItem = (*TIdList_item)(unsafe.Pointer(uintptr(_pNew.X0) + 16*uintptr(_i))) _2_pOldItem = (*TIdList_item)(unsafe.Pointer(uintptr(_p.X0) + 16*uintptr(_i))) - *(**int8)(unsafe.Pointer(&(_2_pNewItem.X0))) = _sqlite3DbStrDup(tls, _db, _2_pOldItem.X0) - *(*int32)(unsafe.Pointer(&(_2_pNewItem.X1))) = _2_pOldItem.X1 + *(**int8)(unsafe.Pointer(&_2_pNewItem.X0)) = _sqlite3DbStrDup(tls, _db, _2_pOldItem.X0) + *(*int32)(unsafe.Pointer(&_2_pNewItem.X1)) = _2_pOldItem.X1 _i += 1 goto _5 _8: @@ -36245,20 +38108,20 @@ func _withDup(tls *crt.TLS, _db *Xsqlite3, _p *XWith) (r0 *XWith) { if _p == nil { goto _0 } - _1_nByte = int32(u64(48) + (u64(32) * uint64((_p.X0)-i32(1)))) + _1_nByte = int32(u64(48) + (u64(32) * uint64(_p.X0-i32(1)))) _pRet = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(_1_nByte))) if _pRet == nil { goto _1 } - *(*int32)(unsafe.Pointer(&(_pRet.X0))) = _p.X0 + *(*int32)(unsafe.Pointer(&_pRet.X0)) = _p.X0 _2_i = i32(0) _2: - if _2_i >= (_p.X0) { + if _2_i >= _p.X0 { goto _5 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 32*uintptr(_2_i))).X2))))) = _sqlite3SelectDup(tls, _db, (*XSelect)((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+32*uintptr(_2_i))).X2), i32(0)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 32*uintptr(_2_i))).X1))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+32*uintptr(_2_i))).X1), i32(0)) - *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 32*uintptr(_2_i))).X0))) = _sqlite3DbStrDup(tls, _db, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+32*uintptr(_2_i))).X0) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pRet.X2)))) + 32*uintptr(_2_i))).X2))))) = _sqlite3SelectDup(tls, _db, (*XSelect)((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_p.X2))))+32*uintptr(_2_i))).X2), i32(0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pRet.X2)))) + 32*uintptr(_2_i))).X1))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_p.X2))))+32*uintptr(_2_i))).X1), i32(0)) + *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pRet.X2)))) + 32*uintptr(_2_i))).X0))) = _sqlite3DbStrDup(tls, _db, (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_p.X2))))+32*uintptr(_2_i))).X0) _2_i += 1 goto _2 _5: @@ -36267,24 +38130,30 @@ _0: return _pRet } -// Set the name of a Select object +// C comment +// /* +// ** Set the name of a Select object +// */ func _sqlite3SelectSetName(tls *crt.TLS, _p *XSelect, _zName *int8) { if (_p != nil) && (_zName != nil) { - Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6))))), str(24576), unsafe.Pointer(_zName)) - } -} - -// Given an expression list (which is really the list of expressions -// that form the result set of a SELECT statement) compute appropriate -// column names for a table that would hold the expression list. -// -// All column names will be unique. -// -// Only the column names are computed. Column.zType, Column.zColl, -// and other fields of Column are zeroed. -// -// Return SQLITE_OK on success. If a memory allocation error occurs, -// store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM. + Xsqlite3_snprintf(tls, int32(u64(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6)))), str(24576), unsafe.Pointer(_zName)) + } +} + +// C comment +// /* +// ** Given an expression list (which is really the list of expressions +// ** that form the result set of a SELECT statement) compute appropriate +// ** column names for a table that would hold the expression list. +// ** +// ** All column names will be unique. +// ** +// ** Only the column names are computed. Column.zType, Column.zColl, +// ** and other fields of Column are zeroed. +// ** +// ** Return SQLITE_OK on success. If a memory allocation error occurs, +// ** store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM. +// */ func _sqlite3ColumnsFromExprList(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pnCol *int16, _paCol **XColumn) (r0 int32) { var _i, _j, _nCol, _nName, _7_iCol int32 var _cnt uint32 @@ -36314,11 +38183,11 @@ _1: *_paCol = _aCol *func() **XColumn { _i = i32(0); return &_pCol }() = _aCol _4: - if _i >= _nCol || (_db.X17) != 0 { + if _i >= _nCol || _db.X17 != 0 { goto _8 } - _p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X0)) - if store0(&_zName, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X1) != nil { + _p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X0)) + if store0(&_zName, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X1) != nil { goto _10 } _5_pColExpr = _p @@ -36351,15 +38220,15 @@ _11: _16: if int32(_5_pColExpr.X0) == i32(27) { func() { - if ((_5_pColExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_5_pColExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000))), unsafe.Pointer(str(49656))) crt.X__builtin_abort(tls) } }() - _zName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_5_pColExpr.X3))))) + _zName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_5_pColExpr.X3)))) goto _24 } - _zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X2 + _zName = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X2 _24: _10: _zName = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_zName)) @@ -36374,31 +38243,31 @@ _25: } _j = _nName - i32(1) _29: - if _j <= i32(0) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(_j))))))))&i32(4)) == 0 { + if _j <= i32(0) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(_j))))))))&i32(4)) == 0 { goto _33 } _j -= 1 goto _29 _33: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(_j)))) == i32(58) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(_j)))) == i32(58) { _nName = _j } _28: _zName = _sqlite3MPrintf(tls, _db, str(49696), _nName, unsafe.Pointer(_zName), preInc5(&_cnt, uint32(1))) if _cnt > uint32(i32(3)) { - Xsqlite3_randomness(tls, int32(u64(4)), (unsafe.Pointer)(&_cnt)) + Xsqlite3_randomness(tls, int32(u64(4)), unsafe.Pointer(&_cnt)) } goto _25 _26: - *(**int8)(unsafe.Pointer(&(_pCol.X0))) = _zName - if (_zName != nil) && (_sqlite3HashInsert(tls, &_ht, _zName, (unsafe.Pointer)(_pCol)) == (unsafe.Pointer)(_pCol)) { + *(**int8)(unsafe.Pointer(&_pCol.X0)) = _zName + if (_zName != nil) && (_sqlite3HashInsert(tls, &_ht, _zName, unsafe.Pointer(_pCol)) == unsafe.Pointer(_pCol)) { _sqlite3OomFault(tls, _db) } *(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32) goto _4 _8: _sqlite3HashClear(tls, &_ht) - if (_db.X17) == 0 { + if _db.X17 == 0 { goto _38 } _j = i32(0) @@ -36406,11 +38275,11 @@ _39: if _j >= _i { goto _42 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XColumn)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCol))+32*uintptr(_j))).X0)) + _sqlite3DbFree(tls, _db, unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCol))+32*uintptr(_j))).X0)) _j += 1 goto _39 _42: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aCol)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_aCol)) *_paCol = nil *_pnCol = int16(i32(0)) return _sqlite3NomemError(tls, i32(118257)) @@ -36428,23 +38297,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ColumnsFromExprListØ00__func__Ø000[0], str(49704), 27) } -// Locate the table identified by *p. -// -// This is a wrapper around sqlite3LocateTable(). The difference between -// sqlite3LocateTable() and this function is that this function restricts -// the search to schema (p->pSchema) if it is not NULL. p->pSchema may be -// non-NULL if it is part of a view or trigger program definition. See -// sqlite3FixSrcList() for details. +// C comment +// /* +// ** Locate the table identified by *p. +// ** +// ** This is a wrapper around sqlite3LocateTable(). The difference between +// ** sqlite3LocateTable() and this function is that this function restricts +// ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be +// ** non-NULL if it is part of a view or trigger program definition. See +// ** sqlite3FixSrcList() for details. +// */ func _sqlite3LocateTableItem(tls *crt.TLS, _pParse *XParse, _flags uint32, _p *TSrcList_item) (r0 *XTable) { var _1_iDb int32 var _zDb *int8 func() { - if (*XSchema)(_p.X0) != nil && (_p.X1) != nil { + if (*XSchema)(_p.X0) != nil && _p.X1 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100094), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LocateTableItemØ00__func__Ø000))), unsafe.Pointer(str(49731))) crt.X__builtin_abort(tls) } }() - if (*XSchema)(_p.X0) != nil { + if _p.X0 != nil { _1_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_p.X0)) _zDb = (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 32*uintptr(_1_iDb))).X0 goto _4 @@ -36460,14 +38332,17 @@ func init() { crt.Xstrncpy(nil, &_sqlite3LocateTableItemØ00__func__Ø000[0], str(49764), 23) } -// Locate the in-memory structure that describes a particular database -// table given the name of that table and (optionally) the name of the -// database containing the table. Return NULL if not found. Also leave an -// error message in pParse->zErrMsg. -// -// The difference between this routine and sqlite3FindTable() is that this -// routine leaves an error message in pParse->zErrMsg where -// sqlite3FindTable() does not. +// C comment +// /* +// ** Locate the in-memory structure that describes a particular database +// ** table given the name of that table and (optionally) the name of the +// ** database containing the table. Return NULL if not found. Also leave an +// ** error message in pParse->zErrMsg. +// ** +// ** The difference between this routine and sqlite3FindTable() is that this +// ** routine leaves an error message in pParse->zErrMsg where +// ** sqlite3FindTable() does not. +// */ func _sqlite3LocateTable(tls *crt.TLS, _pParse *XParse, _flags uint32, _zName *int8, _zDbase *int8) (r0 *XTable) { var _2_zMsg *int8 var _p *XTable @@ -36505,14 +38380,17 @@ _4: } _sqlite3ErrorMsg(tls, _pParse, str(49832), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zName)) _11: - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) _9: _1: return _p } -// This routine is a no-op if the database schema is already initialized. -// Otherwise, the schema is loaded. An error code is returned. +// C comment +// /* +// ** This routine is a no-op if the database schema is already initialized. +// ** Otherwise, the schema is loaded. An error code is returned. +// */ func _sqlite3ReadSchema(tls *crt.TLS, _pParse *XParse) (r0 int32) { var _rc int32 var _db *Xsqlite3 @@ -36524,12 +38402,12 @@ func _sqlite3ReadSchema(tls *crt.TLS, _pParse *XParse) (r0 int32) { crt.X__builtin_abort(tls) } }() - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { - _rc = _sqlite3Init(tls, _db, (**int8)(unsafe.Pointer(&(_pParse.X1)))) + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { + _rc = _sqlite3Init(tls, _db, (**int8)(unsafe.Pointer(&_pParse.X1))) } if _rc != i32(0) { - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc - *(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _rc + *(*int32)(unsafe.Pointer(&_pParse.X16)) += 1 } return _rc } @@ -36540,17 +38418,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ReadSchemaØ00__func__Ø000[0], str(49839), 18) } -// Initialize all database files - the main database file, the file -// used to store temporary tables, and any additional database files -// created using ATTACH statements. Return a success code. If an -// error occurs, write an error message into *pzErrMsg. -// -// After a database is initialized, the DB_SchemaLoaded bit is set -// bit is set in the flags field of the Db structure. If the database -// file was of zero-length, then the DB_Empty flag is also set. +// C comment +// /* +// ** Initialize all database files - the main database file, the file +// ** used to store temporary tables, and any additional database files +// ** created using ATTACH statements. Return a success code. If an +// ** error occurs, write an error message into *pzErrMsg. +// ** +// ** After a database is initialized, the DB_SchemaLoaded bit is set +// ** bit is set in the flags field of the Db structure. If the database +// ** file was of zero-length, then the DB_Empty flag is also set. +// */ func _sqlite3Init(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8) (r0 int32) { var _i, _rc, _commit_internal int32 - _commit_internal = bool2int(((_db.X6) & i32(2)) == 0) + _commit_internal = bool2int((_db.X6 & i32(2)) == 0) func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116025), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(863))) @@ -36564,17 +38445,17 @@ func _sqlite3Init(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8) (r0 int32) { } }() func() { - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(49896))) crt.X__builtin_abort(tls) } }() _rc = i32(0) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_db.X14))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8 + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_db.X14)) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8 _i = i32(0) _6: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _10 } if ((int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X4).X9) & i32(1)) == i32(1)) || (_i == i32(1)) { @@ -36589,7 +38470,7 @@ _7: goto _6 _10: func() { - if (_db.X5) <= i32(1) { + if _db.X5 <= i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116044), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(49913))) crt.X__builtin_abort(tls) } @@ -36602,7 +38483,7 @@ _10: _sqlite3ResetOneSchema(tls, _db, i32(1)) } _17: - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X2))) = uint8(i32(0)) if (_rc == i32(0)) && _commit_internal != 0 { _sqlite3CommitInternalChanges(tls, _db) } @@ -36615,12 +38496,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3InitØ00__func__Ø000[0], str(49923), 12) } -// Attempt to read the database schema and initialize internal -// data structures for a single database file. The index of the -// database file is given by iDb. iDb==0 is used for the main -// database. iDb==1 should never be used. iDb>=2 is used for -// auxiliary databases. Return one of the SQLITE_ error codes to -// indicate success or failure. +// C comment +// /* +// ** Attempt to read the database schema and initialize internal +// ** data structures for a single database file. The index of the +// ** database file is given by iDb. iDb==0 is used for the main +// ** database. iDb==1 should never be used. iDb>=2 is used for +// ** auxiliary databases. Return one of the SQLITE_ error codes to +// ** indicate success or failure. +// */ func _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) (r0 int32) { var _rc, _i, _size, _openedTransaction int32 var _zMasterName, _17_zSql *int8 @@ -36632,13 +38516,13 @@ func _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) var _initData XInitData _openedTransaction = i32(0) func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } }() func() { - if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X4) == nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(49935))) crt.X__builtin_abort(tls) } @@ -36655,21 +38539,21 @@ func _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 8*uintptr(i32(0)))) = store0(&_zMasterName, func() *int8 { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg)) + 8*uintptr(i32(0)))) = store0(&_zMasterName, func() *int8 { if i32(1) != 0 && (_iDb == i32(1)) { return str(50007) } return str(50026) }()) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 8*uintptr(i32(1)))) = str(50040) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 8*uintptr(i32(2)))) = str(50042) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 8*uintptr(i32(3)))) = nil - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_initData.X0))))) = _db - *(*int32)(unsafe.Pointer(&(_initData.X2))) = _iDb - *(*int32)(unsafe.Pointer(&(_initData.X3))) = i32(0) - *(***int8)(unsafe.Pointer(&(_initData.X1))) = _pzErrMsg - _sqlite3InitCallback(tls, (unsafe.Pointer)(&_initData), i32(3), (**int8)(unsafe.Pointer(&_azArg)), nil) - if (_initData.X3) != 0 { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg)) + 8*uintptr(i32(1)))) = str(50040) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg)) + 8*uintptr(i32(2)))) = str(50042) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg)) + 8*uintptr(i32(3)))) = nil + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_initData.X0)))) = _db + *(*int32)(unsafe.Pointer(&_initData.X2)) = _iDb + *(*int32)(unsafe.Pointer(&_initData.X3)) = i32(0) + *(***int8)(unsafe.Pointer(&_initData.X1)) = _pzErrMsg + _sqlite3InitCallback(tls, unsafe.Pointer(&_initData), i32(3), (**int8)(unsafe.Pointer(&_azArg)), nil) + if _initData.X3 != 0 { _rc = _initData.X3 goto _error_out } @@ -36712,25 +38596,25 @@ _21: if _i >= i32(5) { goto _24 } - _sqlite3BtreeGetMeta(tls, (*XBtree)(_pDb.X1), _i+i32(1), (*uint32)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta))+4*uintptr(_i)))))) + _sqlite3BtreeGetMeta(tls, (*XBtree)(_pDb.X1), _i+i32(1), (*uint32)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta))+4*uintptr(_i)))))) _i += 1 goto _21 _24: - *(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X0))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(0)))) - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4))))) == 0 { + *(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X0))) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(0)))) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(4))))) == 0 { goto _25 } if _iDb != i32(0) { goto _26 } - _8_encoding = uint8(int32(uint8(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4)))))) & i32(3)) + _8_encoding = uint8(int32(uint8(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(4)))))) & i32(3)) if int32(_8_encoding) == i32(0) { _8_encoding = uint8(i32(1)) } - *(*uint8)(unsafe.Pointer(&(_db.X14))) = _8_encoding + *(*uint8)(unsafe.Pointer(&_db.X14)) = _8_encoding goto _28 _26: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4))))) != int32(_db.X14) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(4))))) != int32(_db.X14) { _sqlite3SetString(tls, _pzErrMsg, _db, str(50118)) _rc = i32(1) goto _initone_error_out @@ -36748,14 +38632,14 @@ _30: if ((*XSchema)(_pDb.X4).X10) != i32(0) { goto _31 } - _size = _sqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(2))))) + _size = _sqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(2))))) if _size == i32(0) { _size = i32(-2000) } *(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X10))) = _size _sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.X1), (*XSchema)(_pDb.X4).X10) _31: - *(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X7))) = uint8(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(1))))) + *(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X7))) = uint8(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(1))))) if int32((*XSchema)(_pDb.X4).X7) == i32(0) { *(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X7))) = uint8(i32(1)) } @@ -36764,36 +38648,36 @@ _31: _rc = i32(1) goto _initone_error_out } - if (_iDb == i32(0)) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(1))))) >= i32(4)) { + if (_iDb == i32(0)) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_meta)) + 4*uintptr(i32(1))))) >= i32(4)) { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-32769) sink1(*p) } } func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(50210))) crt.X__builtin_abort(tls) } }() _17_zSql = _sqlite3MPrintf(tls, _db, str(50224), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0), unsafe.Pointer(_zMasterName)) _18_xAuth = _db.X59 - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = nil - _rc = Xsqlite3_exec(tls, _db, _17_zSql, _sqlite3InitCallback, (unsafe.Pointer)(&_initData), nil) - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _18_xAuth + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&_db.X59)) = nil + _rc = Xsqlite3_exec(tls, _db, _17_zSql, _sqlite3InitCallback, unsafe.Pointer(&_initData), nil) + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&_db.X59)) = _18_xAuth if _rc == i32(0) { _rc = _initData.X3 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_17_zSql)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_17_zSql)) if _rc == i32(0) { _sqlite3AnalysisLoad(tls, _db, _iDb) } - if (_db.X17) != 0 { + if _db.X17 != 0 { _rc = _sqlite3NomemError(tls, i32(115978)) _sqlite3ResetAllSchemasOfConnection(tls, _db) } - if (_rc == i32(0)) || ((_db.X6)&i32(65536)) != 0 { + if (_rc == i32(0)) || (_db.X6&i32(65536)) != 0 { { p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4).X9))) *p = uint16(int32(*p) | i32(1)) @@ -36824,16 +38708,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3InitOneØ00__func__Ø000[0], str(50279), 15) } -// This is the callback routine for the code that initializes the -// database. See sqlite3Init() below for additional information. -// This routine is also called from the OP_ParseSchema opcode of the VDBE. -// -// Each callback contains the following information: -// -// argv[0] = name of thing being created -// argv[1] = root page number for table or index. 0 for trigger or view. -// argv[2] = SQL text for the CREATE statement. -// +// C comment +// /* +// ** This is the callback routine for the code that initializes the +// ** database. See sqlite3Init() below for additional information. +// ** This routine is also called from the OP_ParseSchema opcode of the VDBE. +// ** +// ** Each callback contains the following information: +// ** +// ** argv[0] = name of thing being created +// ** argv[1] = root page number for table or index. 0 for trigger or view. +// ** argv[2] = SQL text for the CREATE statement. +// ** +// */ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) { var _iDb, _3_rc, _3_rcp int32 var _3_pStmt unsafe.Pointer @@ -36863,12 +38750,12 @@ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _arg *p = uint16(int32(*p) & i32(-5)) sink14(*p) } - if (_db.X17) != 0 { - _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), nil) + if _db.X17 != 0 { + _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), nil) return i32(1) } func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115731), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -36876,24 +38763,24 @@ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _arg if _argv == nil { return i32(0) } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) == nil { - _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), nil) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) == nil { + _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), nil) goto _32 } - if Xsqlite3_strnicmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2)))), str(50302), i32(7)) != i32(0) { + if Xsqlite3_strnicmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2)))), str(50302), i32(7)) != i32(0) { goto _11 } - _3_saved_iDb = (*t21)(unsafe.Pointer(&(_db.X33))).X1 + _3_saved_iDb = (*t21)(unsafe.Pointer(&_db.X33)).X1 func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50210))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(_iDb) - *(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X0))) = _sqlite3Atoi(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X3))) = uint8(i32(0)) - _3_rcp = Xsqlite3_prepare(tls, _db, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2)))), i32(-1), &_3_pStmt, nil) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X1))) = uint8(_iDb) + *(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X0))) = _sqlite3Atoi(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X3))) = uint8(i32(0)) + _3_rcp = Xsqlite3_prepare(tls, _db, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2)))), i32(-1), &_3_pStmt, nil) _3_rc = _db.X10 func() { if (_3_rc & i32(255)) != (_3_rcp & i32(255)) { @@ -36901,9 +38788,9 @@ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _arg crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = _3_saved_iDb + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X1))) = _3_saved_iDb func() { - if int32(_3_saved_iDb) != i32(0) && ((_db.X6)&i32(268435456)) == i32(0) { + if int32(_3_saved_iDb) != i32(0) && (_db.X6&i32(268435456)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50332))) crt.X__builtin_abort(tls) } @@ -36911,7 +38798,7 @@ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _arg if i32(0) == _3_rc { goto _19 } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X3) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X3) != 0 { func() { if _iDb != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115757), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50379))) @@ -36920,13 +38807,13 @@ func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _arg }() goto _23 } - *(*int32)(unsafe.Pointer(&(_pData.X3))) = _3_rc + *(*int32)(unsafe.Pointer(&_pData.X3)) = _3_rc if _3_rc == i32(7) { _sqlite3OomFault(tls, _db) goto _27 } if (_3_rc != i32(9)) && ((_3_rc & i32(255)) != i32(6)) { - _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), Xsqlite3_errmsg(tls, _db)) + _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), Xsqlite3_errmsg(tls, _db)) } _27: _23: @@ -36934,16 +38821,16 @@ _19: Xsqlite3_finalize(tls, _3_pStmt) goto _32 _11: - if ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == nil) || (((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) != nil) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2)))))) + 1*uintptr(i32(0))))) != i32(0))) { - _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), nil) + if ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == nil) || (((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) != nil) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2)))))) + 1*uintptr(i32(0))))) != i32(0))) { + _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), nil) goto _32 } - _10_pIndex = _sqlite3FindIndex(tls, _db, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) + _10_pIndex = _sqlite3FindIndex(tls, _db, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) if _10_pIndex == nil { goto _35 } - if _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&(_10_pIndex.X11)))) == i32(0) { - _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), str(50386)) + if _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&_10_pIndex.X11))) == i32(0) { + _corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), str(50386)) } _35: _32: @@ -36956,13 +38843,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3InitCallbackØ00__func__Ø000[0], str(50403), 20) } -// Fill the InitData structure with an error message that indicates -// that the database is corrupt. +// C comment +// /* +// ** Fill the InitData structure with an error message that indicates +// ** that the database is corrupt. +// */ func _corruptSchema(tls *crt.TLS, _pData *XInitData, _zObj *int8, _zExtra *int8) { var _1_z *int8 var _db *Xsqlite3 _db = (*Xsqlite3)(_pData.X0) - if (_db.X17) != 0 || ((_db.X6)&i32(65536)) != i32(0) { + if _db.X17 != 0 || (_db.X6&i32(65536)) != i32(0) { goto _1 } if _zObj == nil { @@ -36972,19 +38862,22 @@ func _corruptSchema(tls *crt.TLS, _pData *XInitData, _zObj *int8, _zExtra *int8) if _zExtra != nil { _1_z = _sqlite3MPrintf(tls, _db, str(50456), unsafe.Pointer(_1_z), unsafe.Pointer(_zExtra)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(_pData.X1))) - *(_pData.X1) = _1_z + _sqlite3DbFree(tls, _db, unsafe.Pointer(*_pData.X1)) + *_pData.X1 = _1_z _1: - *(*int32)(unsafe.Pointer(&(_pData.X3))) = func() int32 { - if (_db.X17) != 0 { + *(*int32)(unsafe.Pointer(&_pData.X3)) = func() int32 { + if _db.X17 != 0 { return _sqlite3NomemError(tls, i32(115702)) } return _sqlite3CorruptError(tls, i32(115702)) }() } -// Return a 32-bit integer value extracted from a string. If the -// string is not an integer, just return 0. +// C comment +// /* +// ** Return a 32-bit integer value extracted from a string. If the +// ** string is not an integer, just return 0. +// */ func _sqlite3Atoi(tls *crt.TLS, _z *int8) (r0 int32) { var _x int32 _x = i32(0) @@ -36994,12 +38887,15 @@ func _sqlite3Atoi(tls *crt.TLS, _z *int8) (r0 int32) { return _x } -// Two versions of the official API. Legacy and new use. In the legacy -// version, the original SQL text is not saved in the prepared statement -// and so if a schema change occurs, SQLITE_SCHEMA is returned by -// sqlite3_step(). In the new version, the original SQL text is retained -// and the statement is automatically recompiled if an schema change -// occurs. +// C comment +// /* +// ** Two versions of the official API. Legacy and new use. In the legacy +// ** version, the original SQL text is not saved in the prepared statement +// ** and so if a schema change occurs, SQLITE_SCHEMA is returned by +// ** sqlite3_step(). In the new version, the original SQL text is retained +// ** and the statement is automatically recompiled if an schema change +// ** occurs. +// */ func Xsqlite3_prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) { var _rc int32 _rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, i32(0), nil, _ppStmt, _pzTail) @@ -37039,7 +38935,10 @@ func _sqlite3LockAndPrepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes in return _rc } -// Compile the UTF-8 encoded SQL statement zSql into a statement handle. +// C comment +// /* +// ** Compile the UTF-8 encoded SQL statement zSql into a statement handle. +// */ func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pReprepare *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) { var _rc, _i, _4_mxLen, _12_iFirst, _12_mx int32 var _zErrMsg, _3_zDb, _4_zSqlCopy *int8 @@ -37049,9 +38948,9 @@ func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _s var _21_pT *XTriggerPrg _zErrMsg = nil _rc = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sParse), i32(0), u64(204)) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_sParse))))+uintptr(u64(456))))), i32(0), u64(144)) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X61))))) = _pReprepare + crt.Xmemset(tls, unsafe.Pointer(&_sParse), i32(0), u64(204)) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_sParse))))+uintptr(u64(456))))), i32(0), u64(144)) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sParse.X61)))) = _pReprepare func() { if _ppStmt == nil || *_ppStmt != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116195), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50533))) @@ -37066,7 +38965,7 @@ func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _s }() _i = i32(0) _5: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _8 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -37090,11 +38989,11 @@ _9: goto _5 _8: _sqlite3VtabUnlockList(tls, _db) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X0))))) = _db - if _nBytes < i32(0) || _nBytes != i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_nBytes-i32(1))))) == i32(0) { + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sParse.X0)))) = _db + if _nBytes < i32(0) || _nBytes != i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(_nBytes-i32(1))))) == i32(0) { goto _15 } - _4_mxLen = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(1)))) + _4_mxLen = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(1)))) if _nBytes > _4_mxLen { _sqlite3ErrorWithMsg(tls, _db, i32(18), str(50612)) _rc = _sqlite3ApiExit(tls, _db, i32(18)) @@ -37103,36 +39002,36 @@ _8: _4_zSqlCopy = _sqlite3DbStrNDup(tls, _db, _zSql, uint64(_nBytes)) if _4_zSqlCopy != nil { _sqlite3RunParser(tls, &_sParse, _4_zSqlCopy, &_zErrMsg) - *(**int8)(unsafe.Pointer(&(_sParse.X62))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_sParse.X62))-uintptr(unsafe.Pointer(_4_zSqlCopy)))/1)))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_4_zSqlCopy)) + *(**int8)(unsafe.Pointer(&_sParse.X62)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_sParse.X62))-uintptr(unsafe.Pointer(_4_zSqlCopy)))/1)))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_4_zSqlCopy)) goto _18 } - *(**int8)(unsafe.Pointer(&(_sParse.X62))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_nBytes))) + *(**int8)(unsafe.Pointer(&_sParse.X62)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(_nBytes))) _18: goto _19 _15: _sqlite3RunParser(tls, &_sParse, _zSql, &_zErrMsg) _19: func() { - if uint32(i32(0)) != (_sParse.X42) { + if uint32(i32(0)) != _sParse.X42 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116260), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50631))) crt.X__builtin_abort(tls) } }() - if (_sParse.X3) == i32(101) { - *(*int32)(unsafe.Pointer(&(_sParse.X3))) = i32(0) + if _sParse.X3 == i32(101) { + *(*int32)(unsafe.Pointer(&_sParse.X3)) = i32(0) } - if (_sParse.X5) != 0 { + if _sParse.X5 != 0 { _schemaIsValid(tls, &_sParse) } - if (_db.X17) != 0 { - *(*int32)(unsafe.Pointer(&(_sParse.X3))) = _sqlite3NomemError(tls, i32(116267)) + if _db.X17 != 0 { + *(*int32)(unsafe.Pointer(&_sParse.X3)) = _sqlite3NomemError(tls, i32(116267)) } if _pzTail != nil { *_pzTail = _sParse.X62 } _rc = _sParse.X3 - if _rc != i32(0) || (*TVdbe)(_sParse.X2) == nil || (_sParse.X54) == 0 { + if _rc != i32(0) || _sParse.X2 == nil || _sParse.X54 == 0 { goto _28 } if int32(_sParse.X54) == i32(2) { @@ -37150,16 +39049,16 @@ _31: if _i >= _12_mx { goto _34 } - _sqlite3VdbeSetColName(tls, (*TVdbe)(_sParse.X2), _i-_12_iFirst, i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PrepareØ00azColNameØ001)) + 8*uintptr(_i))), nil) + _sqlite3VdbeSetColName(tls, (*TVdbe)(_sParse.X2), _i-_12_iFirst, i32(0), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PrepareØ00azColNameØ001)) + 8*uintptr(_i))), nil) _i += 1 goto _31 _34: _28: - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0) { _16_pVdbe = (*TVdbe)(_sParse.X2) _sqlite3VdbeSetSql(tls, _16_pVdbe, _zSql, int32(int64((uintptr(unsafe.Pointer(_sParse.X62))-uintptr(unsafe.Pointer(_zSql)))/1)), _saveSqlFlag) } - if ((*TVdbe)(_sParse.X2) != nil) && ((_rc != i32(0)) || ((_db.X17) != 0)) { + if (_sParse.X2 != nil) && ((_rc != i32(0)) || (_db.X17 != 0)) { _sqlite3VdbeFinalize(tls, (*TVdbe)(_sParse.X2)) func() { if (*_ppStmt) != nil { @@ -37173,22 +39072,22 @@ _28: _41: if _zErrMsg != nil { _sqlite3ErrorWithMsg(tls, _db, _rc, str(24576), unsafe.Pointer(_zErrMsg)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg)) goto _43 } _sqlite3Error(tls, _db, _rc) _43: - if (*XTriggerPrg)(_sParse.X69) != nil { + if _sParse.X69 != nil { _21_pT = (*XTriggerPrg)(_sParse.X69) - *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X69))))) = (*XTriggerPrg)(_21_pT.X1) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_21_pT)) + *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sParse.X69)))) = (*XTriggerPrg)(_21_pT.X1) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_21_pT)) goto _43 } _end_prepare: _sqlite3ParserReset(tls, &_sParse) _rc = _sqlite3ApiExit(tls, _db, _rc) func() { - if (_rc & (_db.X11)) != _rc { + if (_rc & _db.X11) != _rc { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116326), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(134))) crt.X__builtin_abort(tls) } @@ -37205,9 +39104,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PrepareØ00__func__Ø000[0], str(50663), 15) } -// Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared -// btree as the argument handle holds an exclusive lock on the -// sqlite_master table. Otherwise SQLITE_OK. +// C comment +// /* +// ** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared +// ** btree as the argument handle holds an exclusive lock on the +// ** sqlite_master table. Otherwise SQLITE_OK. +// */ func _sqlite3BtreeSchemaLocked(tls *crt.TLS, _p *XBtree) (r0 int32) { var _rc int32 func() { @@ -37234,10 +39136,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSchemaLockedØ00__func__Ø000[0], str(50725), 25) } -// Query to see if Btree handle p may obtain a lock of type eLock -// (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return -// SQLITE_OK if the lock may be obtained (by calling -// setSharedCacheTableLock()), or SQLITE_LOCKED if not. +// C comment +// /* +// ** Query to see if Btree handle p may obtain a lock of type eLock +// ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return +// ** SQLITE_OK if the lock may be obtained (by calling +// ** setSharedCacheTableLock()), or SQLITE_LOCKED if not. +// */ func _querySharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTab uint32, _eLock uint8) (r0 int32) { var _pBt *XBtShared var _pIter *XBtLock @@ -37278,7 +39183,7 @@ func _querySharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTab uint32, _eLock u crt.X__builtin_abort(tls) } }() - if (_p.X3) == 0 { + if _p.X3 == 0 { return i32(0) } if ((*XBtree)(_pBt.X26) != _p) && ((int32(_pBt.X10) & i32(32)) != i32(0)) { @@ -37301,7 +39206,7 @@ _21: crt.X__builtin_abort(tls) } }() - if (*XBtree)(_pIter.X0) == _p || (_pIter.X1) != _iTab || int32(_pIter.X2) == int32(_eLock) { + if (*XBtree)(_pIter.X0) == _p || _pIter.X1 != _iTab || int32(_pIter.X2) == int32(_eLock) { goto _34 } if int32(_eLock) == i32(2) { @@ -37312,7 +39217,7 @@ _21: } }() { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(64)) sink14(*p) } @@ -37332,16 +39237,19 @@ func init() { crt.Xstrncpy(nil, &_querySharedCacheTableLockØ00__func__Ø000[0], str(51104), 26) } -// Check schema cookies in all databases. If any cookie is out -// of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies -// make no changes to pParse->rc. +// C comment +// /* +// ** Check schema cookies in all databases. If any cookie is out +// ** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies +// ** make no changes to pParse->rc. +// */ func _schemaIsValid(tls *crt.TLS, _pParse *XParse) { var _iDb, _rc, _cookie, _1_openedTransaction int32 var _db *Xsqlite3 var _1_pBt *XBtree _db = (*Xsqlite3)(_pParse.X0) func() { - if (_pParse.X5) == 0 { + if _pParse.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116091), unsafe.Pointer((*int8)(unsafe.Pointer(&_schemaIsValidØ00__func__Ø000))), unsafe.Pointer(str(51130))) crt.X__builtin_abort(tls) } @@ -37354,7 +39262,7 @@ func _schemaIsValid(tls *crt.TLS, _pParse *XParse) { }() _iDb = i32(0) _4: - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { goto _7 } _1_openedTransaction = i32(0) @@ -37383,7 +39291,7 @@ _9: }() if _cookie != ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4).X0) { _sqlite3ResetOneSchema(tls, _db, _iDb) - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(17) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(17) } if _1_openedTransaction != 0 { _sqlite3BtreeCommit(tls, _1_pBt) @@ -37400,7 +39308,10 @@ func init() { crt.Xstrncpy(nil, &_schemaIsValidØ00__func__Ø000[0], str(51185), 14) } -// Return non-zero if a read (or write) transaction is active. +// C comment +// /* +// ** Return non-zero if a read (or write) transaction is active. +// */ func _sqlite3BtreeIsInReadTrans(tls *crt.TLS, _p *XBtree) (r0 int32) { func() { if _p == nil { @@ -37423,39 +39334,42 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeIsInReadTransØ00__func__Ø000[0], str(51199), 26) } -// Attempt to start a new transaction. A write-transaction -// is started if the second argument is nonzero, otherwise a read- -// transaction. If the second argument is 2 or more and exclusive -// transaction is started, meaning that no other process is allowed -// to access the database. A preexisting transaction may not be -// upgraded to exclusive by calling this routine a second time - the -// exclusivity flag only works for a new transaction. -// -// A write-transaction must be started before attempting any -// changes to the database. None of the following routines -// will work unless a transaction is started first: -// -// sqlite3BtreeCreateTable() -// sqlite3BtreeCreateIndex() -// sqlite3BtreeClearTable() -// sqlite3BtreeDropTable() -// sqlite3BtreeInsert() -// sqlite3BtreeDelete() -// sqlite3BtreeUpdateMeta() -// -// If an initial attempt to acquire the lock fails because of lock contention -// and the database was previously unlocked, then invoke the busy handler -// if there is one. But if there was previously a read-lock, do not -// invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is -// returned when there is already a read-lock in order to avoid a deadlock. -// -// Suppose there are two processes A and B. A has a read lock and B has -// a reserved lock. B tries to promote to exclusive but is blocked because -// of A's read lock. A tries to promote to reserved but is blocked by B. -// One or the other of the two processes must give way or there can be -// no progress. By returning SQLITE_BUSY and not invoking the busy callback -// when A already has a read lock, we encourage A to give up and let B -// proceed. +// C comment +// /* +// ** Attempt to start a new transaction. A write-transaction +// ** is started if the second argument is nonzero, otherwise a read- +// ** transaction. If the second argument is 2 or more and exclusive +// ** transaction is started, meaning that no other process is allowed +// ** to access the database. A preexisting transaction may not be +// ** upgraded to exclusive by calling this routine a second time - the +// ** exclusivity flag only works for a new transaction. +// ** +// ** A write-transaction must be started before attempting any +// ** changes to the database. None of the following routines +// ** will work unless a transaction is started first: +// ** +// ** sqlite3BtreeCreateTable() +// ** sqlite3BtreeCreateIndex() +// ** sqlite3BtreeClearTable() +// ** sqlite3BtreeDropTable() +// ** sqlite3BtreeInsert() +// ** sqlite3BtreeDelete() +// ** sqlite3BtreeUpdateMeta() +// ** +// ** If an initial attempt to acquire the lock fails because of lock contention +// ** and the database was previously unlocked, then invoke the busy handler +// ** if there is one. But if there was previously a read-lock, do not +// ** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is +// ** returned when there is already a read-lock in order to avoid a deadlock. +// ** +// ** Suppose there are two processes A and B. A has a read lock and B has +// ** a reserved lock. B tries to promote to exclusive but is blocked because +// ** of A's read lock. A tries to promote to reserved but is blocked by B. +// ** One or the other of the two processes must give way or there can be +// ** no progress. By returning SQLITE_BUSY and not invoking the busy callback +// ** when A already has a read lock, we encourage A to give up and let B +// ** proceed. +// */ func _sqlite3BtreeBeginTrans(tls *crt.TLS, _p *XBtree, _wrflag int32) (r0 int32) { var _rc int32 var _3_pBlock *Xsqlite3 @@ -37520,13 +39434,13 @@ _17: goto _trans_begun } { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-9)) sink14(*p) } - if (_pBt.X18) == uint32(i32(0)) { + if _pBt.X18 == uint32(i32(0)) { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -37552,7 +39466,7 @@ _31: if _rc != i32(0) { _unlockBtreeIfUnused(tls, _pBt) } - if (((_rc & i32(255)) == i32(5)) && (int32(_pBt.X8) == i32(0))) && _btreeInvokeBusyHandler(tls, (unsafe.Pointer)(_pBt)) != 0 { + if (((_rc & i32(255)) == i32(5)) && (int32(_pBt.X8) == i32(0))) && _btreeInvokeBusyHandler(tls, unsafe.Pointer(_pBt)) != 0 { goto _25 } if _rc != i32(0) { @@ -37561,57 +39475,57 @@ _31: if int32(_p.X2) != i32(0) { goto _39 } - *(*int32)(unsafe.Pointer(&(_pBt.X17))) += 1 - if (_p.X3) != 0 { + *(*int32)(unsafe.Pointer(&_pBt.X17)) += 1 + if _p.X3 != 0 { func() { - if (*XBtree)((*XBtLock)(unsafe.Pointer(&(_p.X11))).X0) != _p || ((*XBtLock)(unsafe.Pointer(&(_p.X11))).X1) != uint32(i32(1)) { + if (*XBtree)((*XBtLock)(unsafe.Pointer(&_p.X11)).X0) != _p || ((*XBtLock)(unsafe.Pointer(&_p.X11)).X1) != uint32(i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62332), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(51293))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X2))) = uint8(i32(1)) - *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X3))))) = (*XBtLock)(_pBt.X25) - *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25))))) = (*XBtLock)(unsafe.Pointer(&(_p.X11))) + *(*uint8)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&_p.X11)).X2))) = uint8(i32(1)) + *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&_p.X11)).X3))))) = (*XBtLock)(_pBt.X25) + *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X25)))) = (*XBtLock)(unsafe.Pointer(&_p.X11)) } _39: - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(func() int32 { if _wrflag != 0 { return i32(2) } return i32(1) }()) if int32(_p.X2) > int32(_pBt.X8) { - *(*uint8)(unsafe.Pointer(&(_pBt.X8))) = _p.X2 + *(*uint8)(unsafe.Pointer(&_pBt.X8)) = _p.X2 } if _wrflag == 0 { goto _47 } _19_pPage1 = (*XMemPage)(_pBt.X3) func() { - if (*XBtree)(_pBt.X26) != nil { + if _pBt.X26 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62346), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(51332))) crt.X__builtin_abort(tls) } }() - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = _p + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X26)))) = _p { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-33)) sink14(*p) } if _wrflag > i32(1) { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(32)) sink14(*p) } } - if (_pBt.X18) == _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_19_pPage1.X19))+1*uintptr(i32(28))))) { + if _pBt.X18 == _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_19_pPage1.X19))+1*uintptr(i32(28))))) { goto _51 } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_19_pPage1.X23)) if _rc == i32(0) { - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_19_pPage1.X19))+1*uintptr(i32(28)))), _pBt.X18) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_19_pPage1.X19))+1*uintptr(i32(28)))), _pBt.X18) } _51: _47: @@ -37641,13 +39555,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeBeginTransØ00__func__Ø000[0], str(51346), 23) } -// Get a reference to pPage1 of the database file. This will -// also acquire a readlock on that file. -// -// SQLITE_OK is returned on success. If the file is not a -// well-formed database file, then SQLITE_CORRUPT is returned. -// SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM -// is returned if we run out of memory. +// C comment +// /* +// ** Get a reference to pPage1 of the database file. This will +// ** also acquire a readlock on that file. +// ** +// ** SQLITE_OK is returned on success. If the file is not a +// ** well-formed database file, then SQLITE_CORRUPT is returned. +// ** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM +// ** is returned if we run out of memory. +// */ func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { var _rc, _nPage, _nPageFile, _nPageHeader, _6_isOpen int32 var _2_pageSize, _2_usableSize uint32 @@ -37676,7 +39593,7 @@ func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { } _nPage = store1(&_nPageHeader, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(i32(28))+uintptr(unsafe.Pointer(_pPage1.X19))))))) _sqlite3PagerPagecount(tls, (*XPager)(_pBt.X0), &_nPageFile) - if (_nPage == i32(0)) || (crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(i32(24))+uintptr(unsafe.Pointer(_pPage1.X19))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(i32(92))+uintptr(unsafe.Pointer(_pPage1.X19))))), uint64(i32(4))) != i32(0)) { + if (_nPage == i32(0)) || (crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(24))+uintptr(unsafe.Pointer(_pPage1.X19))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(92))+uintptr(unsafe.Pointer(_pPage1.X19))))), uint64(i32(4))) != i32(0)) { _nPage = _nPageFile } if _nPage <= i32(0) { @@ -37684,20 +39601,20 @@ func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { } _2_page1 = _pPage1.X19 _rc = i32(26) - if crt.Xmemcmp(tls, (unsafe.Pointer)(_2_page1), (unsafe.Pointer)(&_zMagicHeader), uint64(i32(16))) != i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer(_2_page1), unsafe.Pointer(&_zMagicHeader), uint64(i32(16))) != i32(0) { goto _page1_init_failed } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(18))))) > i32(2) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(18))))) > i32(2) { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(19))))) > i32(2) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(19))))) > i32(2) { goto _page1_init_failed } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(19))))) != i32(2) || (int32(_pBt.X10)&i32(16)) != i32(0) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(19))))) != i32(2) || (int32(_pBt.X10)&i32(16)) != i32(0) { goto _13 } _6_isOpen = i32(0) @@ -37713,10 +39630,10 @@ func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { goto _17 _13: _17: - if crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(21))))), (unsafe.Pointer)(str(51384)), uint64(i32(3))) != i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1))+1*uintptr(i32(21))))), unsafe.Pointer(str(51384)), uint64(i32(3))) != i32(0) { goto _page1_init_failed } - _2_pageSize = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(17))))) << uint(i32(16)))) + _2_pageSize = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(17))))) << uint(i32(16)))) if ((((_2_pageSize - uint32(i32(1))) & _2_pageSize) != uint32(i32(0))) || (_2_pageSize > uint32(i32(65536)))) || (_2_pageSize <= uint32(i32(256))) { goto _page1_init_failed } @@ -37726,13 +39643,13 @@ _17: crt.X__builtin_abort(tls) } }() - _2_usableSize = _2_pageSize - uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(20))))) - if _2_pageSize != (_pBt.X15) { + _2_usableSize = _2_pageSize - uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1)) + 1*uintptr(i32(20))))) + if _2_pageSize != _pBt.X15 { _releasePage(tls, _pPage1) - *(*uint32)(unsafe.Pointer(&(_pBt.X16))) = _2_usableSize - *(*uint32)(unsafe.Pointer(&(_pBt.X15))) = _2_pageSize + *(*uint32)(unsafe.Pointer(&_pBt.X16)) = _2_usableSize + *(*uint32)(unsafe.Pointer(&_pBt.X15)) = _2_pageSize _freeTempSpace(tls, _pBt) - _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), int32(_2_pageSize-_2_usableSize)) + _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&_pBt.X15)), int32(_2_pageSize-_2_usableSize)) return _rc } if ((((*Xsqlite3)(_pBt.X1).X6) & i32(65536)) == i32(0)) && (_nPage > _nPageFile) { @@ -37742,44 +39659,44 @@ _17: if _2_usableSize < uint32(i32(480)) { goto _page1_init_failed } - *(*uint32)(unsafe.Pointer(&(_pBt.X15))) = _2_pageSize - *(*uint32)(unsafe.Pointer(&(_pBt.X16))) = _2_usableSize - *(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(52))))) != 0 { + *(*uint32)(unsafe.Pointer(&_pBt.X15)) = _2_pageSize + *(*uint32)(unsafe.Pointer(&_pBt.X16)) = _2_usableSize + *(*uint8)(unsafe.Pointer(&_pBt.X5)) = uint8(func() int32 { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1))+1*uintptr(i32(52))))) != 0 { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(64))))) != 0 { + *(*uint8)(unsafe.Pointer(&_pBt.X6)) = uint8(func() int32 { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_page1))+1*uintptr(i32(64))))) != 0 { return i32(1) } return i32(0) }()) _8: - *(*uint16)(unsafe.Pointer(&(_pBt.X11))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(64))) / uint32(i32(255))) - uint32(i32(23))) - *(*uint16)(unsafe.Pointer(&(_pBt.X12))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23))) - *(*uint16)(unsafe.Pointer(&(_pBt.X13))) = uint16((_pBt.X16) - uint32(i32(35))) - *(*uint16)(unsafe.Pointer(&(_pBt.X14))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23))) + *(*uint16)(unsafe.Pointer(&_pBt.X11)) = uint16((((_pBt.X16 - uint32(i32(12))) * uint32(i32(64))) / uint32(i32(255))) - uint32(i32(23))) + *(*uint16)(unsafe.Pointer(&_pBt.X12)) = uint16((((_pBt.X16 - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23))) + *(*uint16)(unsafe.Pointer(&_pBt.X13)) = uint16(_pBt.X16 - uint32(i32(35))) + *(*uint16)(unsafe.Pointer(&_pBt.X14)) = uint16((((_pBt.X16 - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23))) if int32(_pBt.X11) > i32(127) { - *(*uint8)(unsafe.Pointer(&(_pBt.X9))) = uint8(i32(127)) + *(*uint8)(unsafe.Pointer(&_pBt.X9)) = uint8(i32(127)) goto _33 } - *(*uint8)(unsafe.Pointer(&(_pBt.X9))) = uint8(_pBt.X11) + *(*uint8)(unsafe.Pointer(&_pBt.X9)) = uint8(_pBt.X11) _33: func() { - if (int32(_pBt.X13) + i32(23)) > int32((_pBt.X15)-uint32(i32(8))) { + if (int32(_pBt.X13) + i32(23)) > int32(_pBt.X15-uint32(i32(8))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62094), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeØ00__func__Ø000))), unsafe.Pointer(str(51406))) crt.X__builtin_abort(tls) } }() - *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = _pPage1 - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(_nPage) + *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X3)))) = _pPage1 + *(*uint32)(unsafe.Pointer(&_pBt.X18)) = uint32(_nPage) return i32(0) _page1_init_failed: _releasePage(tls, _pPage1) - *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil + *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X3)))) = nil return _rc _ = _nPageHeader @@ -37792,31 +39709,34 @@ func init() { crt.Xstrncpy(nil, &_lockBtreeØ00__func__Ø000[0], str(51445), 10) } -// This function is called to obtain a shared lock on the database file. -// It is illegal to call sqlite3PagerGet() until after this function -// has been successfully called. If a shared-lock is already held when -// this function is called, it is a no-op. -// -// The following operations are also performed by this function. -// -// 1) If the pager is currently in PAGER_OPEN state (no lock held -// on the database file), then an attempt is made to obtain a -// SHARED lock on the database file. Immediately after obtaining -// the SHARED lock, the file-system is checked for a hot-journal, -// which is played back if present. Following any hot-journal -// rollback, the contents of the cache are validated by checking -// the 'change-counter' field of the database file header and -// discarded if they are found to be invalid. -// -// 2) If the pager is running in exclusive-mode, and there are currently -// no outstanding references to any pages, and is in the error state, -// then an attempt is made to clear the error state by discarding -// the contents of the page cache and rolling back any open journal -// file. -// -// If everything is successful, SQLITE_OK is returned. If an IO error -// occurs while locking the database, checking for a hot-journal file or -// rolling back a journal file, the IO error code is returned. +// C comment +// /* +// ** This function is called to obtain a shared lock on the database file. +// ** It is illegal to call sqlite3PagerGet() until after this function +// ** has been successfully called. If a shared-lock is already held when +// ** this function is called, it is a no-op. +// ** +// ** The following operations are also performed by this function. +// ** +// ** 1) If the pager is currently in PAGER_OPEN state (no lock held +// ** on the database file), then an attempt is made to obtain a +// ** SHARED lock on the database file. Immediately after obtaining +// ** the SHARED lock, the file-system is checked for a hot-journal, +// ** which is played back if present. Following any hot-journal +// ** rollback, the contents of the cache are validated by checking +// ** the 'change-counter' field of the database file header and +// ** discarded if they are found to be invalid. +// ** +// ** 2) If the pager is running in exclusive-mode, and there are currently +// ** no outstanding references to any pages, and is in the error state, +// ** then an attempt is made to clear the error state by discarding +// ** the contents of the page cache and rolling back any open journal +// ** file. +// ** +// ** If everything is successful, SQLITE_OK is returned. If an IO error +// ** occurs while locking the database, checking for a hot-journal file or +// ** rolling back a journal file, the IO error code is returned. +// */ func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _1_bHotJournal, _8_bExists, _9_fout, _9_f int32 var _15_nPage uint32 @@ -37842,7 +39762,7 @@ func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { } }() func() { - if (_pPager.X26) != i32(0) { + if _pPager.X26 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52040), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11754))) crt.X__builtin_abort(tls) } @@ -37852,7 +39772,7 @@ func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { } _1_bHotJournal = i32(1) func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52045), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } @@ -37882,7 +39802,7 @@ func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { if _1_bHotJournal == 0 { goto _22 } - if (_pPager.X12) != 0 { + if _pPager.X12 != 0 { _rc = i32(776) goto _failed } @@ -37901,7 +39821,7 @@ func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { _9_fout = i32(0) _9_f = i32(2050) func() { - if (_pPager.X10) != 0 { + if _pPager.X10 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51663))) crt.X__builtin_abort(tls) } @@ -37930,12 +39850,12 @@ _25: }() _rc = _pagerSyncHotJournal(tls, _pPager) if _rc == i32(0) { - _rc = _pager_playback(tls, _pPager, bool2int((_pPager.X10) == 0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0)) + _rc = _pager_playback(tls, _pPager, bool2int(_pPager.X10 == 0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(0)) } goto _40 _35: - if (_pPager.X1) == 0 { + if _pPager.X1 == 0 { _pagerUnlockDb(tls, _pPager, i32(1)) } _40: @@ -37950,13 +39870,13 @@ _40: } }() func() { - if int32(_pPager.X15) != i32(1) && ((_pPager.X1) == 0 || int32(_pPager.X15) <= i32(1)) { + if int32(_pPager.X15) != i32(1) && (_pPager.X1 == 0 || int32(_pPager.X15) <= i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52161), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51708))) crt.X__builtin_abort(tls) } }() _22: - if (_pPager.X10) != 0 || (_pPager.X21) == 0 { + if _pPager.X10 != 0 || _pPager.X21 == 0 { goto _49 } _15_nPage = u32(0) @@ -37967,19 +39887,19 @@ _22: if _15_nPage <= uint32(i32(0)) { goto _51 } - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(&_15_dbFileVers), int32(u64(16)), int64(i32(24))) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), unsafe.Pointer(&_15_dbFileVers), int32(u64(16)), int64(i32(24))) if (_rc != i32(0)) && (_rc != i32(522)) { goto _failed } goto _54 _51: - crt.Xmemset(tls, (unsafe.Pointer)(&_15_dbFileVers), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(&_15_dbFileVers), i32(0), u64(16)) _54: - if crt.Xmemcmp(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)(&_15_dbFileVers), u64(16)) == i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer((*[16]int8)(unsafe.Pointer(&_pPager.X40))), unsafe.Pointer(&_15_dbFileVers), u64(16)) == i32(0) { goto _55 } _pager_reset(tls, _pPager) - if (_pPager.X20) != 0 { + if _pPager.X20 != 0 { _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil) } _55: @@ -38002,12 +39922,12 @@ _10: _rc = _pagerBeginReadTransaction(tls, _pPager) } if ((int32(_pPager.X10) == i32(0)) && (int32(_pPager.X14) == i32(0))) && (_rc == i32(0)) { - _rc = _pagerPagecount(tls, _pPager, (*uint32)(unsafe.Pointer(&(_pPager.X22)))) + _rc = _pagerPagecount(tls, _pPager, (*uint32)(unsafe.Pointer(&_pPager.X22))) } _failed: if _rc != i32(0) { func() { - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11747))) crt.X__builtin_abort(tls) } @@ -38021,8 +39941,8 @@ _failed: }() goto _71 } - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X21))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X21)) = uint8(i32(1)) _71: return _rc @@ -38036,18 +39956,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerSharedLockØ00__func__Ø000[0], str(51826), 23) } -// Try to obtain a lock of type locktype on the database file. If -// a similar or greater lock is already held, this function is a no-op -// (returning SQLITE_OK immediately). -// -// Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke -// the busy callback if the lock is currently not available. Repeat -// until the busy callback returns false or until the attempt to -// obtain the lock succeeds. -// -// Return SQLITE_OK on success and an error code if we cannot obtain -// the lock. If the lock is obtained successfully, set the Pager.state -// variable to locktype before returning. +// C comment +// /* +// ** Try to obtain a lock of type locktype on the database file. If +// ** a similar or greater lock is already held, this function is a no-op +// ** (returning SQLITE_OK immediately). +// ** +// ** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke +// ** the busy callback if the lock is currently not available. Repeat +// ** until the busy callback returns false or until the attempt to +// ** obtain the lock succeeds. +// ** +// ** Return SQLITE_OK on success and an error code if we cannot obtain +// ** the lock. If the lock is obtained successfully, set the Pager.state +// ** variable to locktype before returning. +// */ func _pager_wait_on_lock(tls *crt.TLS, _pPager *XPager, _locktype int32) (r0 int32) { var _rc int32 func() { @@ -38058,7 +39981,7 @@ func _pager_wait_on_lock(tls *crt.TLS, _pPager *XPager, _locktype int32) (r0 int }() _6: _rc = _pagerLockDb(tls, _pPager, _locktype) - if (_rc == i32(5)) && (_pPager.X53)(tls, _pPager.X54) != 0 { + if (_rc == i32(5)) && _pPager.X53(tls, _pPager.X54) != 0 { goto _6 } return _rc @@ -38070,14 +39993,17 @@ func init() { crt.Xstrncpy(nil, &_pager_wait_on_lockØ00__func__Ø000[0], str(51990), 19) } -// Lock the database file to level eLock, which must be either SHARED_LOCK, -// RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the -// Pager.eLock variable to the new locking state. -// -// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -// called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. -// See the comment above the #define of UNKNOWN_LOCK for an explanation -// of this. +// C comment +// /* +// ** Lock the database file to level eLock, which must be either SHARED_LOCK, +// ** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the +// ** Pager.eLock variable to the new locking state. +// ** +// ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +// ** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. +// ** See the comment above the #define of UNKNOWN_LOCK for an explanation +// ** of this. +// */ func _pagerLockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) { var _rc int32 _rc = i32(0) @@ -38091,13 +40017,13 @@ func _pagerLockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) { goto _5 } _rc = func() int32 { - if (_pPager.X11) != 0 { + if _pPager.X11 != 0 { return i32(0) } return _sqlite3OsLock(tls, (*Xsqlite3_file)(_pPager.X31), _eLock) }() if (_rc == i32(0)) && ((int32(_pPager.X15) != i32(5)) || (_eLock == i32(4))) { - *(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(_eLock) + *(*uint8)(unsafe.Pointer(&_pPager.X15)) = uint8(_eLock) } _5: return _rc @@ -38109,35 +40035,38 @@ func init() { crt.Xstrncpy(nil, &_pagerLockDbØ00__func__Ø000[0], str(52077), 12) } -// This function is called after transitioning from PAGER_UNLOCK to -// PAGER_SHARED state. It tests if there is a hot journal present in -// the file-system for the given pager. A hot journal is one that -// needs to be played back. According to this function, a hot-journal -// file exists if the following criteria are met: -// -// * The journal file exists in the file system, and -// * No process holds a RESERVED or greater lock on the database file, and -// * The database file itself is greater than 0 bytes in size, and -// * The first byte of the journal file exists and is not 0x00. -// -// If the current size of the database file is 0 but a journal file -// exists, that is probably an old journal left over from a prior -// database with the same name. In this case the journal file is -// just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK -// is returned. -// -// This routine does not check if there is a master journal filename -// at the end of the file. If there is, and that master journal file -// does not exist, then the journal file is not really hot. In this -// case this routine will return a false-positive. The pager_playback() -// routine will discover that the journal file is not really hot and -// will not roll it back. -// -// If a hot-journal file is found to exist, *pExists is set to 1 and -// SQLITE_OK returned. If no hot-journal file is present, *pExists is -// set to 0 and SQLITE_OK returned. If an IO error occurs while trying -// to determine whether or not a hot-journal file exists, the IO error -// code is returned and the value of *pExists is undefined. +// C comment +// /* +// ** This function is called after transitioning from PAGER_UNLOCK to +// ** PAGER_SHARED state. It tests if there is a hot journal present in +// ** the file-system for the given pager. A hot journal is one that +// ** needs to be played back. According to this function, a hot-journal +// ** file exists if the following criteria are met: +// ** +// ** * The journal file exists in the file system, and +// ** * No process holds a RESERVED or greater lock on the database file, and +// ** * The database file itself is greater than 0 bytes in size, and +// ** * The first byte of the journal file exists and is not 0x00. +// ** +// ** If the current size of the database file is 0 but a journal file +// ** exists, that is probably an old journal left over from a prior +// ** database with the same name. In this case the journal file is +// ** just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK +// ** is returned. +// ** +// ** This routine does not check if there is a master journal filename +// ** at the end of the file. If there is, and that master journal file +// ** does not exist, then the journal file is not really hot. In this +// ** case this routine will return a false-positive. The pager_playback() +// ** routine will discover that the journal file is not really hot and +// ** will not roll it back. +// ** +// ** If a hot-journal file is found to exist, *pExists is set to 1 and +// ** SQLITE_OK returned. If no hot-journal file is present, *pExists is +// ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying +// ** to determine whether or not a hot-journal file exists, the IO error +// ** code is returned and the value of *pExists is undefined. +// */ func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) { var _rc, _exists, _jrnlOpen, _2_locked, _8_f int32 var _3_nPage uint32 @@ -38148,7 +40077,7 @@ func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) { _exists = i32(1) _jrnlOpen = bool2int((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) func() { - if (_pPager.X3) == 0 { + if _pPager.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51916), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(12385))) crt.X__builtin_abort(tls) } @@ -38201,7 +40130,7 @@ func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) { goto _19 } _sqlite3OsDelete(tls, _pVfs, _pPager.X52, i32(0)) - if (_pPager.X1) == 0 { + if _pPager.X1 == 0 { _pagerUnlockDb(tls, _pPager, i32(1)) } _19: @@ -38216,7 +40145,7 @@ _18: goto _23 } _9_first = u8(0) - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_9_first), i32(1), int64(i32(0))) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_9_first), i32(1), int64(i32(0))) if _rc == i32(522) { _rc = i32(0) } @@ -38245,18 +40174,22 @@ func init() { } func _sqlite3OsCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) { - return (*(*func(*crt.TLS, *Xsqlite3_file, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{((*Xsqlite3_io_methods)(_id.X0).X9)})))(tls, _id, _pResOut) -} - -// This function is called as part of the transition from PAGER_OPEN -// to PAGER_READER state to determine the size of the database file -// in pages (assuming the page size currently stored in Pager.pageSize). -// -// If no error occurs, SQLITE_OK is returned and the size of the database -// in pages is stored in *pnPage. Otherwise, an error code (perhaps -// SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified. + return func() func(*crt.TLS, *Xsqlite3_file, *int32) int32 { + v := (*Xsqlite3_io_methods)(_id.X0).X9 + return *(*func(*crt.TLS, *Xsqlite3_file, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _id, _pResOut) +} + +// C comment +// /* +// ** This function is called as part of the transition from PAGER_OPEN +// ** to PAGER_READER state to determine the size of the database file +// ** in pages (assuming the page size currently stored in Pager.pageSize). +// ** +// ** If no error occurs, SQLITE_OK is returned and the size of the database +// ** in pages is stored in *pnPage. Otherwise, an error code (perhaps +// ** SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified. +// */ func _pagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *uint32) (r0 int32) { var _1_rc int32 var _1_n int64 @@ -38305,8 +40238,8 @@ func _pagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *uint32) (r0 int32) } _nPage = uint32(((_1_n + int64(_pPager.X48)) - int64(i32(1))) / int64(_pPager.X48)) _11: - if _nPage > (_pPager.X49) { - *(*uint32)(unsafe.Pointer(&(_pPager.X49))) = _nPage + if _nPage > _pPager.X49 { + *(*uint32)(unsafe.Pointer(&_pPager.X49)) = _nPage } *_pnPage = _nPage return i32(0) @@ -38318,7 +40251,10 @@ func init() { crt.Xstrncpy(nil, &_pagerPagecountØ00__func__Ø000[0], str(52230), 15) } -// Return the size of the database in pages (or zero, if unknown). +// C comment +// /* +// ** Return the size of the database in pages (or zero, if unknown). +// */ func _sqlite3WalDbsize(tls *crt.TLS, _pWal *XWal) (r0 uint32) { if (_pWal != nil) && func() int32 { if int32(_pWal.X9) >= i32(0) { @@ -38330,7 +40266,7 @@ func _sqlite3WalDbsize(tls *crt.TLS, _pWal *XWal) (r0 uint32) { return i32(0) }() }() != 0 { - return (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7 + return (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7 } return uint32(i32(0)) } @@ -38341,22 +40277,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalDbsizeØ00__func__Ø000[0], str(52245), 17) } -// Check if the *-wal file that corresponds to the database opened by pPager -// exists if the database is not empy, or verify that the *-wal file does -// not exist (by deleting it) if the database file is empty. -// -// If the database is not empty and the *-wal file exists, open the pager -// in WAL mode. If the database is empty or if no *-wal file exists and -// if no error occurs, make sure Pager.journalMode is not set to -// PAGER_JOURNALMODE_WAL. -// -// Return SQLITE_OK or an error code. -// -// The caller must hold a SHARED lock on the database file to call this -// function. Because an EXCLUSIVE lock on the db file is required to delete -// a WAL on a none-empty database, this ensures there is no race condition -// between the xAccess() below and an xDelete() being executed by some -// other connection. +// C comment +// /* +// ** Check if the *-wal file that corresponds to the database opened by pPager +// ** exists if the database is not empy, or verify that the *-wal file does +// ** not exist (by deleting it) if the database file is empty. +// ** +// ** If the database is not empty and the *-wal file exists, open the pager +// ** in WAL mode. If the database is empty or if no *-wal file exists and +// ** if no error occurs, make sure Pager.journalMode is not set to +// ** PAGER_JOURNALMODE_WAL. +// ** +// ** Return SQLITE_OK or an error code. +// ** +// ** The caller must hold a SHARED lock on the database file to call this +// ** function. Because an EXCLUSIVE lock on the db file is required to delete +// ** a WAL on a none-empty database, this ensures there is no race condition +// ** between the xAccess() below and an xDelete() being executed by some +// ** other connection. +// */ func _pagerOpenWalIfPresent(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _1_isWal int32 var _1_nPage uint32 @@ -38373,7 +40312,7 @@ func _pagerOpenWalIfPresent(tls *crt.TLS, _pPager *XPager) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pPager.X10) != 0 { + if _pPager.X10 != 0 { goto _4 } _rc = _pagerPagecount(tls, _pPager, &_1_nPage) @@ -38400,7 +40339,7 @@ _8: goto _12 } if int32(_pPager.X2) == i32(5) { - *(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X2)) = uint8(i32(0)) } _12: _9: @@ -38414,19 +40353,22 @@ func init() { crt.Xstrncpy(nil, &_pagerOpenWalIfPresentØ00__func__Ø000[0], str(52262), 22) } -// The caller must be holding a SHARED lock on the database file to call -// this function. -// -// If the pager passed as the first argument is open on a real database -// file (not a temp file or an in-memory database), and the WAL file -// is not already open, make an attempt to open it now. If successful, -// return SQLITE_OK. If an error occurs or the VFS used by the pager does -// not support the xShmXXX() methods, return an error code. *pbOpen is -// not modified in either case. -// -// If the pager is open on a temp-file (or in-memory database), or if -// the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK -// without doing anything. +// C comment +// /* +// ** The caller must be holding a SHARED lock on the database file to call +// ** this function. +// ** +// ** If the pager passed as the first argument is open on a real database +// ** file (not a temp file or an in-memory database), and the WAL file +// ** is not already open, make an attempt to open it now. If successful, +// ** return SQLITE_OK. If an error occurs or the VFS used by the pager does +// ** not support the xShmXXX() methods, return an error code. *pbOpen is +// ** not modified in either case. +// ** +// ** If the pager is open on a temp-file (or in-memory database), or if +// ** the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK +// ** without doing anything. +// */ func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int32) { var _rc int32 _rc = i32(0) @@ -38455,12 +40397,12 @@ func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int } }() func() { - if _pbOpen == nil && ((_pPager.X10) != 0 || (*XWal)(_pPager.X60) != nil) { + if _pbOpen == nil && (_pPager.X10 != 0 || _pPager.X60 != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54348), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52385))) crt.X__builtin_abort(tls) } }() - if (_pPager.X10) != 0 || (*XWal)(_pPager.X60) != nil { + if _pPager.X10 != 0 || _pPager.X60 != nil { goto _16 } if _sqlite3PagerWalSupported(tls, _pPager) == 0 { @@ -38469,8 +40411,8 @@ func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32)) _rc = _pagerOpenWal(tls, _pPager) if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(5)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X2)) = uint8(i32(5)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(0)) } goto _19 _16: @@ -38485,23 +40427,27 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerOpenWalØ00__func__Ø000[0], str(52435), 20) } -// Return true if the underlying VFS for the given pager supports the -// primitives necessary for write-ahead logging. +// C comment +// /* +// ** Return true if the underlying VFS for the given pager supports the +// ** primitives necessary for write-ahead logging. +// */ func _sqlite3PagerWalSupported(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _pMethods *Xsqlite3_io_methods _pMethods = (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) - if (_pPager.X11) != 0 { + if _pPager.X11 != 0 { return i32(0) } - return bool2int(((_pPager.X1) != 0) || (((_pMethods.X0) >= i32(2)) && ((*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32 - }{(_pMethods.X13)}))) != nil))) + return bool2int((_pPager.X1 != 0) || ((_pMethods.X0 >= i32(2)) && (_pMethods.X13 != nil))) } -// Call sqlite3WalOpen() to open the WAL handle. If the pager is in -// exclusive-locking mode when this function is called, take an EXCLUSIVE -// lock on the database file and use heap-memory to store the wal-index -// in. Otherwise, use the normal shared-memory. +// C comment +// /* +// ** Call sqlite3WalOpen() to open the WAL handle. If the pager is in +// ** exclusive-locking mode when this function is called, take an EXCLUSIVE +// ** lock on the database file and use heap-memory to store the wal-index +// ** in. Otherwise, use the normal shared-memory. +// */ func _pagerOpenWal(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 _rc = i32(0) @@ -38517,11 +40463,11 @@ func _pagerOpenWal(tls *crt.TLS, _pPager *XPager) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pPager.X1) != 0 { + if _pPager.X1 != 0 { _rc = _pagerExclusiveLock(tls, _pPager) } if _rc == i32(0) { - _rc = _sqlite3WalOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), (*Xsqlite3_file)(_pPager.X31), _pPager.X61, int32(_pPager.X1), _pPager.X50, (**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60)))))) + _rc = _sqlite3WalOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), (*Xsqlite3_file)(_pPager.X31), _pPager.X61, int32(_pPager.X1), _pPager.X50, (**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X60))))) } _pagerFixMaplimit(tls, _pPager) return _rc @@ -38533,8 +40479,11 @@ func init() { crt.Xstrncpy(nil, &_pagerOpenWalØ00__func__Ø000[0], str(52554), 13) } -// Attempt to take an exclusive lock on the database file. If a PENDING lock -// is obtained instead, immediately release it. +// C comment +// /* +// ** Attempt to take an exclusive lock on the database file. If a PENDING lock +// ** is obtained instead, immediately release it. +// */ func _pagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 func() { @@ -38556,24 +40505,27 @@ func init() { crt.Xstrncpy(nil, &_pagerExclusiveLockØ00__func__Ø000[0], str(52567), 19) } -// Open a connection to the WAL file zWalName. The database file must -// already be opened on connection pDbFd. The buffer that zWalName points -// to must remain valid for the lifetime of the returned Wal* handle. -// -// A SHARED lock should be held on the database file when this function -// is called. The purpose of this SHARED lock is to prevent any other -// client from unlinking the WAL or wal-index file. If another process -// were to do this just after this client opened one of these files, the -// system would be badly broken. -// -// If the log file is successfully opened, SQLITE_OK is returned and -// *ppWal is set to point to a new WAL handle. If an error occurs, -// an SQLite error code is returned and *ppWal is left unmodified. +// C comment +// /* +// ** Open a connection to the WAL file zWalName. The database file must +// ** already be opened on connection pDbFd. The buffer that zWalName points +// ** to must remain valid for the lifetime of the returned Wal* handle. +// ** +// ** A SHARED lock should be held on the database file when this function +// ** is called. The purpose of this SHARED lock is to prevent any other +// ** client from unlinking the WAL or wal-index file. If another process +// ** were to do this just after this client opened one of these files, the +// ** system would be badly broken. +// ** +// ** If the log file is successfully opened, SQLITE_OK is returned and +// ** *ppWal is set to point to a new WAL handle. If an error occurs, +// ** an SQLite error code is returned and *ppWal is left unmodified. +// */ func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _zWalName *int8, _bNoShm int32, _mxWalSize int64, _ppWal **XWal) (r0 int32) { var _rc, _flags, _4_iDC int32 var _pRet *XWal func() { - if _zWalName == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zWalName)) + 1*uintptr(i32(0))))) == 0 { + if _zWalName == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zWalName)) + 1*uintptr(i32(0))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55767), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000))), unsafe.Pointer(str(52586))) crt.X__builtin_abort(tls) } @@ -38592,15 +40544,15 @@ func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _ if _pRet == nil { return _sqlite3NomemError(tls, i32(55790)) } - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X0))))) = _pVfs - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X2))))) = (*Xsqlite3_file)(unsafe.Pointer((*XWal)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRet)) + 144*uintptr(i32(1)))))) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X1))))) = _pDbFd - *(*int16)(unsafe.Pointer(&(_pRet.X9))) = int16(i32(-1)) - *(*int64)(unsafe.Pointer(&(_pRet.X4))) = _mxWalSize - *(**int8)(unsafe.Pointer(&(_pRet.X21))) = _zWalName - *(*uint8)(unsafe.Pointer(&(_pRet.X16))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pRet.X17))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pRet.X11))) = uint8(func() int32 { + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X0)))) = _pVfs + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X2)))) = (*Xsqlite3_file)(unsafe.Pointer((*XWal)(unsafe.Pointer(uintptr(unsafe.Pointer(_pRet)) + 144*uintptr(i32(1)))))) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X1)))) = _pDbFd + *(*int16)(unsafe.Pointer(&_pRet.X9)) = int16(i32(-1)) + *(*int64)(unsafe.Pointer(&_pRet.X4)) = _mxWalSize + *(**int8)(unsafe.Pointer(&_pRet.X21)) = _zWalName + *(*uint8)(unsafe.Pointer(&_pRet.X16)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pRet.X17)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pRet.X11)) = uint8(func() int32 { if _bNoShm != 0 { return i32(2) } @@ -38609,20 +40561,20 @@ func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _ _flags = i32(524294) _rc = _sqlite3OsOpen(tls, _pVfs, _zWalName, (*Xsqlite3_file)(_pRet.X2), _flags, &_flags) if (_rc == i32(0)) && (_flags&i32(1)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pRet.X14))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pRet.X14)) = uint8(i32(1)) } if _rc != i32(0) { _walIndexClose(tls, _pRet, i32(0)) _sqlite3OsClose(tls, (*Xsqlite3_file)(_pRet.X2)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pRet)) + Xsqlite3_free(tls, unsafe.Pointer(_pRet)) goto _11 } _4_iDC = _sqlite3OsDeviceCharacteristics(tls, _pDbFd) if (_4_iDC & i32(1024)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pRet.X16))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pRet.X16)) = uint8(i32(0)) } if (_4_iDC & i32(4096)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pRet.X17))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pRet.X17)) = uint8(i32(0)) } *_ppWal = _pRet _11: @@ -38635,12 +40587,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalOpenØ00__func__Ø000[0], str(52616), 15) } -// Begin a read transaction on the WAL. -// -// This routine used to be called "pagerOpenSnapshot()" because it essentially -// makes a snapshot of the database at the current point in time and preserves -// that snapshot for use by the reader in spite of concurrently changes by -// other writers or checkpointers. +// C comment +// /* +// ** Begin a read transaction on the WAL. +// ** +// ** This routine used to be called "pagerOpenSnapshot()" because it essentially +// ** makes a snapshot of the database at the current point in time and preserves +// ** that snapshot for use by the reader in spite of concurrently changes by +// ** other writers or checkpointers. +// */ func _pagerBeginReadTransaction(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc, _changed int32 _changed = i32(0) @@ -38662,7 +40617,7 @@ func _pagerBeginReadTransaction(tls *crt.TLS, _pPager *XPager) (r0 int32) { goto _6 } _pager_reset(tls, _pPager) - if (_pPager.X20) != 0 { + if _pPager.X20 != 0 { _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil) } _6: @@ -38675,18 +40630,21 @@ func init() { crt.Xstrncpy(nil, &_pagerBeginReadTransactionØ00__func__Ø000[0], str(52631), 26) } -// Begin a read transaction on the database. -// -// This routine used to be called sqlite3OpenSnapshot() and with good reason: -// it takes a snapshot of the state of the WAL and wal-index for the current -// instant in time. The current thread will continue to use this snapshot. -// Other threads might append new content to the WAL and wal-index but -// that extra content is ignored by the current thread. -// -// If the database contents have changes since the previous read -// transaction, then *pChanged is set to 1 before returning. The -// Pager layer will use this to know that is cache is stale and -// needs to be flushed. +// C comment +// /* +// ** Begin a read transaction on the database. +// ** +// ** This routine used to be called sqlite3OpenSnapshot() and with good reason: +// ** it takes a snapshot of the state of the WAL and wal-index for the current +// ** instant in time. The current thread will continue to use this snapshot. +// ** Other threads might append new content to the WAL and wal-index but +// ** that extra content is ignored by the current thread. +// ** +// ** If the database contents have changes since the previous read +// ** transaction, then *pChanged is set to 1 before returning. The +// ** Pager layer will use this to know that is cache is stale and +// ** needs to be flushed. +// */ func _sqlite3WalBeginReadTransaction(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) { var _rc, _cnt int32 _cnt = i32(0) @@ -38701,54 +40659,57 @@ _0: panic(0) } -// Attempt to start a read transaction. This might fail due to a race or -// other transient condition. When that happens, it returns WAL_RETRY to -// indicate to the caller that it is safe to retry immediately. -// -// On success return SQLITE_OK. On a permanent failure (such an -// I/O error or an SQLITE_BUSY because another process is running -// recovery) return a positive error code. -// -// The useWal parameter is true to force the use of the WAL and disable -// the case where the WAL is bypassed because it has been completely -// checkpointed. If useWal==0 then this routine calls walIndexReadHdr() -// to make a copy of the wal-index header into pWal->hdr. If the -// wal-index header has changed, *pChanged is set to 1 (as an indication -// to the caller that the local paget cache is obsolete and needs to be -// flushed.) When useWal==1, the wal-index header is assumed to already -// be loaded and the pChanged parameter is unused. -// -// The caller must set the cnt parameter to the number of prior calls to -// this routine during the current read attempt that returned WAL_RETRY. -// This routine will start taking more aggressive measures to clear the -// race conditions after multiple WAL_RETRY returns, and after an excessive -// number of errors will ultimately return SQLITE_PROTOCOL. The -// SQLITE_PROTOCOL return indicates that some other process has gone rogue -// and is not honoring the locking protocol. There is a vanishingly small -// chance that SQLITE_PROTOCOL could be returned because of a run of really -// bad luck when there is lots of contention for the wal-index, but that -// possibility is so small that it can be safely neglected, we believe. -// -// On success, this routine obtains a read lock on -// WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is -// in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1) -// that means the Wal does not hold any read lock. The reader must not -// access any database page that is modified by a WAL frame up to and -// including frame number aReadMark[pWal->readLock]. The reader will -// use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0 -// Or if pWal->readLock==0, then the reader will ignore the WAL -// completely and get all content directly from the database file. -// If the useWal parameter is 1 then the WAL will never be ignored and -// this routine will always set pWal->readLock>0 on success. -// When the read transaction is completed, the caller must release the -// lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1. -// -// This routine uses the nBackfill and aReadMark[] fields of the header -// to select a particular WAL_READ_LOCK() that strives to let the -// checkpoint process do as much work as possible. This routine might -// update values of the aReadMark[] array in the header, but if it does -// so it takes care to hold an exclusive lock on the corresponding -// WAL_READ_LOCK() while changing values. +// C comment +// /* +// ** Attempt to start a read transaction. This might fail due to a race or +// ** other transient condition. When that happens, it returns WAL_RETRY to +// ** indicate to the caller that it is safe to retry immediately. +// ** +// ** On success return SQLITE_OK. On a permanent failure (such an +// ** I/O error or an SQLITE_BUSY because another process is running +// ** recovery) return a positive error code. +// ** +// ** The useWal parameter is true to force the use of the WAL and disable +// ** the case where the WAL is bypassed because it has been completely +// ** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() +// ** to make a copy of the wal-index header into pWal->hdr. If the +// ** wal-index header has changed, *pChanged is set to 1 (as an indication +// ** to the caller that the local paget cache is obsolete and needs to be +// ** flushed.) When useWal==1, the wal-index header is assumed to already +// ** be loaded and the pChanged parameter is unused. +// ** +// ** The caller must set the cnt parameter to the number of prior calls to +// ** this routine during the current read attempt that returned WAL_RETRY. +// ** This routine will start taking more aggressive measures to clear the +// ** race conditions after multiple WAL_RETRY returns, and after an excessive +// ** number of errors will ultimately return SQLITE_PROTOCOL. The +// ** SQLITE_PROTOCOL return indicates that some other process has gone rogue +// ** and is not honoring the locking protocol. There is a vanishingly small +// ** chance that SQLITE_PROTOCOL could be returned because of a run of really +// ** bad luck when there is lots of contention for the wal-index, but that +// ** possibility is so small that it can be safely neglected, we believe. +// ** +// ** On success, this routine obtains a read lock on +// ** WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is +// ** in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1) +// ** that means the Wal does not hold any read lock. The reader must not +// ** access any database page that is modified by a WAL frame up to and +// ** including frame number aReadMark[pWal->readLock]. The reader will +// ** use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0 +// ** Or if pWal->readLock==0, then the reader will ignore the WAL +// ** completely and get all content directly from the database file. +// ** If the useWal parameter is 1 then the WAL will never be ignored and +// ** this routine will always set pWal->readLock>0 on success. +// ** When the read transaction is completed, the caller must release the +// ** lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1. +// ** +// ** This routine uses the nBackfill and aReadMark[] fields of the header +// ** to select a particular WAL_READ_LOCK() that strives to let the +// ** checkpoint process do as much work as possible. This routine might +// ** update values of the aReadMark[] array in the header, but if it does +// ** so it takes care to hold an exclusive lock on the corresponding +// ** WAL_READ_LOCK() while changing values. +// */ func _walTryBeginRead(tls *crt.TLS, _pWal *XWal, _pChanged *int32, _useWal int32, _cnt int32) (r0 int32) { var _mxI, _i, _rc, _1_nDelay int32 var _mxReadMark, _mxFrame, _13_thisMark uint32 @@ -38765,7 +40726,7 @@ func _walTryBeginRead(tls *crt.TLS, _pWal *XWal, _pChanged *int32, _useWal int32 } _1_nDelay = i32(1) if _cnt > i32(100) { - *(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWal.X23)) = uint8(i32(1)) return i32(15) } if _cnt >= i32(10) { @@ -38780,7 +40741,7 @@ _2: if _rc != i32(5) { goto _6 } - if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { + if (*(**uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pWal.X7)) + 8*uintptr(i32(0))))) == nil { _rc = i32(-1) goto _11 } @@ -38799,7 +40760,7 @@ _6: } _5: _pInfo = _walCkptInfo(tls, _pWal) - if _useWal != 0 || (_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _useWal != 0 || _pInfo.X0 != ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { goto _14 } _rc = _walLockShared(tls, _pWal, i32(3)) @@ -38807,11 +40768,11 @@ _5: if _rc != i32(0) { goto _15 } - if crt.Xmemcmp(tls, (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u64(48)) != 0 { + if crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), u64(48)) != 0 { _walUnlockShared(tls, _pWal, i32(3)) return i32(-1) } - *(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_pWal.X9)) = int16(i32(0)) return i32(0) _15: @@ -38821,13 +40782,13 @@ _15: _14: _mxReadMark = uint32(i32(0)) _mxI = i32(0) - _mxFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + _mxFrame = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 _i = i32(1) _19: if _i >= i32(5) { goto _22 } - _13_thisMark = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) + _13_thisMark = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(_i))) if (_mxReadMark <= _13_thisMark) && (_13_thisMark <= _mxFrame) { func() { if _13_thisMark == u32(4294967295) { @@ -38851,7 +40812,7 @@ _30: } _rc = _walLockExclusive(tls, _pWal, i32(3)+_i, i32(1)) if _rc == i32(0) { - _mxReadMark = store5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1)))))+4*uintptr(_i))), _mxFrame) + _mxReadMark = store5((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1))))+4*uintptr(_i))), _mxFrame) _mxI = _i _walUnlockExclusive(tls, _pWal, i32(3)+_i, i32(1)) goto _33 @@ -38886,19 +40847,19 @@ _29: return _rc }() } - *(*uint32)(unsafe.Pointer(&(_pWal.X19))) = (_pInfo.X0) + uint32(i32(1)) + *(*uint32)(unsafe.Pointer(&_pWal.X19)) = _pInfo.X0 + uint32(i32(1)) _walShmBarrier(tls, _pWal) - if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_mxI)))) != _mxReadMark) || crt.Xmemcmp(tls, (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u64(48)) != 0 { + if ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pInfo.X1)))) + 4*uintptr(_mxI)))) != _mxReadMark) || crt.Xmemcmp(tls, unsafe.Pointer(_walIndexHdr(tls, _pWal)), unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), u64(48)) != 0 { _walUnlockShared(tls, _pWal, i32(3)+_mxI) return i32(-1) } func() { - if _mxReadMark > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _mxReadMark > ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56852), unsafe.Pointer((*int8)(unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000))), unsafe.Pointer(str(52758))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(_mxI) + *(*int16)(unsafe.Pointer(&_pWal.X9)) = int16(_mxI) return _rc } @@ -38914,25 +40875,28 @@ func init() { crt.Xstrncpy(nil, &_zMagicHeader[0], str(52804), 16) } -// Begin a write-transaction on the specified pager object. If a -// write-transaction has already been opened, this function is a no-op. -// -// If the exFlag argument is false, then acquire at least a RESERVED -// lock on the database file. If exFlag is true, then acquire at least -// an EXCLUSIVE lock. If such a lock is already held, no locking -// functions need be called. -// -// If the subjInMemory argument is non-zero, then any sub-journal opened -// within this transaction will be opened as an in-memory file. This -// has no effect if the sub-journal is already opened (as it may be when -// running in exclusive mode) or if the transaction does not require a -// sub-journal. If the subjInMemory argument is zero, then any required -// sub-journal is implemented in-memory if pPager is an in-memory database, -// or using a temporary file otherwise. +// C comment +// /* +// ** Begin a write-transaction on the specified pager object. If a +// ** write-transaction has already been opened, this function is a no-op. +// ** +// ** If the exFlag argument is false, then acquire at least a RESERVED +// ** lock on the database file. If exFlag is true, then acquire at least +// ** an EXCLUSIVE lock. If such a lock is already held, no locking +// ** functions need be called. +// ** +// ** If the subjInMemory argument is non-zero, then any sub-journal opened +// ** within this transaction will be opened as an in-memory file. This +// ** has no effect if the sub-journal is already opened (as it may be when +// ** running in exclusive mode) or if the transaction does not require a +// ** sub-journal. If the subjInMemory argument is zero, then any required +// ** sub-journal is implemented in-memory if pPager is an in-memory database, +// ** or using a temporary file otherwise. +// */ func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMemory int32) (r0 int32) { var _rc int32 _rc = i32(0) - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return _pPager.X26 } func() { @@ -38941,7 +40905,7 @@ func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMem crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X19))) = uint8(_subjInMemory) + *(*uint8)(unsafe.Pointer(&_pPager.X19)) = uint8(_subjInMemory) if func() int32 { if int32(_pPager.X14) == i32(1) { return i32(1) @@ -38963,7 +40927,7 @@ func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMem if (*XWal)(_pPager.X60) == nil { goto _9 } - if (_pPager.X1) == 0 || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(-1)) == 0 { + if _pPager.X1 == 0 || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(-1)) == 0 { goto _11 } _rc = _pagerLockDb(tls, _pPager, i32(4)) @@ -38981,11 +40945,11 @@ _9: } _13: if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(2)) - *(*uint32)(unsafe.Pointer(&(_pPager.X25))) = _pPager.X22 - *(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _pPager.X22 - *(*uint32)(unsafe.Pointer(&(_pPager.X23))) = _pPager.X22 - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(2)) + *(*uint32)(unsafe.Pointer(&_pPager.X25)) = _pPager.X22 + *(*uint32)(unsafe.Pointer(&_pPager.X24)) = _pPager.X22 + *(*uint32)(unsafe.Pointer(&_pPager.X23)) = _pPager.X22 + *(*int64)(unsafe.Pointer(&_pPager.X34)) = int64(i32(0)) } func() { if _rc != i32(0) && int32(_pPager.X14) != i32(1) { @@ -39015,17 +40979,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerBeginØ00__func__Ø000[0], str(52978), 18) } -// This function starts a write transaction on the WAL. -// -// A read transaction must have already been started by a prior call -// to sqlite3WalBeginReadTransaction(). -// -// If another thread or process has written into the database since -// the read transaction was started, then it is not possible for this -// thread to write as doing so would cause a fork. So this routine -// returns SQLITE_BUSY in that case and no write transaction is started. -// -// There can only be a single writer active at a time. +// C comment +// /* +// ** This function starts a write transaction on the WAL. +// ** +// ** A read transaction must have already been started by a prior call +// ** to sqlite3WalBeginReadTransaction(). +// ** +// ** If another thread or process has written into the database since +// ** the read transaction was started, then it is not possible for this +// ** thread to write as doing so would cause a fork. So this routine +// ** returns SQLITE_BUSY in that case and no write transaction is started. +// ** +// ** There can only be a single writer active at a time. +// */ func _sqlite3WalBeginWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) { var _rc int32 func() { @@ -39035,22 +41002,22 @@ func _sqlite3WalBeginWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) { } }() func() { - if int32(_pWal.X12) != i32(0) || (_pWal.X20) != uint32(i32(0)) { + if int32(_pWal.X12) != i32(0) || _pWal.X20 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57205), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000))), unsafe.Pointer(str(52996))) crt.X__builtin_abort(tls) } }() - if (_pWal.X14) != 0 { + if _pWal.X14 != 0 { return i32(8) } _rc = _walLockExclusive(tls, _pWal, i32(0), i32(1)) if _rc != 0 { return _rc } - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1)) - if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), u64(48)) != i32(0) { + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(1)) + if crt.Xmemcmp(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), unsafe.Pointer(_walIndexHdr(tls, _pWal)), u64(48)) != i32(0) { _walUnlockExclusive(tls, _pWal, i32(0), i32(1)) - *(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X12)) = uint8(i32(0)) _rc = i32(517) } return _rc @@ -39062,30 +41029,36 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalBeginWriteTransactionØ00__func__Ø000[0], str(53036), 32) } -// This function returns true if main-memory should be used instead of -// a temporary file for transient pager files and statement journals. -// The value returned depends on the value of db->temp_store (runtime -// parameter) and the compile time value of SQLITE_TEMP_STORE. The -// following table describes the relationship between these two values -// and this functions return value. -// -// SQLITE_TEMP_STORE db->temp_store Location of temporary database -// ----------------- -------------- ------------------------------ -// 0 any file (return 0) -// 1 1 file (return 0) -// 1 2 memory (return 1) -// 1 0 file (return 0) -// 2 1 file (return 0) -// 2 2 memory (return 1) -// 2 0 memory (return 1) -// 3 any memory (return 1) +// C comment +// /* +// ** This function returns true if main-memory should be used instead of +// ** a temporary file for transient pager files and statement journals. +// ** The value returned depends on the value of db->temp_store (runtime +// ** parameter) and the compile time value of SQLITE_TEMP_STORE. The +// ** following table describes the relationship between these two values +// ** and this functions return value. +// ** +// ** SQLITE_TEMP_STORE db->temp_store Location of temporary database +// ** ----------------- -------------- ------------------------------ +// ** 0 any file (return 0) +// ** 1 1 file (return 0) +// ** 1 2 memory (return 1) +// ** 1 0 file (return 0) +// ** 2 1 file (return 0) +// ** 2 2 memory (return 1) +// ** 2 0 memory (return 1) +// ** 3 any memory (return 1) +// */ func _sqlite3TempInMemory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return bool2int(int32(_db.X16) == i32(2)) } -// If pBt points to an empty file then convert that empty file -// into a new empty database by initializing the first page of -// the database. +// C comment +// /* +// ** If pBt points to an empty file then convert that empty file +// ** into a new empty database by initializing the first page of +// ** the database. +// */ func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { var _rc int32 var _data *uint8 @@ -39096,7 +41069,7 @@ func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pBt.X18) > uint32(i32(0)) { + if _pBt.X18 > uint32(i32(0)) { return i32(0) } _pP1 = (*XMemPage)(_pBt.X3) @@ -39111,26 +41084,26 @@ func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { if _rc != 0 { return _rc } - crt.Xmemcpy(tls, (unsafe.Pointer)(_data), (unsafe.Pointer)(&_zMagicHeader), u64(16)) + crt.Xmemcpy(tls, unsafe.Pointer(_data), unsafe.Pointer(&_zMagicHeader), u64(16)) i32(0) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(16)))) = uint8(((_pBt.X15) >> uint(i32(8))) & uint32(i32(255))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(17)))) = uint8(((_pBt.X15) >> uint(i32(16))) & uint32(i32(255))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(18)))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(19)))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(16)))) = uint8((_pBt.X15 >> uint(i32(8))) & uint32(i32(255))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(17)))) = uint8((_pBt.X15 >> uint(i32(16))) & uint32(i32(255))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(18)))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(19)))) = uint8(i32(1)) func() { - if (_pBt.X16) > (_pBt.X15) || ((_pBt.X16)+uint32(i32(255))) < (_pBt.X15) { + if _pBt.X16 > _pBt.X15 || (_pBt.X16+uint32(i32(255))) < _pBt.X15 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62174), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(53075))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(20)))) = uint8((_pBt.X15) - (_pBt.X16)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(21)))) = uint8(i32(64)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(22)))) = uint8(i32(32)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(23)))) = uint8(i32(32)) - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(24))))), i32(0), uint64(i32(76))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(20)))) = uint8(_pBt.X15 - _pBt.X16) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(21)))) = uint8(i32(64)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(22)))) = uint8(i32(32)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(23)))) = uint8(i32(32)) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(i32(24))))), i32(0), uint64(i32(76))) _zeroPage(tls, _pP1, i32(13)) { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(2)) sink14(*p) } @@ -39146,10 +41119,10 @@ func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { crt.X__builtin_abort(tls) } }() - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(52)))), uint32(_pBt.X5)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(64)))), uint32(_pBt.X6)) - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(i32(1)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(31)))) = uint8(i32(1)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(i32(52)))), uint32(_pBt.X5)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(i32(64)))), uint32(_pBt.X6)) + *(*uint32)(unsafe.Pointer(&_pBt.X18)) = uint32(i32(1)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(i32(31)))) = uint8(i32(1)) return i32(0) } @@ -39159,8 +41132,11 @@ func init() { crt.Xstrncpy(nil, &_newDatabaseØ00__func__Ø000[0], str(53226), 12) } -// Set up a raw page so that it looks like a database page holding -// no entries. +// C comment +// /* +// ** Set up a raw page so that it looks like a database page holding +// ** no entries. +// */ func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) { var _first uint16 var _hdr uint8 @@ -39170,19 +41146,19 @@ func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) { _pBt = (*XBtShared)(_pPage.X18) _hdr = _pPage.X6 func() { - if _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.X23)) != (_pPage.X4) { + if _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.X23)) != _pPage.X4 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60959), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53238))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage) { + if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != unsafe.Pointer(_pPage) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60960), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(20336))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_data) { + if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != unsafe.Pointer(_data) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60961), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53290))) crt.X__builtin_abort(tls) } @@ -39200,40 +41176,43 @@ func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) { } }() if (int32(_pBt.X10) & i32(4)) != 0 { - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr)))), i32(0), uint64((_pBt.X16)-uint32(_hdr))) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr)))), i32(0), uint64(_pBt.X16-uint32(_hdr))) } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr))) = uint8(int8(_flags)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr))) = uint8(int8(_flags)) _first = uint16(int32(_hdr) + func() int32 { if (_flags & i32(8)) == i32(0) { return i32(12) } return i32(8) }()) - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(1))))), i32(0), uint64(i32(4))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7)))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8((_pBt.X16) >> uint(i32(8))) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(1))))), i32(0), uint64(i32(4))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(int32(_hdr)+i32(7)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_pBt.X16 >> uint(i32(8))) return _data }()))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_pBt.X16) - *(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16((_pBt.X16) - uint32(_first)) + *(*uint16)(unsafe.Pointer(&_pPage.X13)) = uint16(_pBt.X16 - uint32(_first)) _decodeFlags(tls, _pPage, _flags) - *(*uint16)(unsafe.Pointer(&(_pPage.X12))) = _first - *(**uint8)(unsafe.Pointer(&(_pPage.X20))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pBt.X16))) - *(**uint8)(unsafe.Pointer(&(_pPage.X21))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_first))) - *(**uint8)(unsafe.Pointer(&(_pPage.X22))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pPage.X7))) - *(*uint8)(unsafe.Pointer(&(_pPage.X9))) = uint8(i32(0)) + *(*uint16)(unsafe.Pointer(&_pPage.X12)) = _first + *(**uint8)(unsafe.Pointer(&_pPage.X20)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_pBt.X16))) + *(**uint8)(unsafe.Pointer(&_pPage.X21)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_first))) + *(**uint8)(unsafe.Pointer(&_pPage.X22)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_pPage.X7))) + *(*uint8)(unsafe.Pointer(&_pPage.X9)) = uint8(i32(0)) func() { - if (_pBt.X15) < uint32(i32(512)) || (_pBt.X15) > uint32(i32(65536)) { + if _pBt.X15 < uint32(i32(512)) || _pBt.X15 > uint32(i32(65536)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60979), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53374))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pPage.X15))) = uint16((_pBt.X15) - uint32(i32(1))) - *(*uint16)(unsafe.Pointer(&(_pPage.X14))) = uint16(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(1)) + *(*uint16)(unsafe.Pointer(&_pPage.X15)) = uint16(_pBt.X15 - uint32(i32(1))) + *(*uint16)(unsafe.Pointer(&_pPage.X14)) = uint16(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = uint8(i32(1)) } -// Return the page number for page pPg. +// C comment +// /* +// ** Return the page number for page pPg. +// */ func _sqlite3PagerPagenumber(tls *crt.TLS, _pPg *XPgHdr) (r0 uint32) { return _pPg.X5 } @@ -39248,21 +41227,24 @@ func _sqlite3PagerIswriteable(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) { return int32(_pPg.X6) & i32(4) } -// Decode the flags byte (the first byte of the header) for a page -// and initialize fields of the MemPage structure accordingly. -// -// Only the following combinations are supported. Anything different -// indicates a corrupt database files: -// -// PTF_ZERODATA -// PTF_ZERODATA | PTF_LEAF -// PTF_LEAFDATA | PTF_INTKEY -// PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF +// C comment +// /* +// ** Decode the flags byte (the first byte of the header) for a page +// ** and initialize fields of the MemPage structure accordingly. +// ** +// ** Only the following combinations are supported. Anything different +// ** indicates a corrupt database files: +// ** +// ** PTF_ZERODATA +// ** PTF_ZERODATA | PTF_LEAF +// ** PTF_LEAFDATA | PTF_INTKEY +// ** PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF +// */ func _decodeFlags(tls *crt.TLS, _pPage *XMemPage, _flagByte int32) (r0 int32) { var _pBt *XBtShared func() { if int32(_pPage.X6) != func() int32 { - if (_pPage.X4) == uint32(i32(1)) { + if _pPage.X4 == uint32(i32(1)) { return i32(100) } return i32(0) @@ -39277,49 +41259,49 @@ func _decodeFlags(tls *crt.TLS, _pPage *XMemPage, _flagByte int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPage.X5))) = uint8(_flagByte >> uint(i32(3))) + *(*uint8)(unsafe.Pointer(&_pPage.X5)) = uint8(_flagByte >> uint(i32(3))) i32(0) { p := &_flagByte *p = (*p) & i32(-9) sink1(*p) } - *(*uint8)(unsafe.Pointer(&(_pPage.X7))) = uint8(i32(4) - (i32(4) * int32(_pPage.X5))) - *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&(_pPage.X24))))) = _cellSizePtr + *(*uint8)(unsafe.Pointer(&_pPage.X7)) = uint8(i32(4) - (i32(4) * int32(_pPage.X5))) + *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&_pPage.X24)))) = _cellSizePtr _pBt = (*XBtShared)(_pPage.X18) if _flagByte != i32(5) { goto _6 } i32(0) i32(0) - *(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1)) - if (_pPage.X5) != 0 { - *(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(1)) - *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtr + *(*uint8)(unsafe.Pointer(&_pPage.X2)) = uint8(i32(1)) + if _pPage.X5 != 0 { + *(*uint8)(unsafe.Pointer(&_pPage.X3)) = uint8(i32(1)) + *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&_pPage.X25)))) = _btreeParseCellPtr goto _8 } - *(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(0)) - *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&(_pPage.X24))))) = _cellSizePtrNoPayload - *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtrNoPayload + *(*uint8)(unsafe.Pointer(&_pPage.X3)) = uint8(i32(0)) + *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&_pPage.X24)))) = _cellSizePtrNoPayload + *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&_pPage.X25)))) = _btreeParseCellPtrNoPayload _8: - *(*uint16)(unsafe.Pointer(&(_pPage.X10))) = _pBt.X13 - *(*uint16)(unsafe.Pointer(&(_pPage.X11))) = _pBt.X14 + *(*uint16)(unsafe.Pointer(&_pPage.X10)) = _pBt.X13 + *(*uint16)(unsafe.Pointer(&_pPage.X11)) = _pBt.X14 goto _11 _6: if _flagByte == i32(2) { i32(0) i32(0) - *(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(0)) - *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtrIndex - *(*uint16)(unsafe.Pointer(&(_pPage.X10))) = _pBt.X11 - *(*uint16)(unsafe.Pointer(&(_pPage.X11))) = _pBt.X12 + *(*uint8)(unsafe.Pointer(&_pPage.X2)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X3)) = uint8(i32(0)) + *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&_pPage.X25)))) = _btreeParseCellPtrIndex + *(*uint16)(unsafe.Pointer(&_pPage.X10)) = _pBt.X11 + *(*uint16)(unsafe.Pointer(&_pPage.X11)) = _pBt.X12 goto _11 } return _sqlite3CorruptError(tls, i32(60802)) _11: - *(*uint8)(unsafe.Pointer(&(_pPage.X8))) = _pBt.X9 + *(*uint8)(unsafe.Pointer(&_pPage.X8)) = _pBt.X9 return i32(0) } @@ -39329,30 +41311,34 @@ func init() { crt.Xstrncpy(nil, &_decodeFlagsØ00__func__Ø000[0], str(53471), 12) } -// The following routines are implementations of the MemPage.xCellSize -// method. -// -// Compute the total number of bytes that a Cell needs in the cell -// data area of the btree-page. The return number includes the cell -// data header and the local payload, but not any overflow page or -// the space used by the cell pointer. -// -// cellSizePtrNoPayload() => table internal nodes -// cellSizePtr() => all index nodes & table leaf nodes +// C comment +// /* +// ** The following routines are implementations of the MemPage.xCellSize +// ** method. +// ** +// ** Compute the total number of bytes that a Cell needs in the cell +// ** data area of the btree-page. The return number includes the cell +// ** data header and the local payload, but not any overflow page or +// ** the space used by the cell pointer. +// ** +// ** cellSizePtrNoPayload() => table internal nodes +// ** cellSizePtr() => all index nodes & table leaf nodes +// */ func _cellSizePtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) { var _5_minLocal int32 var _nSize uint32 var _pIter, _pEnd *uint8 var _debuginfo XCellInfo _pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(_pPage.X7))) - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, &_debuginfo) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, &_debuginfo) _nSize = uint32(*_pIter) if _nSize < uint32(i32(128)) { goto _0 } - _pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8)))) + _pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + 1*uintptr(i32(8)))) { p := &_nSize *p = (*p) & uint32(i32(127)) @@ -39365,10 +41351,10 @@ _1: } _0: *(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1) - if (_pPage.X2) == 0 { + if _pPage.X2 == 0 { goto _3 } - _pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(9)))) + _pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + 1*uintptr(i32(9)))) _4: if (int32(*postInc13(&_pIter, 1))&i32(128)) != 0 && (crt.P2U(unsafe.Pointer(_pIter)) < crt.P2U(unsafe.Pointer(_pEnd))) { goto _4 @@ -39399,7 +41385,7 @@ _7: } _9: func() { - if _nSize != uint32(_debuginfo.X4) && (_sqlite3Config.X6) != i32(0) { + if _nSize != uint32(_debuginfo.X4) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60301), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrØ00__func__Ø000))), unsafe.Pointer(str(53483))) crt.X__builtin_abort(tls) } @@ -39433,7 +41419,7 @@ func _btreeParseCellPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *X } }() func() { - if (_pPage.X3) == 0 { + if _pPage.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60142), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000))), unsafe.Pointer(str(53565))) crt.X__builtin_abort(tls) } @@ -39449,7 +41435,7 @@ func _btreeParseCellPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *X if _nPayload < uint32(i32(128)) { goto _9 } - _1_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8)))) + _1_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + 1*uintptr(i32(8)))) { p := &_nPayload *p = (*p) & uint32(i32(127)) @@ -39466,7 +41452,7 @@ _9: if _iKey < uint64(i32(128)) { goto _12 } - _3_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(7)))) + _3_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + 1*uintptr(i32(7)))) { p := &_iKey *p = (*p) & uint64(i32(127)) @@ -39485,17 +41471,17 @@ _13: _14: _12: *(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1) - *(*int64)(unsafe.Pointer(&(_pInfo.X0))) = *(*int64)(unsafe.Pointer(&_iKey)) - *(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = _nPayload - *(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = _pIter + *(*int64)(unsafe.Pointer(&_pInfo.X0)) = *(*int64)(unsafe.Pointer(&_iKey)) + *(*uint32)(unsafe.Pointer(&_pInfo.X2)) = _nPayload + *(**uint8)(unsafe.Pointer(&_pInfo.X1)) = _pIter if _nPayload > uint32(_pPage.X10) { goto _17 } - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(_nPayload + uint32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1)))) + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(_nPayload + uint32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1)))) if int32(_pInfo.X4) < i32(4) { - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4)) + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(i32(4)) } - *(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_nPayload) + *(*uint16)(unsafe.Pointer(&_pInfo.X3)) = uint16(_nPayload) goto _19 _17: _btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo) @@ -39508,31 +41494,35 @@ func init() { crt.Xstrncpy(nil, &_btreeParseCellPtrØ00__func__Ø000[0], str(53606), 18) } -// This is common tail processing for btreeParseCellPtr() and -// btreeParseCellPtrIndex() for the case when the cell does not fit entirely -// on a single B-tree page. Make necessary adjustments to the CellInfo -// structure. +// C comment +// /* +// ** This is common tail processing for btreeParseCellPtr() and +// ** btreeParseCellPtrIndex() for the case when the cell does not fit entirely +// ** on a single B-tree page. Make necessary adjustments to the CellInfo +// ** structure. +// */ func _btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) { var _minLocal, _maxLocal, _surplus int32 _minLocal = int32(_pPage.X11) _maxLocal = int32(_pPage.X10) - _surplus = int32(uint32(_minLocal) + (((_pInfo.X2) - uint32(_minLocal)) % (((*XBtShared)(_pPage.X18).X16) - uint32(i32(4))))) + _surplus = int32(uint32(_minLocal) + ((_pInfo.X2 - uint32(_minLocal)) % (((*XBtShared)(_pPage.X18).X16) - uint32(i32(4))))) if _surplus <= _maxLocal { - *(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_surplus) + *(*uint16)(unsafe.Pointer(&_pInfo.X3)) = uint16(_surplus) goto _1 } - *(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_minLocal) + *(*uint16)(unsafe.Pointer(&_pInfo.X3)) = uint16(_minLocal) _1: - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(int32(uint16(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pInfo.X1))+1*uintptr(_pInfo.X3)))))-uintptr(unsafe.Pointer(_pCell)))/1))) + i32(4)) + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(int32(uint16(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pInfo.X1))+1*uintptr(_pInfo.X3)))))-uintptr(unsafe.Pointer(_pCell)))/1))) + i32(4)) } func _cellSizePtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) { var _pIter, _pEnd *uint8 var _debuginfo XCellInfo _pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(i32(4)))) - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, &_debuginfo) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, &_debuginfo) func() { if int32(_pPage.X7) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60319), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53624))) @@ -39545,7 +41535,7 @@ _2: goto _2 } func() { - if int32(_debuginfo.X4) != int32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))) && (_sqlite3Config.X6) != i32(0) { + if int32(_debuginfo.X4) != int32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60322), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53647))) crt.X__builtin_abort(tls) } @@ -39562,18 +41552,21 @@ func init() { crt.Xstrncpy(nil, &_cellSizePtrNoPayloadØ00__func__Ø000[0], str(53699), 21) } -// The following routines are implementations of the MemPage.xParseCell() -// method. -// -// Parse a cell content block and fill in the CellInfo structure. -// -// btreeParseCellPtr() => table btree leaf nodes -// btreeParseCellNoPayload() => table btree internal nodes -// btreeParseCellPtrIndex() => index btree nodes -// -// There is also a wrapper function btreeParseCell() that works for -// all MemPage types and that references the cell by index rather than -// by pointer. +// C comment +// /* +// ** The following routines are implementations of the MemPage.xParseCell() +// ** method. +// ** +// ** Parse a cell content block and fill in the CellInfo structure. +// ** +// ** btreeParseCellPtr() => table btree leaf nodes +// ** btreeParseCellNoPayload() => table btree internal nodes +// ** btreeParseCellPtrIndex() => index btree nodes +// ** +// ** There is also a wrapper function btreeParseCell() that works for +// ** all MemPage types and that references the cell by index rather than +// ** by pointer. +// */ func _btreeParseCellPtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 { @@ -39593,10 +41586,10 @@ func _btreeParseCellPtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4) + int32(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(i32(4)))), (*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&(_pInfo.X0)))))))) - *(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = uint32(i32(0)) - *(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(i32(0)) - *(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = nil + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(i32(4) + int32(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(i32(4)))), (*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&_pInfo.X0))))))) + *(*uint32)(unsafe.Pointer(&_pInfo.X2)) = uint32(i32(0)) + *(*uint16)(unsafe.Pointer(&_pInfo.X3)) = uint16(i32(0)) + *(**uint8)(unsafe.Pointer(&_pInfo.X1)) = nil } var _btreeParseCellPtrNoPayloadØ00__func__Ø000 [27]int8 @@ -39605,8 +41598,11 @@ func init() { crt.Xstrncpy(nil, &_btreeParseCellPtrNoPayloadØ00__func__Ø000[0], str(53735), 27) } -// Read a 64-bit variable-length integer from memory starting at p[0]. -// Return the number of bytes read. The value is stored in *v. +// C comment +// /* +// ** Read a 64-bit variable-length integer from memory starting at p[0]. +// ** Return the number of bytes read. The value is stored in *v. +// */ func _sqlite3GetVarint(tls *crt.TLS, _p *uint8, _v *uint64) (r0 uint8) { var _a, _b, _s uint32 _a = uint32(*_p) @@ -39815,7 +41811,7 @@ func _sqlite3GetVarint(tls *crt.TLS, _p *uint8, _v *uint64) (r0 uint8) { sink5(*p) } _s = _s << uint(i32(4)) - _b = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(-4))))) + _b = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(-4))))) { p := &_b *p = (*p) & uint32(i32(127)) @@ -39857,7 +41853,7 @@ func _btreeParseCellPtrIndex(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pIn if _nPayload < uint32(i32(128)) { goto _7 } - _1_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8)))) + _1_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + 1*uintptr(i32(8)))) { p := &_nPayload *p = (*p) & uint32(i32(127)) @@ -39870,17 +41866,17 @@ _8: } _7: *(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1) - *(*int64)(unsafe.Pointer(&(_pInfo.X0))) = int64(_nPayload) - *(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = _nPayload - *(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = _pIter + *(*int64)(unsafe.Pointer(&_pInfo.X0)) = int64(_nPayload) + *(*uint32)(unsafe.Pointer(&_pInfo.X2)) = _nPayload + *(**uint8)(unsafe.Pointer(&_pInfo.X1)) = _pIter if _nPayload > uint32(_pPage.X10) { goto _10 } - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(_nPayload + uint32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1)))) + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(_nPayload + uint32(uint16(int64((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1)))) if int32(_pInfo.X4) < i32(4) { - *(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4)) + *(*uint16)(unsafe.Pointer(&_pInfo.X4)) = uint16(i32(4)) } - *(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_nPayload) + *(*uint16)(unsafe.Pointer(&_pInfo.X3)) = uint16(_nPayload) goto _12 _10: _btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo) @@ -39893,12 +41889,15 @@ func init() { crt.Xstrncpy(nil, &_btreeParseCellPtrIndexØ00__func__Ø000[0], str(53783), 23) } -// Invoke the busy handler for a btree. +// C comment +// /* +// ** Invoke the busy handler for a btree. +// */ func _btreeInvokeBusyHandler(tls *crt.TLS, _pArg unsafe.Pointer) (r0 int32) { var _pBt *XBtShared _pBt = (*XBtShared)(_pArg) func() { - if (*Xsqlite3)(_pBt.X1) == nil { + if _pBt.X1 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61201), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000))), unsafe.Pointer(str(53806))) crt.X__builtin_abort(tls) } @@ -39918,11 +41917,14 @@ func init() { crt.Xstrncpy(nil, &_btreeInvokeBusyHandlerØ00__func__Ø000[0], str(53849), 23) } -// Invoke the given busy handler. -// -// This routine is called when an operation failed with a lock. -// If this routine returns non-zero, the lock is retried. If it -// returns 0, the operation aborts with an SQLITE_BUSY error. +// C comment +// /* +// ** Invoke the given busy handler. +// ** +// ** This routine is called when an operation failed with a lock. +// ** If this routine returns non-zero, the lock is retried. If it +// ** returns 0, the operation aborts with an SQLITE_BUSY error. +// */ func _sqlite3InvokeBusyHandler(tls *crt.TLS, _p *t19) (r0 int32) { var _rc int32 if (func() int32 { @@ -39936,17 +41938,17 @@ func _sqlite3InvokeBusyHandler(tls *crt.TLS, _p *t19) (r0 int32) { return i32(0) }() != 0 || (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_p.X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_p.X0})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{nil})))) || ((_p.X2) < i32(0)) { + }{nil})))) || (_p.X2 < i32(0)) { return i32(0) } - _rc = (_p.X0)(tls, _p.X1, _p.X2) + _rc = _p.X0(tls, _p.X1, _p.X2) if _rc == i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X2))) = i32(-1) + *(*int32)(unsafe.Pointer(&_p.X2)) = i32(-1) goto _6 } - *(*int32)(unsafe.Pointer(&(_p.X2))) += 1 + *(*int32)(unsafe.Pointer(&_p.X2)) += 1 _6: return _rc } @@ -39970,7 +41972,7 @@ func _sqlite3PagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32 crt.X__builtin_abort(tls) } }() - if (_nSavepoint > (_pPager.X38)) && ((_pPager.X3) != 0) { + if (_nSavepoint > _pPager.X38) && (_pPager.X3 != 0) { return _pagerOpenSavepoint(tls, _pPager, _nSavepoint) } return i32(0) @@ -39982,14 +41984,17 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerOpenSavepointØ00__func__Ø000[0], str(53897), 26) } -// Check that there are at least nSavepoint savepoints open. If there are -// currently less than nSavepoints open, then open one or more savepoints -// to make up the difference. If the number of savepoints is already -// equal to nSavepoint, then this function is a no-op. -// -// If a memory allocation fails, SQLITE_NOMEM is returned. If an error -// occurs while opening the sub-journal file, then an IO error code is -// returned. Otherwise, SQLITE_OK. +// C comment +// /* +// ** Check that there are at least nSavepoint savepoints open. If there are +// ** currently less than nSavepoints open, then open one or more savepoints +// ** to make up the difference. If the number of savepoints is already +// ** equal to nSavepoint, then this function is a no-op. +// ** +// ** If a memory allocation fails, SQLITE_NOMEM is returned. If an error +// ** occurs while opening the sub-journal file, then an IO error code is +// ** returned. Otherwise, SQLITE_OK. +// */ func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) { var _rc, _nCurrent, _ii int32 var _aNew *XPagerSavepoint @@ -40008,7 +42013,7 @@ func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 i } }() func() { - if _nSavepoint <= _nCurrent || (_pPager.X3) == 0 { + if _nSavepoint <= _nCurrent || _pPager.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53616), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(53923))) crt.X__builtin_abort(tls) } @@ -40017,34 +42022,34 @@ func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 i if _aNew == nil { return _sqlite3NomemError(tls, i32(53626)) } - crt.Xmemset(tls, (unsafe.Pointer)((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew))+48*uintptr(_nCurrent)))), i32(0), uint64(_nSavepoint-_nCurrent)*u64(48)) - *(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X37))))) = _aNew + crt.Xmemset(tls, unsafe.Pointer((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew))+48*uintptr(_nCurrent)))), i32(0), uint64(_nSavepoint-_nCurrent)*u64(48)) + *(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X37)))) = _aNew _ii = _nCurrent _8: if _ii >= _nSavepoint { goto _11 } - *(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X3))) = _pPager.X22 - if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && ((_pPager.X34) > int64(i32(0))) { - *(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X0))) = _pPager.X34 + *(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X3))) = _pPager.X22 + if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && (_pPager.X34 > int64(i32(0))) { + *(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X0))) = _pPager.X34 goto _14 } - *(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X0))) = int64(_pPager.X47) + *(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X0))) = int64(_pPager.X47) _14: - *(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X4))) = _pPager.X29 - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X2))))) = _sqlite3BitvecCreate(tls, _pPager.X22) - if (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew))+48*uintptr(_ii))).X2) == nil { + *(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X4))) = _pPager.X29 + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X2))))) = _sqlite3BitvecCreate(tls, _pPager.X22) + if ((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X2) == nil { return _sqlite3NomemError(tls, i32(53642)) } if (*XWal)(_pPager.X60) != nil { - _sqlite3WalSavepoint(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 48*uintptr(_ii))).X5)))))) + _sqlite3WalSavepoint(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_aNew)) + 48*uintptr(_ii))).X5)))))) } - *(*int32)(unsafe.Pointer(&(_pPager.X38))) = _ii + i32(1) + *(*int32)(unsafe.Pointer(&_pPager.X38)) = _ii + i32(1) _ii += 1 goto _8 _11: func() { - if (_pPager.X38) != _nSavepoint { + if _pPager.X38 != _nSavepoint { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53649), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(53965))) crt.X__builtin_abort(tls) } @@ -40059,21 +42064,24 @@ func init() { crt.Xstrncpy(nil, &_pagerOpenSavepointØ00__func__Ø000[0], str(53996), 19) } -// Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 -// values. This function populates the array with values required to -// "rollback" the write position of the WAL handle back to the current -// point in the event of a savepoint rollback (via WalSavepointUndo()). +// C comment +// /* +// ** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 +// ** values. This function populates the array with values required to +// ** "rollback" the write position of the WAL handle back to the current +// ** point in the event of a savepoint rollback (via WalSavepointUndo()). +// */ func _sqlite3WalSavepoint(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) { func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57300), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0)))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(2)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(0)))) = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(2)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22 } var _sqlite3WalSavepointØ00__func__Ø000 [20]int8 @@ -40086,9 +42094,12 @@ func _assertTruncateConstraint(tls *crt.TLS, _pPager *XPager) { _sqlite3PcacheIterateDirty(tls, (*XPCache)(_pPager.X59), _assertTruncateConstraintCb) } -// For all dirty pages currently in the cache, invoke the specified -// callback. This is only used if the SQLITE_CHECK_PAGES macro is -// defined. +// C comment +// /* +// ** For all dirty pages currently in the cache, invoke the specified +// ** callback. This is only used if the SQLITE_CHECK_PAGES macro is +// ** defined. +// */ func _sqlite3PcacheIterateDirty(tls *crt.TLS, _pCache *XPCache, _xIter func(*crt.TLS, *XPgHdr)) { var _pDirty *XPgHdr _pDirty = (*XPgHdr)(_pCache.X0) @@ -40110,7 +42121,7 @@ func _assertTruncateConstraintCb(tls *crt.TLS, _pPg *XPgHdr) { } }() func() { - if _subjRequiresPage(tls, _pPg) != 0 && (_pPg.X5) > ((*XPager)(_pPg.X4).X22) { + if _subjRequiresPage(tls, _pPg) != 0 && _pPg.X5 > ((*XPager)(_pPg.X4).X22) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50855), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000))), unsafe.Pointer(str(54058))) crt.X__builtin_abort(tls) } @@ -40123,24 +42134,27 @@ func init() { crt.Xstrncpy(nil, &_assertTruncateConstraintCbØ00__func__Ø000[0], str(54115), 27) } -// This function may only be called if the b-tree connection already -// has a read or write transaction open on the database. -// -// Read the meta-information out of a database file. Meta[0] -// is the number of free pages currently in the database. Meta[1] -// through meta[15] are available for use by higher layers. Meta[0] -// is read-only, the others are read/write. -// -// The schema layer numbers meta values differently. At the schema -// layer (and the SetCookie and ReadCookie opcodes) the number of -// free pages is not visible. So Cookie[0] is the same as Meta[1]. -// -// This routine treats Meta[BTREE_DATA_VERSION] as a special case. Instead -// of reading the value out of the header, it instead loads the "DataVersion" -// from the pager. The BTREE_DATA_VERSION value is not actually stored in the -// database file. It is a number computed by the pager. But its access -// pattern is the same as header meta values, and so it is convenient to -// read it from this routine. +// C comment +// /* +// ** This function may only be called if the b-tree connection already +// ** has a read or write transaction open on the database. +// ** +// ** Read the meta-information out of a database file. Meta[0] +// ** is the number of free pages currently in the database. Meta[1] +// ** through meta[15] are available for use by higher layers. Meta[0] +// ** is read-only, the others are read/write. +// ** +// ** The schema layer numbers meta values differently. At the schema +// ** layer (and the SetCookie and ReadCookie opcodes) the number of +// ** free pages is not visible. So Cookie[0] is the same as Meta[1]. +// ** +// ** This routine treats Meta[BTREE_DATA_VERSION] as a special case. Instead +// ** of reading the value out of the header, it instead loads the "DataVersion" +// ** from the pager. The BTREE_DATA_VERSION value is not actually stored in the +// ** database file. It is a number computed by the pager. But its access +// ** pattern is the same as header meta values, and so it is convenient to +// ** read it from this routine. +// */ func _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) { var _pBt *XBtShared _pBt = (*XBtShared)(_p.X1) @@ -40158,7 +42172,7 @@ func _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) } }() func() { - if (*XMemPage)(_pBt.X3) == nil { + if _pBt.X3 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67863), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000))), unsafe.Pointer(str(54228))) crt.X__builtin_abort(tls) } @@ -40170,10 +42184,10 @@ func _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) } }() if _idx == i32(15) { - *_pMeta = _sqlite3PagerDataVersion(tls, (*XPager)(_pBt.X0)) + (_p.X8) + *_pMeta = _sqlite3PagerDataVersion(tls, (*XPager)(_pBt.X0)) + _p.X8 goto _10 } - *_pMeta = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)+(_idx*i32(4)))))) + *_pMeta = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)+(_idx*i32(4)))))) _10: _sqlite3BtreeLeave(tls, _p) } @@ -40184,7 +42198,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeGetMetaØ00__func__Ø000[0], str(54258), 20) } -// Return the pPager->iDataVersion value +// C comment +// /* +// ** Return the pPager->iDataVersion value +// */ func _sqlite3PagerDataVersion(tls *crt.TLS, _pPager *XPager) (r0 uint32) { func() { if int32(_pPager.X14) <= i32(0) { @@ -40201,12 +42218,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerDataVersionØ00__func__Ø000[0], str(54304), 24) } -// Reset the schema for the database at index iDb. Also reset the -// TEMP schema. +// C comment +// /* +// ** Reset the schema for the database at index iDb. Also reset the +// ** TEMP schema. +// */ func _sqlite3ResetOneSchema(tls *crt.TLS, _db *Xsqlite3, _iDb int32) { var _pDb *XDb func() { - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100217), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000))), unsafe.Pointer(str(54328))) crt.X__builtin_abort(tls) } @@ -40243,7 +42263,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ResetOneSchemaØ00__func__Ø000[0], str(54356), 22) } -// Do both phases of a commit. +// C comment +// /* +// ** Do both phases of a commit. +// */ func _sqlite3BtreeCommit(tls *crt.TLS, _p *XBtree) (r0 int32) { var _rc int32 _sqlite3BtreeEnter(tls, _p) @@ -40255,30 +42278,33 @@ func _sqlite3BtreeCommit(tls *crt.TLS, _p *XBtree) (r0 int32) { return _rc } -// This routine does the first phase of a two-phase commit. This routine -// causes a rollback journal to be created (if it does not already exist) -// and populated with enough information so that if a power loss occurs -// the database can be restored to its original state by playing back -// the journal. Then the contents of the journal are flushed out to -// the disk. After the journal is safely on oxide, the changes to the -// database are written into the database file and flushed to oxide. -// At the end of this call, the rollback journal still exists on the -// disk and we are still holding all locks, so the transaction has not -// committed. See sqlite3BtreeCommitPhaseTwo() for the second phase of the -// commit process. -// -// This call is a no-op if no write-transaction is currently active on pBt. -// -// Otherwise, sync the database file for the btree pBt. zMaster points to -// the name of a master journal file that should be written into the -// individual journal file, or is NULL, indicating no master journal file -// (single database transaction). -// -// When this is called, the master journal should already have been -// created, populated with this journal pointer and synced to disk. -// -// Once this is routine has returned, the only thing required to commit -// the write-transaction for this database file is to delete the journal. +// C comment +// /* +// ** This routine does the first phase of a two-phase commit. This routine +// ** causes a rollback journal to be created (if it does not already exist) +// ** and populated with enough information so that if a power loss occurs +// ** the database can be restored to its original state by playing back +// ** the journal. Then the contents of the journal are flushed out to +// ** the disk. After the journal is safely on oxide, the changes to the +// ** database are written into the database file and flushed to oxide. +// ** At the end of this call, the rollback journal still exists on the +// ** disk and we are still holding all locks, so the transaction has not +// ** committed. See sqlite3BtreeCommitPhaseTwo() for the second phase of the +// ** commit process. +// ** +// ** This call is a no-op if no write-transaction is currently active on pBt. +// ** +// ** Otherwise, sync the database file for the btree pBt. zMaster points to +// ** the name of a master journal file that should be written into the +// ** individual journal file, or is NULL, indicating no master journal file +// ** (single database transaction). +// ** +// ** When this is called, the master journal should already have been +// ** created, populated with this journal pointer and synced to disk. +// ** +// ** Once this is routine has returned, the only thing required to commit +// ** the write-transaction for this database file is to delete the journal. +// */ func _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 int32) { var _rc int32 var _1_pBt *XBtShared @@ -40288,7 +42314,7 @@ func _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 i } _1_pBt = (*XBtShared)(_p.X1) _sqlite3BtreeEnter(tls, _p) - if (_1_pBt.X5) == 0 { + if _1_pBt.X5 == 0 { goto _1 } _rc = _autoVacuumCommit(tls, _1_pBt) @@ -40297,7 +42323,7 @@ func _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 i return _rc } _1: - if (_1_pBt.X7) != 0 { + if _1_pBt.X7 != 0 { _sqlite3PagerTruncateImage(tls, (*XPager)(_1_pBt.X0), _1_pBt.X18) } _rc = _sqlite3PagerCommitPhaseOne(tls, (*XPager)(_1_pBt.X0), _zMaster, i32(0)) @@ -40306,13 +42332,16 @@ _0: return _rc } -// This routine is called prior to sqlite3PagerCommit when a transaction -// is committed for an auto-vacuum database. -// -// If SQLITE_OK is returned, then *pnTrunc is set to the number of pages -// the database file should be truncated to during the commit process. -// i.e. the database has been reorganized so that only the first *pnTrunc -// pages are in use. +// C comment +// /* +// ** This routine is called prior to sqlite3PagerCommit when a transaction +// ** is committed for an auto-vacuum database. +// ** +// ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages +// ** the database file should be truncated to during the commit process. +// ** i.e. the database has been reorganized so that only the first *pnTrunc +// ** pages are in use. +// */ func _autoVacuumCommit(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { var _rc, _nRef int32 var _1_nFin, _1_nFree, _1_iFree, _1_nOrig uint32 @@ -40328,19 +42357,19 @@ func _autoVacuumCommit(tls *crt.TLS, _pBt *XBtShared) (r0 int32) { }() _invalidateAllOverflowCache(tls, _pBt) func() { - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62759), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000))), unsafe.Pointer(str(54378))) crt.X__builtin_abort(tls) } }() - if (_pBt.X6) != 0 { + if _pBt.X6 != 0 { goto _4 } _1_nOrig = _btreePagecount(tls, _pBt) - if (_ptrmapPageno(tls, _pBt, _1_nOrig) == _1_nOrig) || (_1_nOrig == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_ptrmapPageno(tls, _pBt, _1_nOrig) == _1_nOrig) || (_1_nOrig == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { return _sqlite3CorruptError(tls, i32(62772)) } - _1_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) + _1_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) _1_nFin = _finalDbSize(tls, _pBt, _1_nOrig, _1_nFree) if _1_nFin > _1_nOrig { return _sqlite3CorruptError(tls, i32(62777)) @@ -40359,11 +42388,11 @@ _9: _13: if ((_rc == i32(101)) || (_rc == i32(0))) && (_1_nFree > uint32(i32(0))) { _rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))), uint32(i32(0))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))), uint32(i32(0))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _1_nFin) - *(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) = _1_nFin + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))), uint32(i32(0))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))), uint32(i32(0))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _1_nFin) + *(*uint8)(unsafe.Pointer(&_pBt.X7)) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_pBt.X18)) = _1_nFin } if _rc != i32(0) { _sqlite3PagerRollback(tls, _pPager) @@ -40384,8 +42413,11 @@ func init() { crt.Xstrncpy(nil, &_autoVacuumCommitØ00__func__Ø000[0], str(54429), 17) } -// Invalidate the overflow page-list cache for all cursors opened -// on the shared btree structure pBt. +// C comment +// /* +// ** Invalidate the overflow page-list cache for all cursors opened +// ** on the shared btree structure pBt. +// */ func _invalidateAllOverflowCache(tls *crt.TLS, _pBt *XBtShared) { var _p *XBtCursor func() { @@ -40400,7 +42432,7 @@ _2: goto _5 } { - p := (*uint8)(unsafe.Pointer(&(_p.X10))) + p := (*uint8)(unsafe.Pointer(&_p.X10)) *p = uint8(int32(*p) & i32(-5)) sink2(*p) } @@ -40415,41 +42447,47 @@ func init() { crt.Xstrncpy(nil, &_invalidateAllOverflowCacheØ00__func__Ø000[0], str(54446), 27) } -// The database opened by the first argument is an auto-vacuum database -// nOrig pages in size containing nFree free pages. Return the expected -// size of the database in pages following an auto-vacuum operation. +// C comment +// /* +// ** The database opened by the first argument is an auto-vacuum database +// ** nOrig pages in size containing nFree free pages. Return the expected +// ** size of the database in pages following an auto-vacuum operation. +// */ func _finalDbSize(tls *crt.TLS, _pBt *XBtShared, _nOrig uint32, _nFree uint32) (r0 uint32) { var _nEntry int32 var _nPtrmap, _nFin uint32 - _nEntry = int32((_pBt.X16) / uint32(i32(5))) + _nEntry = int32(_pBt.X16 / uint32(i32(5))) _nPtrmap = (((_nFree - _nOrig) + _ptrmapPageno(tls, _pBt, _nOrig)) + uint32(_nEntry)) / uint32(_nEntry) _nFin = (_nOrig - _nFree) - _nPtrmap - if (_nOrig > ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) && (_nFin < ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_nOrig > ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) && (_nFin < ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { _nFin -= 1 } _1: - if (_ptrmapPageno(tls, _pBt, _nFin) == _nFin) || (_nFin == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_ptrmapPageno(tls, _pBt, _nFin) == _nFin) || (_nFin == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { _nFin -= 1 goto _1 } return _nFin } -// Perform a single step of an incremental-vacuum. If successful, return -// SQLITE_OK. If there is no work to do (and therefore no point in -// calling this function again), return SQLITE_DONE. Or, if an error -// occurs, return some other error code. -// -// More specifically, this function attempts to re-organize the database so -// that the last page of the file currently in use is no longer in use. -// -// Parameter nFin is the number of pages that this database would contain -// were this function called until it returns SQLITE_DONE. -// -// If the bCommit parameter is non-zero, this function assumes that the -// caller will keep calling incrVacuumStep() until it returns SQLITE_DONE -// or an error. bCommit is passed true for an auto-vacuum-on-commit -// operation, or false for an incremental vacuum. +// C comment +// /* +// ** Perform a single step of an incremental-vacuum. If successful, return +// ** SQLITE_OK. If there is no work to do (and therefore no point in +// ** calling this function again), return SQLITE_DONE. Or, if an error +// ** occurs, return some other error code. +// ** +// ** More specifically, this function attempts to re-organize the database so +// ** that the last page of the file currently in use is no longer in use. +// ** +// ** Parameter nFin is the number of pages that this database would contain +// ** were this function called until it returns SQLITE_DONE. +// ** +// ** If the bCommit parameter is non-zero, this function assumes that the +// ** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE +// ** or an error. bCommit is passed true for an auto-vacuum-on-commit +// ** operation, or false for an incremental vacuum. +// */ func _incrVacuumStep(tls *crt.TLS, _pBt *XBtShared, _nFin uint32, _iLastPg uint32, _bCommit int32) (r0 int32) { var _rc int32 var _nFreeList, _1_iPtrPage, _6_iFreePg, _8_iFreePg, _8_iNear uint32 @@ -40467,10 +42505,10 @@ func _incrVacuumStep(tls *crt.TLS, _pBt *XBtShared, _nFin uint32, _iLastPg uint3 crt.X__builtin_abort(tls) } }() - if _ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg || _iLastPg == ((uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1))) { + if _ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg || _iLastPg == ((uint32(_sqlite3PendingByte)/_pBt.X15)+uint32(i32(1))) { goto _5 } - _nFreeList = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) + _nFreeList = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) if _nFreeList == uint32(i32(0)) { return i32(101) } @@ -40539,11 +42577,11 @@ _5: } _24: _iLastPg -= 1 - if (_iLastPg == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg) { + if (_iLastPg == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg) { goto _24 } - *(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) = _iLastPg + *(*uint8)(unsafe.Pointer(&_pBt.X7)) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_pBt.X18)) = _iLastPg _23: return i32(0) } @@ -40554,26 +42592,29 @@ func init() { crt.Xstrncpy(nil, &_incrVacuumStepØ00__func__Ø000[0], str(54519), 15) } -// Allocate a new page from the database file. -// -// The new page is marked as dirty. (In other words, sqlite3PagerWrite() -// has already been called on the new page.) The new page has also -// been referenced and the calling routine is responsible for calling -// sqlite3PagerUnref() on the new page when it is done. -// -// SQLITE_OK is returned on success. Any other return value indicates -// an error. *ppPage is set to NULL in the event of an error. -// -// If the "nearby" parameter is not 0, then an effort is made to -// locate a page close to the page number "nearby". This can be used in an -// attempt to keep related pages close to each other in the database file, -// which in turn can make database access faster. -// -// If the eMode parameter is BTALLOC_EXACT and the nearby page exists -// anywhere on the free-list, then it is guaranteed to be returned. If -// eMode is BTALLOC_LT then the page returned will be less than or equal -// to nearby if any such page exists. If eMode is BTALLOC_ANY then there -// are no restrictions on which page is returned. +// C comment +// /* +// ** Allocate a new page from the database file. +// ** +// ** The new page is marked as dirty. (In other words, sqlite3PagerWrite() +// ** has already been called on the new page.) The new page has also +// ** been referenced and the calling routine is responsible for calling +// ** sqlite3PagerUnref() on the new page when it is done. +// ** +// ** SQLITE_OK is returned on success. Any other return value indicates +// ** an error. *ppPage is set to NULL in the event of an error. +// ** +// ** If the "nearby" parameter is not 0, then an effort is made to +// ** locate a page close to the page number "nearby". This can be used in an +// ** attempt to keep related pages close to each other in the database file, +// ** which in turn can make database access faster. +// ** +// ** If the eMode parameter is BTALLOC_EXACT and the nearby page exists +// ** anywhere on the free-list, then it is guaranteed to be returned. If +// ** eMode is BTALLOC_LT then the page returned will be less than or equal +// ** to nearby if any such page exists. If eMode is BTALLOC_ANY then there +// ** are no restrictions on which page is returned. +// */ func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgno *uint32, _nearby uint32, _eMode uint8) (r0 int32) { var _rc, _34_dist, _35_d2, _39_noContent, _43_bNoContent int32 var _n, _k, _mxPage, _2_iTrunk, _2_nSearch, _22_iNewTrunk, _29_closest, _29_iPage, _30_i uint32 @@ -40589,14 +42630,14 @@ func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgn } }() func() { - if int32(_eMode) != i32(0) && (_nearby <= uint32(i32(0)) || (_pBt.X5) == 0) { + if int32(_eMode) != i32(0) && (_nearby <= uint32(i32(0)) || _pBt.X5 == 0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64691), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54534))) crt.X__builtin_abort(tls) } }() _pPage1 = (*XMemPage)(_pBt.X3) _mxPage = _btreePagecount(tls, _pBt) - _n = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36))))) + _n = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(36))))) if _n >= _mxPage { return _sqlite3CorruptError(tls, i32(64699)) } @@ -40618,7 +42659,7 @@ func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgn } }() func() { - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64716), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54378))) crt.X__builtin_abort(tls) } @@ -40641,14 +42682,14 @@ _17: if _rc != 0 { return _rc } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))), _n-uint32(i32(1))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(36)))), _n-uint32(i32(1))) _19: _pPrevTrunk = _pTrunk if _pPrevTrunk != nil { - _2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0))))) + _2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPrevTrunk.X19))+1*uintptr(i32(0))))) goto _21 } - _2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))) + _2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32))))) _21: if (_2_iTrunk > _mxPage) || (postInc5(&_2_nSearch, uint32(1)) > _n) { _rc = _sqlite3CorruptError(tls, i32(64755)) @@ -40667,12 +42708,12 @@ _24: } }() func() { - if (_pTrunk.X19) == nil { + if _pTrunk.X19 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64764), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54618))) crt.X__builtin_abort(tls) } }() - _k = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4))))) + _k = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(4))))) if _k != uint32(i32(0)) || _2_searchList != 0 { goto _31 } @@ -40687,12 +42728,12 @@ _24: goto _end_allocate_page } *_pPgno = _2_iTrunk - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) *_ppPage = _pTrunk _pTrunk = nil goto _57 _31: - if _k > (((_pBt.X16) / uint32(i32(4))) - uint32(i32(2))) { + if _k > ((_pBt.X16 / uint32(i32(4))) - uint32(i32(2))) { _rc = _sqlite3CorruptError(tls, i32(64784)) goto _end_allocate_page } @@ -40710,18 +42751,18 @@ _31: goto _43 } if _pPrevTrunk == nil { - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) goto _45 } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.X23)) if _rc != i32(0) { goto _end_allocate_page } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPrevTrunk.X19))+1*uintptr(i32(0))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) _45: goto _47 _43: - _22_iNewTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(8))))) + _22_iNewTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(8))))) if _22_iNewTrunk > _mxPage { _rc = _sqlite3CorruptError(tls, i32(64818)) goto _end_allocate_page @@ -40735,9 +42776,9 @@ _43: _releasePage(tls, _22_pNewTrunk) goto _end_allocate_page } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(0))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(4)))), _k-uint32(i32(1))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(8))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(12))))), uint64((_k-uint32(i32(1)))*uint32(i32(4)))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_22_pNewTrunk.X19))+1*uintptr(i32(0))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(0))))), uint64(i32(4))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_22_pNewTrunk.X19))+1*uintptr(i32(4)))), _k-uint32(i32(1))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_22_pNewTrunk.X19))+1*uintptr(i32(8))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(12))))), uint64((_k-uint32(i32(1)))*uint32(i32(4)))) _releasePage(tls, _22_pNewTrunk) if _pPrevTrunk == nil { func() { @@ -40746,14 +42787,14 @@ _43: crt.X__builtin_abort(tls) } }() - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))), _22_iNewTrunk) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32)))), _22_iNewTrunk) goto _54 } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.X23)) if _rc != 0 { goto _end_allocate_page } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0)))), _22_iNewTrunk) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPrevTrunk.X19))+1*uintptr(i32(0)))), _22_iNewTrunk) _54: _47: _pTrunk = nil @@ -40775,7 +42816,7 @@ _60: if _30_i >= _k { goto _63 } - _29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4))))))) + _29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4))))))) if _29_iPage <= _nearby { _29_closest = _30_i goto _63 @@ -40785,13 +42826,13 @@ _60: _63: goto _65 _59: - _34_dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(i32(8)))))-_nearby)) + _34_dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(i32(8)))))-_nearby)) _30_i = uint32(i32(1)) _66: if _30_i >= _k { goto _69 } - _35_d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4)))))))-_nearby)) + _35_d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4)))))))-_nearby)) if _35_d2 < _34_dist { _29_closest = _30_i _34_dist = _35_d2 @@ -40804,7 +42845,7 @@ _65: _58: _29_closest = uint32(i32(0)) _71: - _29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4))))))) + _29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4))))))) if _29_iPage > _mxPage { _rc = _sqlite3CorruptError(tls, i32(64883)) goto _end_allocate_page @@ -40818,9 +42859,9 @@ _71: goto _end_allocate_page } if _29_closest < (_k - uint32(i32(1))) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4))))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(4))+(_k*uint32(i32(4))))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4))))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(uint32(i32(4))+(_k*uint32(i32(4))))))), uint64(i32(4))) } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(i32(4)))), _k-uint32(i32(1))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_29_aData))+1*uintptr(i32(4)))), _k-uint32(i32(1))) _39_noContent = func() int32 { if _btreeGetHasContent(tls, _pBt, *_pPgno) == 0 { return i32(1) @@ -40857,16 +42898,16 @@ _7: if _rc != 0 { return _rc } - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1 - if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1 + *(*uint32)(unsafe.Pointer(&_pBt.X18)) += 1 + if _pBt.X18 == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { + *(*uint32)(unsafe.Pointer(&_pBt.X18)) += 1 } - if (_pBt.X5) == 0 || _ptrmapPageno(tls, _pBt, _pBt.X18) != (_pBt.X18) { + if _pBt.X5 == 0 || _ptrmapPageno(tls, _pBt, _pBt.X18) != _pBt.X18 { goto _89 } _44_pPg = nil func() { - if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { + if _pBt.X18 == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64950), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54690))) crt.X__builtin_abort(tls) } @@ -40879,15 +42920,15 @@ _7: if _rc != 0 { return _rc } - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1 - if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { - *(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1 + *(*uint32)(unsafe.Pointer(&_pBt.X18)) += 1 + if _pBt.X18 == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { + *(*uint32)(unsafe.Pointer(&_pBt.X18)) += 1 } _89: _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(i32(28))+uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19)))), _pBt.X18) *_pPgno = _pBt.X18 func() { - if (*_pPgno) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { + if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64964), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54725))) crt.X__builtin_abort(tls) } @@ -40903,7 +42944,7 @@ _89: } _83: func() { - if (*_pPgno) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { + if (*_pPgno) == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64975), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54725))) crt.X__builtin_abort(tls) } @@ -40935,13 +42976,16 @@ func init() { crt.Xstrncpy(nil, &_allocateBtreePageØ00__func__Ø000[0], str(54859), 18) } -// Get an unused page. -// -// This works just like btreeGetPage() with the addition: -// -// * If the page is already in use for some other purpose, immediately -// release it and return an SQLITE_CURRUPT error. -// * Make sure the isInit flag is clear +// C comment +// /* +// ** Get an unused page. +// ** +// ** This works just like btreeGetPage() with the addition: +// ** +// ** * If the page is already in use for some other purpose, immediately +// ** release it and return an SQLITE_CURRUPT error. +// ** * Make sure the isInit flag is clear +// */ func _btreeGetUnusedPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) { var _rc int32 _rc = _btreeGetPage(tls, _pBt, _pgno, _ppPage, _flags) @@ -40961,13 +43005,19 @@ _2: return _rc } -// Return the number of references to the specified page. +// C comment +// /* +// ** Return the number of references to the specified page. +// */ func _sqlite3PagerPageRefcount(tls *crt.TLS, _pPage *XPgHdr) (r0 int32) { return _sqlite3PcachePageRefcount(tls, _pPage) } -// Compute the absolute value of a 32-bit signed integer, of possible. Or -// if the integer has a value of -2147483648, return +2147483647 +// C comment +// /* +// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** if the integer has a value of -2147483648, return +2147483647 +// */ func _sqlite3AbsInt32(tls *crt.TLS, _x int32) (r0 int32) { if _x >= i32(0) { return _x @@ -40978,30 +43028,39 @@ func _sqlite3AbsInt32(tls *crt.TLS, _x int32) (r0 int32) { return -_x } -// Query the BtShared.pHasContent vector. -// -// This function is called when a free-list leaf page is removed from the -// free-list for reuse. It returns false if it is safe to retrieve the -// page from the pager layer with the 'no-content' flag set. True otherwise. +// C comment +// /* +// ** Query the BtShared.pHasContent vector. +// ** +// ** This function is called when a free-list leaf page is removed from the +// ** free-list for reuse. It returns false if it is safe to retrieve the +// ** page from the pager layer with the 'no-content' flag set. True otherwise. +// */ func _btreeGetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) { var _p *XBitvec _p = (*XBitvec)(_pBt.X22) return bool2int((_p != nil) && ((_pgno > _sqlite3BitvecSize(tls, _p)) || _sqlite3BitvecTest(tls, _p, _pgno) != 0)) } -// Return the value of the iSize parameter specified when Bitvec *p -// was created. +// C comment +// /* +// ** Return the value of the iSize parameter specified when Bitvec *p +// ** was created. +// */ func _sqlite3BitvecSize(tls *crt.TLS, _p *XBitvec) (r0 uint32) { return _p.X0 } -// Move the open database page pDbPage to location iFreePage in the -// database. The pDbPage reference remains valid. -// -// The isCommit flag indicates that there is no need to remember that -// the journal needs to be sync()ed before database page pDbPage->pgno -// can be written to. The caller has already promised not to write to that -// page. +// C comment +// /* +// ** Move the open database page pDbPage to location iFreePage in the +// ** database. The pDbPage reference remains valid. +// ** +// ** The isCommit flag indicates that there is no need to remember that +// ** the journal needs to be sync()ed before database page pDbPage->pgno +// ** can be written to. The caller has already promised not to write to that +// ** page. +// */ func _relocatePage(tls *crt.TLS, _pBt *XBtShared, _pDbPage *XMemPage, _eType uint8, _iPtrPage uint32, _iFreePage uint32, _isCommit int32) (r0 int32) { var _rc int32 var _iDbPage, _4_nextOvfl uint32 @@ -41031,7 +43090,7 @@ func _relocatePage(tls *crt.TLS, _pBt *XBtShared, _pDbPage *XMemPage, _eType uin if _rc != i32(0) { return _rc } - *(*uint32)(unsafe.Pointer(&(_pDbPage.X4))) = _iFreePage + *(*uint32)(unsafe.Pointer(&_pDbPage.X4)) = _iFreePage if int32(_eType) != i32(5) && int32(_eType) != i32(1) { goto _11 } @@ -41078,29 +43137,32 @@ func init() { crt.Xstrncpy(nil, &_relocatePageØ00__func__Ø000[0], str(54995), 13) } -// Move the page pPg to location pgno in the file. -// -// There must be no references to the page previously located at -// pgno (which we call pPgOld) though that page is allowed to be -// in cache. If the page previously located at pgno is not already -// in the rollback journal, it is not put there by by this routine. -// -// References to the page pPg remain valid. Updating any -// meta-data associated with pPg (i.e. data stored in the nExtra bytes -// allocated along with the page) is the responsibility of the caller. -// -// A transaction must be active when this routine is called. It used to be -// required that a statement transaction was not active, but this restriction -// has been removed (CREATE INDEX needs to move a page when a statement -// transaction is active). -// -// If the fourth argument, isCommit, is non-zero, then this page is being -// moved as part of a database reorganization just before the transaction -// is being committed. In this case, it is guaranteed that the database page -// pPg refers to will not be written to again within this transaction. -// -// This function may return SQLITE_NOMEM or an IO error code if an error -// occurs. Otherwise, it returns SQLITE_OK. +// C comment +// /* +// ** Move the page pPg to location pgno in the file. +// ** +// ** There must be no references to the page previously located at +// ** pgno (which we call pPgOld) though that page is allowed to be +// ** in cache. If the page previously located at pgno is not already +// ** in the rollback journal, it is not put there by by this routine. +// ** +// ** References to the page pPg remain valid. Updating any +// ** meta-data associated with pPg (i.e. data stored in the nExtra bytes +// ** allocated along with the page) is the responsibility of the caller. +// ** +// ** A transaction must be active when this routine is called. It used to be +// ** required that a statement transaction was not active, but this restriction +// ** has been removed (CREATE INDEX needs to move a page when a statement +// ** transaction is active). +// ** +// ** If the fourth argument, isCommit, is non-zero, then this page is being +// ** moved as part of a database reorganization just before the transaction +// ** is being committed. In this case, it is guaranteed that the database page +// ** pPg refers to will not be written to again within this transaction. +// ** +// ** This function may return SQLITE_NOMEM or an IO error code if an error +// ** occurs. Otherwise, it returns SQLITE_OK. +// */ func _sqlite3PagerMovepage(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr, _pgno uint32, _isCommit int32) (r0 int32) { var _rc int32 var _needSyncPgno, _origPgno uint32 @@ -41125,12 +43187,12 @@ func _sqlite3PagerMovepage(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr, _pgno ui } }() func() { - if (_pPager.X10) == 0 && (_pPager.X13) != 0 { + if _pPager.X10 == 0 && _pPager.X13 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53895), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55096))) crt.X__builtin_abort(tls) } }() - if (_pPager.X10) == 0 { + if _pPager.X10 == 0 { goto _10 } _rc = _sqlite3PagerWrite(tls, _pPg) @@ -41144,7 +43206,7 @@ _10: if (int32(_pPg.X6)&i32(8)) != 0 && (_isCommit == 0) { _needSyncPgno = _pPg.X5 func() { - if int32(_pPager.X2) != i32(2) && _pageInJournal(tls, _pPager, _pPg) == 0 && (_pPg.X5) <= (_pPager.X23) { + if int32(_pPager.X2) != i32(2) && _pageInJournal(tls, _pPager, _pPg) == 0 && _pPg.X5 <= _pPager.X23 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53938), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55123))) crt.X__builtin_abort(tls) } @@ -41157,7 +43219,7 @@ _10: }() } { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) & i32(-9)) sink14(*p) } @@ -41172,12 +43234,12 @@ _10: goto _25 } { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) | (int32(_pPgOld.X6) & i32(8))) sink14(*p) } - if (_pPager.X10) != 0 { - _sqlite3PcacheMove(tls, _pPgOld, (_pPager.X22)+uint32(i32(1))) + if _pPager.X10 != 0 { + _sqlite3PcacheMove(tls, _pPgOld, _pPager.X22+uint32(i32(1))) goto _27 } _sqlite3PcacheDrop(tls, _pPgOld) @@ -41186,7 +43248,7 @@ _25: _origPgno = _pPg.X5 _sqlite3PcacheMove(tls, _pPg, _pgno) _sqlite3PcacheMakeDirty(tls, _pPg) - if ((_pPager.X10) != 0) && (_pPgOld != nil) { + if (_pPager.X10 != 0) && (_pPgOld != nil) { _sqlite3PcacheMove(tls, _pPgOld, _origPgno) _sqlite3PagerUnrefNotNull(tls, _pPgOld) } @@ -41197,20 +43259,20 @@ _25: if _rc == i32(0) { goto _31 } - if _needSyncPgno <= (_pPager.X23) { + if _needSyncPgno <= _pPager.X23 { func() { - if (_pPager.X58) == nil { + if _pPager.X58 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55255))) crt.X__builtin_abort(tls) } }() - _sqlite3BitvecClear(tls, (*XBitvec)(_pPager.X30), _needSyncPgno, (unsafe.Pointer)(_pPager.X58)) + _sqlite3BitvecClear(tls, (*XBitvec)(_pPager.X30), _needSyncPgno, unsafe.Pointer(_pPager.X58)) } return _rc _31: { - p := (*uint16)(unsafe.Pointer(&(_8_pPgHdr.X6))) + p := (*uint16)(unsafe.Pointer(&_8_pPgHdr.X6)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } @@ -41226,7 +43288,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerMovepageØ00__func__Ø000[0], str(55276), 21) } -// Change the page number of page p to newPgno. +// C comment +// /* +// ** Change the page number of page p to newPgno. +// */ func _sqlite3PcacheMove(tls *crt.TLS, _p *XPgHdr, _newPgno uint32) { var _pCache *XPCache _pCache = (*XPCache)(_p.X8) @@ -41248,10 +43313,11 @@ func _sqlite3PcacheMove(tls *crt.TLS, _p *XPgHdr, _newPgno uint32) { crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32) - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X9)})))(tls, _pCache.X12, (*Xsqlite3_pcache_page)(_p.X0), _p.X5, _newPgno) - *(*uint32)(unsafe.Pointer(&(_p.X5))) = _newPgno + func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32) { + v := (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X9 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32))(unsafe.Pointer(&v)) + }()(tls, _pCache.X12, (*Xsqlite3_pcache_page)(_p.X0), _p.X5, _newPgno) + *(*uint32)(unsafe.Pointer(&_p.X5)) = _newPgno if (int32(_p.X6)&i32(2)) != 0 && (int32(_p.X6)&i32(8)) != 0 { _pcacheManageDirtyList(tls, _p, uint8(i32(3))) } @@ -41263,10 +43329,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheMoveØ00__func__Ø000[0], str(55307), 18) } -// Clear the i-th bit. -// -// pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage -// that BitvecClear can use to rebuilt its hash table. +// C comment +// /* +// ** Clear the i-th bit. +// ** +// ** pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage +// ** that BitvecClear can use to rebuilt its hash table. +// */ func _sqlite3BitvecClear(tls *crt.TLS, _p *XBitvec, _i uint32, _pBuf unsafe.Pointer) { var _1_bin, _4_j, _6_h uint32 var _4_aiValues *uint32 @@ -41281,12 +43350,12 @@ func _sqlite3BitvecClear(tls *crt.TLS, _p *XBitvec, _i uint32, _pBuf unsafe.Poin }() _i -= 1 _3: - if (_p.X2) == 0 { + if _p.X2 == 0 { goto _4 } - _1_bin = _i / (_p.X2) - _i = _i % (_p.X2) - _p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 8*uintptr(_1_bin))) + _1_bin = _i / _p.X2 + _i = _i % _p.X2 + _p = *(**XBitvec)(unsafe.Pointer(uintptr(unsafe.Pointer((*[62]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 8*uintptr(_1_bin))) if _p == nil { return } @@ -41294,28 +43363,28 @@ _3: _4: if uint64(_p.X0) <= u64(3968) { { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[496]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(_i/uint32(i32(8))))) *p = uint8(int32(*p) & (^(i32(1) << uint(int32(_i&uint32(i32(7))))))) sink2(*p) } goto _7 } _4_aiValues = (*uint32)(_pBuf) - crt.Xmemcpy(tls, (unsafe.Pointer)(_4_aiValues), (unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), u64(496)) - crt.Xmemset(tls, (unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), i32(0), u64(496)) - *(*uint32)(unsafe.Pointer(&(_p.X1))) = uint32(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_4_aiValues), unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3))))), u64(496)) + crt.Xmemset(tls, unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3))))), i32(0), u64(496)) + *(*uint32)(unsafe.Pointer(&_p.X1)) = uint32(i32(0)) _4_j = uint32(i32(0)) _8: if uint64(_4_j) >= u64(124) { goto _11 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))) == 0 || (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))) == (_i+uint32(i32(1))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_aiValues)) + 4*uintptr(_4_j)))) == 0 || (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_aiValues)) + 4*uintptr(_4_j)))) == (_i+uint32(i32(1))) { goto _13 } - _6_h = uint32(uint64(((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j))))-uint32(i32(1)))*uint32(i32(1))) % u64(124)) - *(*uint32)(unsafe.Pointer(&(_p.X1))) += 1 + _6_h = uint32(uint64(((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_aiValues)) + 4*uintptr(_4_j))))-uint32(i32(1)))*uint32(i32(1))) % u64(124)) + *(*uint32)(unsafe.Pointer(&_p.X1)) += 1 _14: - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_6_h)))) == 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_6_h)))) == 0 { goto _15 } _6_h += 1 @@ -41324,7 +43393,7 @@ _14: } goto _14 _15: - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_6_h))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[124]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&_p.X3)))))) + 4*uintptr(_6_h))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_aiValues)) + 4*uintptr(_4_j))) _13: _4_j += 1 goto _8 @@ -41338,9 +43407,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BitvecClearØ00__func__Ø000[0], str(55325), 19) } -// Set the pointer-map entries for all children of page pPage. Also, if -// pPage contains cells that point to overflow pages, set the pointer -// map entries for the overflow pages as well. +// C comment +// /* +// ** Set the pointer-map entries for all children of page pPage. Also, if +// ** pPage contains cells that point to overflow pages, set the pointer +// ** map entries for the overflow pages as well. +// */ func _setChildPtrmaps(tls *crt.TLS, _pPage *XMemPage) (r0 int32) { var _i, _nCell, _rc int32 var _pgno, _2_childPgno, _3_childPgno uint32 @@ -41364,17 +43436,17 @@ _3: if _i >= _nCell { goto _6 } - _1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(1))))))))) + _1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(1))))))))) _ptrmapPutOvflPtr(tls, _pPage, _1_pCell, &_rc) - if (_pPage.X5) == 0 { + if _pPage.X5 == 0 { _2_childPgno = _sqlite3Get4byte(tls, _1_pCell) _ptrmapPut(tls, _pBt, _2_childPgno, uint8(i32(5)), _pgno, &_rc) } _i += 1 goto _3 _6: - if (_pPage.X5) == 0 { - _3_childPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) + if _pPage.X5 == 0 { + _3_childPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) _ptrmapPut(tls, _pBt, _3_childPgno, uint8(i32(5)), _pgno, &_rc) } return _rc @@ -41386,13 +43458,16 @@ func init() { crt.Xstrncpy(nil, &_setChildPtrmapsØ00__func__Ø000[0], str(55344), 16) } -// Initialize the auxiliary information for a disk block. -// -// Return SQLITE_OK on success. If we see that the page does -// not contain a well-formed database page, then return -// 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. +// C comment +// /* +// ** Initialize the auxiliary information for a disk block. +// ** +// ** Return SQLITE_OK on success. If we see that the page does +// ** not contain a well-formed database page, then return +// ** 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 *crt.TLS, _pPage *XMemPage) (r0 int32) { var _1_pc, _1_usableSize, _1_nFree, _1_top, _1_iCellFirst, _1_iCellLast, _3_i, _3_sz int32 var _7_next, _7_size uint32 @@ -41419,7 +43494,7 @@ func _btreeInitPage(tls *crt.TLS, _pPage *XMemPage) (r0 int32) { } }() func() { - if (_pPage.X4) != _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.X23)) { + if _pPage.X4 != _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.X23)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60822), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(55392))) crt.X__builtin_abort(tls) } @@ -41431,40 +43506,40 @@ func _btreeInitPage(tls *crt.TLS, _pPage *XMemPage) (r0 int32) { } }() func() { - if (_pPage.X19) != (*uint8)(_sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23))) { + if _pPage.X19 != (*uint8)(_sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60824), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(55490))) crt.X__builtin_abort(tls) } }() - if (_pPage.X0) != 0 { + if _pPage.X0 != 0 { goto _12 } _1_pBt = (*XBtShared)(_pPage.X18) _1_hdr = _pPage.X6 _1_data = _pPage.X19 - if _decodeFlags(tls, _pPage, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_1_hdr))))) != 0 { + if _decodeFlags(tls, _pPage, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data)) + 1*uintptr(_1_hdr))))) != 0 { return _sqlite3CorruptError(tls, i32(60844)) } func() { - if (_1_pBt.X15) < uint32(i32(512)) || (_1_pBt.X15) > uint32(i32(65536)) { + if _1_pBt.X15 < uint32(i32(512)) || _1_pBt.X15 > uint32(i32(65536)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60845), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(53374))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pPage.X15))) = uint16((_1_pBt.X15) - uint32(i32(1))) - *(*uint8)(unsafe.Pointer(&(_pPage.X9))) = uint8(i32(0)) + *(*uint16)(unsafe.Pointer(&_pPage.X15)) = uint16(_1_pBt.X15 - uint32(i32(1))) + *(*uint8)(unsafe.Pointer(&_pPage.X9)) = uint8(i32(0)) _1_usableSize = int32(_1_pBt.X16) - *(*uint16)(unsafe.Pointer(&(_pPage.X12))) = store14(&_1_cellOffset, uint16((int32(_1_hdr)+i32(8))+int32(_pPage.X7))) - *(**uint8)(unsafe.Pointer(&(_pPage.X20))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_1_usableSize))) - *(**uint8)(unsafe.Pointer(&(_pPage.X21))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_1_cellOffset))) - *(**uint8)(unsafe.Pointer(&(_pPage.X22))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_pPage.X7))) - _1_top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1) - *(*uint16)(unsafe.Pointer(&(_pPage.X14))) = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(1)))))) - if uint32(_pPage.X14) > (((_1_pBt.X15) - uint32(i32(8))) / uint32(i32(6))) { + *(*uint16)(unsafe.Pointer(&_pPage.X12)) = store14(&_1_cellOffset, uint16((int32(_1_hdr)+i32(8))+int32(_pPage.X7))) + *(**uint8)(unsafe.Pointer(&_pPage.X20)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data)) + 1*uintptr(_1_usableSize))) + *(**uint8)(unsafe.Pointer(&_pPage.X21)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data)) + 1*uintptr(_1_cellOffset))) + *(**uint8)(unsafe.Pointer(&_pPage.X22)) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data)) + 1*uintptr(_pPage.X7))) + _1_top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1) + *(*uint16)(unsafe.Pointer(&_pPage.X14)) = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(1)))))) + if uint32(_pPage.X14) > ((_1_pBt.X15 - uint32(i32(8))) / uint32(i32(6))) { return _sqlite3CorruptError(tls, i32(60862)) } func() { - if int32(_pPage.X14) <= i32(0) && _1_top != _1_usableSize && (_sqlite3Config.X6) != i32(0) { + if int32(_pPage.X14) <= i32(0) && _1_top != _1_usableSize && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60869), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(55542))) crt.X__builtin_abort(tls) } @@ -41474,7 +43549,7 @@ func _btreeInitPage(tls *crt.TLS, _pPage *XMemPage) (r0 int32) { if (((*Xsqlite3)(_1_pBt.X1).X6) & i32(536870912)) == 0 { goto _22 } - if (_pPage.X5) == 0 { + if _pPage.X5 == 0 { _1_iCellLast -= 1 } _3_i = i32(0) @@ -41482,25 +43557,26 @@ _24: if _3_i >= int32(_pPage.X14) { goto _27 } - _1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(1))))) + _1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(1))))) if (_1_pc < _1_iCellFirst) || (_1_pc > _1_iCellLast) { return _sqlite3CorruptError(tls, i32(60890)) } - _3_sz = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc))))) + _3_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(_1_pc))))) if (_1_pc + _3_sz) > _1_usableSize { return _sqlite3CorruptError(tls, i32(60895)) } _3_i += 1 goto _24 _27: - if (_pPage.X5) == 0 { + if _pPage.X5 == 0 { _1_iCellLast += 1 } _22: - _1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(1))))) - _1_nFree = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(int32(_1_hdr)+i32(7))))) + _1_top + _1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(1))))) + _1_nFree = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data)) + 1*uintptr(int32(_1_hdr)+i32(7))))) + _1_top if _1_pc <= i32(0) { goto _32 } @@ -41511,8 +43587,8 @@ _33: if _1_pc > _1_iCellLast { return _sqlite3CorruptError(tls, i32(60917)) } - _7_next = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(1)))))) - _7_size = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(1)))))) + _7_next = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(1)))))) + _7_size = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(1)))))) _1_nFree = int32(uint32(_1_nFree) + _7_size) if _7_next <= ((uint32(_1_pc) + _7_size) + uint32(i32(3))) { goto _35 @@ -41530,8 +43606,8 @@ _32: if _1_nFree > _1_usableSize { return _sqlite3CorruptError(tls, i32(60941)) } - *(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16(_1_nFree - _1_iCellFirst) - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(1)) + *(*uint16)(unsafe.Pointer(&_pPage.X13)) = uint16(_1_nFree - _1_iCellFirst) + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = uint8(i32(1)) _12: return i32(0) } @@ -41542,9 +43618,12 @@ func init() { crt.Xstrncpy(nil, &_btreeInitPageØ00__func__Ø000[0], str(55590), 14) } -// If the cell pCell, part of page pPage contains a pointer -// to an overflow page, insert an entry into the pointer-map -// for the overflow page. +// C comment +// /* +// ** If the cell pCell, part of page pPage contains a pointer +// ** to an overflow page, insert an entry into the pointer-map +// ** for the overflow page. +// */ func _ptrmapPutOvflPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pRC *int32) { var _1_ovfl uint32 var _info XCellInfo @@ -41557,11 +43636,12 @@ func _ptrmapPutOvflPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pRC *int3 crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, &_info) - if uint32(_info.X3) < (_info.X2) { - _1_ovfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(int32(_info.X4)-i32(4))))) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, &_info) + if uint32(_info.X3) < _info.X2 { + _1_ovfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(int32(_info.X4)-i32(4))))) _ptrmapPut(tls, (*XBtShared)(_pPage.X18), _1_ovfl, uint8(i32(3)), _pPage.X4, _pRC) } _ = _info @@ -41573,14 +43653,17 @@ func init() { crt.Xstrncpy(nil, &_ptrmapPutOvflPtrØ00__func__Ø000[0], str(55613), 17) } -// Write an entry into the pointer map. -// -// This routine updates the pointer map entry for page number 'key' -// so that it maps to type 'eType' and parent page number 'pgno'. -// -// If *pRC is initially non-zero (non-SQLITE_OK) then this routine is -// a no-op. If an error occurs, the appropriate error code is written -// into *pRC. +// C comment +// /* +// ** Write an entry into the pointer map. +// ** +// ** This routine updates the pointer map entry for page number 'key' +// ** so that it maps to type 'eType' and parent page number 'pgno'. +// ** +// ** If *pRC is initially non-zero (non-SQLITE_OK) then this routine is +// ** a no-op. If an error occurs, the appropriate error code is written +// ** into *pRC. +// */ func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _parent uint32, _pRC *int32) { var _offset, _rc int32 var _iPtrmap uint32 @@ -41596,13 +43679,13 @@ func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _paren } }() func() { - if i32(0) != bool2int(_ptrmapPageno(tls, _pBt, (uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1))) == ((uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1)))) { + if i32(0) != bool2int(_ptrmapPageno(tls, _pBt, (uint32(_sqlite3PendingByte)/_pBt.X15)+uint32(i32(1))) == ((uint32(_sqlite3PendingByte)/_pBt.X15)+uint32(i32(1)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59969), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(55630))) crt.X__builtin_abort(tls) } }() func() { - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59971), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(54378))) crt.X__builtin_abort(tls) } @@ -41629,13 +43712,13 @@ func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _paren } }() _pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) - if int32(_eType) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset)))) && _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1))))) == _parent { + if int32(_eType) == int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap)) + 1*uintptr(_offset)))) && _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap))+1*uintptr(_offset+i32(1))))) == _parent { goto _ptrmap_exit } *_pRC = store1(&_rc, _sqlite3PagerWrite(tls, _pDbPage)) if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset))) = _eType - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1)))), _parent) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap)) + 1*uintptr(_offset))) = _eType + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPtrmap))+1*uintptr(_offset+i32(1)))), _parent) } _ptrmap_exit: _sqlite3PagerUnref(tls, _pDbPage) @@ -41647,18 +43730,21 @@ func init() { crt.Xstrncpy(nil, &_ptrmapPutØ00__func__Ø000[0], str(55676), 10) } -// Somewhere on pPage is a pointer to page iFrom. Modify this pointer so -// that it points to iTo. Parameter eType describes the type of pointer to -// be modified, as follows: -// -// PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child -// page of pPage. -// -// PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow -// page pointed to by one of the cells on pPage. -// -// PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next -// overflow page in the list. +// C comment +// /* +// ** Somewhere on pPage is a pointer to page iFrom. Modify this pointer so +// ** that it points to iTo. Parameter eType describes the type of pointer to +// ** be modified, as follows: +// ** +// ** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child +// ** page of pPage. +// ** +// ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow +// ** page pointed to by one of the cells on pPage. +// ** +// ** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next +// ** overflow page in the list. +// */ func _modifyPagePointer(tls *crt.TLS, _pPage *XMemPage, _iFrom uint32, _iTo uint32, _eType uint8) (r0 int32) { var _3_i, _3_nCell, _3_rc int32 var _4_pCell *uint8 @@ -41694,14 +43780,15 @@ _8: if _3_i >= _3_nCell { goto _11 } - _4_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_3_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_3_i))))) + 1*uintptr(i32(1))))))))) + _4_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_3_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_3_i))))) + 1*uintptr(i32(1))))))))) if int32(_eType) != i32(3) { goto _12 } - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _4_pCell, &_5_info) - if uint32(_5_info.X3) >= (_5_info.X2) { + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _4_pCell, &_5_info) + if uint32(_5_info.X3) >= _5_info.X2 { goto _13 } if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(_5_info.X4))))) > crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr((*XBtShared)(_pPage.X18).X16))))) { @@ -41725,10 +43812,10 @@ _11: if _3_i != _3_nCell { goto _18 } - if (int32(_eType) != i32(5)) || (_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) != _iFrom) { + if (int32(_eType) != i32(5)) || (_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) != _iFrom) { return _sqlite3CorruptError(tls, i32(62477)) } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8)))), _iTo) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8)))), _iTo) _18: _6: return i32(0) @@ -41743,18 +43830,21 @@ func init() { crt.Xstrncpy(nil, &_modifyPagePointerØ00__func__Ø000[0], str(55686), 18) } -// Truncate the in-memory database file image to nPage pages. This -// function does not actually modify the database file on disk. It -// just sets the internal state of the pager object so that the -// truncation will be done when the current transaction is committed. -// -// This function is only called right before committing a transaction. -// Once this function has been called, the transaction must either be -// rolled back or committed. It is not safe to call this function and -// then continue writing to the database. +// C comment +// /* +// ** Truncate the in-memory database file image to nPage pages. This +// ** function does not actually modify the database file on disk. It +// ** just sets the internal state of the pager object so that the +// ** truncation will be done when the current transaction is committed. +// ** +// ** This function is only called right before committing a transaction. +// ** Once this function has been called, the transaction must either be +// ** rolled back or committed. It is not safe to call this function and +// ** then continue writing to the database. +// */ func _sqlite3PagerTruncateImage(tls *crt.TLS, _pPager *XPager, _nPage uint32) { func() { - if (_pPager.X22) < _nPage { + if _pPager.X22 < _nPage { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50876), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000))), unsafe.Pointer(str(55704))) crt.X__builtin_abort(tls) } @@ -41765,7 +43855,7 @@ func _sqlite3PagerTruncateImage(tls *crt.TLS, _pPager *XPager, _nPage uint32) { crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _nPage + *(*uint32)(unsafe.Pointer(&_pPager.X22)) = _nPage } var _sqlite3PagerTruncateImageØ00__func__Ø000 [26]int8 @@ -41774,30 +43864,33 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerTruncateImageØ00__func__Ø000[0], str(55726), 26) } -// Sync the database file for the pager pPager. zMaster points to the name -// of a master journal file that should be written into the individual -// journal file. zMaster may be NULL, which is interpreted as no master -// journal (a single database transaction). -// -// This routine ensures that: -// -// * The database file change-counter is updated, -// * the journal is synced (unless the atomic-write optimization is used), -// * all dirty pages are written to the database file, -// * the database file is truncated (if required), and -// * the database file synced. -// -// The only thing that remains to commit the transaction is to finalize -// (delete, truncate or zero the first part of) the journal file (or -// delete the master journal file if specified). -// -// Note that if zMaster==NULL, this does not overwrite a previous value -// passed to an sqlite3PagerCommitPhaseOne() call. -// -// If the final parameter - noSync - is true, then the database file itself -// is not synced. The caller must call sqlite3PagerSync() directly to -// sync the database file before calling CommitPhaseTwo() to delete the -// journal file in this case. +// C comment +// /* +// ** Sync the database file for the pager pPager. zMaster points to the name +// ** of a master journal file that should be written into the individual +// ** journal file. zMaster may be NULL, which is interpreted as no master +// ** journal (a single database transaction). +// ** +// ** This routine ensures that: +// ** +// ** * The database file change-counter is updated, +// ** * the journal is synced (unless the atomic-write optimization is used), +// ** * all dirty pages are written to the database file, +// ** * the database file is truncated (if required), and +// ** * the database file synced. +// ** +// ** The only thing that remains to commit the transaction is to finalize +// ** (delete, truncate or zero the first part of) the journal file (or +// ** delete the master journal file if specified). +// ** +// ** Note that if zMaster==NULL, this does not overwrite a previous value +// ** passed to an sqlite3PagerCommitPhaseOne() call. +// ** +// ** If the final parameter - noSync - is true, then the database file itself +// ** is not synced. The caller must call sqlite3PagerSync() directly to +// ** sync the database file before calling CommitPhaseTwo() to delete the +// ** journal file in this case. +// */ func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, _noSync int32) (r0 int32) { var _rc int32 var _9_nNew uint32 @@ -41816,7 +43909,7 @@ func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, } }() if func() int32 { - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53236), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -41834,13 +43927,13 @@ func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, return i32(0) } func() { - if int32(_pPager.X13) != i32(0) && (_pPager.X10) == 0 { + if int32(_pPager.X13) != i32(0) && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53247), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55898))) crt.X__builtin_abort(tls) } }() func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53248), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(19565))) crt.X__builtin_abort(tls) } @@ -41857,7 +43950,7 @@ func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, if _3_pList == nil { _rc = _sqlite3PagerGet(tls, _pPager, uint32(i32(1)), &_3_pPageOne, i32(0)) _3_pList = _3_pPageOne - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pList.X3))))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pList.X3)))) = nil } func() { if _rc != i32(0) { @@ -41906,10 +43999,10 @@ _20: goto _commit_phase_one_exit } _sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.X59)) - if (_pPager.X22) <= (_pPager.X24) { + if _pPager.X22 <= _pPager.X24 { goto _35 } - _9_nNew = (_pPager.X22) - uint32(bool2int((_pPager.X22) == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)))) + _9_nNew = _pPager.X22 - uint32(bool2int(_pPager.X22 == uint32((_sqlite3PendingByte/_pPager.X48)+i32(1)))) func() { if int32(_pPager.X14) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55952))) @@ -41927,7 +44020,7 @@ _35: _28: _commit_phase_one_exit: if (_rc == i32(0)) && ((*XWal)(_pPager.X60) == nil) { - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(5)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(5)) } return _rc } @@ -41954,7 +44047,7 @@ func _pagerWalFrames(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr, _nTruncate u var _p *XPgHdr var _2_ppNext **XPgHdr func() { - if (*XWal)(_pPager.X60) == nil { + if _pPager.X60 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50067), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56014))) crt.X__builtin_abort(tls) } @@ -41967,11 +44060,11 @@ func _pagerWalFrames(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr, _nTruncate u }() _p = _pList _4: - if _p == nil || (*XPgHdr)(_p.X3) == nil { + if _p == nil || _p.X3 == nil { goto _8 } func() { - if (_p.X5) >= ((*XPgHdr)(_p.X3).X5) { + if _p.X5 >= ((*XPgHdr)(_p.X3).X5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50072), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56033))) crt.X__builtin_abort(tls) } @@ -41995,8 +44088,8 @@ _15: if store25(_2_ppNext, _p) == nil { goto _18 } - if (_p.X5) <= _nTruncate { - _2_ppNext = (**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) + if _p.X5 <= _nTruncate { + _2_ppNext = (**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) _nList += 1 } _p = (*XPgHdr)(_p.X3) @@ -42013,15 +44106,15 @@ _14: _nList = i32(1) _22: { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(2)))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(i32(2)))) *p = (*p) + _nList sink1(*p) } - if (_pList.X5) == uint32(i32(1)) { + if _pList.X5 == uint32(i32(1)) { _pager_write_changecounter(tls, _pList) } _rc = _sqlite3WalFrames(tls, (*XWal)(_pPager.X60), _pPager.X48, _pList, _nTruncate, _isCommit, int32(_pPager.X8)) - if _rc != i32(0) || (*Xsqlite3_backup)(_pPager.X36) == nil { + if _rc != i32(0) || _pPager.X36 == nil { goto _25 } _p = _pList @@ -42043,12 +44136,15 @@ func init() { crt.Xstrncpy(nil, &_pagerWalFramesØ00__func__Ø000[0], str(56088), 15) } -// Update the value of the change-counter at offsets 24 and 92 in -// the header and the sqlite version number at offset 96. -// -// This is an unconditional update. See also the pager_incr_changecounter() -// routine which only updates the change-counter if the update is actually -// needed, as determined by the pPager->changeCountDone state variable. +// C comment +// /* +// ** Update the value of the change-counter at offsets 24 and 92 in +// ** the header and the sqlite version number at offset 96. +// ** +// ** This is an unconditional update. See also the pager_incr_changecounter() +// ** routine which only updates the change-counter if the update is actually +// ** needed, as determined by the pPager->changeCountDone state variable. +// */ func _pager_write_changecounter(tls *crt.TLS, _pPg *XPgHdr) { var _change_counter uint32 _change_counter = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer((*[16]int8)(unsafe.Pointer(&((*XPager)(_pPg.X4).X40)))))))) + uint32(i32(1)) @@ -42057,8 +44153,11 @@ func _pager_write_changecounter(tls *crt.TLS, _pPg *XPgHdr) { _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*int8)(_pPg.X1)))))+uintptr(i32(96)))), uint32(i32(3019003))) } -// Write a set of frames to the log. The caller must hold the write-lock -// on the log file (obtained using sqlite3WalBeginWriteTransaction()). +// C comment +// /* +// ** Write a set of frames to the log. The caller must hold the write-lock +// ** on the log file (obtained using sqlite3WalBeginWriteTransaction()). +// */ func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, _nTruncate uint32, _isCommit int32, _sync_flags int32) (r0 int32) { var _rc, _nExtra, _szFrame, _6_nDbSize, _11_bSync, _12_sectorSize int32 var _iOffset, _8_iOff, _15_sz int64 @@ -42079,7 +44178,7 @@ func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, } }() func() { - if (_pWal.X12) == 0 { + if _pWal.X12 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(15606))) crt.X__builtin_abort(tls) } @@ -42091,37 +44190,37 @@ func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, } }() _pLive = _walIndexHdr(tls, _pWal) - if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_pLive), u64(48)) != i32(0) { - _iFirst = (_pLive.X6) + uint32(i32(1)) + if crt.Xmemcmp(tls, unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18))), unsafe.Pointer(_pLive), u64(48)) != i32(0) { + _iFirst = _pLive.X6 + uint32(i32(1)) } if i32(0) != store1(&_rc, _walRestartLog(tls, _pWal)) { return _rc } - _iFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + _iFrame = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 if _iFrame != uint32(i32(0)) { goto _8 } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(0)))), uint32(i32(931071618))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(4)))), uint32(i32(3007000))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(8)))), uint32(_szPage)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(12)))), _pWal.X22) - if (_pWal.X22) == uint32(i32(0)) { - Xsqlite3_randomness(tls, i32(8), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9))))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(0)))), uint32(i32(931071618))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(4)))), uint32(i32(3007000))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(8)))), uint32(_szPage)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(12)))), _pWal.X22) + if _pWal.X22 == uint32(i32(0)) { + Xsqlite3_randomness(tls, i32(8), unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9))))) } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(16))))), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(16))))), unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9)))), uint64(i32(8))) _walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer(&_3_aWalHdr)), i32(24), nil, (*uint32)(unsafe.Pointer(&_3_aCksum))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(24)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(0))))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(28)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(1))))) - *(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32(_szPage) - *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(1)))) - *(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(1)) - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_3_aWalHdr), int32(u64(32)), int64(i32(0))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(24)))), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aCksum)) + 4*uintptr(i32(0))))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aWalHdr))+1*uintptr(i32(28)))), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aCksum)) + 4*uintptr(i32(1))))) + *(*uint32)(unsafe.Pointer(&_pWal.X8)) = uint32(_szPage) + *(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X4))) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aCksum)) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_aCksum)) + 4*uintptr(i32(1)))) + *(*uint8)(unsafe.Pointer(&_pWal.X15)) = uint8(i32(1)) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(&_3_aWalHdr), int32(u64(32)), int64(i32(0))) if _rc != i32(0) { return _rc } - if (_pWal.X16) == 0 || _sync_flags == 0 { + if _pWal.X16 == 0 || _sync_flags == 0 { goto _12 } _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X2), _sync_flags&i32(19)) @@ -42136,11 +44235,11 @@ _8: crt.X__builtin_abort(tls) } }() - *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pWal - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X1))))) = (*Xsqlite3_file)(_pWal.X2) - *(*int64)(unsafe.Pointer(&(_w.X2))) = int64(i32(0)) - *(*int32)(unsafe.Pointer(&(_w.X3))) = _sync_flags - *(*int32)(unsafe.Pointer(&(_w.X4))) = _szPage + *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = _pWal + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X1)))) = (*Xsqlite3_file)(_pWal.X2) + *(*int64)(unsafe.Pointer(&_w.X2)) = int64(i32(0)) + *(*int32)(unsafe.Pointer(&_w.X3)) = _sync_flags + *(*int32)(unsafe.Pointer(&_w.X4)) = _szPage _iOffset = int64(i32(32)) + (int64((_iFrame+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24))) _szFrame = _szPage + i32(24) _p = _pList @@ -42148,7 +44247,7 @@ _16: if _p == nil { goto _19 } - if _iFirst == 0 || (*XPgHdr)(_p.X3) == nil && _isCommit != i32(0) { + if _iFirst == 0 || _p.X3 == nil && _isCommit != i32(0) { goto _22 } _7_iWrite = uint32(i32(0)) @@ -42163,8 +44262,8 @@ _16: goto _26 } _8_iOff = (int64(i32(32)) + (int64(_7_iWrite-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(24)) - if ((_pWal.X20) == uint32(i32(0))) || (_7_iWrite < (_pWal.X20)) { - *(*uint32)(unsafe.Pointer(&(_pWal.X20))) = _7_iWrite + if (_pWal.X20 == uint32(i32(0))) || (_7_iWrite < _pWal.X20) { + *(*uint32)(unsafe.Pointer(&_pWal.X20)) = _7_iWrite } _8_pData = _p.X1 _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), _8_pData, _szPage, _8_iOff) @@ -42172,7 +44271,7 @@ _16: return _rc } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) & i32(-65)) sink14(*p) } @@ -42203,7 +44302,7 @@ _22: sink6(*p) } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) | i32(64)) sink14(*p) } @@ -42211,7 +44310,7 @@ _17: _p = (*XPgHdr)(_p.X3) goto _16 _19: - if _isCommit == 0 || (_pWal.X20) == 0 { + if _isCommit == 0 || _pWal.X20 == 0 { goto _37 } _rc = _walRewriteChecksums(tls, _pWal, _iFrame) @@ -42223,14 +44322,14 @@ _37: goto _40 } _11_bSync = i32(1) - if (_pWal.X17) == 0 { + if _pWal.X17 == 0 { goto _41 } _12_sectorSize = _sqlite3SectorSize(tls, (*Xsqlite3_file)(_pWal.X2)) - *(*int64)(unsafe.Pointer(&(_w.X2))) = (((_iOffset + int64(_12_sectorSize)) - int64(i32(1))) / int64(_12_sectorSize)) * int64(_12_sectorSize) - _11_bSync = bool2int((_w.X2) == _iOffset) + *(*int64)(unsafe.Pointer(&_w.X2)) = (((_iOffset + int64(_12_sectorSize)) - int64(i32(1))) / int64(_12_sectorSize)) * int64(_12_sectorSize) + _11_bSync = bool2int(_w.X2 == _iOffset) _42: - if _iOffset >= (_w.X2) { + if _iOffset >= _w.X2 { goto _43 } _rc = _walWriteOneFrame(tls, &_w, _pLast, int32(_nTruncate), _iOffset) @@ -42256,17 +44355,17 @@ _41: _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_w.X1), _sync_flags&i32(19)) } _40: - if _isCommit == 0 || (_pWal.X15) == 0 || (_pWal.X4) < int64(i32(0)) { + if _isCommit == 0 || _pWal.X15 == 0 || _pWal.X4 < int64(i32(0)) { goto _50 } _15_sz = _pWal.X4 - if (int64(i32(32)) + (int64(((_iFrame+uint32(_nExtra))+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) > (_pWal.X4) { + if (int64(i32(32)) + (int64(((_iFrame+uint32(_nExtra))+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) > _pWal.X4 { _15_sz = int64(i32(32)) + (int64(((_iFrame+uint32(_nExtra))+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24))) } _walLimitSize(tls, _pWal, _15_sz) - *(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWal.X15)) = uint8(i32(0)) _50: - _iFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6 + _iFrame = (*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6 _p = _pList _52: if _p == nil || _rc != i32(0) { @@ -42290,15 +44389,15 @@ _56: if _rc != i32(0) { goto _61 } - *(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5))) = uint16((_szPage & i32(65280)) | (_szPage >> uint(i32(16)))) - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = _iFrame + *(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X5))) = uint16((_szPage & i32(65280)) | (_szPage >> uint(i32(16)))) + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6))) = _iFrame if _isCommit != 0 { - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X2))) += 1 - *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7))) = _nTruncate + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X2))) += 1 + *(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X7))) = _nTruncate } if _isCommit != 0 { _walIndexWriteHdr(tls, _pWal) - *(*uint32)(unsafe.Pointer(&(_pWal.X3))) = _iFrame + *(*uint32)(unsafe.Pointer(&_pWal.X3)) = _iFrame } _61: return _rc @@ -42315,16 +44414,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WalFramesØ00__func__Ø000[0], str(56226), 17) } -// This function is called just before writing a set of frames to the log -// file (see sqlite3WalFrames()). It checks to see if, instead of appending -// to the current log file, it is possible to overwrite the start of the -// existing log file with the new frames (i.e. "reset" the log). If so, -// it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left -// unchanged. -// -// SQLITE_OK is returned if no error is encountered (regardless of whether -// or not pWal->hdr.mxFrame is modified). An SQLite error code is returned -// if an error occurs. +// C comment +// /* +// ** This function is called just before writing a set of frames to the log +// ** file (see sqlite3WalFrames()). It checks to see if, instead of appending +// ** to the current log file, it is possible to overwrite the start of the +// ** existing log file with the new frames (i.e. "reset" the log). If so, +// ** it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left +// ** unchanged. +// ** +// ** SQLITE_OK is returned if no error is encountered (regardless of whether +// ** or not pWal->hdr.mxFrame is modified). An SQLite error code is returned +// ** if an error occurs. +// */ func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) { var _rc, _cnt, _5_notUsed int32 var _2_salt1 uint32 @@ -42335,15 +44437,15 @@ func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) { } _1_pInfo = _walCkptInfo(tls, _pWal) func() { - if (_1_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) { + if _1_pInfo.X0 != ((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X6) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57356), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRestartLogØ00__func__Ø000))), unsafe.Pointer(str(22957))) crt.X__builtin_abort(tls) } }() - if (_1_pInfo.X0) <= uint32(i32(0)) { + if _1_pInfo.X0 <= uint32(i32(0)) { goto _3 } - Xsqlite3_randomness(tls, i32(4), (unsafe.Pointer)(&_2_salt1)) + Xsqlite3_randomness(tls, i32(4), unsafe.Pointer(&_2_salt1)) _rc = _walLockExclusive(tls, _pWal, i32(4), i32(4)) if _rc == i32(0) { _walRestartHdr(tls, _pWal, _2_salt1) @@ -42356,7 +44458,7 @@ func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) { _6: _3: _walUnlockShared(tls, _pWal, i32(3)) - *(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_pWal.X9)) = int16(i32(-1)) _cnt = i32(0) _7: _rc = _walTryBeginRead(tls, _pWal, &_5_notUsed, i32(1), preInc1(&_cnt, 1)) @@ -42383,14 +44485,17 @@ func init() { crt.Xstrncpy(nil, &_walRestartLogØ00__func__Ø000[0], str(56266), 14) } -// Write out a single frame of the WAL +// C comment +// /* +// ** Write out a single frame of the WAL +// */ func _walWriteOneFrame(tls *crt.TLS, _p *XWalWriter, _pPage *XPgHdr, _nTruncate int32, _iOffset int64) (r0 int32) { var _rc int32 var _pData unsafe.Pointer var _aFrame [24]uint8 _pData = _pPage.X1 _walEncodeFrame(tls, (*XWal)(_p.X0), _pPage.X5, uint32(_nTruncate), (*uint8)(_pData), (*uint8)(unsafe.Pointer(&_aFrame))) - _rc = _walWriteToLog(tls, _p, (unsafe.Pointer)(&_aFrame), int32(u64(24)), _iOffset) + _rc = _walWriteToLog(tls, _p, unsafe.Pointer(&_aFrame), int32(u64(24)), _iOffset) if _rc != 0 { return _rc } @@ -42401,49 +44506,55 @@ func _walWriteOneFrame(tls *crt.TLS, _p *XWalWriter, _pPage *XPgHdr, _nTruncate panic(0) } -// This function encodes a single frame header and writes it to a buffer -// supplied by the caller. A frame-header is made up of a series of -// 4-byte big-endian integers, as follows: -// -// 0: Page number. -// 4: For commit records, the size of the database image in pages -// after the commit. For all other records, zero. -// 8: Salt-1 (copied from the wal-header) -// 12: Salt-2 (copied from the wal-header) -// 16: Checksum-1. -// 20: Checksum-2. +// C comment +// /* +// ** This function encodes a single frame header and writes it to a buffer +// ** supplied by the caller. A frame-header is made up of a series of +// ** 4-byte big-endian integers, as follows: +// ** +// ** 0: Page number. +// ** 4: For commit records, the size of the database image in pages +// ** after the commit. For all other records, zero. +// ** 8: Salt-1 (copied from the wal-header) +// ** 12: Salt-2 (copied from the wal-header) +// ** 16: Checksum-1. +// ** 20: Checksum-2. +// */ func _walEncodeFrame(tls *crt.TLS, _pWal *XWal, _iPage uint32, _nTruncate uint32, _aData *uint8, _aFrame *uint8) { var _nativeCksum int32 var _aCksum *uint32 - _aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + _aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) i32(0) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(0)))), _iPage) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(4)))), _nTruncate) - if (_pWal.X20) == uint32(i32(0)) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), uint64(i32(8))) - _nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(0)))), _iPage) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(4)))), _nTruncate) + if _pWal.X20 == uint32(i32(0)) { + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(8))))), unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X9)))), uint64(i32(8))) + _nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X4) == i32(0)) _walChecksumBytes(tls, _nativeCksum, _aFrame, i32(8), _aCksum, _aCksum) _walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.X8), _aCksum, _aCksum) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(16)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(0))))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(20)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(1))))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(16)))), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCksum)) + 4*uintptr(i32(0))))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(20)))), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCksum)) + 4*uintptr(i32(1))))) goto _1 } - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), i32(0), uint64(i32(16))) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrame))+1*uintptr(i32(8))))), i32(0), uint64(i32(16))) _1: } -// Write iAmt bytes of content into the WAL file beginning at iOffset. -// Do a sync when crossing the p->iSyncPoint boundary. -// -// In other words, if iSyncPoint is in between iOffset and iOffset+iAmt, -// first write the part before iSyncPoint, then sync, then write the -// rest. +// C comment +// /* +// ** Write iAmt bytes of content into the WAL file beginning at iOffset. +// ** Do a sync when crossing the p->iSyncPoint boundary. +// ** +// ** In other words, if iSyncPoint is in between iOffset and iOffset+iAmt, +// ** first write the part before iSyncPoint, then sync, then write the +// ** rest. +// */ func _walWriteToLog(tls *crt.TLS, _p *XWalWriter, _pContent unsafe.Pointer, _iAmt int32, _iOffset int64) (r0 int32) { var _rc, _1_iFirstAmt int32 - if _iOffset >= (_p.X2) || (_iOffset+int64(_iAmt)) < (_p.X2) { + if _iOffset >= _p.X2 || (_iOffset+int64(_iAmt)) < _p.X2 { goto _1 } - _1_iFirstAmt = int32((_p.X2) - _iOffset) + _1_iFirstAmt = int32(_p.X2 - _iOffset) _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X1), _pContent, _1_iFirstAmt, _iOffset) if _rc != 0 { return _rc @@ -42458,14 +44569,14 @@ func _walWriteToLog(tls *crt.TLS, _p *XWalWriter, _pContent unsafe.Pointer, _iAm *p = (*p) - _1_iFirstAmt sink1(*p) } - _pContent = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_1_iFirstAmt) + uintptr(unsafe.Pointer((*int8)(_pContent)))))) + _pContent = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_1_iFirstAmt) + uintptr(unsafe.Pointer((*int8)(_pContent)))))) func() { - if ((_p.X3) & i32(3)) == 0 { + if (_p.X3 & i32(3)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57427), unsafe.Pointer((*int8)(unsafe.Pointer(&_walWriteToLogØ00__func__Ø000))), unsafe.Pointer(str(56280))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_p.X1), (_p.X3)&i32(19)) + _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_p.X1), _p.X3&i32(19)) if (_iAmt == i32(0)) || _rc != 0 { return _rc } @@ -42480,12 +44591,15 @@ func init() { crt.Xstrncpy(nil, &_walWriteToLogØ00__func__Ø000[0], str(56333), 14) } -// This function is called as part of committing a transaction within which -// one or more frames have been overwritten. It updates the checksums for -// all frames written to the wal file by the current transaction starting -// with the earliest to have been overwritten. -// -// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** This function is called as part of committing a transaction within which +// ** one or more frames have been overwritten. It updates the checksums for +// ** all frames written to the wal file by the current transaction starting +// ** with the earliest to have been overwritten. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// */ func _walRewriteChecksums(tls *crt.TLS, _pWal *XWal, _iLast uint32) (r0 int32) { var _szPage, _rc int32 var _iCksumOff, _3_iOff int64 @@ -42499,38 +44613,38 @@ func _walRewriteChecksums(tls *crt.TLS, _pWal *XWal, _iLast uint32) (r0 int32) { return _sqlite3NomemError(tls, i32(57477)) } func() { - if (_pWal.X20) <= uint32(i32(0)) { + if _pWal.X20 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57484), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRewriteChecksumsØ00__func__Ø000))), unsafe.Pointer(str(56347))) crt.X__builtin_abort(tls) } }() - if (_pWal.X20) == uint32(i32(1)) { + if _pWal.X20 == uint32(i32(1)) { _iCksumOff = int64(i32(24)) goto _4 } - _iCksumOff = (int64(i32(32)) + (int64(((_pWal.X20)-uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(16)) + _iCksumOff = (int64(i32(32)) + (int64((_pWal.X20-uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(16)) _4: - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_aBuf), int32(u64(8)), _iCksumOff) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = _sqlite3Get4byte(tls, _aBuf) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(u64(4))))) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(_aBuf), int32(u64(8)), _iCksumOff) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(0)))) = _sqlite3Get4byte(tls, _aBuf) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&_pWal.X18)).X8))))) + 4*uintptr(i32(1)))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aBuf))+1*uintptr(u64(4))))) _iRead = _pWal.X20 - *(*uint32)(unsafe.Pointer(&(_pWal.X20))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pWal.X20)) = uint32(i32(0)) _5: if _rc != i32(0) || _iRead > _iLast { goto _9 } _3_iOff = int64(i32(32)) + (int64(_iRead-uint32(i32(1))) * int64(_szPage+i32(24))) - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_aBuf), _szPage+i32(24), _3_iOff) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(_aBuf), _szPage+i32(24), _3_iOff) if _rc == i32(0) { _4_iPgno = _sqlite3Get4byte(tls, _aBuf) - _4_nDbSize = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(i32(4))))) - _walEncodeFrame(tls, _pWal, _4_iPgno, _4_nDbSize, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(i32(24)))), (*uint8)(unsafe.Pointer(&_aFrame))) - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_aFrame), int32(u64(24)), _3_iOff) + _4_nDbSize = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aBuf))+1*uintptr(i32(4))))) + _walEncodeFrame(tls, _pWal, _4_iPgno, _4_nDbSize, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aBuf))+1*uintptr(i32(24)))), (*uint8)(unsafe.Pointer(&_aFrame))) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), unsafe.Pointer(&_aFrame), int32(u64(24)), _3_iOff) } _iRead += 1 goto _5 _9: - Xsqlite3_free(tls, (unsafe.Pointer)(_aBuf)) + Xsqlite3_free(tls, unsafe.Pointer(_aBuf)) return _rc _ = _aFrame @@ -42543,26 +44657,29 @@ func init() { crt.Xstrncpy(nil, &_walRewriteChecksumsØ00__func__Ø000[0], str(56364), 20) } -// This routine is called to increment the value of the database file -// change-counter, stored as a 4-byte big-endian integer starting at -// byte offset 24 of the pager file. The secondary change counter at -// 92 is also updated, as is the SQLite version number at offset 96. -// -// But this only happens if the pPager->changeCountDone flag is false. -// To avoid excess churning of page 1, the update only happens once. -// See also the pager_write_changecounter() routine that does an -// unconditional update of the change counters. -// -// If the isDirectMode flag is zero, then this is done by calling -// sqlite3PagerWrite() on page 1, then modifying the contents of the -// page data. In this case the file will be updated when the current -// transaction is committed. -// -// The isDirectMode flag may only be non-zero if the library was compiled -// with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case, -// if isDirect is non-zero, then the database file is updated directly -// by writing an updated version of page 1 using a call to the -// sqlite3OsWrite() function. +// C comment +// /* +// ** This routine is called to increment the value of the database file +// ** change-counter, stored as a 4-byte big-endian integer starting at +// ** byte offset 24 of the pager file. The secondary change counter at +// ** 92 is also updated, as is the SQLite version number at offset 96. +// ** +// ** But this only happens if the pPager->changeCountDone flag is false. +// ** To avoid excess churning of page 1, the update only happens once. +// ** See also the pager_write_changecounter() routine that does an +// ** unconditional update of the change counters. +// ** +// ** If the isDirectMode flag is zero, then this is done by calling +// ** sqlite3PagerWrite() on page 1, then modifying the contents of the +// ** page data. In this case the file will be updated when the current +// ** transaction is committed. +// ** +// ** The isDirectMode flag may only be non-zero if the library was compiled +// ** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case, +// ** if isDirect is non-zero, then the database file is updated directly +// ** by writing an updated version of page 1 using a call to the +// ** sqlite3OsWrite() function. +// */ func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int32) (r0 int32) { var _rc int32 var _4_zBuf, _6_pCopy unsafe.Pointer @@ -42587,8 +44704,8 @@ func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int3 } }() - if (_pPager.X16) != 0 || func() int32 { - if (_pPager.X22) > uint32(i32(0)) { + if _pPager.X16 != 0 || func() int32 { + if _pPager.X22 > uint32(i32(0)) { return i32(1) } return func() int32 { @@ -42600,7 +44717,7 @@ func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int3 goto _10 } func() { - if (_pPager.X10) != 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil { + if _pPager.X10 != 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53099), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(56400))) crt.X__builtin_abort(tls) } @@ -42630,7 +44747,7 @@ func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int3 _pager_write_changecounter(tls, _1_pPgHdr) goto _22 _22: - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = uint8(i32(1)) _21: _sqlite3PagerUnref(tls, _1_pPgHdr) _10: @@ -42647,23 +44764,26 @@ func init() { crt.Xstrncpy(nil, &_pager_incr_changecounterØ00__func__Ø000[0], str(56467), 25) } -// Write the supplied master journal name into the journal file for pager -// pPager at the current location. The master journal name must be the last -// thing written to a journal file. If the pager is in full-sync mode, the -// journal file descriptor is advanced to the next sector boundary before -// anything is written. The format is: -// -// + 4 bytes: PAGER_MJ_PGNO. -// + N bytes: Master journal filename in utf-8. -// + 4 bytes: N (length of master journal name in bytes, no nul-terminator). -// + 4 bytes: Master journal name checksum. -// + 8 bytes: aJournalMagic[]. -// -// The master journal page checksum is the sum of the bytes in the master -// journal name, where each byte is interpreted as a signed 8-bit integer. -// -// If zMaster is a NULL pointer (occurs for a single database transaction), -// this call is a no-op. +// C comment +// /* +// ** Write the supplied master journal name into the journal file for pager +// ** pPager at the current location. The master journal name must be the last +// ** thing written to a journal file. If the pager is in full-sync mode, the +// ** journal file descriptor is advanced to the next sector boundary before +// ** anything is written. The format is: +// ** +// ** + 4 bytes: PAGER_MJ_PGNO. +// ** + N bytes: Master journal filename in utf-8. +// ** + 4 bytes: N (length of master journal name in bytes, no nul-terminator). +// ** + 4 bytes: Master journal name checksum. +// ** + 8 bytes: aJournalMagic[]. +// ** +// ** The master journal page checksum is the sum of the bytes in the master +// ** journal name, where each byte is interpreted as a signed 8-bit integer. +// ** +// ** If zMaster is a NULL pointer (occurs for a single database transaction), +// ** this call is a no-op. +// */ func _writeMasterJournal(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) { var _rc, _nMaster int32 var _iHdrOff, _jrnlSize int64 @@ -42684,39 +44804,39 @@ func _writeMasterJournal(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int3 if ((_zMaster == nil) || (int32(_pPager.X2) == i32(4))) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil) { return i32(0) } - *(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X17)) = uint8(i32(1)) func() { - if (_pPager.X35) > (_pPager.X34) { + if _pPager.X35 > _pPager.X34 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48595), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000))), unsafe.Pointer(str(13683))) crt.X__builtin_abort(tls) } }() _nMaster = i32(0) _9: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_nMaster)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(_nMaster)))) == 0 { goto _12 } { p := &_cksum - *p = (*p) + uint32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_nMaster)))) + *p = (*p) + uint32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMaster)) + 1*uintptr(_nMaster)))) sink5(*p) } _nMaster += 1 goto _9 _12: - if (_pPager.X5) != 0 { - *(*int64)(unsafe.Pointer(&(_pPager.X34))) = _journalHdrOffset(tls, _pPager) + if _pPager.X5 != 0 { + *(*int64)(unsafe.Pointer(&_pPager.X34)) = _journalHdrOffset(tls, _pPager) } _iHdrOff = _pPager.X34 - if ((((i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff, uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_zMaster), _nMaster, _iHdrOff+int64(i32(4)))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), (_iHdrOff+int64(i32(4)))+int64(_nMaster), uint32(_nMaster))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(4)), _cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_aJournalMagic), i32(8), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(8))))) { + if ((((i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff, uint32((_sqlite3PendingByte/_pPager.X48)+i32(1))))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(_zMaster), _nMaster, _iHdrOff+int64(i32(4)))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), (_iHdrOff+int64(i32(4)))+int64(_nMaster), uint32(_nMaster))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(4)), _cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_aJournalMagic), i32(8), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(8))))) { return _rc } { - p := (*int64)(unsafe.Pointer(&(_pPager.X34))) + p := (*int64)(unsafe.Pointer(&_pPager.X34)) *p = (*p) + int64(_nMaster+i32(20)) sink6(*p) } - if (i32(0) == store1(&_rc, _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), &_jrnlSize))) && (_jrnlSize > (_pPager.X34)) { + if (i32(0) == store1(&_rc, _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), &_jrnlSize))) && (_jrnlSize > _pPager.X34) { _rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), _pPager.X34) } return _rc @@ -42728,39 +44848,42 @@ func init() { crt.Xstrncpy(nil, &_writeMasterJournalØ00__func__Ø000[0], str(56492), 19) } -// Sync the journal. In other words, make sure all the pages that have -// been written to the journal have actually reached the surface of the -// disk and can be restored in the event of a hot-journal rollback. -// -// If the Pager.noSync flag is set, then this function is a no-op. -// Otherwise, the actions required depend on the journal-mode and the -// device characteristics of the file-system, as follows: -// -// * If the journal file is an in-memory journal file, no action need -// be taken. -// -// * Otherwise, if the device does not support the SAFE_APPEND property, -// then the nRec field of the most recently written journal header -// is updated to contain the number of journal records that have -// been written following it. If the pager is operating in full-sync -// mode, then the journal file is synced before this field is updated. -// -// * If the device does not support the SEQUENTIAL property, then -// journal file is synced. -// -// Or, in pseudo-code: -// -// if( NOT <in-memory journal> ){ -// if( NOT SAFE_APPEND ){ -// if( <full-sync mode> ) xSync(<journal file>); -// <update nRec field> -// } -// if( NOT SEQUENTIAL ) xSync(<journal file>); -// } -// -// 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. +// C comment +// /* +// ** Sync the journal. In other words, make sure all the pages that have +// ** been written to the journal have actually reached the surface of the +// ** disk and can be restored in the event of a hot-journal rollback. +// ** +// ** If the Pager.noSync flag is set, then this function is a no-op. +// ** Otherwise, the actions required depend on the journal-mode and the +// ** device characteristics of the file-system, as follows: +// ** +// ** * If the journal file is an in-memory journal file, no action need +// ** be taken. +// ** +// ** * Otherwise, if the device does not support the SAFE_APPEND property, +// ** then the nRec field of the most recently written journal header +// ** is updated to contain the number of journal records that have +// ** been written following it. If the pager is operating in full-sync +// ** mode, then the journal file is synced before this field is updated. +// ** +// ** * If the device does not support the SEQUENTIAL property, then +// ** journal file is synced. +// ** +// ** Or, in pseudo-code: +// ** +// ** if( NOT <in-memory journal> ){ +// ** if( NOT SAFE_APPEND ){ +// ** if( <full-sync mode> ) xSync(<journal file>); +// ** <update nRec field> +// ** } +// ** if( NOT SEQUENTIAL ) xSync(<journal file>); +// ** } +// ** +// ** If successful, this routine clears the PGHDR_NEED_SYNC flag of every +// ** page currently held in memory before returning SQLITE_OK. If an IO +// ** error is encountered, then the IO error code is returned to the caller. +// */ func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) { var _rc, _2_iDc int32 var _3_iNextHdrOffset int64 @@ -42788,11 +44911,11 @@ func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) { if _rc != i32(0) { return _rc } - if (_pPager.X4) != 0 { + if _pPager.X4 != 0 { goto _8 } func() { - if (_pPager.X10) != 0 { + if _pPager.X10 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51130), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(51663))) crt.X__builtin_abort(tls) } @@ -42810,17 +44933,17 @@ func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) { if i32(0) != (_2_iDc & i32(512)) { goto _15 } - crt.Xmemcpy(tls, (unsafe.Pointer)(&_3_zHeader), (unsafe.Pointer)(&_aJournalMagic), u64(8)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_zHeader))+1*uintptr(u64(8)))), uint32(_pPager.X27)) + crt.Xmemcpy(tls, unsafe.Pointer(&_3_zHeader), unsafe.Pointer(&_aJournalMagic), u64(8)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_3_zHeader))+1*uintptr(u64(8)))), uint32(_pPager.X27)) _3_iNextHdrOffset = _journalHdrOffset(tls, _pPager) - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_3_aMagic), i32(8), _3_iNextHdrOffset) - if (_rc == i32(0)) && (i32(0) == crt.Xmemcmp(tls, (unsafe.Pointer)(&_3_aMagic), (unsafe.Pointer)(&_aJournalMagic), uint64(i32(8)))) { - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_syncJournalØ00zerobyteØ001), i32(1), _3_iNextHdrOffset) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_3_aMagic), i32(8), _3_iNextHdrOffset) + if (_rc == i32(0)) && (i32(0) == crt.Xmemcmp(tls, unsafe.Pointer(&_3_aMagic), unsafe.Pointer(&_aJournalMagic), uint64(i32(8)))) { + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_syncJournalØ00zerobyteØ001), i32(1), _3_iNextHdrOffset) } if (_rc != i32(0)) && (_rc != i32(522)) { return _rc } - if (_pPager.X5) == 0 || i32(0) != (_2_iDc&i32(1024)) { + if _pPager.X5 == 0 || i32(0) != (_2_iDc&i32(1024)) { goto _21 } _rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), int32(_pPager.X9)) @@ -42828,7 +44951,7 @@ func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) { return _rc } _21: - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_3_zHeader), int32(u64(12)), _pPager.X35) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), unsafe.Pointer(&_3_zHeader), int32(u64(12)), _pPager.X35) if _rc != i32(0) { return _rc } @@ -42846,11 +44969,11 @@ _15: return _rc } _24: - *(*int64)(unsafe.Pointer(&(_pPager.X35))) = _pPager.X34 + *(*int64)(unsafe.Pointer(&_pPager.X35)) = _pPager.X34 if _newHdr == 0 || i32(0) != (_2_iDc&i32(512)) { goto _29 } - *(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0) + *(*int32)(unsafe.Pointer(&_pPager.X27)) = i32(0) _rc = _writeJournalHdr(tls, _pPager) if _rc != i32(0) { return _rc @@ -42858,11 +44981,11 @@ _24: _29: goto _31 _12: - *(*int64)(unsafe.Pointer(&(_pPager.X35))) = _pPager.X34 + *(*int64)(unsafe.Pointer(&_pPager.X35)) = _pPager.X34 _31: _8: _sqlite3PcacheClearSyncFlags(tls, (*XPCache)(_pPager.X59)) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(4)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(4)) func() { if _assert_pager_state(tls, _pPager) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51224), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(11016))) @@ -42882,15 +45005,18 @@ func init() { crt.Xstrncpy(nil, &_syncJournalØ00__func__Ø000[0], str(56511), 12) } -// This function may only be called while a write-transaction is active in -// rollback. If the connection is in WAL mode, this call is a no-op. -// Otherwise, if the connection does not already have an EXCLUSIVE lock on -// the database file, an attempt is made to obtain one. -// -// If the EXCLUSIVE lock is already held or the attempt to obtain it is -// successful, or the connection is in WAL mode, SQLITE_OK is returned. -// Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is -// returned. +// C comment +// /* +// ** This function may only be called while a write-transaction is active in +// ** rollback. If the connection is in WAL mode, this call is a no-op. +// ** Otherwise, if the connection does not already have an EXCLUSIVE lock on +// ** the database file, an attempt is made to obtain one. +// ** +// ** If the EXCLUSIVE lock is already held or the attempt to obtain it is +// ** successful, or the connection is in WAL mode, SQLITE_OK is returned. +// ** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is +// ** returned. +// */ func _sqlite3PagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 _rc = _pPager.X26 @@ -42930,7 +45056,10 @@ func init() { var _syncJournalØ00zerobyteØ001 uint8 -// Clear the PGHDR_NEED_SYNC flag from all dirty pages. +// C comment +// /* +// ** Clear the PGHDR_NEED_SYNC flag from all dirty pages. +// */ func _sqlite3PcacheClearSyncFlags(tls *crt.TLS, _pCache *XPCache) { var _p *XPgHdr _p = (*XPgHdr)(_pCache.X0) @@ -42939,46 +45068,49 @@ _0: goto _3 } { - p := (*uint16)(unsafe.Pointer(&(_p.X6))) + p := (*uint16)(unsafe.Pointer(&_p.X6)) *p = uint16(int32(*p) & i32(-9)) sink14(*p) } _p = (*XPgHdr)(_p.X9) goto _0 _3: - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = (*XPgHdr)(_pCache.X1) -} - -// The argument is the first in a linked list of dirty pages connected -// by the PgHdr.pDirty pointer. This function writes each one of the -// in-memory pages in the list to the database file. The argument may -// be NULL, representing an empty list. In this case this function is -// a no-op. -// -// The pager must hold at least a RESERVED lock when this function -// is called. Before writing anything to the database file, this lock -// is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained, -// SQLITE_BUSY is returned and no data is written to the database file. -// -// If the pager is a temp-file pager and the actual file-system file -// is not yet open, it is created and opened before any data is -// written out. -// -// Once the lock has been upgraded and, if necessary, the file opened, -// the pages are written out to the database file in list order. Writing -// a page is skipped if it meets either of the following criteria: -// -// * The page number is greater than Pager.dbSize, or -// * The PGHDR_DONT_WRITE flag is set on the page. -// -// If writing out a page causes the database file to grow, Pager.dbFileSize -// is updated accordingly. If page 1 is written out, then the value cached -// in Pager.dbFileVers[] is updated to match the new value stored in -// the database file. -// -// If everything is successful, SQLITE_OK is returned. If an IO error -// occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot -// be obtained, SQLITE_BUSY is returned. + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCache.X2)))) = (*XPgHdr)(_pCache.X1) +} + +// C comment +// /* +// ** The argument is the first in a linked list of dirty pages connected +// ** by the PgHdr.pDirty pointer. This function writes each one of the +// ** in-memory pages in the list to the database file. The argument may +// ** be NULL, representing an empty list. In this case this function is +// ** a no-op. +// ** +// ** The pager must hold at least a RESERVED lock when this function +// ** is called. Before writing anything to the database file, this lock +// ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained, +// ** SQLITE_BUSY is returned and no data is written to the database file. +// ** +// ** If the pager is a temp-file pager and the actual file-system file +// ** is not yet open, it is created and opened before any data is +// ** written out. +// ** +// ** Once the lock has been upgraded and, if necessary, the file opened, +// ** the pages are written out to the database file in list order. Writing +// ** a page is skipped if it meets either of the following criteria: +// ** +// ** * The page number is greater than Pager.dbSize, or +// ** * The PGHDR_DONT_WRITE flag is set on the page. +// ** +// ** If writing out a page causes the database file to grow, Pager.dbFileSize +// ** is updated accordingly. If page 1 is written out, then the value cached +// ** in Pager.dbFileVers[] is updated to match the new value stored in +// ** the database file. +// ** +// ** If everything is successful, SQLITE_OK is returned. If an IO error +// ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot +// ** be obtained, SQLITE_BUSY is returned. +// */ func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 int32) { var _rc int32 var _2_szFile, _4_offset int64 @@ -42992,7 +45124,7 @@ func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 in } }() func() { - if (_pPager.X10) == 0 && int32(_pPager.X14) != i32(4) { + if _pPager.X10 == 0 && int32(_pPager.X14) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51265), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56664))) crt.X__builtin_abort(tls) } @@ -43011,7 +45143,7 @@ func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 in }() if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil { func() { - if (_pPager.X10) == 0 || _rc != i32(0) { + if _pPager.X10 == 0 || _rc != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51274), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56758))) crt.X__builtin_abort(tls) } @@ -43024,17 +45156,17 @@ func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 in crt.X__builtin_abort(tls) } }() - if ((_rc == i32(0)) && ((_pPager.X25) < (_pPager.X22))) && (((*XPgHdr)(_pList.X3) != nil) || ((_pList.X5) > (_pPager.X25))) { + if ((_rc == i32(0)) && (_pPager.X25 < _pPager.X22)) && ((_pList.X3 != nil) || (_pList.X5 > _pPager.X25)) { _2_szFile = int64(_pPager.X48) * int64(_pPager.X22) - _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(5), (unsafe.Pointer)(&_2_szFile)) - *(*uint32)(unsafe.Pointer(&(_pPager.X25))) = _pPager.X22 + _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(5), unsafe.Pointer(&_2_szFile)) + *(*uint32)(unsafe.Pointer(&_pPager.X25)) = _pPager.X22 } _20: if _rc != i32(0) || _pList == nil { goto _22 } _3_pgno = _pList.X5 - if _3_pgno > (_pPager.X22) || i32(0) != (int32(_pList.X6)&i32(16)) { + if _3_pgno > _pPager.X22 || i32(0) != (int32(_pList.X6)&i32(16)) { goto _25 } _4_offset = int64(_3_pgno-uint32(i32(1))) * int64(_pPager.X48) @@ -43044,18 +45176,18 @@ _20: crt.X__builtin_abort(tls) } }() - if (_pList.X5) == uint32(i32(1)) { + if _pList.X5 == uint32(i32(1)) { _pager_write_changecounter(tls, _pList) } _4_pData = (*int8)(_pList.X1) - _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_4_pData), _pPager.X48, _4_offset) + _rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), unsafe.Pointer(_4_pData), _pPager.X48, _4_offset) if _3_pgno == uint32(i32(1)) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_pData))+1*uintptr(i32(24))))), u64(16)) + crt.Xmemcpy(tls, unsafe.Pointer((*[16]int8)(unsafe.Pointer(&_pPager.X40))), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pData))+1*uintptr(i32(24))))), u64(16)) } - if _3_pgno > (_pPager.X24) { - *(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _3_pgno + if _3_pgno > _pPager.X24 { + *(*uint32)(unsafe.Pointer(&_pPager.X24)) = _3_pgno } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(2)))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(i32(2)))) += 1 _sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.X36), _3_pgno, (*uint8)(_pList.X1)) goto _31 _25: @@ -43075,19 +45207,22 @@ func init() { crt.Xstrncpy(nil, &_pager_write_pagelistØ00__func__Ø000[0], str(56862), 21) } -// Open a temporary file. -// -// Write the file descriptor into *pFile. Return SQLITE_OK on success -// or some other error code if we fail. The OS will automatically -// delete the temporary file when it is closed. -// -// The flags passed to the VFS layer xOpen() call are those specified -// by parameter vfsFlags ORed with the following: -// -// SQLITE_OPEN_READWRITE -// SQLITE_OPEN_CREATE -// SQLITE_OPEN_EXCLUSIVE -// SQLITE_OPEN_DELETEONCLOSE +// C comment +// /* +// ** Open a temporary file. +// ** +// ** Write the file descriptor into *pFile. Return SQLITE_OK on success +// ** or some other error code if we fail. The OS will automatically +// ** delete the temporary file when it is closed. +// ** +// ** The flags passed to the VFS layer xOpen() call are those specified +// ** by parameter vfsFlags ORed with the following: +// ** +// ** SQLITE_OPEN_READWRITE +// ** SQLITE_OPEN_CREATE +// ** SQLITE_OPEN_EXCLUSIVE +// ** SQLITE_OPEN_DELETEONCLOSE +// */ func _pagerOpentemp(tls *crt.TLS, _pPager *XPager, _pFile *Xsqlite3_file, _vfsFlags int32) (r0 int32) { var _rc int32 { @@ -43111,30 +45246,33 @@ func init() { crt.Xstrncpy(nil, &_pagerOpentempØ00__func__Ø000[0], str(56914), 14) } -// Commit the transaction currently in progress. -// -// This routine implements the second phase of a 2-phase commit. The -// sqlite3BtreeCommitPhaseOne() routine does the first phase and should -// be invoked prior to calling this routine. The sqlite3BtreeCommitPhaseOne() -// routine did all the work of writing information out to disk and flushing the -// contents so that they are written onto the disk platter. All this -// routine has to do is delete or truncate or zero the header in the -// the rollback journal (which causes the transaction to commit) and -// drop locks. -// -// Normally, if an error occurs while the pager layer is attempting to -// finalize the underlying journal file, this function returns an error and -// the upper layer will attempt a rollback. However, if the second argument -// is non-zero then this b-tree transaction is part of a multi-file -// transaction. In this case, the transaction has already been committed -// (by deleting a master journal file) and the caller will ignore this -// functions return code. So, even if an error occurs in the pager layer, -// reset the b-tree objects internal state to indicate that the write -// transaction has been closed. This is quite safe, as the pager will have -// transitioned to the error state. -// -// This will release the write lock on the database file. If there -// are no active cursors, it also releases the read lock. +// C comment +// /* +// ** Commit the transaction currently in progress. +// ** +// ** This routine implements the second phase of a 2-phase commit. The +// ** sqlite3BtreeCommitPhaseOne() routine does the first phase and should +// ** be invoked prior to calling this routine. The sqlite3BtreeCommitPhaseOne() +// ** routine did all the work of writing information out to disk and flushing the +// ** contents so that they are written onto the disk platter. All this +// ** routine has to do is delete or truncate or zero the header in the +// ** the rollback journal (which causes the transaction to commit) and +// ** drop locks. +// ** +// ** Normally, if an error occurs while the pager layer is attempting to +// ** finalize the underlying journal file, this function returns an error and +// ** the upper layer will attempt a rollback. However, if the second argument +// ** is non-zero then this b-tree transaction is part of a multi-file +// ** transaction. In this case, the transaction has already been committed +// ** (by deleting a master journal file) and the caller will ignore this +// ** functions return code. So, even if an error occurs in the pager layer, +// ** reset the b-tree objects internal state to indicate that the write +// ** transaction has been closed. This is quite safe, as the pager will have +// ** transitioned to the error state. +// ** +// ** This will release the write lock on the database file. If there +// ** are no active cursors, it also releases the read lock. +// */ func _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 int32) { var _1_rc int32 var _1_pBt *XBtShared @@ -43165,7 +45303,7 @@ func _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 } }() func() { - if (_1_pBt.X17) <= i32(0) { + if _1_pBt.X17 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62933), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(56960))) crt.X__builtin_abort(tls) } @@ -43175,8 +45313,8 @@ func _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 _sqlite3BtreeLeave(tls, _p) return _1_rc } - *(*uint32)(unsafe.Pointer(&(_p.X8))) -= 1 - *(*uint8)(unsafe.Pointer(&(_1_pBt.X8))) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_p.X8)) -= 1 + *(*uint8)(unsafe.Pointer(&_1_pBt.X8)) = uint8(i32(1)) _btreeClearHasContent(tls, _1_pBt) _6: _btreeEndTransaction(tls, _p) @@ -43190,24 +45328,27 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000[0], str(56980), 27) } -// When this function is called, the database file has been completely -// updated to reflect the changes made by the current transaction and -// synced to disk. The journal file still exists in the file-system -// though, and if a failure occurs at this point it will eventually -// be used as a hot-journal and the current transaction rolled back. -// -// This function finalizes the journal file, either by deleting, -// truncating or partially zeroing it, so that it cannot be used -// for hot-journal rollback. Once this is done the transaction is -// irrevocably committed. -// -// If an error occurs, an IO error code is returned and the pager -// moves into the error state. Otherwise, SQLITE_OK is returned. +// C comment +// /* +// ** When this function is called, the database file has been completely +// ** updated to reflect the changes made by the current transaction and +// ** synced to disk. The journal file still exists in the file-system +// ** though, and if a failure occurs at this point it will eventually +// ** be used as a hot-journal and the current transaction rolled back. +// ** +// ** This function finalizes the journal file, either by deleting, +// ** truncating or partially zeroing it, so that it cannot be used +// ** for hot-journal rollback. Once this is done the transaction is +// ** irrevocably committed. +// ** +// ** If an error occurs, an IO error code is returned and the pager +// ** moves into the error state. Otherwise, SQLITE_OK is returned. +// */ func _sqlite3PagerCommitPhaseTwo(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 _rc = i32(0) if func() int32 { - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -43230,17 +45371,17 @@ func _sqlite3PagerCommitPhaseTwo(tls *crt.TLS, _pPager *XPager) (r0 int32) { crt.X__builtin_abort(tls) } }() - if ((int32(_pPager.X14) == i32(2)) && ((_pPager.X1) != 0)) && (int32(_pPager.X2) == i32(1)) { + if ((int32(_pPager.X14) == i32(2)) && (_pPager.X1 != 0)) && (int32(_pPager.X2) == i32(1)) { func() { - if (_pPager.X34) != int64(_pPager.X47) && (_pPager.X34) != 0 { + if _pPager.X34 != int64(_pPager.X47) && _pPager.X34 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(57150))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(1)) return i32(0) } - *(*uint32)(unsafe.Pointer(&(_pPager.X39))) += 1 + *(*uint32)(unsafe.Pointer(&_pPager.X39)) += 1 _rc = _pager_end_transaction(tls, _pPager, int32(_pPager.X17), i32(1)) return _pager_error(tls, _pPager, _rc) } @@ -43251,10 +45392,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseTwoØ00__func__Ø000[0], str(57216), 27) } -// Set the number of result columns that will be returned by this SQL -// statement. This is now set at compile time, rather than during -// execution of the vdbe program so that sqlite3_column_count() can -// be called on an SQL statement before sqlite3_step(). +// C comment +// /* +// ** Set the number of result columns that will be returned by this SQL +// ** statement. This is now set at compile time, rather than during +// ** execution of the vdbe program so that sqlite3_column_count() can +// ** be called on an SQL statement before sqlite3_step(). +// */ func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) { var _n int32 var _db *Xsqlite3 @@ -43263,8 +45407,8 @@ func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) { _releaseMemArray(tls, (*XMem)(_p.X20), int32(_p.X29)*i32(2)) _sqlite3DbFree(tls, _db, _p.X20) _n = _nResColumn * i32(2) - *(*uint16)(unsafe.Pointer(&(_p.X29))) = uint16(_nResColumn) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X20))))) = store20(&_pColName, (*XMem)(_sqlite3DbMallocRawNN(tls, _db, u64(72)*uint64(_n)))) + *(*uint16)(unsafe.Pointer(&_p.X29)) = uint16(_nResColumn) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X20)))) = store20(&_pColName, (*XMem)(_sqlite3DbMallocRawNN(tls, _db, u64(72)*uint64(_n)))) if (*XMem)(_p.X20) == nil { return } @@ -43272,21 +45416,24 @@ func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) { _ = _pColName } -// Release an array of N Mem elements +// C comment +// /* +// ** Release an array of N Mem elements +// */ func _releaseMemArray(tls *crt.TLS, _p *XMem, _N int32) { var _1_db *Xsqlite3 var _1_pEnd *XMem if _p == nil || _N == 0 { goto _1 } - _1_pEnd = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 72*uintptr(_N))) + _1_pEnd = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 72*uintptr(_N))) _1_db = (*Xsqlite3)(_p.X9) - if (_1_db.X79) == nil { + if _1_db.X79 == nil { goto _2 } _3: - if (_p.X7) != 0 { - _sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_p.X6)) + if _p.X7 != 0 { + _sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.X6)) } if crt.P2U(unsafe.Pointer(preInc20(&_p, 72))) < crt.P2U(unsafe.Pointer(_1_pEnd)) { goto _3 @@ -43294,7 +45441,7 @@ _3: return _2: func() { - if (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+72*uintptr(i32(1)))) != _1_pEnd && (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+72*uintptr(i32(0)))).X9) != (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+72*uintptr(i32(1)))).X9) { + if (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p))+72*uintptr(i32(1)))) != _1_pEnd && (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p))+72*uintptr(i32(0)))).X9) != (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p))+72*uintptr(i32(1)))).X9) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72960), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000))), unsafe.Pointer(str(57243))) crt.X__builtin_abort(tls) } @@ -43309,12 +45456,12 @@ _2: _sqlite3VdbeMemRelease(tls, _p) goto _13 } - if (_p.X7) != 0 { - _sqlite3DbFreeNN(tls, _1_db, (unsafe.Pointer)(_p.X6)) - *(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0) + if _p.X7 != 0 { + _sqlite3DbFreeNN(tls, _1_db, unsafe.Pointer(_p.X6)) + *(*int32)(unsafe.Pointer(&_p.X7)) = i32(0) } _13: - *(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(128)) + *(*uint16)(unsafe.Pointer(&_p.X1)) = uint16(i32(128)) if crt.P2U(unsafe.Pointer(preInc20(&_p, 72))) < crt.P2U(unsafe.Pointer(_1_pEnd)) { goto _2 } @@ -43327,27 +45474,33 @@ func init() { crt.Xstrncpy(nil, &_releaseMemArrayØ00__func__Ø000[0], str(57277), 16) } -// Initialize an array of N Mem element. +// C comment +// /* +// ** Initialize an array of N Mem element. +// */ func _initMemArray(tls *crt.TLS, _p *XMem, _N int32, _db *Xsqlite3, _flags uint16) { _0: - if postInc1(&_N, int32(-1)) > i32(0) { - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _db - *(*uint16)(unsafe.Pointer(&(_p.X1))) = _flags - *(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = nil + if postInc1(&_N, -1) > i32(0) { + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = _db + *(*uint16)(unsafe.Pointer(&_p.X1)) = _flags + *(*int32)(unsafe.Pointer(&_p.X7)) = i32(0) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X11)))) = nil *(*uintptr)(unsafe.Pointer(&_p)) += uintptr(72) goto _0 } } -// Set the name of the idx'th column to be returned by the SQL statement. -// zName must be a pointer to a nul terminated string. -// -// This call must be made after a call to sqlite3VdbeSetNumCols(). -// -// The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC -// or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed -// to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. +// C comment +// /* +// ** Set the name of the idx'th column to be returned by the SQL statement. +// ** zName must be a pointer to a nul terminated string. +// ** +// ** This call must be made after a call to sqlite3VdbeSetNumCols(). +// ** +// ** The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC +// ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed +// ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. +// */ func _sqlite3VdbeSetColName(tls *crt.TLS, _p *TVdbe, _idx int32, _var int32, _zName *int8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) { var _rc int32 var _pColName *XMem @@ -43369,9 +45522,10 @@ func _sqlite3VdbeSetColName(tls *crt.TLS, _p *TVdbe, _idx int32, _var int32, _zN f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57325))) crt.X__builtin_abort(tls) } @@ -43407,7 +45561,10 @@ func init() { _sqlite3PrepareØ00azColNameØ001 = [12]*int8{str(57442), str(57447), str(57454), str(57457), str(57460), str(57463), str(57466), str(57469), str(57477), str(57486), str(26370), str(57492)} } -// Remember the SQL string for a prepared statement. +// C comment +// /* +// ** Remember the SQL string for a prepared statement. +// */ func _sqlite3VdbeSetSql(tls *crt.TLS, _p *TVdbe, _z *int8, _n int32, _isPrepareV2 int32) { func() { if _isPrepareV2 != i32(1) && _isPrepareV2 != i32(0) { @@ -43419,16 +45576,16 @@ func _sqlite3VdbeSetSql(tls *crt.TLS, _p *TVdbe, _z *int8, _n int32, _isPrepareV return } if _isPrepareV2 == 0 { - *(*uint32)(unsafe.Pointer(&(_p.X41))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_p.X41)) = uint32(i32(0)) } func() { - if (_p.X36) != nil { + if _p.X36 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71484), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000))), unsafe.Pointer(str(57532))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_p.X36))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _z, uint64(_n)) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(uint8(_isPrepareV2)), 512, 9) + *(**int8)(unsafe.Pointer(&_p.X36)) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _z, uint64(_n)) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(uint8(_isPrepareV2)), 512, 9) } var _sqlite3VdbeSetSqlØ00__func__Ø000 [18]int8 @@ -43437,12 +45594,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSetSqlØ00__func__Ø000[0], str(57543), 18) } -// Clean up and delete a VDBE after execution. Return an integer which is -// the result code. Write any error message text into *pzErrMsg. +// C comment +// /* +// ** Clean up and delete a VDBE after execution. Return an integer which is +// ** the result code. Write any error message text into *pzErrMsg. +// */ func _sqlite3VdbeFinalize(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _rc int32 _rc = i32(0) - if ((_p.X5) == uint32(i32(770837923))) || ((_p.X5) == uint32(i32(832317811))) { + if (_p.X5 == uint32(i32(770837923))) || (_p.X5 == uint32(i32(832317811))) { _rc = _sqlite3VdbeReset(tls, _p) func() { if (_rc & ((*Xsqlite3)(_p.X0).X11)) != _rc { @@ -43455,100 +45615,106 @@ func _sqlite3VdbeFinalize(tls *crt.TLS, _p *TVdbe) (r0 int32) { return _rc } -// Clean up a VDBE after execution but do not delete the VDBE just yet. -// Write any error messages into *pzErrMsg. Return the result code. -// -// After this routine is run, the VDBE should be ready to be executed -// again. -// -// To look at it another way, this routine resets the state of the -// virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to -// VDBE_MAGIC_INIT. +// C comment +// /* +// ** Clean up a VDBE after execution but do not delete the VDBE just yet. +// ** Write any error messages into *pzErrMsg. Return the result code. +// ** +// ** After this routine is run, the VDBE should be ready to be executed +// ** again. +// ** +// ** To look at it another way, this routine resets the state of the +// ** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to +// ** VDBE_MAGIC_INIT. +// */ func _sqlite3VdbeReset(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _db *Xsqlite3 _db = (*Xsqlite3)(_p.X0) _sqlite3VdbeHalt(tls, _p) - if (_p.X9) < i32(0) { + if _p.X9 < i32(0) { goto _0 } _sqlite3VdbeTransferError(tls, _p) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = nil - if ((uint32((_p.X32)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = nil + if ((uint32(_p.X32>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) } goto _4 _0: - if (_p.X10) != 0 && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) { + if _p.X10 != 0 && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) { _sqlite3ErrorWithMsg(tls, _db, _p.X10, func() *int8 { - if (_p.X22) != nil { + if _p.X22 != nil { return str(24576) } return nil }(), unsafe.Pointer(_p.X22)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = nil + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = nil } _4: _Cleanup(tls, _p) - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(1224384374)) - return (_p.X10) & (_db.X11) -} - -// This routine is called the when a VDBE tries to halt. If the VDBE -// has made changes and is in autocommit mode, then commit those -// changes. If a rollback is needed, then do the rollback. -// -// This routine is the only way to move the state of a VM from -// SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. It is harmless to -// call this on a VM that is in the SQLITE_MAGIC_HALT state. -// -// Return an error code. If the commit could not complete because of -// lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it -// means the close did not happen and needs to be repeated. + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(i32(1224384374)) + return _p.X10 & _db.X11 +} + +// C comment +// /* +// ** This routine is called the when a VDBE tries to halt. If the VDBE +// ** has made changes and is in autocommit mode, then commit those +// ** changes. If a rollback is needed, then do the rollback. +// ** +// ** This routine is the only way to move the state of a VM from +// ** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. It is harmless to +// ** call this on a VM that is in the SQLITE_MAGIC_HALT state. +// ** +// ** Return an error code. If the commit could not complete because of +// ** lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it +// ** means the close did not happen and needs to be repeated. +// */ func _sqlite3VdbeHalt(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _rc, _3_mrc, _3_eStatementOp, _3_isSpecialError int32 var _db *Xsqlite3 _db = (*Xsqlite3)(_p.X0) - if (_p.X5) != uint32(i32(770837923)) { + if _p.X5 != uint32(i32(770837923)) { return i32(0) } - if (_db.X17) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(74044)) + if _db.X17 != 0 { + *(*int32)(unsafe.Pointer(&_p.X10)) = _sqlite3NomemError(tls, i32(74044)) } _closeAllCursors(tls, _p) _checkActiveVdbeCnt(tls, _db) - if (_p.X9) < i32(0) || ((uint32((_p.X32)>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == 0 { + if _p.X9 < i32(0) || ((uint32(_p.X32>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == 0 { goto _3 } _3_eStatementOp = i32(0) _sqlite3VdbeEnter(tls, _p) - _3_mrc = (_p.X10) & i32(255) + _3_mrc = _p.X10 & i32(255) _3_isSpecialError = bool2int((((_3_mrc == i32(7)) || (_3_mrc == i32(10))) || (_3_mrc == i32(9))) || (_3_mrc == i32(13))) if _3_isSpecialError == 0 { goto _7 } - if ((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != 0 && _3_mrc == i32(9) { + if ((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != 0 && _3_mrc == i32(9) { goto _9 } - if ((_3_mrc == i32(7)) || (_3_mrc == i32(13))) && (((uint32((_p.X32)>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) != 0) { + if ((_3_mrc == i32(7)) || (_3_mrc == i32(13))) && (((uint32(_p.X32>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) != 0) { _3_eStatementOp = i32(2) goto _13 } _sqlite3RollbackAll(tls, _db, i32(516)) _sqlite3CloseSavepoints(tls, _db) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) _13: _9: _7: - if (_p.X10) == i32(0) { + if _p.X10 == i32(0) { _sqlite3VdbeCheckFk(tls, _p, i32(0)) } - if (_db.X64) > i32(0) && (**XVTable)(unsafe.Pointer(_db.X67)) == nil || (_db.X15) == 0 || (_db.X36) != bool2int(int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) { + if _db.X64 > i32(0) && (**XVTable)(unsafe.Pointer(_db.X67)) == nil || _db.X15 == 0 || _db.X36 != bool2int(int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) { goto _18 } - if (_p.X10) != i32(0) && (int32(_p.X30) != i32(3) || _3_isSpecialError != 0) { + if _p.X10 != i32(0) && (int32(_p.X30) != i32(3) || _3_isSpecialError != 0) { goto _21 } _rc = _sqlite3VdbeCheckFk(tls, _p, i32(1)) @@ -43556,7 +45722,7 @@ _7: goto _22 } if func() int32 { - if ((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_p.X32>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -43573,20 +45739,20 @@ _7: _22: _rc = _vdbeCommit(tls, _db, _p) _26: - if (_rc == i32(5)) && (((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0) { + if (_rc == i32(5)) && (((uint32(_p.X32>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0) { _sqlite3VdbeLeave(tls, _p) return i32(5) } if _rc != i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = _rc + *(*int32)(unsafe.Pointer(&_p.X10)) = _rc _sqlite3RollbackAll(tls, _db, i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) goto _31 } - *(*int64)(unsafe.Pointer(&(_db.X77))) = int64(i32(0)) - *(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_db.X77)) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_db.X78)) = int64(i32(0)) { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-33554433) sink1(*p) } @@ -43595,15 +45761,15 @@ _31: goto _32 _21: _sqlite3RollbackAll(tls, _db, i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) _32: - *(*int32)(unsafe.Pointer(&(_db.X76))) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X76)) = i32(0) goto _34 _18: if _3_eStatementOp != i32(0) { goto _34 } - if ((_p.X10) == i32(0)) || (int32(_p.X30) == i32(3)) { + if (_p.X10 == i32(0)) || (int32(_p.X30) == i32(3)) { _3_eStatementOp = i32(1) goto _39 } @@ -43613,8 +45779,8 @@ _18: } _sqlite3RollbackAll(tls, _db, i32(516)) _sqlite3CloseSavepoints(tls, _db) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) _39: _34: if _3_eStatementOp == 0 { @@ -43624,18 +45790,18 @@ _34: if _rc == 0 { goto _41 } - if ((_p.X10) == i32(0)) || (((_p.X10) & i32(255)) == i32(19)) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = _rc - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = nil + if (_p.X10 == i32(0)) || ((_p.X10 & i32(255)) == i32(19)) { + *(*int32)(unsafe.Pointer(&_p.X10)) = _rc + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = nil } _sqlite3RollbackAll(tls, _db, i32(516)) _sqlite3CloseSavepoints(tls, _db) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) _41: _40: - if ((uint32((_p.X32)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) == 0 { goto _44 } if _3_eStatementOp != i32(2) { @@ -43644,102 +45810,105 @@ _40: } _sqlite3VdbeSetChanges(tls, _db, i32(0)) _46: - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) _44: _sqlite3VdbeLeave(tls, _p) _3: - if (_p.X9) < i32(0) { + if _p.X9 < i32(0) { goto _47 } - *(*int32)(unsafe.Pointer(&(_db.X34))) -= 1 - if ((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { - *(*int32)(unsafe.Pointer(&(_db.X36))) -= 1 + *(*int32)(unsafe.Pointer(&_db.X34)) -= 1 + if ((uint32(_p.X32>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { + *(*int32)(unsafe.Pointer(&_db.X36)) -= 1 } - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(*int32)(unsafe.Pointer(&(_db.X35))) -= 1 + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(*int32)(unsafe.Pointer(&_db.X35)) -= 1 } func() { - if (_db.X34) < (_db.X35) { + if _db.X34 < _db.X35 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74194), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57587))) crt.X__builtin_abort(tls) } }() func() { - if (_db.X35) < (_db.X36) { + if _db.X35 < _db.X36 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74195), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57618))) crt.X__builtin_abort(tls) } }() func() { - if (_db.X36) < i32(0) { + if _db.X36 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74196), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57648))) crt.X__builtin_abort(tls) } }() _47: - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(832317811)) + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(i32(832317811)) _checkActiveVdbeCnt(tls, _db) - if (_db.X17) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(74201)) + if _db.X17 != 0 { + *(*int32)(unsafe.Pointer(&_p.X10)) = _sqlite3NomemError(tls, i32(74201)) } - if (_db.X15) != 0 { + if _db.X15 != 0 { } func() { - if (_db.X34) <= i32(0) && int32(_db.X15) != i32(0) && (_db.X76) != i32(0) { + if _db.X34 <= i32(0) && int32(_db.X15) != i32(0) && _db.X76 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74212), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57666))) crt.X__builtin_abort(tls) } }() return func() int32 { - if (_p.X10) == i32(5) { + if _p.X10 == i32(5) { return i32(5) } return i32(0) }() } -// Close all cursors. -// -// Also release any dynamic memory held by the VM in the Vdbe.aMem memory -// cell array. This is necessary as the memory cell array may contain -// pointers to VdbeFrame objects, which may in turn contain pointers to -// open cursors. +// C comment +// /* +// ** Close all cursors. +// ** +// ** Also release any dynamic memory held by the VM in the Vdbe.aMem memory +// ** cell array. This is necessary as the memory cell array may contain +// ** pointers to VdbeFrame objects, which may in turn contain pointers to +// ** open cursors. +// */ func _closeAllCursors(tls *crt.TLS, _p *TVdbe) { var _1_pFrame, _3_pDel *XVdbeFrame - if (*XVdbeFrame)(_p.X38) == nil { + if _p.X38 == nil { goto _0 } _1_pFrame = (*XVdbeFrame)(_p.X38) _1: - if (*XVdbeFrame)(_1_pFrame.X1) == nil { + if _1_pFrame.X1 == nil { goto _4 } _1_pFrame = (*XVdbeFrame)(_1_pFrame.X1) goto _1 _4: _sqlite3VdbeFrameRestore(tls, _1_pFrame) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = nil - *(*int32)(unsafe.Pointer(&(_p.X40))) = i32(0) + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X38)))) = nil + *(*int32)(unsafe.Pointer(&_p.X40)) = i32(0) _0: func() { - if (_p.X40) != i32(0) { + if _p.X40 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73539), unsafe.Pointer((*int8)(unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(57726))) crt.X__builtin_abort(tls) } }() _closeCursorsInFrame(tls, _p) - if (*XMem)(_p.X18) != nil { + if _p.X18 != nil { _releaseMemArray(tls, (*XMem)(_p.X18), _p.X6) } _7: - if (*XVdbeFrame)(_p.X39) != nil { + if _p.X39 != nil { _3_pDel = (*XVdbeFrame)(_p.X39) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X39))))) = (*XVdbeFrame)(_3_pDel.X1) + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X39)))) = (*XVdbeFrame)(_3_pDel.X1) _sqlite3VdbeFrameDelete(tls, _3_pDel) goto _7 } - if (*XAuxData)(_p.X43) != nil { - _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_p.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))), i32(-1), i32(0)) + if _p.X43 != nil { + _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_p.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X43)))), i32(-1), i32(0)) } func() { if (*XAuxData)(_p.X43) != nil { @@ -43749,44 +45918,50 @@ _7: }() } -// 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. +// C comment +// /* +// ** Copy the values stored in the VdbeFrame structure to its Vdbe. This +// ** is used, for example, when a trigger sub-program is halted to restore +// ** control to the main program. +// */ func _sqlite3VdbeFrameRestore(tls *crt.TLS, _pFrame *XVdbeFrame) (r0 int32) { var _v *TVdbe _v = (*TVdbe)(_pFrame.X0) _closeCursorsInFrame(tls, _v) - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X17))))) = (*XVdbeOp)(_pFrame.X2) - *(*int32)(unsafe.Pointer(&(_v.X27))) = _pFrame.X12 - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X18))))) = (*XMem)(_pFrame.X4) - *(*int32)(unsafe.Pointer(&(_v.X6))) = _pFrame.X13 - *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_v.X23))))) = (**XVdbeCursor)(unsafe.Pointer(_pFrame.X5)) - *(*int32)(unsafe.Pointer(&(_v.X7))) = _pFrame.X10 + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_v.X17)))) = (*XVdbeOp)(_pFrame.X2) + *(*int32)(unsafe.Pointer(&_v.X27)) = _pFrame.X12 + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_v.X18)))) = (*XMem)(_pFrame.X4) + *(*int32)(unsafe.Pointer(&_v.X6)) = _pFrame.X13 + *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_v.X23)))) = (**XVdbeCursor)(unsafe.Pointer(_pFrame.X5)) + *(*int32)(unsafe.Pointer(&_v.X7)) = _pFrame.X10 *(*int64)(unsafe.Pointer(&((*Xsqlite3)(_v.X0).X7))) = _pFrame.X8 - *(*int32)(unsafe.Pointer(&(_v.X11))) = _pFrame.X16 + *(*int32)(unsafe.Pointer(&_v.X11)) = _pFrame.X16 *(*int32)(unsafe.Pointer(&((*Xsqlite3)(_v.X0).X29))) = _pFrame.X17 - _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_v.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X43))))), i32(-1), i32(0)) - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X43))))) = (*XAuxData)(_pFrame.X9) - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrame.X9))))) = nil + _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_v.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_v.X43)))), i32(-1), i32(0)) + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_v.X43)))) = (*XAuxData)(_pFrame.X9) + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrame.X9)))) = nil return _pFrame.X11 } -// Close all cursors in the current frame. +// C comment +// /* +// ** Close all cursors in the current frame. +// */ func _closeCursorsInFrame(tls *crt.TLS, _p *TVdbe) { var _1_i int32 var _2_pC *XVdbeCursor - if (**XVdbeCursor)(unsafe.Pointer(_p.X23)) == nil { + if _p.X23 == nil { goto _0 } _1_i = i32(0) _1: - if _1_i >= (_p.X7) { + if _1_i >= _p.X7 { goto _4 } - _2_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_1_i))) + _2_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_1_i))) if _2_pC != nil { _sqlite3VdbeFreeCursor(tls, _p, _2_pC) - *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_1_i))) = nil + *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_1_i))) = nil } _1_i += 1 goto _1 @@ -43794,8 +45969,11 @@ _4: _0: } -// Close a VDBE cursor and release all the resources that cursor -// happens to hold. +// C comment +// /* +// ** Close a VDBE cursor and release all the resources that cursor +// ** happens to hold. +// */ func _sqlite3VdbeFreeCursor(tls *crt.TLS, _p *TVdbe, _pCx *XVdbeCursor) { var _7_pVCur *Xsqlite3_file var _7_pModule *Xsqlite3_module @@ -43826,22 +46004,22 @@ _6: if ((uint32(_pCx.X7) << uint(i32(31))) >> uint(i32(31))) == 0 { goto _9 } - if (*XBtree)(_pCx.X8) != nil { + if _pCx.X8 != nil { _sqlite3BtreeClose(tls, (*XBtree)(_pCx.X8)) } goto _11 _9: func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCx.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73463), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000))), unsafe.Pointer(str(57799))) crt.X__builtin_abort(tls) } }() - _sqlite3BtreeCloseCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14))))))) + _sqlite3BtreeCloseCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCx.X14)))))) _11: goto _8 _7: - _7_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14)))))) + _7_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCx.X14))))) _7_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_7_pVCur.X0).X0) func() { if ((*Xsqlite3_vtab)(_7_pVCur.X0).X1) <= i32(0) { @@ -43850,9 +46028,10 @@ _7: } }() *(*int32)(unsafe.Pointer(&((*Xsqlite3_vtab)(_7_pVCur.X0).X1))) -= 1 - (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_7_pModule.X7)})))(tls, _7_pVCur) + func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := _7_pModule.X7 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _7_pVCur) goto _8 _8: } @@ -43863,7 +46042,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeFreeCursorØ00__func__Ø000[0], str(57839), 22) } -// Free any cursor components allocated by sqlite3VdbeSorterXXX routines. +// C comment +// /* +// ** Free any cursor components allocated by sqlite3VdbeSorterXXX routines. +// */ func _sqlite3VdbeSorterClose(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor) { var _pSorter *XVdbeSorter func() { @@ -43872,12 +46054,12 @@ func _sqlite3VdbeSorterClose(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor) { crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) if _pSorter != nil { _sqlite3VdbeSorterReset(tls, _db, _pSorter) - Xsqlite3_free(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSorter)) - *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))) = nil + Xsqlite3_free(tls, unsafe.Pointer((*t47)(unsafe.Pointer(&_pSorter.X9)).X1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSorter)) + *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14)))))) = nil } } @@ -43887,49 +46069,55 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterCloseØ00__func__Ø000[0], str(57892), 23) } -// Reset a sorting cursor back to its original empty state. +// C comment +// /* +// ** Reset a sorting cursor back to its original empty state. +// */ func _sqlite3VdbeSorterReset(tls *crt.TLS, _db *Xsqlite3, _pSorter *XVdbeSorter) { var _i int32 var _2_pTask *XSortSubtask _vdbeSorterJoinAll(tls, _pSorter, i32(0)) func() { - if (_pSorter.X13) == 0 && (*XPmaReader)(_pSorter.X4) != nil { + if _pSorter.X13 == 0 && (*XPmaReader)(_pSorter.X4) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87243), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterResetØ00__func__Ø000))), unsafe.Pointer(str(57915))) crt.X__builtin_abort(tls) } }() - if (*XPmaReader)(_pSorter.X4) != nil { + if _pSorter.X4 != nil { _vdbePmaReaderClear(tls, (*XPmaReader)(_pSorter.X4)) _sqlite3DbFree(tls, _db, _pSorter.X4) - *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X4))))) = nil + *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X4)))) = nil } _vdbeMergeEngineFree(tls, (*XMergeEngine)(_pSorter.X5)) - *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X5))))) = nil + *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X5)))) = nil _i = i32(0) _4: if _i >= int32(_pSorter.X15) { goto _7 } - _2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_i))) + _2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_i))) _vdbeSortSubtaskCleanup(tls, _db, _2_pTask) - *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pTask.X2))))) = _pSorter + *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pTask.X2)))) = _pSorter _i += 1 goto _4 _7: - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { - _vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0)) - } - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = nil - *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_pSorter.X12))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_pSorter.X10))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pSorter.X2))) = i32(0) + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { + _vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0)) + } + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) = nil + *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X2))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pSorter.X12)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_pSorter.X10)) = i32(0) + *(*int32)(unsafe.Pointer(&_pSorter.X2)) = i32(0) _sqlite3DbFree(tls, _db, _pSorter.X8) - *(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X8))))) = nil + *(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X8)))) = nil } -// Join all outstanding threads launched by SorterWrite() to create -// level-0 PMAs. +// C comment +// /* +// ** Join all outstanding threads launched by SorterWrite() to create +// ** level-0 PMAs. +// */ func _vdbeSorterJoinAll(tls *crt.TLS, _pSorter *XVdbeSorter, _rcin int32) (r0 int32) { var _rc, _i, _1_rc2 int32 var _1_pTask *XSortSubtask @@ -43939,7 +46127,7 @@ _0: if _i < i32(0) { goto _3 } - _1_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_i))) + _1_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_i))) _1_rc2 = _vdbeSorterJoinThread(tls, _1_pTask) if _rc == i32(0) { _rc = _1_rc2 @@ -43950,28 +46138,32 @@ _3: return _rc } -// Join thread pTask->thread. +// C comment +// /* +// ** Join thread pTask->thread. +// */ func _vdbeSorterJoinThread(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) { var _rc int32 var _1_pRet unsafe.Pointer _rc = i32(0) - if (*XSQLiteThread)(_pTask.X0) != nil { + if _pTask.X0 != nil { _1_pRet = crt.U2P(1) _sqlite3ThreadJoin(tls, (*XSQLiteThread)(_pTask.X0), &_1_pRet) _rc = int32(int64(crt.P2U(_1_pRet))) func() { - if (_pTask.X1) != i32(1) { + if _pTask.X1 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87133), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterJoinThreadØ00__func__Ø000))), unsafe.Pointer(str(57959))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pTask.X1))) = i32(0) - *(**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X0))))) = nil + *(*int32)(unsafe.Pointer(&_pTask.X1)) = i32(0) + *(**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTask.X0)))) = nil } return _rc } -// Get the results of the thread +// C comment +// /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) (r0 int32) { var _rc int32 func() { @@ -43992,7 +46184,7 @@ func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) }() != 0 { return _sqlite3NomemError(tls, i32(26938)) } - if (_p.X1) != 0 { + if _p.X1 != 0 { *_ppOut = _p.X2 _rc = i32(0) goto _6 @@ -44004,7 +46196,7 @@ func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) return i32(0) }() _6: - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) return _rc } @@ -44026,37 +46218,43 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterResetØ00__func__Ø000[0], str(58023), 23) } -// Free all memory belonging to the PmaReader object passed as the -// argument. All structure fields are set to zero before returning. +// C comment +// /* +// ** Free all memory belonging to the PmaReader object passed as the +// ** argument. All structure fields are set to zero before returning. +// */ func _vdbePmaReaderClear(tls *crt.TLS, _pReadr *XPmaReader) { - Xsqlite3_free(tls, (unsafe.Pointer)(_pReadr.X5)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pReadr.X7)) - if (_pReadr.X9) != nil { - _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), (unsafe.Pointer)(_pReadr.X9)) + Xsqlite3_free(tls, unsafe.Pointer(_pReadr.X5)) + Xsqlite3_free(tls, unsafe.Pointer(_pReadr.X7)) + if _pReadr.X9 != nil { + _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), unsafe.Pointer(_pReadr.X9)) } _vdbeIncrFree(tls, (*XIncrMerger)(_pReadr.X10)) - crt.Xmemset(tls, (unsafe.Pointer)(_pReadr), i32(0), u64(80)) + crt.Xmemset(tls, unsafe.Pointer(_pReadr), i32(0), u64(80)) } -// Free all resources associated with the IncrMerger object indicated by -// the first argument. +// C comment +// /* +// ** Free all resources associated with the IncrMerger object indicated by +// ** the first argument. +// */ func _vdbeIncrFree(tls *crt.TLS, _pIncr *XIncrMerger) { if _pIncr == nil { goto _0 } - if (_pIncr.X5) == 0 { + if _pIncr.X5 == 0 { goto _1 } _vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.X0)) - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+16*uintptr(i32(0)))).X0) != nil { - _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+16*uintptr(i32(0)))).X0)) + if ((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))).X0) != nil { + _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6))))+16*uintptr(i32(0)))).X0)) } - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+16*uintptr(i32(1)))).X0) != nil { - _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+16*uintptr(i32(1)))).X0)) + if ((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))).X0) != nil { + _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6))))+16*uintptr(i32(1)))).X0)) } _1: _vdbeMergeEngineFree(tls, (*XMergeEngine)(_pIncr.X1)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pIncr)) + Xsqlite3_free(tls, unsafe.Pointer(_pIncr)) _0: } @@ -44068,7 +46266,7 @@ func _sqlite3OsCloseFree(tls *crt.TLS, _pFile *Xsqlite3_file) { } }() _sqlite3OsClose(tls, _pFile) - Xsqlite3_free(tls, (unsafe.Pointer)(_pFile)) + Xsqlite3_free(tls, unsafe.Pointer(_pFile)) } var _sqlite3OsCloseFreeØ00__func__Ø000 [19]int8 @@ -44077,7 +46275,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3OsCloseFreeØ00__func__Ø000[0], str(58052), 19) } -// Free the MergeEngine object passed as the only argument. +// C comment +// /* +// ** Free the MergeEngine object passed as the only argument. +// */ func _vdbeMergeEngineFree(tls *crt.TLS, _pMerger *XMergeEngine) { var _i int32 if _pMerger == nil { @@ -44085,7 +46286,7 @@ func _vdbeMergeEngineFree(tls *crt.TLS, _pMerger *XMergeEngine) { } _i = i32(0) _1: - if _i >= (_pMerger.X0) { + if _i >= _pMerger.X0 { goto _4 } _vdbePmaReaderClear(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+80*uintptr(_i)))) @@ -44093,32 +46294,35 @@ _1: goto _1 _4: _0: - Xsqlite3_free(tls, (unsafe.Pointer)(_pMerger)) + Xsqlite3_free(tls, unsafe.Pointer(_pMerger)) } -// Free all resources owned by the object indicated by argument pTask. All -// fields of *pTask are zeroed before returning. +// C comment +// /* +// ** Free all resources owned by the object indicated by argument pTask. All +// ** fields of *pTask are zeroed before returning. +// */ func _vdbeSortSubtaskCleanup(tls *crt.TLS, _db *Xsqlite3, _pTask *XSortSubtask) { _sqlite3DbFree(tls, _db, _pTask.X3) - if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil { - Xsqlite3_free(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pTask.X4))).X1)) + if ((*t47)(unsafe.Pointer(&_pTask.X4)).X1) != nil { + Xsqlite3_free(tls, unsafe.Pointer((*t47)(unsafe.Pointer(&_pTask.X4)).X1)) goto _1 } func() { - if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil { + if ((*t47)(unsafe.Pointer(&_pTask.X4)).X1) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87067), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSortSubtaskCleanupØ00__func__Ø000))), unsafe.Pointer(str(58071))) crt.X__builtin_abort(tls) } }() - _vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pTask.X4))).X0)) + _vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&_pTask.X4)).X0)) _1: - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) != nil { - _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0)) + if ((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0) != nil { + _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0)) } - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0) != nil { - _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0)) + if ((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X0) != nil { + _sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X0)) } - crt.Xmemset(tls, (unsafe.Pointer)(_pTask), i32(0), u64(104)) + crt.Xmemset(tls, unsafe.Pointer(_pTask), i32(0), u64(104)) } var _vdbeSortSubtaskCleanupØ00__func__Ø000 [23]int8 @@ -44127,7 +46331,10 @@ func init() { crt.Xstrncpy(nil, &_vdbeSortSubtaskCleanupØ00__func__Ø000[0], str(58094), 23) } -// Free the list of sorted records starting at pRecord. +// C comment +// /* +// ** Free the list of sorted records starting at pRecord. +// */ func _vdbeSorterRecordFree(tls *crt.TLS, _db *Xsqlite3, _pRecord *XSorterRecord) { var _p, _pNext *XSorterRecord _p = _pRecord @@ -44135,27 +46342,30 @@ _0: if _p == nil { goto _3 } - _pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1)))))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p)) + _pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p.X1))))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p)) _p = _pNext goto _0 _3: } -// If parameter iOp is less than zero, then invoke the destructor for -// all auxiliary data pointers currently cached by the VM passed as -// the first argument. -// -// Or, if iOp is greater than or equal to zero, then the destructor is -// only invoked for those auxiliary data pointers created by the user -// function invoked by the OP_Function opcode at instruction iOp of -// VM pVdbe, and only then if: -// -// * the associated function parameter is the 32nd or later (counting -// from left to right), or -// -// * the corresponding bit in argument mask is clear (where the first -// function parameter corresponds to bit 0 etc.). +// C comment +// /* +// ** If parameter iOp is less than zero, then invoke the destructor for +// ** all auxiliary data pointers currently cached by the VM passed as +// ** the first argument. +// ** +// ** Or, if iOp is greater than or equal to zero, then the destructor is +// ** only invoked for those auxiliary data pointers created by the user +// ** function invoked by the OP_Function opcode at instruction iOp of +// ** VM pVdbe, and only then if: +// ** +// ** * the associated function parameter is the 32nd or later (counting +// ** from left to right), or +// ** +// ** * the corresponding bit in argument mask is clear (where the first +// ** function parameter corresponds to bit 0 etc.). +// */ func _sqlite3VdbeDeleteAuxData(tls *crt.TLS, _db *Xsqlite3, _pp **XAuxData, _iOp int32, _mask int32) { var _1_pAux *XAuxData _0: @@ -44163,17 +46373,17 @@ _0: goto _1 } _1_pAux = *_pp - if _iOp >= i32(0) && ((_1_pAux.X0) != _iOp || (_1_pAux.X1) < i32(0) || (_1_pAux.X1) <= i32(31) && (uint32(_mask)&(u32(1)<<uint(_1_pAux.X1))) != 0) { + if _iOp >= i32(0) && (_1_pAux.X0 != _iOp || _1_pAux.X1 < i32(0) || _1_pAux.X1 <= i32(31) && (uint32(_mask)&(u32(1)<<uint(_1_pAux.X1))) != 0) { goto _6 } - if (_1_pAux.X3) != nil { - (_1_pAux.X3)(tls, _1_pAux.X2) + if _1_pAux.X3 != nil { + _1_pAux.X3(tls, _1_pAux.X2) } *_pp = (*XAuxData)(_1_pAux.X4) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pAux)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pAux)) goto _8 _6: - _pp = (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pAux.X4))))) + _pp = (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pAux.X4)))) _8: goto _0 _1: @@ -44185,26 +46395,29 @@ func init() { crt.Xstrncpy(nil, &_closeAllCursorsØ00__func__Ø000[0], str(58117), 16) } -// Delete a VdbeFrame object and its contents. VdbeFrame objects are -// allocated by the OP_Program opcode in sqlite3VdbeExec(). +// C comment +// /* +// ** Delete a VdbeFrame object and its contents. VdbeFrame objects are +// ** allocated by the OP_Program opcode in sqlite3VdbeExec(). +// */ func _sqlite3VdbeFrameDelete(tls *crt.TLS, _p *XVdbeFrame) { var _i int32 var _aMem *XMem var _apCsr **XVdbeCursor - _aMem = (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(u64(112)))))) - _apCsr = (**XVdbeCursor)(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_p.X14))))) + _aMem = (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(u64(112)))))) + _apCsr = (**XVdbeCursor)(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_p.X14))))) _i = i32(0) _0: - if _i >= (_p.X15) { + if _i >= _p.X15 { goto _3 } - _sqlite3VdbeFreeCursor(tls, (*TVdbe)(_p.X0), *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apCsr)) + 8*uintptr(_i)))) + _sqlite3VdbeFreeCursor(tls, (*TVdbe)(_p.X0), *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_apCsr)) + 8*uintptr(_i)))) _i += 1 goto _0 _3: _releaseMemArray(tls, _aMem, _p.X14) - _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))), i32(-1), i32(0)) - _sqlite3DbFree(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), (unsafe.Pointer)(_p)) + _sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))), i32(-1), i32(0)) + _sqlite3DbFree(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), unsafe.Pointer(_p)) } func _checkActiveVdbeCnt(tls *crt.TLS, _db *Xsqlite3) { @@ -44218,14 +46431,14 @@ _0: if _p == nil { goto _1 } - if Xsqlite3_stmt_busy(tls, (unsafe.Pointer)(_p)) == 0 { + if Xsqlite3_stmt_busy(tls, unsafe.Pointer(_p)) == 0 { goto _2 } _cnt += 1 - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { _nWrite += 1 } - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { _nRead += 1 } _2: @@ -44233,30 +46446,33 @@ _2: goto _0 _1: func() { - if _cnt != (_db.X34) { + if _cnt != _db.X34 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73910), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58133))) crt.X__builtin_abort(tls) } }() func() { - if _nWrite != (_db.X36) { + if _nWrite != _db.X36 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73911), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58154))) crt.X__builtin_abort(tls) } }() func() { - if _nRead != (_db.X35) { + if _nRead != _db.X35 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73912), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58177))) crt.X__builtin_abort(tls) } }() } -// Return true if the prepared statement is in need of being reset. +// C comment +// /* +// ** Return true if the prepared statement is in need of being reset. +// */ func Xsqlite3_stmt_busy(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _v *TVdbe _v = (*TVdbe)(_pStmt) - return bool2int(((_v != nil) && ((_v.X5) == uint32(i32(770837923)))) && ((_v.X9) >= i32(0))) + return bool2int(((_v != nil) && (_v.X5 == uint32(i32(770837923)))) && (_v.X9 >= i32(0))) } var _checkActiveVdbeCntØ00__func__Ø000 [19]int8 @@ -44265,30 +46481,33 @@ func init() { crt.Xstrncpy(nil, &_checkActiveVdbeCntØ00__func__Ø000[0], str(58198), 19) } -// If SQLite is compiled to support shared-cache mode and to be threadsafe, -// this routine obtains the mutex associated with each BtShared structure -// that may be accessed by the VM passed as an argument. In doing so it also -// sets the BtShared.db member of each of the BtShared structures, ensuring -// that the correct busy-handler callback is invoked if required. -// -// If SQLite is not threadsafe but does support shared-cache mode, then -// sqlite3BtreeEnter() is invoked to set the BtShared.db variables -// of all of BtShared structures accessible via the database handle -// associated with the VM. -// -// If SQLite is not threadsafe and does not support shared-cache mode, this -// function is a no-op. -// -// The p->btreeMask field is a bitmask of all btrees that the prepared -// statement p will ever use. Let N be the number of bits in p->btreeMask -// corresponding to btrees that use shared cache. Then the runtime of -// this routine is N*N. But as N is rarely more than 1, this should not -// be a problem. +// C comment +// /* +// ** If SQLite is compiled to support shared-cache mode and to be threadsafe, +// ** this routine obtains the mutex associated with each BtShared structure +// ** that may be accessed by the VM passed as an argument. In doing so it also +// ** sets the BtShared.db member of each of the BtShared structures, ensuring +// ** that the correct busy-handler callback is invoked if required. +// ** +// ** If SQLite is not threadsafe but does support shared-cache mode, then +// ** sqlite3BtreeEnter() is invoked to set the BtShared.db variables +// ** of all of BtShared structures accessible via the database handle +// ** associated with the VM. +// ** +// ** If SQLite is not threadsafe and does not support shared-cache mode, this +// ** function is a no-op. +// ** +// ** The p->btreeMask field is a bitmask of all btrees that the prepared +// ** statement p will ever use. Let N be the number of bits in p->btreeMask +// ** corresponding to btrees that use shared cache. Then the runtime of +// ** this routine is N*N. But as N is rarely more than 1, this should not +// ** be a problem. +// */ func _sqlite3VdbeEnter(tls *crt.TLS, _p *TVdbe) { var _i, _nDb int32 var _db *Xsqlite3 var _aDb *XDb - if (_p.X34) == uint32(i32(0)) { + if _p.X34 == uint32(i32(0)) { return } _db = (*Xsqlite3)(_p.X0) @@ -44299,8 +46518,8 @@ _1: if _i >= _nDb { goto _4 } - if ((_i != i32(1)) && (((_p.X34) & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 { - if (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+32*uintptr(_i))).X1) != nil { + if ((_i != i32(1)) && ((_p.X34 & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 { + if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDb))+32*uintptr(_i))).X1) != nil { return i32(1) } return func() int32 { @@ -44309,7 +46528,7 @@ _1: return i32(0) }() }() != 0 { - _sqlite3BtreeEnter(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+32*uintptr(_i))).X1)) + _sqlite3BtreeEnter(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDb))+32*uintptr(_i))).X1)) } _i += 1 goto _1 @@ -44325,21 +46544,24 @@ func init() { func _sqlite3VdbeCheckFk(tls *crt.TLS, _p *TVdbe, _deferred int32) (r0 int32) { var _db *Xsqlite3 _db = (*Xsqlite3)(_p.X0) - if (_deferred != 0 && (((_db.X77) + (_db.X78)) > int64(i32(0)))) || ((_deferred == 0) && ((_p.X14) > int64(i32(0)))) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(787) - *(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2)) + if (_deferred != 0 && ((_db.X77 + _db.X78) > int64(i32(0)))) || ((_deferred == 0) && (_p.X14 > int64(i32(0)))) { + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(787) + *(*uint8)(unsafe.Pointer(&_p.X30)) = uint8(i32(2)) _sqlite3VdbeError(tls, _p, str(58234)) return i32(1) } return i32(0) } -// Change the error string stored in Vdbe.zErrMsg +// C comment +// /* +// ** Change the error string stored in Vdbe.zErrMsg +// */ func _sqlite3VdbeError(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) { var _ap []interface{} - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X22)) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_p.X22)) _ap = args - *(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap) + *(**int8)(unsafe.Pointer(&_p.X22)) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap) _ap = nil } @@ -44350,13 +46572,16 @@ func init() { } func _sqlite3VdbeLeave(tls *crt.TLS, _p *TVdbe) { - if (_p.X34) == uint32(i32(0)) { + if _p.X34 == uint32(i32(0)) { return } _vdbeLeave(tls, _p) } -// Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). +// C comment +// /* +// ** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter(). +// */ func _vdbeLeave(tls *crt.TLS, _p *TVdbe) { var _i, _nDb int32 var _db *Xsqlite3 @@ -44369,8 +46594,8 @@ _0: if _i >= _nDb { goto _3 } - if ((_i != i32(1)) && (((_p.X34) & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 { - if (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+32*uintptr(_i))).X1) != nil { + if ((_i != i32(1)) && ((_p.X34 & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 { + if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDb))+32*uintptr(_i))).X1) != nil { return i32(1) } return func() int32 { @@ -44379,7 +46604,7 @@ _0: return i32(0) }() }() != 0 { - _sqlite3BtreeLeave(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+32*uintptr(_i))).X1)) + _sqlite3BtreeLeave(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(unsafe.Pointer(_aDb))+32*uintptr(_i))).X1)) } _i += 1 goto _0 @@ -44392,10 +46617,13 @@ func init() { crt.Xstrncpy(nil, &_vdbeLeaveØ00__func__Ø000[0], str(58280), 10) } -// A read or write transaction may or may not be active on database handle -// db. If a transaction is active, commit it. If there is a -// write-transaction spanning more than one database file, this routine -// takes care of the master journal trickery. +// C comment +// /* +// ** A read or write transaction may or may not be active on database handle +// ** db. If a transaction is active, commit it. If there is a +// ** write-transaction spanning more than one database file, this routine +// ** takes care of the master journal trickery. +// */ func _vdbeCommit(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) { var _i, _nTrans, _rc, _needXcommit, _13_res, _13_retryCount, _13_nMainFile int32 var _13_offset int64 @@ -44411,7 +46639,7 @@ func _vdbeCommit(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) { _rc = _sqlite3VtabSync(tls, _db, _p) _i = i32(0) _0: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _4 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44421,7 +46649,7 @@ _0: _needXcommit = i32(1) _sqlite3BtreeEnter(tls, _1_pBt) _2_pPager = _sqlite3BtreePager(tls, _1_pBt) - if (int32((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X2) != i32(1)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_vdbeCommitØ00aMJNeededØ001)) + 1*uintptr(_sqlite3PagerGetJournalMode(tls, _2_pPager))))) != 0) { + if (int32((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X2) != i32(1)) && ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vdbeCommitØ00aMJNeededØ001)) + 1*uintptr(_sqlite3PagerGetJournalMode(tls, _2_pPager))))) != 0) { func() { if _i == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73684), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58290))) @@ -44439,10 +46667,10 @@ _4: if _rc != i32(0) { return _rc } - if _needXcommit == 0 || (_db.X46) == nil { + if _needXcommit == 0 || _db.X46 == nil { goto _12 } - _rc = (_db.X46)(tls, _db.X45) + _rc = _db.X46(tls, _db.X45) if _rc != 0 { return i32(531) } @@ -44452,7 +46680,7 @@ _12: } _i = i32(0) _16: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _20 } _8_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44464,7 +46692,7 @@ _16: _20: _i = i32(0) _22: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _26 } _10_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44504,10 +46732,10 @@ _30: } _32: _13_retryCount += 1 - Xsqlite3_randomness(tls, int32(u64(4)), (unsafe.Pointer)(&_14_iRandom)) - Xsqlite3_snprintf(tls, i32(13), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zMaster))+1*uintptr(_13_nMainFile))), str(58340), (_14_iRandom>>uint(i32(8)))&uint32(i32(16777215)), _14_iRandom&uint32(i32(255))) + Xsqlite3_randomness(tls, int32(u64(4)), unsafe.Pointer(&_14_iRandom)) + Xsqlite3_snprintf(tls, i32(13), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_13_zMaster))+1*uintptr(_13_nMainFile))), str(58340), (_14_iRandom>>uint(i32(8)))&uint32(i32(16777215)), _14_iRandom&uint32(i32(255))) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zMaster)) + 1*uintptr(_sqlite3Strlen30(tls, _13_zMaster)-i32(3))))) != i32(57) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_13_zMaster)) + 1*uintptr(_sqlite3Strlen30(tls, _13_zMaster)-i32(3))))) != i32(57) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73774), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58353))) crt.X__builtin_abort(tls) } @@ -44521,12 +46749,12 @@ _34: _rc = _sqlite3OsOpenMalloc(tls, _13_pVfs, _13_zMaster, &_13_pMaster, i32(16406), nil) } if _rc != i32(0) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster)) return _rc } _i = i32(0) _42: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _45 } _20_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44538,12 +46766,12 @@ _42: goto _43 } func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_zFile)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_zFile)) + 1*uintptr(i32(0))))) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73803), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58394))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3OsWrite(tls, _13_pMaster, (unsafe.Pointer)(_21_zFile), _sqlite3Strlen30(tls, _21_zFile)+i32(1), _13_offset) + _rc = _sqlite3OsWrite(tls, _13_pMaster, unsafe.Pointer(_21_zFile), _sqlite3Strlen30(tls, _21_zFile)+i32(1), _13_offset) { p := &_13_offset *p = (*p) + int64(_sqlite3Strlen30(tls, _21_zFile)+i32(1)) @@ -44552,7 +46780,7 @@ _42: if _rc != i32(0) { _sqlite3OsCloseFree(tls, _13_pMaster) _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(0)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster)) return _rc } _46: @@ -44563,12 +46791,12 @@ _45: if (i32(0) == (_sqlite3OsDeviceCharacteristics(tls, _13_pMaster) & i32(1024))) && (i32(0) != store1(&_rc, _sqlite3OsSync(tls, _13_pMaster, i32(2)))) { _sqlite3OsCloseFree(tls, _13_pMaster) _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(0)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster)) return _rc } _i = i32(0) _53: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _57 } _25_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44586,11 +46814,11 @@ _57: } }() if _rc != i32(0) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster)) return _rc } _rc = _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_13_zMaster)) _13_zMaster = nil if _rc != 0 { return _rc @@ -44598,7 +46826,7 @@ _57: _sqlite3BeginBenignMalloc(tls) _i = i32(0) _63: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _66 } _29_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -44614,11 +46842,14 @@ _29: return _rc } -// Invoke the xSync method of all virtual tables in the sqlite3.aVTrans -// array. Return the error code for the first error that occurs, or -// SQLITE_OK if all xSync operations are successful. -// -// If an error message is available, leave it in p->zErrMsg. +// C comment +// /* +// ** Invoke the xSync method of all virtual tables in the sqlite3.aVTrans +// ** array. Return the error code for the first error that occurs, or +// ** SQLITE_OK if all xSync operations are successful. +// ** +// ** If an error message is available, leave it in p->zErrMsg. +// */ func _sqlite3VtabSync(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) { var _i, _rc int32 var _1_pVtab *Xsqlite3_vtab @@ -44626,18 +46857,19 @@ func _sqlite3VtabSync(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) { var _1_x func(*crt.TLS, *Xsqlite3_vtab) int32 _rc = i32(0) _aVTrans = (**XVTable)(unsafe.Pointer(_db.X67)) - *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = nil + *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_db.X67)))) = nil _i = i32(0) _0: - if _rc != i32(0) || _i >= (_db.X64) { + if _rc != i32(0) || _i >= _db.X64 { goto _4 } - _1_pVtab = (*Xsqlite3_vtab)((*(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aVTrans)) + 8*uintptr(_i)))).X2) + _1_pVtab = (*Xsqlite3_vtab)((*(**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_aVTrans)) + 8*uintptr(_i)))).X2) if (_1_pVtab != nil) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab) int32 - }{store49(&_1_x, *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_module)(_1_pVtab.X0).X15)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{store49(&_1_x, func() func(*crt.TLS, *Xsqlite3_vtab) int32 { + v := (*Xsqlite3_module)(_1_pVtab.X0).X15 + return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v)) + }())})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab) int32 }{nil}))) { _rc = _1_x(tls, _1_pVtab) @@ -44646,21 +46878,24 @@ _0: _i += 1 goto _0 _4: - *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = _aVTrans + *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_db.X67)))) = _aVTrans return _rc } -// Transfer error message text from an sqlite3_vtab.zErrMsg (text stored -// in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored -// in memory obtained from sqlite3DbMalloc). +// C comment +// /* +// ** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored +// ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored +// ** in memory obtained from sqlite3DbMalloc). +// */ func _sqlite3VtabImportErrmsg(tls *crt.TLS, _p *TVdbe, _pVtab *Xsqlite3_vtab) { var _1_db *Xsqlite3 - if (_pVtab.X2) != nil { + if _pVtab.X2 != nil { _1_db = (*Xsqlite3)(_p.X0) - _sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3DbStrDup(tls, _1_db, _pVtab.X2) - Xsqlite3_free(tls, (unsafe.Pointer)(_pVtab.X2)) - *(**int8)(unsafe.Pointer(&(_pVtab.X2))) = nil + _sqlite3DbFree(tls, _1_db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = _sqlite3DbStrDup(tls, _1_db, _pVtab.X2) + Xsqlite3_free(tls, unsafe.Pointer(_pVtab.X2)) + *(**int8)(unsafe.Pointer(&_pVtab.X2)) = nil } } @@ -44670,7 +46905,10 @@ func init() { _vdbeCommitØ00aMJNeededØ001 = [6]uint8{1, 1, 0, 1, 0, 0} } -// Return the current journal mode. +// C comment +// /* +// ** Return the current journal mode. +// */ func _sqlite3PagerGetJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) { return int32(_pPager.X2) } @@ -44681,11 +46919,14 @@ func init() { crt.Xstrncpy(nil, &_vdbeCommitØ00__func__Ø000[0], str(58422), 11) } -// Return the full pathname of the underlying database file. Return -// an empty string if the database is in-memory or a TEMP database. -// -// The pager filename is invariant as long as the pager is -// open so it is safe to access without the BtShared mutex. +// C comment +// /* +// ** Return the full pathname of the underlying database file. Return +// ** an empty string if the database is in-memory or a TEMP database. +// ** +// ** The pager filename is invariant as long as the pager is +// ** open so it is safe to access without the BtShared mutex. +// */ func _sqlite3BtreeGetFilename(tls *crt.TLS, _p *XBtree) (r0 *int8) { func() { if (*XPager)((*XBtShared)(_p.X1).X0) == nil { @@ -44702,25 +46943,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeGetFilenameØ00__func__Ø000[0], str(58451), 24) } -// Return the full pathname of the database file. -// -// Except, if the pager is in-memory only, then return an empty string if -// nullIfMemDb is true. This routine is called with nullIfMemDb==1 when -// used to report the filename to the user, for compatibility with legacy -// behavior. But when the Btree needs to know the filename for matching to -// shared cache, it uses nullIfMemDb==0 so that in-memory databases can -// participate in shared-cache. +// C comment +// /* +// ** Return the full pathname of the database file. +// ** +// ** Except, if the pager is in-memory only, then return an empty string if +// ** nullIfMemDb is true. This routine is called with nullIfMemDb==1 when +// ** used to report the filename to the user, for compatibility with legacy +// ** behavior. But when the Btree needs to know the filename for matching to +// ** shared cache, it uses nullIfMemDb==0 so that in-memory databases can +// ** participate in shared-cache. +// */ func _sqlite3PagerFilename(tls *crt.TLS, _pPager *XPager, _nullIfMemDb int32) (r0 *int8) { return func() *int8 { - if _nullIfMemDb != 0 && ((_pPager.X13) != 0) { + if _nullIfMemDb != 0 && (_pPager.X13 != 0) { return str(0) } - return (_pPager.X51) + return _pPager.X51 }() } -// Invoke the xCommit method of all virtual tables in the -// sqlite3.aVTrans array. Then clear the array itself. +// C comment +// /* +// ** Invoke the xCommit method of all virtual tables in the +// ** sqlite3.aVTrans array. Then clear the array itself. +// */ func _sqlite3VtabCommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { _callFinaliser(tls, _db, int32(u64(128))) return i32(0) @@ -44735,7 +46982,7 @@ func _sqlite3OsOpenMalloc(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFile *int8, _ppFi } _rc = _sqlite3OsOpen(tls, _pVfs, _zFile, _pFile, _flags, _pOutFlags) if _rc != i32(0) { - Xsqlite3_free(tls, (unsafe.Pointer)(_pFile)) + Xsqlite3_free(tls, unsafe.Pointer(_pFile)) goto _2 } *_ppFile = _pFile @@ -44747,12 +46994,15 @@ _3: return _rc } -// Return the pathname of the journal file for this database. The return -// value of this routine is the same regardless of whether the journal file -// has been created or not. -// -// The pager journal filename is invariant as long as the pager is -// open so it is safe to access without the BtShared mutex. +// C comment +// /* +// ** Return the pathname of the journal file for this database. The return +// ** value of this routine is the same regardless of whether the journal file +// ** has been created or not. +// ** +// ** The pager journal filename is invariant as long as the pager is +// ** open so it is safe to access without the BtShared mutex. +// */ func _sqlite3BtreeGetJournalname(tls *crt.TLS, _p *XBtree) (r0 *int8) { func() { if (*XPager)((*XBtShared)(_p.X1).X0) == nil { @@ -44769,42 +47019,51 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeGetJournalnameØ00__func__Ø000[0], str(58475), 27) } -// Return the full pathname of the journal file. +// C comment +// /* +// ** Return the full pathname of the journal file. +// */ func _sqlite3PagerJournalname(tls *crt.TLS, _pPager *XPager) (r0 *int8) { return _pPager.X52 } -// This routine is called when a commit occurs. +// C comment +// /* +// ** This routine is called when a commit occurs. +// */ func _sqlite3CommitInternalChanges(tls *crt.TLS, _db *Xsqlite3) { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-3) sink1(*p) } } func _sqlite3VdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) { - if ((*Xsqlite3)(_p.X0).X76) != 0 && (_p.X12) != 0 { + if ((*Xsqlite3)(_p.X0).X76) != 0 && _p.X12 != 0 { return _vdbeCloseStatement(tls, _p, _eOp) } return i32(0) } -// If the Vdbe passed as the first argument opened a statement-transaction, -// close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or -// SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement -// transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the -// statement transaction is committed. -// -// If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. -// Otherwise SQLITE_OK. +// C comment +// /* +// ** If the Vdbe passed as the first argument opened a statement-transaction, +// ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or +// ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement +// ** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the +// ** statement transaction is committed. +// ** +// ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. +// ** Otherwise SQLITE_OK. +// */ func _vdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) { var _rc, _i, _iSavepoint, _1_rc2 int32 var _db *Xsqlite3 var _1_pBt *XBtree _db = (*Xsqlite3)(_p.X0) _rc = i32(0) - _iSavepoint = (_p.X12) - i32(1) + _iSavepoint = _p.X12 - i32(1) func() { if _eOp != i32(2) && _eOp != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73934), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58502))) @@ -44812,20 +47071,20 @@ func _vdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) { } }() func() { - if (_db.X76) <= i32(0) { + if _db.X76 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73935), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58552))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X12) != ((_db.X76) + (_db.X75)) { + if _p.X12 != (_db.X76 + _db.X75) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73936), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58569))) crt.X__builtin_abort(tls) } }() _i = i32(0) _7: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _10 } _1_rc2 = i32(0) @@ -44846,8 +47105,8 @@ _11: _i += 1 goto _7 _10: - *(*int32)(unsafe.Pointer(&(_db.X76))) -= 1 - *(*int32)(unsafe.Pointer(&(_p.X12))) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X76)) -= 1 + *(*int32)(unsafe.Pointer(&_p.X12)) = i32(0) if _rc != i32(0) { goto _15 } @@ -44859,8 +47118,8 @@ _10: } _15: if _eOp == i32(2) { - *(*int64)(unsafe.Pointer(&(_db.X77))) = _p.X15 - *(*int64)(unsafe.Pointer(&(_db.X78))) = _p.X16 + *(*int64)(unsafe.Pointer(&_db.X77)) = _p.X15 + *(*int64)(unsafe.Pointer(&_db.X78)) = _p.X16 } return _rc } @@ -44871,16 +47130,19 @@ func init() { crt.Xstrncpy(nil, &_vdbeCloseStatementØ00__func__Ø000[0], str(58616), 19) } -// The second argument to this function, op, is always SAVEPOINT_ROLLBACK -// or SAVEPOINT_RELEASE. This function either releases or rolls back the -// savepoint identified by parameter iSavepoint, depending on the value -// of op. -// -// Normally, iSavepoint is greater than or equal to zero. However, if op is -// SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the -// contents of the entire transaction are rolled back. This is different -// from a normal transaction rollback, as no locks are released and the -// transaction remains open. +// C comment +// /* +// ** The second argument to this function, op, is always SAVEPOINT_ROLLBACK +// ** or SAVEPOINT_RELEASE. This function either releases or rolls back the +// ** savepoint identified by parameter iSavepoint, depending on the value +// ** of op. +// ** +// ** Normally, iSavepoint is greater than or equal to zero. However, if op is +// ** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the +// ** contents of the entire transaction are rolled back. This is different +// ** from a normal transaction rollback, as no locks are released and the +// ** transaction remains open. +// */ func _sqlite3BtreeSavepoint(tls *crt.TLS, _p *XBtree, _op int32, _iSavepoint int32) (r0 int32) { var _rc int32 var _1_pBt *XBtShared @@ -44912,12 +47174,12 @@ func _sqlite3BtreeSavepoint(tls *crt.TLS, _p *XBtree, _op int32, _iSavepoint int goto _11 } if (_iSavepoint < i32(0)) && ((int32(_1_pBt.X10) & i32(8)) != i32(0)) { - *(*uint32)(unsafe.Pointer(&(_1_pBt.X18))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_1_pBt.X18)) = uint32(i32(0)) } _rc = _newDatabase(tls, _1_pBt) - *(*uint32)(unsafe.Pointer(&(_1_pBt.X18))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(i32(28))+uintptr(unsafe.Pointer((*XMemPage)(_1_pBt.X3).X19))))) + *(*uint32)(unsafe.Pointer(&_1_pBt.X18)) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(i32(28))+uintptr(unsafe.Pointer((*XMemPage)(_1_pBt.X3).X19))))) func() { - if (_1_pBt.X18) <= uint32(i32(0)) { + if _1_pBt.X18 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63155), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000))), unsafe.Pointer(str(58695))) crt.X__builtin_abort(tls) } @@ -44934,19 +47196,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSavepointØ00__func__Ø000[0], str(58708), 22) } -// Invoke either the xSavepoint, xRollbackTo or xRelease method of all -// virtual tables that currently have an open transaction. Pass iSavepoint -// as the second argument to the virtual table method invoked. -// -// If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is -// SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is -// SAVEPOINT_RELEASE, then the xRelease method of each virtual table with -// an open transaction is invoked. -// -// If any virtual table method returns an error code other than SQLITE_OK, -// processing is abandoned and the error returned to the caller of this -// function immediately. If all calls to virtual table methods are successful, -// SQLITE_OK is returned. +// C comment +// /* +// ** Invoke either the xSavepoint, xRollbackTo or xRelease method of all +// ** virtual tables that currently have an open transaction. Pass iSavepoint +// ** as the second argument to the virtual table method invoked. +// ** +// ** If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is +// ** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is +// ** SAVEPOINT_RELEASE, then the xRelease method of each virtual table with +// ** an open transaction is invoked. +// ** +// ** If any virtual table method returns an error code other than SQLITE_OK, +// ** processing is abandoned and the error returned to the caller of this +// ** function immediately. If all calls to virtual table methods are successful, +// ** SQLITE_OK is returned. +// */ func _sqlite3VtabSavepoint(tls *crt.TLS, _db *Xsqlite3, _op int32, _iSavepoint int32) (r0 int32) { var _rc, _1_i int32 var _2_pVTab *XVTable @@ -44965,17 +47230,17 @@ func _sqlite3VtabSavepoint(tls *crt.TLS, _db *Xsqlite3, _op int32, _iSavepoint i crt.X__builtin_abort(tls) } }() - if (**XVTable)(unsafe.Pointer(_db.X67)) == nil { + if _db.X67 == nil { goto _6 } _1_i = i32(0) _7: - if _rc != i32(0) || _1_i >= (_db.X64) { + if _rc != i32(0) || _1_i >= _db.X64 { goto _11 } - _2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 8*uintptr(_1_i))) + _2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_db.X67)) + 8*uintptr(_1_i))) _2_pMod = (*Xsqlite3_module)((*XModule)(_2_pVTab.X1).X0) - if (*Xsqlite3_vtab)(_2_pVTab.X2) == nil || (_2_pMod.X0) < i32(2) { + if _2_pVTab.X2 == nil || _2_pMod.X0 < i32(2) { goto _13 } switch _op { @@ -44988,23 +47253,26 @@ _7: } _15: - _3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_2_pMod.X20)})) - *(*int32)(unsafe.Pointer(&(_2_pVTab.X5))) = _iSavepoint + i32(1) + _3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 { + v := _2_pMod.X20 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v)) + }() + *(*int32)(unsafe.Pointer(&_2_pVTab.X5)) = _iSavepoint + i32(1) goto _18 _16: - _3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_2_pMod.X22)})) + _3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 { + v := _2_pMod.X22 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v)) + }() goto _18 _17: - _3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_2_pMod.X21)})) + _3_xMethod = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 { + v := _2_pMod.X21 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v)) + }() goto _18 _18: - if (_3_xMethod != nil) && ((_2_pVTab.X5) > _iSavepoint) { + if (_3_xMethod != nil) && (_2_pVTab.X5 > _iSavepoint) { _rc = _3_xMethod(tls, (*Xsqlite3_vtab)(_2_pVTab.X2), _iSavepoint) } _13: @@ -45021,8 +47289,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabSavepointØ00__func__Ø000[0], str(58812), 21) } -// This routine sets the value to be returned by subsequent calls to -// sqlite3_changes() on the database handle 'db'. +// C comment +// /* +// ** This routine sets the value to be returned by subsequent calls to +// ** sqlite3_changes() on the database handle 'db'. +// */ func _sqlite3VdbeSetChanges(tls *crt.TLS, _db *Xsqlite3, _nChange int32) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 { @@ -45030,9 +47301,9 @@ func _sqlite3VdbeSetChanges(tls *crt.TLS, _db *Xsqlite3, _nChange int32) { crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_db.X29))) = _nChange + *(*int32)(unsafe.Pointer(&_db.X29)) = _nChange { - p := (*int32)(unsafe.Pointer(&(_db.X30))) + p := (*int32)(unsafe.Pointer(&_db.X30)) *p = (*p) + _nChange sink1(*p) } @@ -45044,29 +47315,35 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSetChangesØ00__func__Ø000[0], str(58833), 22) } -// Copy the error code and error message belonging to the VDBE passed -// as the first argument to its database handle (so that they will be -// returned by calls to sqlite3_errcode() and sqlite3_errmsg()). -// -// This function does not clear the VDBE error code or message, just -// copies them to the database handle. +// C comment +// /* +// ** Copy the error code and error message belonging to the VDBE passed +// ** as the first argument to its database handle (so that they will be +// ** returned by calls to sqlite3_errcode() and sqlite3_errmsg()). +// ** +// ** This function does not clear the VDBE error code or message, just +// ** copies them to the database handle. +// */ func _sqlite3VdbeTransferError(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _rc int32 var _db *Xsqlite3 _db = (*Xsqlite3)(_p.X0) _rc = _p.X10 - if (_p.X22) == nil { + if _p.X22 == nil { goto _0 } - *(*uint8)(unsafe.Pointer(&(_db.X18))) += 1 + *(*uint8)(unsafe.Pointer(&_db.X18)) += 1 _sqlite3BeginBenignMalloc(tls) if (*XMem)(_db.X56) == nil { - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X56))))) = _sqlite3ValueNew(tls, _db) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X56)))) = _sqlite3ValueNew(tls, _db) } - _sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), (unsafe.Pointer)(_p.X22), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + _sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), unsafe.Pointer(_p.X22), uint8(i32(1)), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _sqlite3EndBenignMalloc(tls) - *(*uint8)(unsafe.Pointer(&(_db.X18))) -= 1 - *(*int32)(unsafe.Pointer(&(_db.X10))) = _rc + *(*uint8)(unsafe.Pointer(&_db.X18)) -= 1 + *(*int32)(unsafe.Pointer(&_db.X10)) = _rc goto _2 _0: _sqlite3Error(tls, _db, _rc) @@ -45074,21 +47351,24 @@ _2: return _rc } -// Clean up the VM after a single run. +// C comment +// /* +// ** Clean up the VM after a single run. +// */ func _Cleanup(tls *crt.TLS, _p *TVdbe) { var _i int32 var _db *Xsqlite3 _db = (*Xsqlite3)(_p.X0) - if (**XVdbeCursor)(unsafe.Pointer(_p.X23)) == nil { + if _p.X23 == nil { goto _4 } _i = i32(0) _1: - if _i >= (_p.X7) { + if _i >= _p.X7 { goto _4 } func() { - if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_i)))) != nil { + if (*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_i)))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73565), unsafe.Pointer((*int8)(unsafe.Pointer(&_CleanupØ00__func__Ø000))), unsafe.Pointer(str(58855))) crt.X__builtin_abort(tls) } @@ -45096,12 +47376,12 @@ _1: _i += 1 goto _1 _4: - if (*XMem)(_p.X18) == nil { + if _p.X18 == nil { goto _7 } _i = i32(0) _8: - if _i >= (_p.X6) { + if _i >= _p.X6 { goto _11 } func() { @@ -45114,9 +47394,9 @@ _8: goto _8 _11: _7: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = nil - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = nil + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X21)))) = nil } var _CleanupØ00__func__Ø000 [8]int8 @@ -45131,7 +47411,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeFinalizeØ00__func__Ø000[0], str(58910), 20) } -// Delete an entire VDBE. +// C comment +// /* +// ** Delete an entire VDBE. +// */ func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) { var _db *Xsqlite3 if func() int32 { @@ -45154,7 +47437,7 @@ func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) { } }() _sqlite3VdbeClearObject(tls, _db, _p) - if (*TVdbe)(_p.X1) != nil { + if _p.X1 != nil { *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_p.X1).X2))))) = (*TVdbe)(_p.X2) goto _6 } @@ -45164,14 +47447,14 @@ func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) { crt.X__builtin_abort(tls) } }() - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X1))))) = (*TVdbe)(_p.X2) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X1)))) = (*TVdbe)(_p.X2) _6: - if (*TVdbe)(_p.X2) != nil { + if _p.X2 != nil { *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_p.X2).X1))))) = (*TVdbe)(_p.X1) } - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(1443283912)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(i32(1443283912)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = nil + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) } var _sqlite3VdbeDeleteØ00__func__Ø000 [18]int8 @@ -45180,12 +47463,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeDeleteØ00__func__Ø000[0], str(58943), 18) } -// Free all memory associated with the Vdbe passed as the second argument, -// except for object itself, which is preserved. -// -// The difference between this function and sqlite3VdbeDelete() is that -// VdbeDelete() also unlinks the Vdbe from the list of VMs associated with -// the database connection and frees the object itself. +// C comment +// /* +// ** Free all memory associated with the Vdbe passed as the second argument, +// ** except for object itself, which is preserved. +// ** +// ** The difference between this function and sqlite3VdbeDelete() is that +// ** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with +// ** the database connection and frees the object itself. +// */ func _sqlite3VdbeClearObject(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) { var _pSub, _pNext *XSubProgram func() { @@ -45202,18 +47488,18 @@ _3: } _pNext = (*XSubProgram)(_pSub.X6) _vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_pSub.X0), _pSub.X1) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSub)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSub)) _pSub = _pNext goto _3 _6: - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { _releaseMemArray(tls, (*XMem)(_p.X24), int32(_p.X4)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X25)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X25)) _sqlite3DbFree(tls, _db, _p.X37) } _vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_p.X17), _p.X27) _sqlite3DbFree(tls, _db, _p.X20) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X36)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X36)) } var _sqlite3VdbeClearObjectØ00__func__Ø000 [23]int8 @@ -45222,53 +47508,59 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeClearObjectØ00__func__Ø000[0], str(58983), 23) } -// Free the space allocated for aOp and any p4 values allocated for the -// opcodes contained within. If aOp is not NULL it is assumed to contain -// nOp entries. +// C comment +// /* +// ** Free the space allocated for aOp and any p4 values allocated for the +// ** opcodes contained within. If aOp is not NULL it is assumed to contain +// ** nOp entries. +// */ func _vdbeFreeOpArray(tls *crt.TLS, _db *Xsqlite3, _aOp *XVdbeOp, _nOp int32) { var _1_pOp *XVdbeOp if _aOp == nil { goto _0 } - _1_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_nOp-i32(1)))) + _1_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_nOp-i32(1)))) _1: if crt.P2U(unsafe.Pointer(_1_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) { goto _4 } - if (_1_pOp.X1) != 0 { - _freeP4(tls, _db, int32(_1_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6)))))) + if _1_pOp.X1 != 0 { + _freeP4(tls, _db, int32(_1_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_1_pOp.X6))))) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pOp.X7)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pOp.X7)) *(*uintptr)(unsafe.Pointer(&_1_pOp)) += uintptr(18446744073709551584) goto _1 _4: - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_aOp)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_aOp)) _0: } -// Free all memory allocations in the pParse object +// C comment +// /* +// ** Free all memory allocations in the pParse object +// */ func _sqlite3ParserReset(tls *crt.TLS, _pParse *XParse) { var _1_db *Xsqlite3 if _pParse == nil { goto _0 } _1_db = (*Xsqlite3)(_pParse.X0) - _sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_pParse.X26)) + _sqlite3DbFree(tls, _1_db, unsafe.Pointer(_pParse.X26)) _sqlite3ExprListDelete(tls, _1_db, (*XExprList)(_pParse.X27)) if _1_db != nil { func() { - if ((*t7)(unsafe.Pointer(&(_1_db.X58))).X0) < uint32(_pParse.X12) { + if ((*t7)(unsafe.Pointer(&_1_db.X58)).X0) < uint32(_pParse.X12) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116168), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParserResetØ00__func__Ø000))), unsafe.Pointer(str(59006))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_1_db.X58))).X0))) + p := (*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_1_db.X58)).X0))) *p = (*p) - uint32(_pParse.X12) sink5(*p) } } - *(*uint8)(unsafe.Pointer(&(_pParse.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X12)) = uint8(i32(0)) _0: } @@ -45278,13 +47570,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ParserResetØ00__func__Ø000[0], str(59057), 19) } -// The following routine destroys a virtual machine that is created by -// the sqlite3_compile() routine. The integer returned is an SQLITE_ -// success/failure code that describes the result of executing the virtual -// machine. -// -// This routine sets the error code and string returned by -// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). +// C comment +// /* +// ** The following routine destroys a virtual machine that is created by +// ** the sqlite3_compile() routine. The integer returned is an SQLITE_ +// ** success/failure code that describes the result of executing the virtual +// ** machine. +// ** +// ** This routine sets the error code and string returned by +// ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). +// */ func Xsqlite3_finalize(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _rc int32 var _2_db *Xsqlite3 @@ -45299,7 +47594,7 @@ func Xsqlite3_finalize(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { return _sqlite3MisuseError(tls, i32(76202)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.X3)) - if (_2_v.X26) > int64(i32(0)) { + if _2_v.X26 > int64(i32(0)) { _invokeProfileCallback(tls, _2_db, _2_v) } _rc = _sqlite3VdbeFinalize(tls, _2_v) @@ -45309,12 +47604,15 @@ _1: return _rc } -// Invoke the profile callback. This routine is only called if we already -// know that the profile callback is defined and needs to be invoked. +// C comment +// /* +// ** Invoke the profile callback. This routine is only called if we already +// ** know that the profile callback is defined and needs to be invoked. +// */ func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) { var _iNow, _iElapse int64 func() { - if (_p.X26) <= int64(i32(0)) { + if _p.X26 <= int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76160), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59076))) crt.X__builtin_abort(tls) } @@ -45322,7 +47620,7 @@ func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) { func() { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, *int8, uint64) - }{(_db.X43)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_db.X43})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, *int8, uint64) }{nil})) && (int32(_db.X24)&i32(2)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76161), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59091))) @@ -45330,26 +47628,26 @@ func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) { } }() func() { - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76162), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(49896))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X36) == nil { + if _p.X36 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76163), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59149))) crt.X__builtin_abort(tls) } }() _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.X0), &_iNow) - _iElapse = (_iNow - (_p.X26)) * int64(i32(1000000)) - if (_db.X43) != nil { - (_db.X43)(tls, _db.X44, _p.X36, uint64(_iElapse)) + _iElapse = (_iNow - _p.X26) * int64(i32(1000000)) + if _db.X43 != nil { + _db.X43(tls, _db.X44, _p.X36, uint64(_iElapse)) } if (int32(_db.X24) & i32(2)) != 0 { - (_db.X41)(tls, uint32(i32(2)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(&_iElapse)) + _db.X41(tls, uint32(i32(2)), _db.X42, unsafe.Pointer(_p), unsafe.Pointer(&_iElapse)) } - *(*int64)(unsafe.Pointer(&(_p.X26))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_p.X26)) = int64(i32(0)) } var _invokeProfileCallbackØ00__func__Ø000 [22]int8 @@ -45370,8 +47668,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_prepareØ00__func__Ø000[0], str(59204), 16) } -// Return UTF-8 encoded English language explanation of the most recent -// error. +// C comment +// /* +// ** Return UTF-8 encoded English language explanation of the most recent +// ** error. +// */ func Xsqlite3_errmsg(tls *crt.TLS, _db *Xsqlite3) (r0 *int8) { var _z *int8 if _db == nil { @@ -45381,13 +47682,13 @@ func Xsqlite3_errmsg(tls *crt.TLS, _db *Xsqlite3) (r0 *int8) { return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, i32(142708))) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - if (_db.X17) != 0 { + if _db.X17 != 0 { _z = _sqlite3ErrStr(tls, _sqlite3NomemError(tls, i32(142712))) goto _3 } _z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.X56)))) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142716), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_errmsgØ00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } @@ -45400,8 +47701,11 @@ _3: return _z } -// Return a static string that describes the kind of error specified in the -// argument. +// C comment +// /* +// ** Return a static string that describes the kind of error specified in the +// ** argument. +// */ func _sqlite3ErrStr(tls *crt.TLS, _rc int32) (r0 *int8) { var _zErr *int8 _zErr = str(59220) @@ -45430,8 +47734,8 @@ _2: crt.X__builtin_abort(tls) return i32(0) }() - }() != 0 && (_rc < i32(27))) && ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3ErrStrØ00aMsgØ001)) + 8*uintptr(_rc)))) != nil) { - _zErr = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3ErrStrØ00aMsgØ001)) + 8*uintptr(_rc))) + }() != 0 && (_rc < i32(27))) && ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)) + 8*uintptr(_rc)))) != nil) { + _zErr = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3ErrStrØ00aMsgØ001)) + 8*uintptr(_rc))) } goto _3 _3: @@ -45456,16 +47760,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_errmsgØ00__func__Ø000[0], str(59902), 15) } -// Locate the in-memory structure that describes -// a particular index given the name of that index -// and the name of the database that contains the index. -// Return NULL if not found. -// -// If zDatabase is 0, all databases are searched for the -// table and the first matching index is returned. (No checking -// for duplicate index names is done.) The search order is -// TEMP first, then MAIN, then any auxiliary databases added -// using the ATTACH command. +// C comment +// /* +// ** Locate the in-memory structure that describes +// ** a particular index given the name of that index +// ** and the name of the database that contains the index. +// ** Return NULL if not found. +// ** +// ** If zDatabase is 0, all databases are searched for the +// ** table and the first matching index is returned. (No checking +// ** for duplicate index names is done.) The search order is +// ** TEMP first, then MAIN, then any auxiliary databases added +// ** using the ATTACH command. +// */ func _sqlite3FindIndex(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDb *int8) (r0 *XIndex) { var _i, _1_j int32 var _1_pSchema *XSchema @@ -45479,7 +47786,7 @@ func _sqlite3FindIndex(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDb *int8) (r }() _i = i32(0) _3: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _6 } _1_j = func() int32 { @@ -45504,7 +47811,7 @@ _3: crt.X__builtin_abort(tls) } }() - _p = (*XIndex)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_1_pSchema.X3))), _zName)) + _p = (*XIndex)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_1_pSchema.X3)), _zName)) if _p != nil { goto _6 } @@ -45521,17 +47828,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FindIndexØ00__func__Ø000[0], str(60000), 17) } -// Free any prior content in *pz and replace it with a copy of zNew. +// C comment +// /* +// ** Free any prior content in *pz and replace it with a copy of zNew. +// */ func _sqlite3SetString(tls *crt.TLS, _pz **int8, _db *Xsqlite3, _zNew *int8) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*_pz)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(*_pz)) *_pz = _sqlite3DbStrDup(tls, _db, _zNew) } -// Change the "soft" limit on the number of pages in the cache. -// Unused and unmodified pages will be recycled when the number of -// pages in the cache exceeds this soft limit. But the size of the -// cache is allowed to grow larger than this limit if it contains -// dirty pages or pages still in active use. +// C comment +// /* +// ** Change the "soft" limit on the number of pages in the cache. +// ** Unused and unmodified pages will be recycled when the number of +// ** pages in the cache exceeds this soft limit. But the size of the +// ** cache is allowed to grow larger than this limit if it contains +// ** dirty pages or pages still in active use. +// */ func _sqlite3BtreeSetCacheSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) { var _pBt *XBtShared _pBt = (*XBtShared)(_p.X1) @@ -45553,22 +47866,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSetCacheSizeØ00__func__Ø000[0], str(60017), 25) } -// Change the maximum number of in-memory pages that are allowed -// before attempting to recycle clean and unused pages. +// C comment +// /* +// ** Change the maximum number of in-memory pages that are allowed +// ** before attempting to recycle clean and unused pages. +// */ func _sqlite3PagerSetCachesize(tls *crt.TLS, _pPager *XPager, _mxPage int32) { _sqlite3PcacheSetCachesize(tls, (*XPCache)(_pPager.X59), _mxPage) } -// Set the suggested cache-size value. +// C comment +// /* +// ** Set the suggested cache-size value. +// */ func _sqlite3PcacheSetCachesize(tls *crt.TLS, _pCache *XPCache, _mxPage int32) { func() { - if (_pCache.X12) == nil { + if _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44939), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetCachesizeØ00__func__Ø000))), unsafe.Pointer(str(15958))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pCache.X4))) = _mxPage - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X5)(tls, _pCache.X12, _numberOfCachePages(tls, _pCache)) + *(*int32)(unsafe.Pointer(&_pCache.X4)) = _mxPage + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X5)(tls, _pCache.X12, _numberOfCachePages(tls, _pCache)) } var _sqlite3PcacheSetCachesizeØ00__func__Ø000 [26]int8 @@ -45577,24 +47896,27 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheSetCachesizeØ00__func__Ø000[0], str(60042), 26) } -// Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The -// contents of sqlite_stat1 are used to populate the Index.aiRowEst[] -// arrays. The contents of sqlite_stat3/4 are used to populate the -// Index.aSample[] arrays. -// -// If the sqlite_stat1 table is not present in the database, SQLITE_ERROR -// is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined -// during compilation and the sqlite_stat3/4 table is present, no data is -// read from it. -// -// If SQLITE_ENABLE_STAT3/4 was defined during compilation and the -// sqlite_stat4 table is not present in the database, SQLITE_ERROR is -// returned. However, in this case, data is read from the sqlite_stat1 -// table (if it is present) before returning. -// -// If an OOM error occurs, this function always sets db->mallocFailed. -// This means if the caller does not care about other errors, the return -// code may be ignored. +// C comment +// /* +// ** Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The +// ** contents of sqlite_stat1 are used to populate the Index.aiRowEst[] +// ** arrays. The contents of sqlite_stat3/4 are used to populate the +// ** Index.aSample[] arrays. +// ** +// ** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR +// ** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined +// ** during compilation and the sqlite_stat3/4 table is present, no data is +// ** read from it. +// ** +// ** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the +// ** sqlite_stat4 table is not present in the database, SQLITE_ERROR is +// ** returned. However, in this case, data is read from the sqlite_stat1 +// ** table (if it is present) before returning. +// ** +// ** If an OOM error occurs, this function always sets db->mallocFailed. +// ** This means if the caller does not care about other errors, the return +// ** code may be ignored. +// */ func _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) { var _rc int32 var _zSql *int8 @@ -45606,7 +47928,7 @@ func _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) { _rc = i32(0) _pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -45623,32 +47945,32 @@ func _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X2))).X2) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_pSchema.X2)).X2) _7: if _i == nil { goto _10 } _1_pTab = (*XTable)(_i.X2) { - p := (*uint32)(unsafe.Pointer(&(_1_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_1_pTab.X9)) *p = (*p) & uint32(i32(-17)) sink5(*p) } _i = (*XHashElem)(_i.X0) goto _7 _10: - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_pSchema.X3)).X2) _11: if _i == nil { goto _14 } _2_pIdx = (*XIndex)(_i.X2) - storebits3((*int8)(unsafe.Pointer(&(_2_pIdx.X16))), int8(i32(0)), 128, 7) + storebits3((*int8)(unsafe.Pointer(&_2_pIdx.X16)), int8(i32(0)), 128, 7) _i = (*XHashElem)(_i.X0) goto _11 _14: - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sInfo.X0))))) = _db - *(**int8)(unsafe.Pointer(&(_sInfo.X1))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sInfo.X0)))) = _db + *(**int8)(unsafe.Pointer(&_sInfo.X1)) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 if _sqlite3FindTable(tls, _db, str(60088), _sInfo.X1) == nil { goto _15 } @@ -45657,8 +47979,8 @@ _14: _rc = _sqlite3NomemError(tls, i32(98796)) goto _17 } - _rc = Xsqlite3_exec(tls, _db, _zSql, _analysisLoader, (unsafe.Pointer)(&_sInfo), nil) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql)) + _rc = Xsqlite3_exec(tls, _db, _zSql, _analysisLoader, unsafe.Pointer(&_sInfo), nil) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql)) _17: _15: func() { @@ -45667,13 +47989,13 @@ _15: crt.X__builtin_abort(tls) } }() - _i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2) + _i = (*XHashElem)((*XHash)(unsafe.Pointer(&_pSchema.X3)).X2) _20: if _i == nil { goto _23 } _6_pIdx = (*XIndex)(_i.X2) - if ((uint32((_6_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_6_pIdx.X16>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { _sqlite3DefaultRowEst(tls, _6_pIdx) } _i = (*XHashElem)(_i.X0) @@ -45694,16 +48016,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AnalysisLoadØ00__func__Ø000[0], str(60142), 20) } -// Locate the in-memory structure that describes a particular database -// table given the name of that table and (optionally) the name of the -// database containing the table. Return NULL if not found. -// -// If zDatabase is 0, all databases are searched for the table and the -// first matching table is returned. (No checking for duplicate table -// names is done.) The search order is TEMP first, then MAIN, then any -// auxiliary databases added using the ATTACH command. -// -// See also sqlite3LocateTable(). +// C comment +// /* +// ** Locate the in-memory structure that describes a particular database +// ** table given the name of that table and (optionally) the name of the +// ** database containing the table. Return NULL if not found. +// ** +// ** If zDatabase is 0, all databases are searched for the table and the +// ** first matching table is returned. (No checking for duplicate table +// ** names is done.) The search order is TEMP first, then MAIN, then any +// ** auxiliary databases added using the ATTACH command. +// ** +// ** See also sqlite3LocateTable(). +// */ func _sqlite3FindTable(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDatabase *int8) (r0 *XTable) { var _i, _2_j int32 var _p *XTable @@ -45717,7 +48042,7 @@ func _sqlite3FindTable(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDatabase *in _3: _i = i32(0) _5: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _8 } _2_j = func() int32 { @@ -45761,15 +48086,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FindTableØ00__func__Ø000[0], str(60210), 17) } -// This callback is invoked once for each index when reading the -// sqlite_stat1 table. -// -// argv[0] = name of the table -// argv[1] = name of the index (might be NULL) -// argv[2] = results of analysis - on integer for each column -// -// Entries for which argv[1]==NULL simply record the number of rows in -// the table. +// C comment +// /* +// ** This callback is invoked once for each index when reading the +// ** sqlite_stat1 table. +// ** +// ** argv[0] = name of the table +// ** argv[1] = name of the index (might be NULL) +// ** argv[2] = results of analysis - on integer for each column +// ** +// ** Entries for which argv[1]==NULL simply record the number of rows in +// ** the table. +// */ func _analysisLoader(tls *crt.TLS, _pData unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) { var _6_nCol int32 var _z *int8 @@ -45787,47 +48115,47 @@ func _analysisLoader(tls *crt.TLS, _pData unsafe.Pointer, _argc int32, _argv **i }() _ = _argc - if ((_argv == nil) || ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == nil)) || ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) == nil) { + if ((_argv == nil) || ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == nil)) || ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) == nil) { return i32(0) } - _pTable = _sqlite3FindTable(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), _pInfo.X1) + _pTable = _sqlite3FindTable(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), _pInfo.X1) if _pTable == nil { return i32(0) } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) == nil { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) == nil { _pIndex = nil goto _9 } - if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) == i32(0) { + if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) == i32(0) { _pIndex = _sqlite3PrimaryKeyIndex(tls, _pTable) goto _9 } - _pIndex = _sqlite3FindIndex(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))), _pInfo.X1) + _pIndex = _sqlite3FindIndex(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))), _pInfo.X1) _9: - _z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2)))) + _z = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2)))) if _pIndex == nil { goto _10 } _6_aiRowEst = nil _6_nCol = int32(_pIndex.X13) + i32(1) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 4, 2) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 4, 2) _decodeIntArray(tls, _z, _6_nCol, _6_aiRowEst, _pIndex.X2, _pIndex) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 128, 7) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(1)), 128, 7) if (*XExpr)(_pIndex.X9) == nil { - *(*int16)(unsafe.Pointer(&(_pTable.X12))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X2)) + 2*uintptr(i32(0)))) + *(*int16)(unsafe.Pointer(&_pTable.X12)) = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X2)) + 2*uintptr(i32(0)))) { - p := (*uint32)(unsafe.Pointer(&(_pTable.X9))) + p := (*uint32)(unsafe.Pointer(&_pTable.X9)) *p = (*p) | uint32(i32(16)) sink5(*p) } } goto _12 _10: - *(*int16)(unsafe.Pointer(&(_8_fakeIdx.X12))) = _pTable.X13 - _decodeIntArray(tls, _z, i32(1), nil, (*int16)(unsafe.Pointer(&(_pTable.X12))), &_8_fakeIdx) - *(*int16)(unsafe.Pointer(&(_pTable.X13))) = _8_fakeIdx.X12 + *(*int16)(unsafe.Pointer(&_8_fakeIdx.X12)) = _pTable.X13 + _decodeIntArray(tls, _z, i32(1), nil, (*int16)(unsafe.Pointer(&_pTable.X12)), &_8_fakeIdx) + *(*int16)(unsafe.Pointer(&_pTable.X13)) = _8_fakeIdx.X12 { - p := (*uint32)(unsafe.Pointer(&(_pTable.X9))) + p := (*uint32)(unsafe.Pointer(&_pTable.X9)) *p = (*p) | uint32(i32(16)) sink5(*p) } @@ -45844,9 +48172,12 @@ func init() { crt.Xstrncpy(nil, &_analysisLoaderØ00__func__Ø000[0], str(60227), 15) } -// The first argument points to a nul-terminated string containing a -// list of space separated integers. Read the first nOut of these into -// the array aOut[]. +// C comment +// /* +// ** The first argument points to a nul-terminated string containing a +// ** list of space separated integers. Read the first nOut of these into +// ** the array aOut[]. +// */ func _decodeIntArray(tls *crt.TLS, _zIntArray *int8, _nOut int32, _aOut *uint32, _aLog *int16, _pIndex *XIndex) { var _c, _i int32 var _v uint32 @@ -45865,7 +48196,7 @@ _2: } _v = uint32(i32(0)) _7: - if (store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))) >= i32(48)) && (_c <= i32(57)) { + if (store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0)))))) >= i32(48)) && (_c <= i32(57)) { _v = ((_v * uint32(i32(10))) + uint32(_c)) - uint32(i32(48)) *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _7 @@ -45883,7 +48214,7 @@ _7: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLog)) + 2*uintptr(_i))) = _sqlite3LogEst(tls, uint64(_v)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLog)) + 2*uintptr(_i))) = _sqlite3LogEst(tls, uint64(_v)) if int32(*_z) == i32(32) { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) } @@ -45896,30 +48227,30 @@ _6: crt.X__builtin_abort(tls) } }() - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 4, 2) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 64, 6) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 4, 2) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 64, 6) _17: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == 0 { goto _18 } if Xsqlite3_strglob(tls, str(60268), _z) == i32(0) { - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 4, 2) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(1)), 4, 2) goto _23 } if Xsqlite3_strglob(tls, str(60279), _z) == i32(0) { - *(*int16)(unsafe.Pointer(&(_pIndex.X12))) = _sqlite3LogEst(tls, uint64(_sqlite3Atoi(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(i32(3))))))) + *(*int16)(unsafe.Pointer(&_pIndex.X12)) = _sqlite3LogEst(tls, uint64(_sqlite3Atoi(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(i32(3))))))) goto _23 } if Xsqlite3_strglob(tls, str(60289), _z) == i32(0) { - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 64, 6) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(1)), 64, 6) } _23: - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(32)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(32)) { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _23 } _25: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(32) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(32) { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _25 } @@ -45933,48 +48264,54 @@ func init() { crt.Xstrncpy(nil, &_decodeIntArrayØ00__func__Ø000[0], str(60301), 15) } -// The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and -// non-zero if there is no match. +// C comment +// /* +// ** The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and +// ** non-zero if there is no match. +// */ func Xsqlite3_strglob(tls *crt.TLS, _zGlobPattern *int8, _zString *int8) (r0 int32) { return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zGlobPattern)), (*uint8)(unsafe.Pointer(_zString)), &_globInfo, uint32(i32(91))) } -// Compare two UTF-8 strings for equality where the first string is -// a GLOB or LIKE expression. Return values: -// -// SQLITE_MATCH: Match -// SQLITE_NOMATCH: No match -// SQLITE_NOWILDCARDMATCH: No match in spite of having * or % wildcards. -// -// Globbing rules: -// -// '*' Matches any sequence of zero or more characters. -// -// '?' Matches exactly one character. -// -// [...] Matches one character from the enclosed list of -// characters. -// -// [^...] Matches one character not in the enclosed list. -// -// With the [...] and [^...] matching, a ']' character can be included -// in the list by making it the first character after '[' or '^'. A -// range of characters can be specified using '-'. Example: -// "[a-z]" matches any single lower-case letter. To match a '-', make -// it the last character in the list. -// -// Like matching rules: -// -// '%' Matches any sequence of zero or more characters -// -// *** '_' Matches any one character -// -// Ec Where E is the "esc" character and c is any other -// character, including '%', '_', and esc, match exactly c. -// -// The comments within this routine usually assume glob matching. -// -// This routine is usually quick, but can be N**2 in the worst case. +// C comment +// /* +// ** Compare two UTF-8 strings for equality where the first string is +// ** a GLOB or LIKE expression. Return values: +// ** +// ** SQLITE_MATCH: Match +// ** SQLITE_NOMATCH: No match +// ** SQLITE_NOWILDCARDMATCH: No match in spite of having * or % wildcards. +// ** +// ** Globbing rules: +// ** +// ** '*' Matches any sequence of zero or more characters. +// ** +// ** '?' Matches exactly one character. +// ** +// ** [...] Matches one character from the enclosed list of +// ** characters. +// ** +// ** [^...] Matches one character not in the enclosed list. +// ** +// ** With the [...] and [^...] matching, a ']' character can be included +// ** in the list by making it the first character after '[' or '^'. A +// ** range of characters can be specified using '-'. Example: +// ** "[a-z]" matches any single lower-case letter. To match a '-', make +// ** it the last character in the list. +// ** +// ** Like matching rules: +// ** +// ** '%' Matches any sequence of zero or more characters +// ** +// *** '_' Matches any one character +// ** +// ** Ec Where E is the "esc" character and c is any other +// ** character, including '%', '_', and esc, match exactly c. +// ** +// ** The comments within this routine usually assume glob matching. +// ** +// ** This routine is usually quick, but can be N**2 in the worst case. +// */ func _patternCompare(tls *crt.TLS, _zPattern *uint8, _zString *uint8, _pInfo *TcompareInfo, _matchOther uint32) (r0 int32) { var _9_bMatch, _13_bMatch, _17_bMatch, _21_seen, _21_invert int32 var _c, _c2, _matchOne, _matchAll, _13_cx, _21_prior_c uint32 @@ -45986,7 +48323,7 @@ func _patternCompare(tls *crt.TLS, _zPattern *uint8, _zString *uint8, _pInfo *Tc _zEscaped = nil _0: if store5(&_c, func() uint32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) { return uint32(*postInc13(&_zPattern, 1)) } return _sqlite3Utf8Read(tls, &_zPattern) @@ -45998,7 +48335,7 @@ _0: } _5: if store5(&_c, func() uint32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) { return uint32(*postInc13(&_zPattern, 1)) } return _sqlite3Utf8Read(tls, &_zPattern) @@ -46035,7 +48372,7 @@ _20: if (*_zString) == 0 { goto _21 } - _9_bMatch = _patternCompare(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern))+1*uintptr(i32(-1)))), _zString, _pInfo, _matchOther) + _9_bMatch = _patternCompare(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern))+1*uintptr(i32(-1)))), _zString, _pInfo, _matchOther) if _9_bMatch != i32(1) { return _9_bMatch } @@ -46058,8 +48395,8 @@ _14: goto _26 } if _noCase != 0 { - _13_cx = _c & uint32(^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(32))) - _c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c))))) + _13_cx = _c & uint32(^(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(32))) + _c = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c))))) goto _28 } _13_cx = _c @@ -46080,7 +48417,7 @@ _30: _26: _35: if store5(&_c2, func() uint32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zString)) + 1*uintptr(i32(0))))) < i32(128) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zString)) + 1*uintptr(i32(0))))) < i32(128) { return uint32(*postInc13(&_zString, 1)) } return _sqlite3Utf8Read(tls, &_zString) @@ -46136,7 +48473,7 @@ _47: if _c2 == 0 || _c2 == uint32(i32(93)) { goto _50 } - if _c2 != uint32(i32(45)) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(93) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) || _21_prior_c <= uint32(i32(0)) { + if _c2 != uint32(i32(45)) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0))))) == i32(93) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) || _21_prior_c <= uint32(i32(0)) { goto _55 } _c2 = _sqlite3Utf8Read(tls, &_zPattern) @@ -46161,7 +48498,7 @@ _50: _44: _41: _c2 = func() uint32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zString)) + 1*uintptr(i32(0))))) < i32(128) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zString)) + 1*uintptr(i32(0))))) < i32(128) { return uint32(*postInc13(&_zString, 1)) } return _sqlite3Utf8Read(tls, &_zString) @@ -46169,7 +48506,7 @@ _41: if _c == _c2 { goto _0 } - if (((_noCase != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c))))) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c2))))))) && (_c < uint32(i32(128)))) && (_c2 < uint32(i32(128))) { + if (((_noCase != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c))))) == int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c2))))))) && (_c < uint32(i32(128)))) && (_c2 < uint32(i32(128))) { goto _0 } if ((_c == _matchOne) && (_zPattern != _zEscaped)) && (_c2 != uint32(i32(0))) { @@ -46192,7 +48529,7 @@ func _sqlite3Utf8Read(tls *crt.TLS, _pz **uint8) (r0 uint32) { if _c < uint32(i32(192)) { goto _0 } - _c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) + _c = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192)))))) _1: if (int32(*(*_pz)) & i32(192)) == i32(128) { _c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(_pz, 1))) @@ -46217,22 +48554,25 @@ func init() { _globInfo = TcompareInfo{X0: u8(42), X1: u8(63), X2: u8(91), X3: u8(0)} } -// Fill the Index.aiRowEst[] array with default information - information -// to be used when we have not run the ANALYZE command. -// -// aiRowEst[0] is supposed to contain the number of elements in the index. -// Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the -// number of rows in the table that match any particular value of the -// first column of the index. aiRowEst[2] is an estimate of the number -// of rows that match any particular combination of the first 2 columns -// of the index. And so forth. It must always be the case that -// * -// aiRowEst[N]<=aiRowEst[N-1] -// aiRowEst[N]>=1 -// -// Apart from that, we have little to go on besides intuition as to -// how aiRowEst[] should be initialized. The numbers generated here -// are based on typical values found in actual indices. +// C comment +// /* +// ** Fill the Index.aiRowEst[] array with default information - information +// ** to be used when we have not run the ANALYZE command. +// ** +// ** aiRowEst[0] is supposed to contain the number of elements in the index. +// ** Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the +// ** number of rows in the table that match any particular value of the +// ** first column of the index. aiRowEst[2] is an estimate of the number +// ** of rows that match any particular combination of the first 2 columns +// ** of the index. And so forth. It must always be the case that +// * +// ** aiRowEst[N]<=aiRowEst[N-1] +// ** aiRowEst[N]>=1 +// ** +// ** Apart from that, we have little to go on besides intuition as to +// ** how aiRowEst[] should be initialized. The numbers generated here +// ** are based on typical values found in actual indices. +// */ func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) { var _nCopy, _i int32 var _a *int16 @@ -46246,15 +48586,15 @@ func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) { return int32(_pIdx.X13) }() func() { - if ((uint32((_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pIdx.X16>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103155), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60347))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0)))) = (*XTable)(_pIdx.X3).X12 + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(i32(0)))) = (*XTable)(_pIdx.X3).X12 if (*XExpr)(_pIdx.X9) != nil { { - p := (*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0)))) + p := (*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(i32(0)))) *p = int16(int32(*p) - i32(10)) sink18(*p) } @@ -46265,8 +48605,8 @@ func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) { crt.X__builtin_abort(tls) } }() - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0))))) < i32(33) { - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0)))) = int16(i32(33)) + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(i32(0))))) < i32(33) { + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(i32(0)))) = int16(i32(33)) } func() { if i32(33) != int32(_sqlite3LogEst(tls, uint64(i32(10)))) { @@ -46274,13 +48614,13 @@ func _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) { crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)((*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a))+2*uintptr(i32(1))))), (unsafe.Pointer)(&_aVal), uint64(_nCopy)*u64(2)) + crt.Xmemcpy(tls, unsafe.Pointer((*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a))+2*uintptr(i32(1))))), unsafe.Pointer(&_aVal), uint64(_nCopy)*u64(2)) _i = _nCopy + i32(1) _10: if _i > int32(_pIdx.X13) { goto _13 } - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(_i))) = int16(i32(23)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(_i))) = int16(i32(23)) func() { if i32(23) != int32(_sqlite3LogEst(tls, uint64(i32(5)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103168), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60406))) @@ -46297,7 +48637,7 @@ _13: } }() if int32(_pIdx.X15) != i32(0) { - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(_pIdx.X13))) = int16(i32(0)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 2*uintptr(_pIdx.X13))) = int16(i32(0)) } _ = _aVal } @@ -46308,10 +48648,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DefaultRowEstØ00__func__Ø000[0], str(60427), 21) } -// Parameter zName points to a nul-terminated buffer containing the name -// of a database ("main", "temp" or the name of an attached db). This -// function returns the index of the named database in db->aDb[], or -// -1 if the named db cannot be found. +// C comment +// /* +// ** Parameter zName points to a nul-terminated buffer containing the name +// ** of a database ("main", "temp" or the name of an attached db). This +// ** function returns the index of the named database in db->aDb[], or +// ** -1 if the named db cannot be found. +// */ func _sqlite3FindDbName(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 int32) { var _i int32 var _1_pDb *XDb @@ -46319,7 +48662,7 @@ func _sqlite3FindDbName(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 int32) { if _zName == nil { goto _0 } - *func() **XDb { _i = (_db.X5) - i32(1); return &_1_pDb }() = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) + *func() **XDb { _i = _db.X5 - i32(1); return &_1_pDb }() = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) _1: if _i < i32(0) { goto _4 @@ -46337,9 +48680,12 @@ _0: return _i } -// Check to see if zTabName is really the name of a pragma. If it is, -// then register an eponymous virtual table for that pragma and return -// a pointer to the Module object for the new virtual table. +// C comment +// /* +// ** Check to see if zTabName is really the name of a pragma. If it is, +// ** then register an eponymous virtual table for that pragma and return +// ** a pointer to the Module object for the new virtual table. +// */ func _sqlite3PragmaVtabRegister(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 *XModule) { var _pName *XPragmaName func() { @@ -46356,12 +48702,12 @@ func _sqlite3PragmaVtabRegister(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 * return nil } func() { - if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zName) != nil { + if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X65)), _zName) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115657), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000))), unsafe.Pointer(str(60494))) crt.X__builtin_abort(tls) } }() - return _sqlite3VtabCreateModule(tls, _db, _zName, &_pragmaVtabModule, (unsafe.Pointer)(_pName), nil) + return _sqlite3VtabCreateModule(tls, _db, _zName, &_pragmaVtabModule, unsafe.Pointer(_pName), nil) } var _sqlite3PragmaVtabRegisterØ00__func__Ø000 [26]int8 @@ -46370,7 +48716,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PragmaVtabRegisterØ00__func__Ø000[0], str(60534), 26) } -// Locate a pragma in the aPragmaName[] array. +// C comment +// /* +// ** Locate a pragma in the aPragmaName[] array. +// */ func _pragmaLocate(tls *crt.TLS, _zName *int8) (r0 *XPragmaName) { var _upr, _lwr, _mid, _rc int32 _mid = i32(0) @@ -46381,7 +48730,7 @@ _0: goto _1 } _mid = (_lwr + _upr) / i32(2) - _rc = Xsqlite3_stricmp(tls, _zName, (*XPragmaName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPragmaName))+16*uintptr(_mid))).X0) + _rc = Xsqlite3_stricmp(tls, _zName, (*XPragmaName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPragmaName))+16*uintptr(_mid))).X0) if _rc == i32(0) { goto _1 } @@ -46397,7 +48746,7 @@ _1: if _lwr > _upr { return nil } - return (*XPragmaName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPragmaName)) + 16*uintptr(_mid))) + return (*XPragmaName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPragmaName)) + 16*uintptr(_mid))) }() } @@ -46433,7 +48782,10 @@ func init() { }{_pragmaVtabRowid})), X13: nil, X14: nil, X15: nil, X16: nil, X17: nil, X18: nil, X19: nil, X20: nil, X21: nil, X22: nil} } -// Pragma virtual table module xConnect method. +// C comment +// /* +// ** Pragma virtual table module xConnect method. +// */ func _pragmaVtabConnect(tls *crt.TLS, _db *Xsqlite3, _pAux unsafe.Pointer, _argc int32, _argv **int8, _ppVtab **Xsqlite3_vtab, _pzErr **int8) (r0 int32) { var _rc, _i, _j int32 var _cSep int8 @@ -46452,7 +48804,7 @@ _0: if _i >= int32(_pPragma.X4) { goto _3 } - _sqlite3XPrintf(tls, &_acc, str(61547), int32(_cSep), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pragCName)) + 8*uintptr(_j))))) + _sqlite3XPrintf(tls, &_acc, str(61547), int32(_cSep), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pragCName)) + 8*uintptr(_j))))) _cSep = int8(i32(44)) *func() *int32 { _i += 1; return &_j }() += 1 goto _0 @@ -46488,11 +48840,11 @@ _3: _rc = i32(7) goto _11 } - crt.Xmemset(tls, (unsafe.Pointer)(_pTab), i32(0), u64(48)) - *(**XPragmaName)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _pPragma - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1))))) = _db - *(*uint8)(unsafe.Pointer(&(_pTab.X4))) = uint8(_i) - *(*uint8)(unsafe.Pointer(&(_pTab.X3))) = uint8(_j) + crt.Xmemset(tls, unsafe.Pointer(_pTab), i32(0), u64(48)) + *(**XPragmaName)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X2)))) = _pPragma + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X1)))) = _db + *(*uint8)(unsafe.Pointer(&_pTab.X4)) = uint8(_i) + *(*uint8)(unsafe.Pointer(&_pTab.X3)) = uint8(_j) _11: goto _12 _9: @@ -46506,7 +48858,10 @@ _12: panic(0) } -// Append the complete text of zero-terminated string z[] to the p string. +// C comment +// /* +// ** Append the complete text of zero-terminated string z[] to the p string. +// */ func _sqlite3StrAccumAppendAll(tls *crt.TLS, _p *XStrAccum, _z *int8) { _sqlite3StrAccumAppend(tls, _p, _z, _sqlite3Strlen30(tls, _z)) } @@ -46523,28 +48878,30 @@ func init() { crt.Xstrncpy(nil, &_pragmaVtabConnectØ00__func__Ø000[0], str(61823), 18) } -// Figure out the best index to use to search a pragma virtual table. -// -// There are not really any index choices. But we want to encourage the -// query planner to give == constraints on as many hidden parameters as -// possible, and especially on the first hidden parameter. So return a -// high cost if hidden parameters are unconstrained. +// C comment +// /* Figure out the best index to use to search a pragma virtual table. +// ** +// ** There are not really any index choices. But we want to encourage the +// ** query planner to give == constraints on as many hidden parameters as +// ** possible, and especially on the first hidden parameter. So return a +// ** high cost if hidden parameters are unconstrained. +// */ func _pragmaVtabBestIndex(tls *crt.TLS, _tab *Xsqlite3_vtab, _pIdxInfo *Xsqlite3_index_info) (r0 int32) { var _i, _j int32 var _seen [2]int32 var _pTab *XPragmaVtab var _pConstraint *Tsqlite3_index_constraint _pTab = (*XPragmaVtab)(unsafe.Pointer(_tab)) - *(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(1) + *(*float64)(unsafe.Pointer(&_pIdxInfo.X9)) = float64(1) if int32(_pTab.X3) == i32(0) { return i32(0) } _pConstraint = (*Tsqlite3_index_constraint)(_pIdxInfo.X1) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0)))) = i32(0) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(0)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(1)))) = i32(0) _i = i32(0) _1: - if _i >= (_pIdxInfo.X0) { + if _i >= _pIdxInfo.X0 { goto _4 } if int32(_pConstraint.X2) == i32(0) { @@ -46553,35 +48910,35 @@ _1: if int32(_pConstraint.X1) != i32(2) { goto _2 } - if (_pConstraint.X0) < int32(_pTab.X4) { + if _pConstraint.X0 < int32(_pTab.X4) { goto _2 } - _j = (_pConstraint.X0) - int32(_pTab.X4) + _j = _pConstraint.X0 - int32(_pTab.X4) func() { if _j >= i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115472), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabBestIndexØ00__func__Ø000))), unsafe.Pointer(str(61841))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(_j))) = _i + i32(1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(_j))) = _i + i32(1) _2: *(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pConstraint }())) += uintptr(12) goto _1 _4: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0))))) == i32(0) { - *(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = 2.147483647e+09 - *(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(2147483647)) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(0))))) == i32(0) { + *(*float64)(unsafe.Pointer(&_pIdxInfo.X9)) = 2.147483647e+09 + *(*int64)(unsafe.Pointer(&_pIdxInfo.X10)) = int64(i32(2147483647)) return i32(0) } - _j = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0))))) - i32(1) + _j = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(0))))) - i32(1) *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X0))) = i32(1) *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X1))) = uint8(i32(1)) - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1))))) == i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(1))))) == i32(0) { return i32(0) } - *(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(20) - *(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(20)) - _j = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1))))) - i32(1) + *(*float64)(unsafe.Pointer(&_pIdxInfo.X9)) = float64(20) + *(*int64)(unsafe.Pointer(&_pIdxInfo.X10)) = int64(i32(20)) + _j = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_seen)) + 4*uintptr(i32(1))))) - i32(1) *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X0))) = i32(2) *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X1))) = uint8(i32(1)) return i32(0) @@ -46596,54 +48953,63 @@ func init() { crt.Xstrncpy(nil, &_pragmaVtabBestIndexØ00__func__Ø000[0], str(61847), 20) } -// Pragma virtual table module xDisconnect method. +// C comment +// /* +// ** Pragma virtual table module xDisconnect method. +// */ func _pragmaVtabDisconnect(tls *crt.TLS, _pVtab *Xsqlite3_vtab) (r0 int32) { var _pTab *XPragmaVtab _pTab = (*XPragmaVtab)(unsafe.Pointer(_pVtab)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pTab)) + Xsqlite3_free(tls, unsafe.Pointer(_pTab)) return i32(0) } -// Create a new cursor for the pragma virtual table +// C comment +// /* Create a new cursor for the pragma virtual table */ func _pragmaVtabOpen(tls *crt.TLS, _pVtab *Xsqlite3_vtab, _ppCursor **Xsqlite3_file) (r0 int32) { var _pCsr *XPragmaVtabCursor _pCsr = (*XPragmaVtabCursor)(Xsqlite3_malloc(tls, int32(u64(40)))) if _pCsr == nil { return i32(7) } - crt.Xmemset(tls, (unsafe.Pointer)(_pCsr), i32(0), u64(40)) - *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_file)(unsafe.Pointer(&(_pCsr.X0))).X0))))) = _pVtab - *_ppCursor = (*Xsqlite3_file)(unsafe.Pointer(&(_pCsr.X0))) + crt.Xmemset(tls, unsafe.Pointer(_pCsr), i32(0), u64(40)) + *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_file)(unsafe.Pointer(&_pCsr.X0)).X0))))) = _pVtab + *_ppCursor = (*Xsqlite3_file)(unsafe.Pointer(&_pCsr.X0)) return i32(0) } -// Close a pragma virtual table cursor +// C comment +// /* Close a pragma virtual table cursor */ func _pragmaVtabClose(tls *crt.TLS, _cur *Xsqlite3_file) (r0 int32) { var _pCsr *XPragmaVtabCursor _pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_cur)) _pragmaVtabCursorClear(tls, _pCsr) - Xsqlite3_free(tls, (unsafe.Pointer)(_pCsr)) + Xsqlite3_free(tls, unsafe.Pointer(_pCsr)) return i32(0) } -// Clear all content from pragma virtual table cursor. +// C comment +// /* Clear all content from pragma virtual table cursor. */ func _pragmaVtabCursorClear(tls *crt.TLS, _pCsr *XPragmaVtabCursor) { var _i int32 Xsqlite3_finalize(tls, _pCsr.X1) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.X1)) = nil _i = i32(0) _0: if _i >= i32(2) { goto _3 } - Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(_i))))) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(_i))) = nil + Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(_i))))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(_i))) = nil _i += 1 goto _0 _3: } -// Pragma virtual table module xFilter method. +// C comment +// /* +// ** Pragma virtual table module xFilter method. +// */ func _pragmaVtabFilter(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _idxNum int32, _idxStr *int8, _argc int32, _argv **XMem) (r0 int32) { var _rc, _i, _j int32 var _zSql *int8 @@ -46671,30 +49037,30 @@ _2: crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(_j))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))))) - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(_j)))) == nil { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(_j))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))))) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(_j)))) == nil { return i32(7) } *func() *int32 { _i += 1; return &_j }() += 1 goto _2 _5: - _sqlite3StrAccumInit(tls, &_acc, nil, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pTab.X1).X31))))) + 4*uintptr(i32(1))))) + _sqlite3StrAccumInit(tls, &_acc, nil, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pTab.X1).X31))))) + 4*uintptr(i32(1))))) _sqlite3StrAccumAppendAll(tls, &_acc, str(61892)) - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(i32(1))))) != nil { - _sqlite3XPrintf(tls, &_acc, str(61900), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(i32(1)))))) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(i32(1))))) != nil { + _sqlite3XPrintf(tls, &_acc, str(61900), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(i32(1)))))) } _sqlite3StrAccumAppendAll(tls, &_acc, (*XPragmaName)(_pTab.X2).X0) - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(i32(0))))) != nil { - _sqlite3XPrintf(tls, &_acc, str(61904), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(i32(0)))))) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(i32(0))))) != nil { + _sqlite3XPrintf(tls, &_acc, str(61904), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(i32(0)))))) } _zSql = _sqlite3StrAccumFinish(tls, &_acc) if _zSql == nil { return i32(7) } - _rc = Xsqlite3_prepare_v2(tls, (*Xsqlite3)(_pTab.X1), _zSql, i32(-1), (*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))), nil) - Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + _rc = Xsqlite3_prepare_v2(tls, (*Xsqlite3)(_pTab.X1), _zSql, i32(-1), (*unsafe.Pointer)(unsafe.Pointer(&_pCsr.X1)), nil) + Xsqlite3_free(tls, unsafe.Pointer(_zSql)) if _rc != i32(0) { - *(**int8)(unsafe.Pointer(&((*Xsqlite3_vtab)(unsafe.Pointer(&(_pTab.X0))).X2))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_pTab.X1)))) + *(**int8)(unsafe.Pointer(&((*Xsqlite3_vtab)(unsafe.Pointer(&_pTab.X0)).X2))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_pTab.X1)))) return _rc } return _pragmaVtabNext(tls, _pVtabCursor) @@ -46727,22 +49093,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_prepare_v2Ø00__func__Ø000[0], str(61925), 19) } -// Advance the pragma virtual table cursor to the next row +// C comment +// /* Advance the pragma virtual table cursor to the next row */ func _pragmaVtabNext(tls *crt.TLS, _pVtabCursor *Xsqlite3_file) (r0 int32) { var _rc int32 var _pCsr *XPragmaVtabCursor _pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor)) _rc = i32(0) - *(*int64)(unsafe.Pointer(&(_pCsr.X2))) += 1 + *(*int64)(unsafe.Pointer(&_pCsr.X2)) += 1 func() { - if (_pCsr.X1) == nil { + if _pCsr.X1 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115529), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabNextØ00__func__Ø000))), unsafe.Pointer(str(61944))) crt.X__builtin_abort(tls) } }() if i32(100) != Xsqlite3_step(tls, _pCsr.X1) { _rc = Xsqlite3_finalize(tls, _pCsr.X1) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_pCsr.X1)) = nil _pragmaVtabCursorClear(tls, _pCsr) } return _rc @@ -46754,9 +49121,12 @@ func init() { crt.Xstrncpy(nil, &_pragmaVtabNextØ00__func__Ø000[0], str(61958), 15) } -// This is the top-level implementation of sqlite3_step(). Call -// sqlite3Step() to do most of the work. If a schema error occurs, -// call sqlite3Reprepare() and try again. +// C comment +// /* +// ** This is the top-level implementation of sqlite3_step(). Call +// ** sqlite3Step() to do most of the work. If a schema error occurs, +// ** call sqlite3Reprepare() and try again. +// */ func Xsqlite3_step(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _rc, _rc2, _cnt, _2_savedPc int32 var _3_zErr *int8 @@ -46771,9 +49141,9 @@ func Xsqlite3_step(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { } _db = (*Xsqlite3)(_v.X0) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(0)), 2, 1) + storebits18((*int16)(unsafe.Pointer(&_v.X32)), int16(i32(0)), 2, 1) _1: - if store1(&_rc, _sqlite3Step(tls, _v)) != i32(17) || postInc1(&_cnt, int32(1)) >= i32(50) { + if store1(&_rc, _sqlite3Step(tls, _v)) != i32(17) || postInc1(&_cnt, 1) >= i32(50) { goto _2 } _2_savedPc = _v.X9 @@ -46783,7 +49153,7 @@ _1: } Xsqlite3_reset(tls, _pStmt) if _2_savedPc >= i32(0) { - storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(1)), 2, 1) + storebits18((*int16)(unsafe.Pointer(&_v.X32)), int16(i32(1)), 2, 1) } func() { if int32((uint32(_v.X32)<<uint(i32(31)))>>uint(i32(31))) != i32(0) { @@ -46797,14 +49167,14 @@ _2: goto _8 } _3_zErr = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.X56)))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_v.X22)) - if (_db.X17) == 0 { - *(**int8)(unsafe.Pointer(&(_v.X22))) = _sqlite3DbStrDup(tls, _db, _3_zErr) - *(*int32)(unsafe.Pointer(&(_v.X10))) = _rc2 + _sqlite3DbFree(tls, _db, unsafe.Pointer(_v.X22)) + if _db.X17 == 0 { + *(**int8)(unsafe.Pointer(&_v.X22)) = _sqlite3DbStrDup(tls, _db, _3_zErr) + *(*int32)(unsafe.Pointer(&_v.X10)) = _rc2 goto _10 } - *(**int8)(unsafe.Pointer(&(_v.X22))) = nil - *(*int32)(unsafe.Pointer(&(_v.X10))) = store1(&_rc, _sqlite3NomemError(tls, i32(76785))) + *(**int8)(unsafe.Pointer(&_v.X22)) = nil + *(*int32)(unsafe.Pointer(&_v.X10)) = store1(&_rc, _sqlite3NomemError(tls, i32(76785))) _10: _8: _rc = _sqlite3ApiExit(tls, _db, _rc) @@ -46815,13 +49185,16 @@ _8: panic(0) } -// Execute the statement pStmt, either until a row of data is ready, the -// statement is completely executed or an error occurs. -// -// This routine implements the bulk of the logic behind the sqlite_step() -// API. The only thing omitted is the automatic recompile if a -// schema change has occurred. That detail is handled by the -// outer sqlite3_step() wrapper procedure. +// C comment +// /* +// ** Execute the statement pStmt, either until a row of data is ready, the +// ** statement is completely executed or an error occurs. +// ** +// ** This routine implements the bulk of the logic behind the sqlite_step() +// ** API. The only thing omitted is the automatic recompile if a +// ** schema change has occurred. That detail is handled by the +// ** outer sqlite3_step() wrapper procedure. +// */ func _sqlite3Step(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _rc int32 var _db *Xsqlite3 @@ -46831,64 +49204,64 @@ func _sqlite3Step(tls *crt.TLS, _p *TVdbe) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_p.X5) != uint32(i32(770837923)) { - Xsqlite3_reset(tls, (unsafe.Pointer)(_p)) + if _p.X5 != uint32(i32(770837923)) { + Xsqlite3_reset(tls, unsafe.Pointer(_p)) } _db = (*Xsqlite3)(_p.X0) - if (_db.X17) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(7) + if _db.X17 != 0 { + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(7) return _sqlite3NomemError(tls, i32(76654)) } - if ((_p.X9) <= i32(0)) && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(17) + if (_p.X9 <= i32(0)) && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) { + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(17) _rc = i32(1) goto _end_of_step } - if (_p.X9) >= i32(0) { + if _p.X9 >= i32(0) { goto _6 } - if (_db.X34) == i32(0) { - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0) + if _db.X34 == i32(0) { + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(0) } func() { - if (_db.X36) <= i32(0) && int32(_db.X15) != i32(0) && ((_db.X77) != int64(i32(0)) || (_db.X78) != int64(i32(0))) { + if _db.X36 <= i32(0) && int32(_db.X15) != i32(0) && (_db.X77 != int64(i32(0)) || _db.X78 != int64(i32(0))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76671), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(61987))) crt.X__builtin_abort(tls) } }() - if ((((_db.X43) != nil) || ((int32(_db.X24) & i32(2)) != i32(0))) && (((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0)) && ((_p.X36) != nil) { - _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.X0), (*int64)(unsafe.Pointer(&(_p.X26)))) + if (((_db.X43 != nil) || ((int32(_db.X24) & i32(2)) != i32(0))) && (((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0)) && (_p.X36 != nil) { + _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.X0), (*int64)(unsafe.Pointer(&_p.X26))) goto _17 } func() { - if (_p.X26) != int64(i32(0)) { + if _p.X26 != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62078))) crt.X__builtin_abort(tls) } }() _17: - *(*int32)(unsafe.Pointer(&(_db.X34))) += 1 - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { - *(*int32)(unsafe.Pointer(&(_db.X36))) += 1 + *(*int32)(unsafe.Pointer(&_db.X34)) += 1 + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + *(*int32)(unsafe.Pointer(&_db.X36)) += 1 } - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(*int32)(unsafe.Pointer(&(_db.X35))) += 1 + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(*int32)(unsafe.Pointer(&_db.X35)) += 1 } - *(*int32)(unsafe.Pointer(&(_p.X9))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X9)) = i32(0) _6: - *(*int32)(unsafe.Pointer(&(_p.X28))) = i32(0) - if ((uint32((_p.X32)>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) != 0 { + *(*int32)(unsafe.Pointer(&_p.X28)) = i32(0) + if ((uint32(_p.X32>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) != 0 { _rc = _sqlite3VdbeList(tls, _p) goto _23 } - *(*int32)(unsafe.Pointer(&(_db.X37))) += 1 + *(*int32)(unsafe.Pointer(&_db.X37)) += 1 _rc = _sqlite3VdbeExec(tls, _p) - *(*int32)(unsafe.Pointer(&(_db.X37))) -= 1 + *(*int32)(unsafe.Pointer(&_db.X37)) -= 1 _23: if _rc == i32(100) { goto _25 } - if (_p.X26) > int64(i32(0)) { + if _p.X26 > int64(i32(0)) { _invokeProfileCallback(tls, _db, _p) } _25: @@ -46896,19 +49269,19 @@ _25: goto _26 } func() { - if (_p.X10) != i32(0) { + if _p.X10 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76709), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62094))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_p.X10))) = _doWalCallbacks(tls, _db) - if (_p.X10) != i32(0) { + *(*int32)(unsafe.Pointer(&_p.X10)) = _doWalCallbacks(tls, _db) + if _p.X10 != i32(0) { _rc = i32(1) } _26: - *(*int32)(unsafe.Pointer(&(_db.X10))) = _rc + *(*int32)(unsafe.Pointer(&_db.X10)) = _rc if i32(7) == _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _p.X10) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(76718)) + *(*int32)(unsafe.Pointer(&_p.X10)) = _sqlite3NomemError(tls, i32(76718)) } _end_of_step: func() { @@ -46918,15 +49291,15 @@ _end_of_step: } }() func() { - if ((_p.X10) == i32(100) || (_p.X10) == i32(101)) && (_p.X10) != (_p.X28) { + if (_p.X10 == i32(100) || _p.X10 == i32(101)) && _p.X10 != _p.X28 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76731), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62212))) crt.X__builtin_abort(tls) } }() - if ((((uint32((_p.X32)>>uint(i32(9))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_rc != i32(100))) && (_rc != i32(101)) { + if ((((uint32(_p.X32>>uint(i32(9))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_rc != i32(100))) && (_rc != i32(101)) { _rc = _sqlite3VdbeTransferError(tls, _p) } - return _rc & (_db.X11) + return _rc & _db.X11 } var _sqlite3StepØ00__func__Ø000 [12]int8 @@ -46935,12 +49308,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3StepØ00__func__Ø000[0], str(62273), 12) } -// Terminate the current execution of an SQL statement and reset it -// back to its starting state so that it can be reused. A success code from -// the prior execution is returned. -// -// This routine sets the error code and string returned by -// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). +// C comment +// /* +// ** Terminate the current execution of an SQL statement and reset it +// ** back to its starting state so that it can be reused. A success code from +// ** the prior execution is returned. +// ** +// ** This routine sets the error code and string returned by +// ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). +// */ func Xsqlite3_reset(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _rc int32 var _2_db *Xsqlite3 @@ -46952,13 +49328,13 @@ func Xsqlite3_reset(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { _2_v = (*TVdbe)(_pStmt) _2_db = (*Xsqlite3)(_2_v.X0) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.X3)) - if (_2_v.X26) > int64(i32(0)) { + if _2_v.X26 > int64(i32(0)) { _invokeProfileCallback(tls, _2_db, _2_v) } _rc = _sqlite3VdbeReset(tls, _2_v) _sqlite3VdbeRewind(tls, _2_v) func() { - if (_rc & (_2_db.X11)) != _rc { + if (_rc & _2_db.X11) != _rc { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_resetØ00__func__Ø000))), unsafe.Pointer(str(62285))) crt.X__builtin_abort(tls) } @@ -46969,8 +49345,11 @@ _1: return _rc } -// Rewind the VDBE back to the beginning in preparation for -// running it. +// C comment +// /* +// ** Rewind the VDBE back to the beginning in preparation for +// ** running it. +// */ func _sqlite3VdbeRewind(tls *crt.TLS, _p *TVdbe) { var _i int32 func() { @@ -46980,21 +49359,21 @@ func _sqlite3VdbeRewind(tls *crt.TLS, _p *TVdbe) { } }() func() { - if (_p.X5) != uint32(i32(381479589)) && (_p.X5) != uint32(i32(1224384374)) { + if _p.X5 != uint32(i32(381479589)) && _p.X5 != uint32(i32(1224384374)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73300), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(62310))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X27) <= i32(0) { + if _p.X27 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73304), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(41716))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(770837923)) + *(*uint32)(unsafe.Pointer(&_p.X5)) = uint32(i32(770837923)) _i = i32(0) _7: - if _i >= (_p.X6) { + if _i >= _p.X6 { goto _10 } func() { @@ -47006,14 +49385,14 @@ _7: _i += 1 goto _7 _10: - *(*int32)(unsafe.Pointer(&(_p.X9))) = i32(-1) - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2)) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) - *(*uint32)(unsafe.Pointer(&(_p.X8))) = uint32(i32(1)) - *(*uint8)(unsafe.Pointer(&(_p.X31))) = uint8(i32(255)) - *(*int32)(unsafe.Pointer(&(_p.X12))) = i32(0) - *(*int64)(unsafe.Pointer(&(_p.X14))) = int64(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X9)) = i32(-1) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(0) + *(*uint8)(unsafe.Pointer(&_p.X30)) = uint8(i32(2)) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) + *(*uint32)(unsafe.Pointer(&_p.X8)) = uint32(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X31)) = uint8(i32(255)) + *(*int32)(unsafe.Pointer(&_p.X12)) = i32(0) + *(*int64)(unsafe.Pointer(&_p.X14)) = int64(i32(0)) } var _sqlite3VdbeRewindØ00__func__Ø000 [18]int8 @@ -47028,19 +49407,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_resetØ00__func__Ø000[0], str(62405), 14) } -// Give a listing of the program in the virtual machine. -// -// The interface is the same as sqlite3VdbeExec(). But instead of -// running the code, it invokes the callback once for each instruction. -// This feature is used to implement "EXPLAIN". -// -// When p->explain==1, each instruction is listed. When -// p->explain==2, only OP_Explain instructions are listed and these -// are shown in a different format. p->explain==2 is used to implement -// EXPLAIN QUERY PLAN. -// -// When p->explain==1, first the main program is listed, then each of -// the trigger subprograms are listed one by one. +// C comment +// /* +// ** Give a listing of the program in the virtual machine. +// ** +// ** The interface is the same as sqlite3VdbeExec(). But instead of +// ** running the code, it invokes the callback once for each instruction. +// ** This feature is used to implement "EXPLAIN". +// ** +// ** When p->explain==1, each instruction is listed. When +// ** p->explain==2, only OP_Explain instructions are listed and these +// ** are shown in a different format. p->explain==2 is used to implement +// ** EXPLAIN QUERY PLAN. +// ** +// ** When p->explain==1, first the main program is listed, then each of +// ** the trigger subprograms are listed one by one. +// */ func _sqlite3VdbeList(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _nRow, _nSub, _i, _rc, _10_j, _13_nByte, _13_j int32 var _8_zP4 *int8 @@ -47055,35 +49437,35 @@ func _sqlite3VdbeList(tls *crt.TLS, _p *TVdbe) (r0 int32) { _rc = i32(0) _pMem = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 72*uintptr(i32(1)))) func() { - if ((uint32((_p.X32)>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) == 0 { + if ((uint32(_p.X32>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73035), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62419))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X5) != uint32(i32(770837923)) { + if _p.X5 != uint32(i32(770837923)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73036), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62430))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X10) != i32(0) && (_p.X10) != i32(5) && (_p.X10) != i32(7) { + if _p.X10 != i32(0) && _p.X10 != i32(5) && _p.X10 != i32(7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73037), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62455))) crt.X__builtin_abort(tls) } }() _releaseMemArray(tls, _pMem, i32(8)) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil - if (_p.X10) == _sqlite3NomemError(tls, i32(73046)) { + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X21)))) = nil + if _p.X10 == _sqlite3NomemError(tls, i32(73046)) { _sqlite3OomFault(tls, _db) return i32(1) } _nRow = _p.X27 - if int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { + if int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { goto _9 } func() { - if (_p.X6) <= i32(9) { + if _p.X6 <= i32(9) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73066), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62517))) crt.X__builtin_abort(tls) } @@ -47100,68 +49482,68 @@ _13: } { p := &_nRow - *p = (*p) + ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(_i)))).X1) + *p = (*p) + ((*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(_i)))).X1) sink1(*p) } _i += 1 goto _13 _16: _9: - _i = postInc1((*int32)(unsafe.Pointer(&(_p.X9))), int32(1)) - if ((_i < _nRow) && (int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) == i32(2))) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_i))).X0) != i32(165)) { + _i = postInc1((*int32)(unsafe.Pointer(&_p.X9)), 1) + if ((_i < _nRow) && (int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) == i32(2))) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_i))).X0) != i32(165)) { goto _9 } if _i >= _nRow { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(0) _rc = i32(101) goto _23 } - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(9) + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) != 0 { + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(9) _rc = i32(1) _sqlite3VdbeError(tls, _p, _sqlite3ErrStr(tls, _p.X10)) goto _23 } - if _i < (_p.X27) { + if _i < _p.X27 { _8_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_i))) goto _25 } { p := &_i - *p = (*p) - (_p.X27) + *p = (*p) - _p.X27 sink1(*p) } _10_j = i32(0) _26: - if _i < ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(_10_j)))).X1) { + if _i < ((*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(_10_j)))).X1) { goto _29 } { p := &_i - *p = (*p) - ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(_10_j)))).X1) + *p = (*p) - ((*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(_10_j)))).X1) sink1(*p) } _10_j += 1 goto _26 _29: - _8_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(_10_j)))).X0) + 32*uintptr(_i))) + _8_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(_10_j)))).X0) + 32*uintptr(_i))) _25: - if int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { + if int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { goto _30 } - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_i) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(_i) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(2562)) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = _sqlite3OpcodeName(tls, int32(_8_pOp.X0)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(2562)) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = _sqlite3OpcodeName(tls, int32(_8_pOp.X0)) func() { - if (_pMem.X5) == nil { + if _pMem.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73113), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62527))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = _sqlite3Strlen30(tls, _pMem.X5) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) if int32(_8_pOp.X1) != i32(-13) { goto _33 @@ -47172,7 +49554,7 @@ _34: if _13_j >= _nSub { goto _37 } - if (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(_13_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_8_pOp.X6)))))) { + if (*(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(_13_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_8_pOp.X6))))) { goto _37 } _13_j += 1 @@ -47180,24 +49562,24 @@ _34: _37: if (_13_j == _nSub) && (i32(0) == _sqlite3VdbeMemGrow(tls, _pSub, _13_nByte, bool2int(_nSub != i32(0)))) { _apSub = (**XSubProgram)(unsafe.Pointer(_pSub.X5)) - *(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 8*uintptr(postInc1(&_nSub, int32(1))))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_8_pOp.X6)))))) + *(**XSubProgram)(unsafe.Pointer(uintptr(unsafe.Pointer(_apSub)) + 8*uintptr(postInc1(&_nSub, 1)))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_8_pOp.X6))))) { - p := (*uint16)(unsafe.Pointer(&(_pSub.X1))) + p := (*uint16)(unsafe.Pointer(&_pSub.X1)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } - *(*int32)(unsafe.Pointer(&(_pSub.X4))) = int32(uint64(_nSub) * u64(8)) + *(*int32)(unsafe.Pointer(&_pSub.X4)) = int32(uint64(_nSub) * u64(8)) } _33: _30: - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X3) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(_8_pOp.X3) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X4) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(_8_pOp.X4) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X5) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(_8_pOp.X5) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(100)) != 0 { func() { @@ -47208,24 +49590,24 @@ _30: }() return i32(1) } - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(514)) _8_zP4 = _displayP4(tls, _8_pOp, _pMem.X5, _pMem.X7) - if _8_zP4 != (_pMem.X5) { - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(0) + if _8_zP4 != _pMem.X5 { + *(*int32)(unsafe.Pointer(&_pMem.X4)) = i32(0) _sqlite3VdbeMemSetStr(tls, _pMem, _8_zP4, i32(-1), uint8(i32(1)), nil) goto _45 } func() { - if (_pMem.X5) == nil { + if _pMem.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62527))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = _sqlite3Strlen30(tls, _pMem.X5) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) _45: *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) - if int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { + if int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(1) { goto _48 } if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(4)) != 0 { @@ -47237,10 +49619,10 @@ _45: }() return i32(1) } - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(2) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(514)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = i32(2) Xsqlite3_snprintf(tls, i32(3), _pMem.X5, str(62558), int32(_8_pOp.X2)) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(500)) != 0 { func() { @@ -47251,13 +49633,13 @@ _45: }() return i32(1) } - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = _displayComment(tls, _8_pOp, _8_zP4, _pMem.X5, i32(500)) - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(514)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = _displayComment(tls, _8_pOp, _8_zP4, _pMem.X5, i32(500)) + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = uint8(i32(1)) _48: - *(*uint16)(unsafe.Pointer(&(_p.X29))) = uint16(i32(8) - (i32(4) * (int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) - i32(1)))) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 72*uintptr(i32(1)))) - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0) + *(*uint16)(unsafe.Pointer(&_p.X29)) = uint16(i32(8) - (i32(4) * (int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) - i32(1)))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X21)))) = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 72*uintptr(i32(1)))) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(0) _rc = i32(100) _23: return _rc @@ -47269,8 +49651,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeListØ00__func__Ø000[0], str(62563), 16) } -// Execute as much of a VDBE program as we can. -// This is the core of sqlite3_step(). +// C comment +// /* +// ** Execute as much of a VDBE program as we can. +// ** This is the core of sqlite3_step(). +// */ func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _nExtraDelete, _rc, _iCompare, _3_i, _3_once, _25_pcDest, _27_pcx, _45_cnt, _51_n, _51_p1, _51_p2, _55_n, _60_i, _87_n, _88_i, _113_res, _113_res2, _140_n, _140_i, _140_p1, _140_p2, _140_idx, _140_bRev, _143_k, _143_mx, _151_v1, _151_v2, _169_c, _179_p2, _179_len, _179_i, _215_nHdr, _215_nVarint, _215_nField, _215_file_format, _215_i, _215_j, _229_p1, _229_nName, _229_iSavepoint, _229_ii, _240_isTransaction, _244_isSchemaChange, _256_desiredAutoCommit, _256_iRollback, _266_iMeta, _266_iGen, _277_iMeta, _277_iDb, _277_iCookie, _282_nField, _282_p2, _282_iDb, _282_wrFlag, _295_pgno, _303_res, _303_oc, _303_nField, _303_eqOnly, _313_i, _324_alreadyExists, _324_takeJump, _324_ii, _324_res, _334_res, _340_res, _340_cnt, _356_seekResult, _356_op, _366_opflags, _377_res, _377_nKeyCol, _390_res, _394_res, _397_res, _400_res, _406_res, _414_res, _417_i, _420_iMoved, _420_iDb, _424_nChange, _430_pgno, _430_flags, _434_iDb, _445_nRoot, _445_nErr, _454_iSet, _454_exists, _458_nMem, _458_nByte, _485_n, _486_i, _496_i, _499_eNew, _499_eOld, _515_p1, _526_nArg, _526_iQuery, _526_res, _526_i, _532_res, _536_nArg, _536_i, _548_i int32 var _66_nByte, _73_iA, _73_iB, _94_iA, _94_iB, _215_nByte, _215_nZero, _228_nEntry, _303_iKey, _340_v, _367_iKey, _382_v, _394_sz, _408_rowid, _451_val, _479_x, _536_rowid int64 @@ -47329,51 +49714,51 @@ func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) { _pIn3 = nil _pOut = nil func() { - if (_p.X5) != uint32(i32(770837923)) { + if _p.X5 != uint32(i32(770837923)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78878), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62430))) crt.X__builtin_abort(tls) } }() _sqlite3VdbeEnter(tls, _p) - if (_p.X10) == i32(7) { + if _p.X10 == i32(7) { goto _no_mem } func() { - if (_p.X10) != i32(0) && ((_p.X10)&i32(255)) != i32(5) { + if _p.X10 != i32(0) && (_p.X10&i32(255)) != i32(5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78885), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62579))) crt.X__builtin_abort(tls) } }() func() { - if ((uint32((_p.X32)>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == 0 && int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + if ((uint32(_p.X32>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == 0 && int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62625))) crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_p.X13))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_p.X13)) = int64(i32(0)) func() { - if int32((uint32((_p.X32)>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(2)))<<uint(i32(30)))>>uint(i32(30))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78888), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62656))) crt.X__builtin_abort(tls) } }() - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil - *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0) - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 { + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X21)))) = nil + *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X2))) = i32(0) + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) != 0 { goto _abort_due_to_interrupt } - if (_db.X61) != nil { - _2_iPrior = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(4)))) + if _db.X61 != nil { + _2_iPrior = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_p.X35)))) + 4*uintptr(i32(4)))) func() { - if uint32(i32(0)) >= (_db.X63) { + if uint32(i32(0)) >= _db.X63 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62670))) crt.X__builtin_abort(tls) } }() - _nProgressLimit = (_db.X63) - (_2_iPrior % (_db.X63)) + _nProgressLimit = _db.X63 - (_2_iPrior % _db.X63) } _sqlite3BeginBenignMalloc(tls) - if (_p.X9) != i32(0) || (((*Xsqlite3)(_p.X0).X6)&i32(134218753)) == i32(0) { + if _p.X9 != i32(0) || (((*Xsqlite3)(_p.X0).X6)&i32(134218753)) == i32(0) { goto _16 } _3_once = i32(1) @@ -47384,10 +49769,10 @@ func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) { crt.Xprintf(tls, str(62691)) _3_i = i32(0) _18: - if _3_i >= (_p.X27) { + if _3_i >= _p.X27 { goto _21 } - _sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), _3_i, (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+32*uintptr(_3_i)))) + _sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), _3_i, (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+32*uintptr(_3_i)))) _3_i += 1 goto _18 _21: @@ -47397,16 +49782,16 @@ _17: } _3_i = i32(0) _23: - if _3_i >= (_p.X27) { + if _3_i >= _p.X27 { goto _26 } - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+32*uintptr(_3_i))).X0) != i32(165) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+32*uintptr(_3_i))).X0) != i32(165) { goto _27 } if _3_once != 0 { crt.Xprintf(tls, str(62714)) } - crt.Xprintf(tls, str(62732), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_3_i))).X6))))))) + crt.Xprintf(tls, str(62732), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_3_i))).X6))))))) _3_once = i32(0) _27: _3_i += 1 @@ -47418,7 +49803,7 @@ _22: } _16: _sqlite3EndBenignMalloc(tls) - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_p.X9))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_p.X9))) _30: func() { if _rc != i32(0) { @@ -47427,138 +49812,138 @@ _30: } }() func() { - if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+32*uintptr(_p.X27))))) { + if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer(_aOp)) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+32*uintptr(_p.X27))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78932), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62749))) crt.X__builtin_abort(tls) } }() _nVmStep += 1 - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)), _pOp) } - _11_opProperty = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0))) + _11_opProperty = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0))) if (int32(_11_opProperty) & i32(2)) == i32(0) { goto _40 } func() { - if (_pOp.X3) <= i32(0) { + if _pOp.X3 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78967), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62778))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X3 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62788))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X3))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X3))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62822))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X3)))) == 0 { + if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X3)))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78970), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62849))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, _pOp.X3, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X3)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X3, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X3)))) } _40: if (int32(_11_opProperty) & i32(4)) == i32(0) { goto _50 } func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78974), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X4 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62905))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62939))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4)))) == 0 { + if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4)))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78977), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62966))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, _pOp.X4, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X4, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4)))) } _50: if (int32(_11_opProperty) & i32(8)) == i32(0) { goto _60 } func() { - if (_pOp.X5) <= i32(0) { + if _pOp.X5 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X5 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78982), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78983), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63056))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5)))) == 0 { + if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5)))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78984), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63083))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, _pOp.X5, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X5, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5)))) } _60: if (int32(_11_opProperty) & i32(16)) != i32(0) { func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78988), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X4 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78989), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62905))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4)))) + _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4)))) } if (int32(_11_opProperty) & i32(32)) != i32(0) { func() { - if (_pOp.X5) <= i32(0) { + if _pOp.X5 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78993), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X5 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5)))) + _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5)))) } _pOrigOp = _pOp switch int32(_pOp.X0) { @@ -47892,26 +50277,26 @@ _60: _81: _jump_to_p2_and_check_for_interrupt: - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_pOp.X4)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_pOp.X4-i32(1)))) _check_for_interrupt: - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 { + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) != 0 { goto _abort_due_to_interrupt } if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{(_db.X61)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_db.X61})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 }{nil})) || _nVmStep < _nProgressLimit { goto _246 } func() { - if (_db.X63) == uint32(i32(0)) { + if _db.X63 == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79076), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63129))) crt.X__builtin_abort(tls) } }() - _nProgressLimit = (_nVmStep + (_db.X63)) - (_nVmStep % (_db.X63)) - if (_db.X61)(tls, _db.X62) != 0 { + _nProgressLimit = (_nVmStep + _db.X63) - (_nVmStep % _db.X63) + if _db.X61(tls, _db.X62) != 0 { _rc = i32(9) goto _abort_due_to_error } @@ -47919,12 +50304,12 @@ _246: goto _250 _82: func() { - if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X3 <= i32(0) || _pOp.X3 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79094), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149))) crt.X__builtin_abort(tls) } }() - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if bool2int((int32(_pIn1.X1)&i32(9312)) != i32(0)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79096), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63196))) @@ -47932,59 +50317,59 @@ _82: } }() _sqlite3VdbeMemAboutToChange(tls, _p, _pIn1) - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))) - if ((_db.X6) & i32(1)) != 0 { + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))) + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X3, _pIn1) } _jump_to_p2: - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_pOp.X4)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_pOp.X4-i32(1)))) goto _250 _83: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if int32(_pIn1.X1) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63220))) crt.X__builtin_abort(tls) } }() - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))))) - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(128)) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))))) + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = uint16(i32(128)) goto _250 _84: func() { - if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X3 <= i32(0) || _pOp.X3 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) < i32(0) || (_pOp.X4) >= (_p.X27) { + if _pOp.X4 < i32(0) || _pOp.X4 >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63241))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) < i32(0) || (_pOp.X5) >= (_p.X27) { + if _pOp.X5 < i32(0) || _pOp.X5 >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79136), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63270))) crt.X__builtin_abort(tls) } }() - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_pOut.X1) & i32(9312)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79138), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63299))) crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64((_pOp.X5) - i32(1)) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) - if (_pOp.X4) != 0 { + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_pOp.X5 - i32(1)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) + if _pOp.X4 != 0 { goto _jump_to_p2 } goto _250 _85: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if int32(_pIn1.X1) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79156), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63220))) @@ -47992,12 +50377,12 @@ _85: } }() func() { - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) < int64(i32(0)) || (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) >= int64(_p.X27) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) < int64(i32(0)) || (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) >= int64(_p.X27) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79157), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63321))) crt.X__builtin_abort(tls) } }() - _24_pCaller = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))))) + _24_pCaller = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))))) func() { if int32(_24_pCaller.X0) != i32(16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79159), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63354))) @@ -48005,75 +50390,75 @@ _85: } }() func() { - if (_24_pCaller.X4) < i32(0) || (_24_pCaller.X4) >= (_p.X27) { + if _24_pCaller.X4 < i32(0) || _24_pCaller.X4 >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63380))) crt.X__builtin_abort(tls) } }() - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_24_pCaller.X4)-i32(1)))) - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(128)) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_24_pCaller.X4-i32(1)))) + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = uint16(i32(128)) goto _250 _86: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if bool2int((int32(_pIn1.X1)&i32(9312)) != i32(0)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63196))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(4)) - _25_pcDest = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))) - if ((_db.X6) & i32(1)) != 0 { + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = uint16(i32(4)) + _25_pcDest = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) = int64(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32))) + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X3, _pIn1) } - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_25_pcDest))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_25_pcDest))) goto _250 _87: - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if (int32(_pIn3.X1) & i32(1)) == i32(0) { goto _250 } _88: _27_pcx = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - if (_pOp.X3) != i32(0) || (*XVdbeFrame)(_p.X38) == nil { + if _pOp.X3 != i32(0) || _p.X38 == nil { goto _286 } _27_pFrame = (*XVdbeFrame)(_p.X38) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = (*XVdbeFrame)(_27_pFrame.X1) - *(*int32)(unsafe.Pointer(&(_p.X40))) -= 1 + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X38)))) = (*XVdbeFrame)(_27_pFrame.X1) + *(*int32)(unsafe.Pointer(&_p.X40)) -= 1 _sqlite3VdbeSetChanges(tls, _db, _p.X11) _27_pcx = _sqlite3VdbeFrameRestore(tls, _27_pFrame) - if (_pOp.X4) == i32(4) { + if _pOp.X4 == i32(4) { _27_pcx = ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_27_pcx))).X4) - i32(1) } _aOp = (*XVdbeOp)(_p.X17) _aMem = (*XMem)(_p.X18) - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(_27_pcx))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_27_pcx))) goto _250 _286: - *(*int32)(unsafe.Pointer(&(_p.X10))) = _pOp.X3 - *(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(_pOp.X4) - *(*int32)(unsafe.Pointer(&(_p.X9))) = _27_pcx + *(*int32)(unsafe.Pointer(&_p.X10)) = _pOp.X3 + *(*uint8)(unsafe.Pointer(&_p.X30)) = uint8(_pOp.X4) + *(*int32)(unsafe.Pointer(&_p.X9)) = _27_pcx func() { if int32(_pOp.X2) > i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79263), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63417))) crt.X__builtin_abort(tls) } }() - if (_p.X10) == 0 { + if _p.X10 == 0 { goto _290 } - if (_pOp.X2) == 0 { + if _pOp.X2 == 0 { goto _291 } - _sqlite3VdbeError(tls, _p, str(63428), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00azTypeØ001)) + 8*uintptr(int32(_pOp.X2)-i32(1)))))) - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil { - *(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3MPrintf(tls, _db, str(63449), unsafe.Pointer(_p.X22), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _sqlite3VdbeError(tls, _p, str(63428), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeExecØ00azTypeØ001)) + 8*uintptr(int32(_pOp.X2)-i32(1)))))) + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil { + *(**int8)(unsafe.Pointer(&_p.X22)) = _sqlite3MPrintf(tls, _db, str(63449), unsafe.Pointer(_p.X22), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) } goto _293 _291: - _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) _293: Xsqlite3_log(tls, _pOp.X3, str(63456), _27_pcx, unsafe.Pointer(_p.X36), unsafe.Pointer(_p.X22)) _290: @@ -48085,23 +50470,23 @@ _290: } }() if _rc == i32(5) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(5) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(5) goto _299 } func() { - if _rc != i32(0) && ((_p.X10)&i32(255)) != i32(19) { + if _rc != i32(0) && (_p.X10&i32(255)) != i32(19) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79286), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63533))) crt.X__builtin_abort(tls) } }() func() { - if _rc != i32(0) && (_db.X77) <= int64(i32(0)) && (_db.X78) <= int64(i32(0)) { + if _rc != i32(0) && _db.X77 <= int64(i32(0)) && _db.X78 <= int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79287), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63582))) crt.X__builtin_abort(tls) } }() _rc = func() int32 { - if (_p.X10) != 0 { + if _p.X10 != 0 { return i32(1) } return i32(101) @@ -48110,43 +50495,43 @@ _299: goto _vdbe_return _89: _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_pOp.X3) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_pOp.X3) goto _250 _90: _pOut = _out2Prerelease(tls, _p, _pOp) func() { - if (*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil { + if (*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79312), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63645))) crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _250 _91: _pOut = _out2Prerelease(tls, _p, _pOp) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(8)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(8)) func() { - if _sqlite3IsNaN(tls, *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) != 0 { + if _sqlite3IsNaN(tls, *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79327), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63661))) crt.X__builtin_abort(tls) } }() - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _250 _92: func() { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79342), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63691))) crt.X__builtin_abort(tls) } }() _pOut = _out2Prerelease(tls, _p, _pOp) - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(58)) - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(58)) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) if int32(_encoding) == i32(1) { goto _315 } - _rc = _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), i32(-1), uint8(i32(1)), nil) + _rc = _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))), i32(-1), uint8(i32(1)), nil) func() { if _rc != i32(0) && _rc != i32(18) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79350), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63704))) @@ -48157,7 +50542,7 @@ _92: goto _no_mem } func() { - if (_pOut.X7) <= i32(0) || (_pOut.X6) != (_pOut.X5) { + if _pOut.X7 <= i32(0) || _pOut.X6 != _pOut.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79352), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63739))) crt.X__builtin_abort(tls) } @@ -48168,20 +50553,20 @@ _92: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pOut.X7))) = i32(0) + *(*int32)(unsafe.Pointer(&_pOut.X7)) = i32(0) { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) | i32(2048)) sink14(*p) } if int32(_pOp.X1) == i32(-1) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) } - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-1)) - *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _pOut.X5 - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = _pOut.X4 + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-1)) + *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = _pOut.X5 + *(*int32)(unsafe.Pointer(&_pOp.X3)) = _pOut.X4 _315: - if (_pOp.X3) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if _pOp.X3 > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { goto _too_big } func() { @@ -48192,103 +50577,103 @@ _315: }() _93: func() { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63691))) crt.X__builtin_abort(tls) } }() _pOut = _out2Prerelease(tls, _p, _pOp) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2562)) - *(**int8)(unsafe.Pointer(&(_pOut.X5))) = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = _pOp.X3 - *(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding - if (_pOp.X5) <= i32(0) { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(2562)) + *(**int8)(unsafe.Pointer(&_pOut.X5)) = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = _pOp.X3 + *(*uint8)(unsafe.Pointer(&_pOut.X2)) = _encoding + if _pOp.X5 <= i32(0) { goto _331 } func() { - if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X5 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79394), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022))) crt.X__builtin_abort(tls) } }() - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if (int32(_pIn3.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63806))) crt.X__builtin_abort(tls) } }() - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) == int64(_pOp.X2) { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2576)) + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) == int64(_pOp.X2) { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(2576)) } _331: goto _250 _94: _pOut = _out2Prerelease(tls, _p, _pOp) - _45_cnt = (_pOp.X5) - (_pOp.X4) + _45_cnt = _pOp.X5 - _pOp.X4 func() { - if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X5 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79420), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = store14(&_45_nullFlag, uint16(func() int32 { - if (_pOp.X3) != 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = store14(&_45_nullFlag, uint16(func() int32 { + if _pOp.X3 != 0 { return i32(257) } return i32(1) }())) - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = i32(0) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = i32(0) _341: if _45_cnt > i32(0) { *(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72) _sqlite3VdbeMemAboutToChange(tls, _p, _pOut) _sqlite3VdbeMemSetNull(tls, _pOut) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = _45_nullFlag - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = i32(0) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = _45_nullFlag + *(*int32)(unsafe.Pointer(&_pOut.X4)) = i32(0) _45_cnt -= 1 goto _341 } goto _250 _95: func() { - if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X3 <= i32(0) || _pOp.X3 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79443), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149))) crt.X__builtin_abort(tls) } }() - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-160)) | i32(1)) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-160)) | i32(1)) goto _250 _96: func() { - if (_pOp.X3) > i32(1000000000) { + if _pOp.X3 > i32(1000000000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79456), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63828))) crt.X__builtin_abort(tls) } }() _pOut = _out2Prerelease(tls, _p, _pOp) - _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), _pOp.X3, uint8(i32(0)), nil) - *(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding + _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))), _pOp.X3, uint8(i32(0)), nil) + *(*uint8)(unsafe.Pointer(&_pOut.X2)) = _encoding goto _250 _97: func() { - if (_pOp.X3) <= i32(0) || (_pOp.X3) > int32(_p.X4) { + if _pOp.X3 <= i32(0) || _pOp.X3 > int32(_p.X4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79475), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63857))) crt.X__builtin_abort(tls) } }() func() { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil && (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != _sqlite3VListNumToName(tls, _p.X25, _pOp.X3) { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil && (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != _sqlite3VListNumToName(tls, _p.X25, _pOp.X3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79476), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63887))) crt.X__builtin_abort(tls) } }() - _49_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 72*uintptr((_pOp.X3)-i32(1)))) + _49_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 72*uintptr(_pOp.X3-i32(1)))) if _sqlite3VdbeMemTooBig(tls, _49_pVar) != 0 { goto _too_big } - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _sqlite3VdbeMemShallowCopy(tls, _pOut, _49_pVar, i32(2048)) goto _250 _98: @@ -48307,17 +50692,17 @@ _98: crt.X__builtin_abort(tls) } }() - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_51_p1))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_51_p2))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_51_p1))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_51_p2))) _362: func() { - if crt.P2U(unsafe.Pointer(_pOut)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) { + if crt.P2U(unsafe.Pointer(_pOut)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr((_p.X6+i32(1))-_p.X7))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79510), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63996))) crt.X__builtin_abort(tls) } }() func() { - if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) { + if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr((_p.X6+i32(1))-_p.X7))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79511), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64034))) crt.X__builtin_abort(tls) } @@ -48330,18 +50715,18 @@ _362: }() _sqlite3VdbeMemAboutToChange(tls, _p, _pOut) _sqlite3VdbeMemMove(tls, _pOut, _pIn1) - if (crt.P2U(unsafe.Pointer((*XMem)(_pOut.X11))) >= crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_51_p1)))))) && (crt.P2U(unsafe.Pointer((*XMem)(_pOut.X11))) < crt.P2U(unsafe.Pointer(_pOut))) { + if (crt.P2U(unsafe.Pointer((*XMem)(_pOut.X11))) >= crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_51_p1)))))) && (crt.P2U(unsafe.Pointer((*XMem)(_pOut.X11))) < crt.P2U(unsafe.Pointer(_pOut))) { { - p := (**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11))))) - *p = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 72*uintptr((_pOp.X4)-_51_p1))) + p := (**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOut.X11)))) + *p = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 72*uintptr(_pOp.X4-_51_p1))) sink20(*p) } } if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 { goto _no_mem } - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, postInc1(&_51_p2, int32(1)), _pOut) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, postInc1(&_51_p2, 1), _pOut) } *(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(72) *(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72) @@ -48351,8 +50736,8 @@ _362: goto _250 _99: _55_n = _pOp.X5 - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) func() { if _pOut == _pIn1 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79542), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64089))) @@ -48364,11 +50749,11 @@ _376: if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 { goto _no_mem } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11))))) = nil - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, ((_pOp.X4)+(_pOp.X5))-_55_n, _pOut) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOut.X11)))) = nil + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, (_pOp.X4+_pOp.X5)-_55_n, _pOut) } - if postInc1(&_55_n, int32(-1)) == i32(0) { + if postInc1(&_55_n, -1) == i32(0) { goto _377 } *(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(72) @@ -48377,8 +50762,8 @@ _376: _377: goto _250 _100: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) func() { if _pOut == _pIn1 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79573), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64089))) @@ -48387,56 +50772,56 @@ _100: }() _sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, i32(4096)) if (*XMem)(_pOut.X11) == nil { - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11))))) = _pIn1 + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOut.X11)))) = _pIn1 } goto _250 _101: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_pIn1.X1) & i32(4)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64100))) crt.X__builtin_abort(tls) } }() - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) - _sqlite3VdbeMemSetInt64(tls, _pOut, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) + _sqlite3VdbeMemSetInt64(tls, _pOut, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) goto _250 _102: func() { - if int32(_p.X29) != (_pOp.X4) { + if int32(_p.X29) != _pOp.X4 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64127))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) <= i32(0) { + if _pOp.X3 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79610), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62778))) crt.X__builtin_abort(tls) } }() func() { - if ((_pOp.X3) + (_pOp.X4)) > ((((_p.X6) + i32(1)) - (_p.X7)) + i32(1)) { + if (_pOp.X3 + _pOp.X4) > (((_p.X6 + i32(1)) - _p.X7) + i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64150))) crt.X__builtin_abort(tls) } }() if ((*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{(_db.X61)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_db.X61})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{nil}))) && (_nVmStep >= _nProgressLimit)) && ((_db.X61)(tls, _db.X62) != i32(0)) { + }{nil}))) && (_nVmStep >= _nProgressLimit)) && (_db.X61(tls, _db.X62) != i32(0)) { _rc = i32(9) goto _abort_due_to_error } if i32(0) != store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(0))) { func() { - if ((_db.X6) & i32(128)) == 0 { + if (_db.X6 & i32(128)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79629), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64194))) crt.X__builtin_abort(tls) } }() func() { - if ((uint32((_p.X32)>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79630), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64221))) crt.X__builtin_abort(tls) } @@ -48444,7 +50829,7 @@ _102: goto _abort_due_to_error } func() { - if (_p.X12) != i32(0) && ((_db.X6)&i32(128)) == 0 { + if _p.X12 != i32(0) && (_db.X6&i32(128)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64240))) crt.X__builtin_abort(tls) } @@ -48456,48 +50841,48 @@ _102: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X8))) = ((_p.X8) + uint32(i32(2))) | uint32(i32(1)) - _60_pMem = store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))), (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X3)))) + *(*uint32)(unsafe.Pointer(&_p.X8)) = (_p.X8 + uint32(i32(2))) | uint32(i32(1)) + _60_pMem = store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X21)))), (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X3)))) _60_i = i32(0) _406: - if _60_i >= (_pOp.X4) { + if _60_i >= _pOp.X4 { goto _409 } func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79662), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64287))) crt.X__builtin_abort(tls) } }() - if ((int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i))).X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i)))) != 0 { + if ((int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i))).X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i)))) != 0 { goto _no_mem } func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i))).X1)&i32(4096)) != i32(0) && (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i))).X1)&i32(18)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i))).X1)&i32(4096)) != i32(0) && (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i))).X1)&i32(18)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79664), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64308))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemNulTerminate(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i)))) - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, (_pOp.X3)+_60_i, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+72*uintptr(_60_i)))) + _sqlite3VdbeMemNulTerminate(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X3+_60_i, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_60_pMem))+72*uintptr(_60_i)))) } _60_i += 1 goto _406 _409: - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _no_mem } if (int32(_db.X24) & i32(4)) != 0 { - (_db.X41)(tls, uint32(i32(4)), _db.X42, (unsafe.Pointer)(_p), nil) + _db.X41(tls, uint32(i32(4)), _db.X42, unsafe.Pointer(_p), nil) } - *(*int32)(unsafe.Pointer(&(_p.X9))) = int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) + i32(1) + *(*int32)(unsafe.Pointer(&_p.X9)) = int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) + i32(1) _rc = i32(100) goto _vdbe_return _103: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if _pIn1 == _pOut { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64382))) @@ -48527,40 +50912,40 @@ _103: if ((int32(_pIn2.X1) & i32(18)) == i32(0)) && _sqlite3VdbeMemStringify(tls, _pIn2, _encoding, uint8(i32(0))) != 0 { goto _no_mem } - _66_nByte = int64((_pIn1.X4) + (_pIn2.X4)) - if _66_nByte > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + _66_nByte = int64(_pIn1.X4 + _pIn2.X4) + if _66_nByte > int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { goto _too_big } if _sqlite3VdbeMemGrow(tls, _pOut, int32(_66_nByte)+i32(2), bool2int(_pOut == _pIn2)) != 0 { goto _no_mem } - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(2)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(2)) if _pOut != _pIn2 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut.X5), (unsafe.Pointer)(_pIn2.X5), uint64(_pIn2.X4)) + crt.Xmemcpy(tls, unsafe.Pointer(_pOut.X5), unsafe.Pointer(_pIn2.X5), uint64(_pIn2.X4)) } - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5))+1*uintptr(_pIn2.X4)))), (unsafe.Pointer)(_pIn1.X5), uint64(_pIn1.X4)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5)) + 1*uintptr(_66_nByte))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5)) + 1*uintptr(_66_nByte+int64(i32(1))))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOut.X5))+1*uintptr(_pIn2.X4)))), unsafe.Pointer(_pIn1.X5), uint64(_pIn1.X4)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOut.X5)) + 1*uintptr(_66_nByte))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOut.X5)) + 1*uintptr(_66_nByte+int64(i32(1))))) = int8(i32(0)) { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) | i32(512)) sink14(*p) } - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_66_nByte) - *(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding + *(*int32)(unsafe.Pointer(&_pOut.X4)) = int32(_66_nByte) + *(*uint8)(unsafe.Pointer(&_pOut.X2)) = _encoding goto _250 _104: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) _73_type1 = _numericType(tls, _pIn1) - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _73_type2 = _numericType(tls, _pIn2) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _73_flags = uint16(int32(_pIn1.X1) | int32(_pIn2.X1)) if ((int32(_73_type1) & int32(_73_type2)) & i32(4)) == i32(0) { goto _436 } - _73_iA = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) - _73_iB = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0))))) + _73_iA = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) + _73_iB = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn2.X0)))) _73_bIntint = int8(i32(1)) switch int32(_pOp.X0) { case i32(88): @@ -48617,8 +51002,8 @@ _442: } goto _444 _444: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _73_iB - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _73_iB + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) goto _454 _436: if (int32(_73_flags) & i32(1)) != i32(0) { @@ -48687,8 +51072,8 @@ _461: if _sqlite3IsNaN(tls, _73_rB) != 0 { goto _arithmetic_result_is_null } - *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _73_rB - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(8)) + *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _73_rB + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(8)) if (((int32(_73_type1) | int32(_73_type2)) & i32(8)) == i32(0)) && (_73_bIntint == 0) { _sqlite3VdbeIntegerAffinity(tls, _pOut) } @@ -48704,8 +51089,8 @@ _109: crt.X__builtin_abort(tls) } }() - if (_pOp.X3) != 0 { - _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X3))), int64(i32(0))) + if _pOp.X3 != 0 { + _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X3))), int64(i32(0))) } goto _250 _110: @@ -48717,19 +51102,19 @@ _110: }() _87_n = int32(_pOp.X2) func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79928), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() func() { - if _87_n != i32(0) && ((_pOp.X4) <= i32(0) || ((_pOp.X4)+_87_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1))) { + if _87_n != i32(0) && (_pOp.X4 <= i32(0) || (_pOp.X4+_87_n) > (((_p.X6+i32(1))-_p.X7)+i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79929), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64488))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) >= (_pOp.X4) && (_pOp.X5) < ((_pOp.X4)+_87_n) { + if _pOp.X5 >= _pOp.X4 && _pOp.X5 < (_pOp.X4+_87_n) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64549))) crt.X__builtin_abort(tls) } @@ -48738,14 +51123,14 @@ _110: if _87_pCtx == nil { goto _no_mem } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X0))))) = nil - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X1))))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(*int32)(unsafe.Pointer(&(_87_pCtx.X4))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X3))))) = _p - *(*uint8)(unsafe.Pointer(&(_87_pCtx.X8))) = uint8(_87_n) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-16)) - *(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _87_pCtx - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(72)) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_87_pCtx.X0)))) = nil + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_87_pCtx.X1)))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(*int32)(unsafe.Pointer(&_87_pCtx.X4)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_87_pCtx.X3)))) = _p + *(*uint8)(unsafe.Pointer(&_87_pCtx.X8)) = uint8(_87_n) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-16)) + *(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) = _87_pCtx + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(72)) _111: func() { if int32(_pOp.X1) != i32(-16) { @@ -48753,18 +51138,18 @@ _111: crt.X__builtin_abort(tls) } }() - _88_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _88_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if (*XMem)(_88_pCtx.X0) == _pOut { goto _486 } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X0))))) = _pOut + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_88_pCtx.X0)))) = _pOut _88_i = int32(_88_pCtx.X8) - i32(1) _487: if _88_i < i32(0) { goto _490 } - *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 8*uintptr(_88_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr((_pOp.X4)+_88_i))) + *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_88_pCtx.X9)))) + 8*uintptr(_88_i))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4+_88_i))) _88_i -= 1 goto _487 _490: @@ -48776,30 +51161,31 @@ _491: goto _494 } func() { - if (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 8*uintptr(_88_i)))).X1) & i32(128)) != i32(0) { + if (int32((*(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_88_pCtx.X9)))) + 8*uintptr(_88_i)))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79963), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64611))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, (_pOp.X4)+_88_i, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 8*uintptr(_88_i)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X4+_88_i, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_88_pCtx.X9)))) + 8*uintptr(_88_i)))) } _88_i += 1 goto _491 _494: - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) - *(*uint8)(unsafe.Pointer(&(_88_pCtx.X7))) = uint8(i32(0)) - (*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{((*XFuncDef)(_88_pCtx.X1).X4)})))(tls, _88_pCtx, int32(_88_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9)))))) - if (_88_pCtx.X7) == 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) + *(*uint8)(unsafe.Pointer(&_88_pCtx.X7)) = uint8(i32(0)) + func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) { + v := (*XFuncDef)(_88_pCtx.X1).X4 + return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v)) + }()(tls, _88_pCtx, int32(_88_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_88_pCtx.X9))))) + if _88_pCtx.X7 == 0 { goto _498 } - if (_88_pCtx.X5) != 0 { + if _88_pCtx.X5 != 0 { _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, _pOut))) _rc = _88_pCtx.X5 } - _sqlite3VdbeDeleteAuxData(tls, _db, (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))), _88_pCtx.X4, _pOp.X3) + _sqlite3VdbeDeleteAuxData(tls, _db, (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X43)))), _88_pCtx.X4, _pOp.X3) if _rc != 0 { goto _abort_due_to_error } @@ -48812,14 +51198,14 @@ _498: goto _too_big } _501: - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _pOut) } goto _250 _112: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if ((int32(_pIn1.X1) | int32(_pIn2.X1)) & i32(1)) != 0 { _sqlite3VdbeMemSetNull(tls, _pOut) goto _250 @@ -48871,7 +51257,7 @@ _112: }()) goto _520 } - crt.Xmemcpy(tls, (unsafe.Pointer)(&_94_uA), (unsafe.Pointer)(&_94_iA), u64(8)) + crt.Xmemcpy(tls, unsafe.Pointer(&_94_uA), unsafe.Pointer(&_94_iA), u64(8)) if int32(_94_op) == i32(86) { { p := &_94_uA @@ -48893,24 +51279,24 @@ _112: } } _522: - crt.Xmemcpy(tls, (unsafe.Pointer)(&_94_iA), (unsafe.Pointer)(&_94_uA), u64(8)) + crt.Xmemcpy(tls, unsafe.Pointer(&_94_iA), unsafe.Pointer(&_94_uA), u64(8)) _520: _509: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _94_iA - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _94_iA + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) goto _250 _116: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) _sqlite3VdbeMemAboutToChange(tls, _p, _pIn1) _sqlite3VdbeMemIntegerify(tls, _pIn1) { - p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) + p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) *p = (*p) + int64(_pOp.X4) sink6(*p) } goto _250 _117: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(4)) != i32(0) { goto _524 } @@ -48918,29 +51304,29 @@ _117: if (int32(_pIn1.X1) & i32(4)) != i32(0) { goto _525 } - if (_pOp.X4) == i32(0) { + if _pOp.X4 == i32(0) { _rc = i32(20) goto _abort_due_to_error } goto _jump_to_p2 _525: _524: - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16((int32(_pIn1.X1) & i32(-49664)) | i32(4)) + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = uint16((int32(_pIn1.X1) & i32(-49664)) | i32(4)) goto _250 _118: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(4)) != 0 { _sqlite3VdbeMemRealify(tls, _pIn1) } goto _250 _119: func() { - if (_pOp.X4) < i32(65) || (_pOp.X4) > i32(69) { + if _pOp.X4 < i32(65) || _pOp.X4 > i32(69) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80151), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64675))) crt.X__builtin_abort(tls) } }() - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) _sqlite3VdbeMemAboutToChange(tls, _p, _pIn1) _rc = func() int32 { if (int32(_pIn1.X1) & i32(16384)) != 0 { @@ -48954,8 +51340,8 @@ _119: } goto _250 _120: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _113_flags1 = _pIn1.X1 _113_flags3 = _pIn3.X1 if ((int32(_113_flags1) | int32(_113_flags3)) & i32(1)) == 0 { @@ -48993,11 +51379,11 @@ _536: if (int32(_pOp.X2) & i32(32)) == 0 { goto _548 } - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _iCompare = i32(1) _sqlite3VdbeMemAboutToChange(tls, _p, _pOut) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) - if ((_db.X6) & i32(1)) != 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X4, _pOut) } goto _550 @@ -49028,11 +51414,11 @@ _554: if ((int32(_pIn1.X1) & int32(_pIn3.X1)) & i32(4)) == i32(0) { goto _557 } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) { _113_res = i32(1) goto _compare_op } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) { _113_res = i32(-1) goto _compare_op } @@ -49060,12 +51446,12 @@ _553: } _561: func() { - if int32(_pOp.X1) != i32(-3) && (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil { + if int32(_pOp.X1) != i32(-3) && (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80353), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64839))) crt.X__builtin_abort(tls) } }() - _113_res = _sqlite3MemCompare(tls, _pIn3, _pIn1, (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _113_res = _sqlite3MemCompare(tls, _pIn3, _pIn1, (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) _compare_op: switch int32(_pOp.X0) { case i32(77): @@ -49107,18 +51493,18 @@ _578: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = _113_flags1 + *(*uint16)(unsafe.Pointer(&_pIn1.X1)) = _113_flags1 func() { if (int32(_pIn3.X1) & i32(1024)) != (int32(_113_flags3) & i32(1024)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80369), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64929))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pIn3.X1))) = _113_flags3 + *(*uint16)(unsafe.Pointer(&_pIn3.X1)) = _113_flags3 if (int32(_pOp.X2) & i32(32)) == 0 { goto _583 } - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _iCompare = _113_res _113_res2 = bool2int(_113_res2 != i32(0)) if (int32(_pOp.X2) & i32(8)) == i32(0) { @@ -49141,9 +51527,9 @@ _578: } _584: _sqlite3VdbeMemAboutToChange(tls, _p, _pOut) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_113_res2) - if ((_db.X6) & i32(1)) != 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_113_res2) + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X4, _pOut) } goto _593 @@ -49161,13 +51547,13 @@ _126: } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X0) != i32(81) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X0) != i32(79) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X0) != i32(81) && int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X0) != i32(79) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80415), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65043))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X2) & i32(32)) == 0 { + if (int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X2) & i32(32)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80416), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65090))) crt.X__builtin_abort(tls) } @@ -49184,19 +51570,19 @@ _127: } }() func() { - if (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil { + if (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65143))) crt.X__builtin_abort(tls) } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X0) != i32(98) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X0) != i32(98) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65154))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X2) & i32(1)) == 0 { + if (int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X2) & i32(1)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80439), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65180))) crt.X__builtin_abort(tls) } @@ -49214,18 +51600,18 @@ _128: } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X0) != i32(96) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X0) != i32(96) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80478), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65207))) crt.X__builtin_abort(tls) } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X1) != i32(-12) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X1) != i32(-12) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80479), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65238))) crt.X__builtin_abort(tls) } }() - _140_aPermute = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(-1)))).X6))))))) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4))))))))))) + _140_aPermute = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(-1)))).X6))))))) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4))))))))))) func() { if _140_aPermute == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80481), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65266))) @@ -49234,7 +51620,7 @@ _128: }() _612: _140_n = _pOp.X5 - _140_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _140_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) func() { if _140_n <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80485), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(1358))) @@ -49258,20 +51644,20 @@ _626: if _143_k >= _140_n { goto _629 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_143_k)))) > _143_mx { - _143_mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_143_k))) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_140_aPermute)) + 4*uintptr(_143_k)))) > _143_mx { + _143_mx = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_140_aPermute)) + 4*uintptr(_143_k))) } _143_k += 1 goto _626 _629: func() { - if _140_p1 <= i32(0) || (_140_p1+_143_mx) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _140_p1 <= i32(0) || (_140_p1+_143_mx) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65278))) crt.X__builtin_abort(tls) } }() func() { - if _140_p2 <= i32(0) || (_140_p2+_143_mx) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _140_p2 <= i32(0) || (_140_p2+_143_mx) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80494), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65320))) crt.X__builtin_abort(tls) } @@ -49279,13 +51665,13 @@ _629: goto _637 _625: func() { - if _140_p1 <= i32(0) || (_140_p1+_140_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _140_p1 <= i32(0) || (_140_p1+_140_n) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65362))) crt.X__builtin_abort(tls) } }() func() { - if _140_p2 <= i32(0) || (_140_p2+_140_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _140_p2 <= i32(0) || (_140_p2+_140_n) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80497), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65403))) crt.X__builtin_abort(tls) } @@ -49298,27 +51684,27 @@ _644: } _140_idx = func() int32 { if _140_aPermute != nil { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_140_i)))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_140_aPermute)) + 4*uintptr(_140_i)))) } return _140_i }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p1+_140_idx))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p1+_140_idx))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65444))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p2+_140_idx))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p2+_140_idx))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80503), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65470))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, _140_p1+_140_idx, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p1+_140_idx)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _140_p1+_140_idx, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p1+_140_idx)))) } - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, _140_p2+_140_idx, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p2+_140_idx)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _140_p2+_140_idx, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p2+_140_idx)))) } func() { if _140_i >= int32(_140_pKeyInfo.X2) { @@ -49326,9 +51712,9 @@ _644: crt.X__builtin_abort(tls) } }() - _140_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_140_pKeyInfo.X6))))) + 8*uintptr(_140_i))) - _140_bRev = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_pKeyInfo.X5)) + 1*uintptr(_140_i)))) - _iCompare = _sqlite3MemCompare(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p1+_140_idx))), (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_140_p2+_140_idx))), _140_pColl) + _140_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_140_pKeyInfo.X6)))) + 8*uintptr(_140_i))) + _140_bRev = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_140_pKeyInfo.X5)) + 1*uintptr(_140_i)))) + _iCompare = _sqlite3MemCompare(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p1+_140_idx))), (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_140_p2+_140_idx))), _140_pColl) if _iCompare == 0 { goto _658 } @@ -49343,25 +51729,25 @@ _647: goto _250 _129: if _iCompare < i32(0) { - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_pOp.X3)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_pOp.X3-i32(1)))) goto _663 } if _iCompare == i32(0) { - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_pOp.X4)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_pOp.X4-i32(1)))) goto _663 } - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr((_pOp.X5)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(_pOp.X5-i32(1)))) _663: goto _250 _130: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(1)) != 0 { _151_v1 = i32(2) goto _665 } _151_v1 = bool2int(_sqlite3VdbeIntValue(tls, _pIn1) != int64(i32(0))) _665: - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) if (int32(_pIn2.X1) & i32(1)) != 0 { _151_v2 = i32(2) goto _667 @@ -49369,36 +51755,36 @@ _665: _151_v2 = bool2int(_sqlite3VdbeIntValue(tls, _pIn2) != int64(i32(0))) _667: if int32(_pOp.X0) == i32(71) { - _151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00and_logicØ002)) + 1*uintptr((_151_v1*i32(3))+_151_v2)))) + _151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeExecØ00and_logicØ002)) + 1*uintptr((_151_v1*i32(3))+_151_v2)))) goto _669 } - _151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00or_logicØ003)) + 1*uintptr((_151_v1*i32(3))+_151_v2)))) + _151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeExecØ00or_logicØ003)) + 1*uintptr((_151_v1*i32(3))+_151_v2)))) _669: - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if _151_v1 == i32(2) { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1)) goto _671 } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_151_v1) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_151_v1) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4)) _671: goto _250 _132: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _sqlite3VdbeMemSetNull(tls, _pOut) if (int32(_pIn1.X1) & i32(1)) == i32(0) { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(bool2int(_sqlite3VdbeIntValue(tls, _pIn1) == 0)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(bool2int(_sqlite3VdbeIntValue(tls, _pIn1) == 0)) } goto _250 _133: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _sqlite3VdbeMemSetNull(tls, _pOut) if (int32(_pIn1.X1) & i32(1)) == i32(0) { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = ^_sqlite3VdbeIntValue(tls, _pIn1) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = ^_sqlite3VdbeIntValue(tls, _pIn1) } goto _250 _134: @@ -49408,28 +51794,28 @@ _134: crt.X__builtin_abort(tls) } }() - if (*XVdbeFrame)(_p.X38) == nil { + if _p.X38 == nil { goto _676 } _164_iAddr = uint32(int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer((*XVdbeOp)(_p.X17)))) / 32))) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8)))))) & (i32(1) << uint(int32(_164_iAddr&uint32(i32(7)))))) != i32(0) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8)))))) & (i32(1) << uint(int32(_164_iAddr&uint32(i32(7)))))) != i32(0) { goto _jump_to_p2 } { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8))))) *p = uint8(int32(*p) | (i32(1) << uint(int32(_164_iAddr&uint32(i32(7)))))) sink2(*p) } goto _678 _676: - if ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(i32(0)))).X3) == (_pOp.X3) { + if ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(i32(0)))).X3) == _pOp.X3 { goto _jump_to_p2 } _678: - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(i32(0)))).X3 + *(*int32)(unsafe.Pointer(&_pOp.X3)) = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(i32(0)))).X3 goto _250 _135: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(1)) != 0 { _169_c = _pOp.X5 goto _681 @@ -49444,52 +51830,52 @@ _681: } goto _250 _137: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(1)) != i32(0) { goto _jump_to_p2 } goto _250 _138: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) if (int32(_pIn1.X1) & i32(1)) == i32(0) { goto _jump_to_p2 } goto _250 _139: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80733), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() func() { - if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { + if (*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80734), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65574))) crt.X__builtin_abort(tls) } }() - if ((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))).X2) != 0 { + if ((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))).X2) != 0 { _sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.X5)*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(72)))))))))))) goto _jump_to_p2 } goto _250 _140: - _179_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _179_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) _179_p2 = _pOp.X4 _rc = _sqlite3VdbeCursorMoveto(tls, &_179_pC, &_179_p2) if _rc != 0 { goto _abort_due_to_error } func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() - _179_pDest = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _179_pDest = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _sqlite3VdbeMemAboutToChange(tls, _p, _179_pDest) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80795), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } @@ -49514,7 +51900,7 @@ _140: } }() func() { - if int32(_179_pC.X0) == i32(3) && (_179_pC.X2) == 0 { + if int32(_179_pC.X0) == i32(3) && _179_pC.X2 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65642))) crt.X__builtin_abort(tls) } @@ -49525,20 +51911,20 @@ _140: crt.X__builtin_abort(tls) } }() - if (_179_pC.X11) == (_p.X8) { + if _179_pC.X11 == _p.X8 { goto _710 } - if (_179_pC.X2) == 0 { + if _179_pC.X2 == 0 { goto _711 } if int32(_179_pC.X0) == i32(3) { func() { - if (*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))) <= i32(0) { + if (*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&_179_pC.X14))))) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65715))) crt.X__builtin_abort(tls) } }() - _179_pReg = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))))) + _179_pReg = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&_179_pC.X14))))))) func() { if (int32(_179_pReg.X1) & i32(16)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65739))) @@ -49551,8 +51937,8 @@ _140: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_179_pC.X23))) = store5((*uint32)(unsafe.Pointer(&(_179_pC.X24))), store5(&_179_avail, uint32(_179_pReg.X4))) - *(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = (*uint8)(unsafe.Pointer(_179_pReg.X5)) + *(*uint32)(unsafe.Pointer(&_179_pC.X23)) = store5((*uint32)(unsafe.Pointer(&_179_pC.X24)), store5(&_179_avail, uint32(_179_pReg.X4))) + *(**uint8)(unsafe.Pointer(&_179_pC.X22)) = (*uint8)(unsafe.Pointer(_179_pReg.X5)) goto _719 } _sqlite3VdbeMemSetNull(tls, _179_pDest) @@ -49560,7 +51946,7 @@ _140: _719: goto _720 _711: - _179_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))) + _179_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_179_pC.X14))))) func() { if int32(_179_pC.X0) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80818), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779))) @@ -49579,39 +51965,39 @@ _711: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_179_pC.X23))) = _sqlite3BtreePayloadSize(tls, _179_pCrsr) - *(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = (*uint8)(_sqlite3BtreePayloadFetch(tls, _179_pCrsr, &_179_avail)) + *(*uint32)(unsafe.Pointer(&_179_pC.X23)) = _sqlite3BtreePayloadSize(tls, _179_pCrsr) + *(**uint8)(unsafe.Pointer(&_179_pC.X22)) = (*uint8)(_sqlite3BtreePayloadFetch(tls, _179_pCrsr, &_179_avail)) func() { if _179_avail > uint32(i32(65536)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80823), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65846))) crt.X__builtin_abort(tls) } }() - if (_179_pC.X23) <= _179_avail { - *(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = _179_pC.X23 + if _179_pC.X23 <= _179_avail { + *(*uint32)(unsafe.Pointer(&_179_pC.X24)) = _179_pC.X23 goto _732 } - if (_179_pC.X23) > uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if _179_pC.X23 > uint32(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { goto _too_big } - *(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = _179_avail + *(*uint32)(unsafe.Pointer(&_179_pC.X24)) = _179_avail _732: _720: - *(*uint32)(unsafe.Pointer(&(_179_pC.X11))) = _p.X8 - *(*uint32)(unsafe.Pointer(&(_179_pC.X16))) = uint32(uint8(func() int32 { - if int32(*(_179_pC.X22)) < int32(u8(128)) { - return func() int32 { _179_offset = uint32(*(_179_pC.X22)); return i32(1) }() + *(*uint32)(unsafe.Pointer(&_179_pC.X11)) = _p.X8 + *(*uint32)(unsafe.Pointer(&_179_pC.X16)) = uint32(uint8(func() int32 { + if int32(*_179_pC.X22) < int32(u8(128)) { + return func() int32 { _179_offset = uint32(*_179_pC.X22); return i32(1) }() } return int32(_sqlite3GetVarint32(tls, _179_pC.X22, &_179_offset)) }())) - *(*uint16)(unsafe.Pointer(&(_179_pC.X19))) = uint16(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0)))) = _179_offset + *(*uint16)(unsafe.Pointer(&_179_pC.X19)) = uint16(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(i32(0)))) = _179_offset if _179_avail >= _179_offset { goto _735 } - *(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = nil - *(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = uint32(i32(0)) - if (_179_offset > uint32(i32(98307))) || (_179_offset > (_179_pC.X23)) { + *(**uint8)(unsafe.Pointer(&_179_pC.X22)) = nil + *(*uint32)(unsafe.Pointer(&_179_pC.X24)) = uint32(i32(0)) + if (_179_offset > uint32(i32(98307))) || (_179_offset > _179_pC.X23) { _rc = _sqlite3CorruptError(tls, i32(80856)) goto _abort_due_to_error } @@ -49632,14 +52018,14 @@ _710: if int32(_179_pC.X19) > _179_p2 { goto _742 } - if (_179_pC.X16) >= (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0))))) { + if _179_pC.X16 >= (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(i32(0))))) { goto _743 } - if (_179_pC.X22) != nil { + if _179_pC.X22 != nil { goto _744 } - crt.Xmemset(tls, (unsafe.Pointer)(&_179_sMem), i32(0), u64(72)) - _rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))), uint32(i32(0)), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0)))), &_179_sMem) + crt.Xmemset(tls, unsafe.Pointer(&_179_sMem), i32(0), u64(72)) + _rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_179_pC.X14))))), uint32(i32(0)), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(i32(0)))), &_179_sMem) if _rc != i32(0) { goto _abort_due_to_error } @@ -49649,11 +52035,11 @@ _744: _179_zData = _179_pC.X22 _op_column_read_header: _179_i = int32(_179_pC.X19) - _179_offset64 = uint64(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_i)))) + _179_offset64 = uint64(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(_179_i)))) _179_zHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(_179_pC.X16))) - _179_zEndHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0))))))) + _179_zEndHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(i32(0))))))) _747: - if store5(&_179_t, uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_zHdr)) + 1*uintptr(i32(0)))))) < uint32(i32(128)) { + if store5(&_179_t, uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zHdr)) + 1*uintptr(i32(0)))))) < uint32(i32(128)) { *(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(1) { p := &_179_offset64 @@ -49664,7 +52050,7 @@ _747: } { p := &_179_zHdr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3GetVarint32(tls, _179_zHdr, &_179_t)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3GetVarint32(tls, _179_zHdr, &_179_t)))) sink13(*p) } { @@ -49673,23 +52059,23 @@ _747: sink17(*p) } _749: - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(postInc1(&_179_i, int32(1))))) = _179_t - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_i))) = uint32(_179_offset64 & uint64(u32(4294967295))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_179_pC.X25)))) + 4*uintptr(postInc1(&_179_i, 1)))) = _179_t + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(_179_i))) = uint32(_179_offset64 & uint64(u32(4294967295))) if (_179_i <= _179_p2) && (crt.P2U(unsafe.Pointer(_179_zHdr)) < crt.P2U(unsafe.Pointer(_179_zEndHdr))) { goto _747 } if (crt.P2U(unsafe.Pointer(_179_zHdr)) < crt.P2U(unsafe.Pointer(_179_zEndHdr)) || crt.P2U(unsafe.Pointer(_179_zHdr)) <= crt.P2U(unsafe.Pointer(_179_zEndHdr)) && _179_offset64 == uint64(_179_pC.X23)) && _179_offset64 <= uint64(_179_pC.X23) { goto _754 } - if (_179_pC.X22) == nil { + if _179_pC.X22 == nil { _sqlite3VdbeMemRelease(tls, &_179_sMem) } _rc = _sqlite3CorruptError(tls, i32(80915)) goto _abort_due_to_error _754: - *(*uint16)(unsafe.Pointer(&(_179_pC.X19))) = uint16(_179_i) - *(*uint32)(unsafe.Pointer(&(_179_pC.X16))) = uint32(int64((uintptr(unsafe.Pointer(_179_zHdr)) - uintptr(unsafe.Pointer(_179_zData))) / 1)) - if (_179_pC.X22) == nil { + *(*uint16)(unsafe.Pointer(&_179_pC.X19)) = uint16(_179_i) + *(*uint32)(unsafe.Pointer(&_179_pC.X16)) = uint32(int64((uintptr(unsafe.Pointer(_179_zHdr)) - uintptr(unsafe.Pointer(_179_zData))) / 1)) + if _179_pC.X22 == nil { _sqlite3VdbeMemRelease(tls, &_179_sMem) } goto _757 @@ -49700,7 +52086,7 @@ _757: goto _758 } if int32(_pOp.X1) == i32(-7) { - _sqlite3VdbeMemShallowCopy(tls, _179_pDest, (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))), i32(2048)) + _sqlite3VdbeMemShallowCopy(tls, _179_pDest, (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))), i32(2048)) goto _760 } _sqlite3VdbeMemSetNull(tls, _179_pDest) @@ -49709,7 +52095,7 @@ _760: _758: goto _761 _742: - _179_t = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(_179_p2))) + _179_t = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_179_pC.X25)))) + 4*uintptr(_179_p2))) _761: func() { if _179_p2 >= int32(_179_pC.X19) { @@ -49733,62 +52119,62 @@ _761: _sqlite3VdbeMemSetNull(tls, _179_pDest) } func() { - if _179_t != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(_179_p2)))) { + if _179_t != (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_179_pC.X25)))) + 4*uintptr(_179_p2)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65933))) crt.X__builtin_abort(tls) } }() - if (_179_pC.X24) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2+i32(1))))) { + if _179_pC.X24 < (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(_179_p2+i32(1))))) { goto _771 } - _179_zData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pC.X22)) + uintptr(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2)))))) + _179_zData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pC.X22)) + uintptr(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(_179_p2)))))) if _179_t < uint32(i32(12)) { _sqlite3VdbeSerialGet(tls, _179_zData, _179_t, _179_pDest) goto _773 } - *(*int32)(unsafe.Pointer(&(_179_pDest.X4))) = store1(&_179_len, int32((_179_t-uint32(i32(12)))/uint32(i32(2)))) - *(*uint8)(unsafe.Pointer(&(_179_pDest.X2))) = _encoding - if (_179_pDest.X7) >= (_179_len + i32(2)) { + *(*int32)(unsafe.Pointer(&_179_pDest.X4)) = store1(&_179_len, int32((_179_t-uint32(i32(12)))/uint32(i32(2)))) + *(*uint8)(unsafe.Pointer(&_179_pDest.X2)) = _encoding + if _179_pDest.X7 >= (_179_len + i32(2)) { goto _774 } - *(*uint16)(unsafe.Pointer(&(_179_pDest.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_179_pDest.X1)) = uint16(i32(1)) if _sqlite3VdbeMemGrow(tls, _179_pDest, _179_len+i32(2), i32(0)) != 0 { goto _no_mem } goto _776 _774: - *(**int8)(unsafe.Pointer(&(_179_pDest.X5))) = _179_pDest.X6 + *(**int8)(unsafe.Pointer(&_179_pDest.X5)) = _179_pDest.X6 _776: - crt.Xmemcpy(tls, (unsafe.Pointer)(_179_pDest.X5), (unsafe.Pointer)(_179_zData), uint64(_179_len)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_pDest.X5)) + 1*uintptr(_179_len))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_pDest.X5)) + 1*uintptr(_179_len+i32(1)))) = int8(i32(0)) - *(*uint16)(unsafe.Pointer(&(_179_pDest.X1))) = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00aFlagØ004)) + 2*uintptr(_179_t&uint32(i32(1))))) + crt.Xmemcpy(tls, unsafe.Pointer(_179_pDest.X5), unsafe.Pointer(_179_zData), uint64(_179_len)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pDest.X5)) + 1*uintptr(_179_len))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pDest.X5)) + 1*uintptr(_179_len+i32(1)))) = int8(i32(0)) + *(*uint16)(unsafe.Pointer(&_179_pDest.X1)) = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeExecØ00aFlagØ004)) + 2*uintptr(_179_t&uint32(i32(1))))) _773: goto _op_column_out _771: - *(*uint8)(unsafe.Pointer(&(_179_pDest.X2))) = _encoding + *(*uint8)(unsafe.Pointer(&_179_pDest.X2)) = _encoding if (((int32(_pOp.X2) & i32(192)) != i32(0)) && (((_179_t >= uint32(i32(12))) && ((_179_t & uint32(i32(1))) == uint32(i32(0)))) || ((int32(_pOp.X2) & i32(128)) != i32(0)))) || (store1(&_179_len, int32(_sqlite3VdbeSerialTypeLen(tls, _179_t))) == i32(0)) { _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00aZeroØ005)), _179_t, _179_pDest) goto _783 } - _rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2))), uint32(_179_len), _179_pDest) + _rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_179_pC.X14))))), *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_aOffset)) + 4*uintptr(_179_p2))), uint32(_179_len), _179_pDest) if _rc != i32(0) { goto _abort_due_to_error } _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(_179_pDest.X5)), _179_t, _179_pDest) { - p := (*uint16)(unsafe.Pointer(&(_179_pDest.X1))) + p := (*uint16)(unsafe.Pointer(&_179_pDest.X1)) *p = uint16(int32(*p) & i32(-4097)) sink14(*p) } _783: _op_column_out: - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _179_pDest) } goto _250 _141: - _213_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _213_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { if _213_zAffinity == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81025), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65950))) @@ -49796,21 +52182,21 @@ _141: } }() func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81026), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_213_zAffinity)) + 1*uintptr(_pOp.X4)))) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_213_zAffinity)) + 1*uintptr(_pOp.X4)))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65963))) crt.X__builtin_abort(tls) } }() - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) _792: func() { - if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_p.X18)+72*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) { + if crt.P2U(unsafe.Pointer(_pIn1)) > crt.P2U(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_p.X18)+72*uintptr((_p.X6+i32(1))-_p.X7))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81030), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65985))) crt.X__builtin_abort(tls) } @@ -49823,7 +52209,7 @@ _792: }() _applyAffinity(tls, _pIn1, *postInc0(&_213_zAffinity, 1), _encoding) *(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(72) - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_213_zAffinity)) + 1*uintptr(i32(0))))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_213_zAffinity)) + 1*uintptr(i32(0))))) != 0 { goto _792 } goto _250 @@ -49832,24 +52218,24 @@ _142: _215_nHdr = i32(0) _215_nZero = int64(i32(0)) _215_nField = _pOp.X3 - _215_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _215_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { - if _215_nField <= i32(0) || (_pOp.X4) <= i32(0) || ((_pOp.X4)+_215_nField) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _215_nField <= i32(0) || _pOp.X4 <= i32(0) || (_pOp.X4+_215_nField) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81092), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66028))) crt.X__builtin_abort(tls) } }() - _215_pData0 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_215_nField))) + _215_pData0 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_215_nField))) _215_nField = _pOp.X4 - _215_pLast = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_pData0)) + 72*uintptr(_215_nField-i32(1)))) + _215_pLast = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_pData0)) + 72*uintptr(_215_nField-i32(1)))) _215_file_format = int32(_p.X31) func() { - if (_pOp.X5) >= (_pOp.X3) && (_pOp.X5) < ((_pOp.X3)+(_pOp.X4)) { + if _pOp.X5 >= _pOp.X3 && _pOp.X5 < (_pOp.X3+_pOp.X4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81099), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66096))) crt.X__builtin_abort(tls) } }() - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _sqlite3VdbeMemAboutToChange(tls, _p, _pOut) func() { if crt.P2U(unsafe.Pointer(_215_pData0)) > crt.P2U(unsafe.Pointer(_215_pLast)) { @@ -49864,12 +52250,12 @@ _142: _807: _applyAffinity(tls, postInc20(&_215_pRec, 72), *postInc0(&_215_zAffinity, 1), _encoding) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zAffinity)) + 1*uintptr(i32(0))))) != i32(0) && crt.P2U(unsafe.Pointer(_215_pRec)) > crt.P2U(unsafe.Pointer(_215_pLast)) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_zAffinity)) + 1*uintptr(i32(0))))) != i32(0) && crt.P2U(unsafe.Pointer(_215_pRec)) > crt.P2U(unsafe.Pointer(_215_pLast)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66154))) crt.X__builtin_abort(tls) } }() - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zAffinity)) + 1*uintptr(i32(0))))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_zAffinity)) + 1*uintptr(i32(0))))) != 0 { goto _807 } _806: @@ -49881,7 +52267,7 @@ _811: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_215_pRec.X8))) = store5(&_215_serial_type, _sqlite3VdbeSerialType(tls, _215_pRec, _215_file_format, &_215_len)) + *(*uint32)(unsafe.Pointer(&_215_pRec.X8)) = store5(&_215_serial_type, _sqlite3VdbeSerialType(tls, _215_pRec, _215_file_format, &_215_len)) if (int32(_215_pRec.X1) & i32(16384)) == 0 { goto _814 } @@ -49895,12 +52281,12 @@ _811: _815: { p := &_215_nZero - *p = (*p) + int64(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_215_pRec.X0)))))) + *p = (*p) + int64(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_215_pRec.X0))))) sink6(*p) } { p := &_215_len - *p = (*p) - uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_215_pRec.X0)))))) + *p = (*p) - uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_215_pRec.X0))))) sink5(*p) } _817: @@ -49945,7 +52331,7 @@ _821: } _823: _215_nByte = int64(uint64(_215_nHdr) + _215_nData) - if (_215_nByte + _215_nZero) > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if (_215_nByte + _215_nZero) > int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { goto _too_big } if _sqlite3VdbeMemClearAndResize(tls, _pOut, int32(_215_nByte)) != 0 { @@ -49973,17 +52359,17 @@ _831: *p = (*p) + int32(uint8(func() int32 { if _215_serial_type < u32(128) { return func() int32 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord)) + 1*uintptr(_215_i))) = uint8(_215_serial_type) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_zNewRecord)) + 1*uintptr(_215_i))) = uint8(_215_serial_type) return i32(1) }() } - return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord))+1*uintptr(_215_i))), uint64(_215_serial_type)) + return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_zNewRecord))+1*uintptr(_215_i))), uint64(_215_serial_type)) }())) sink1(*p) } { p := &_215_j - *p = int32(uint32(*p) + _sqlite3VdbeSerialPut(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord))+1*uintptr(_215_j))), _215_pRec, _215_serial_type)) + *p = int32(uint32(*p) + _sqlite3VdbeSerialPut(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_215_zNewRecord))+1*uintptr(_215_j))), _215_pRec, _215_serial_type)) sink1(*p) } if crt.P2U(unsafe.Pointer(preInc20(&_215_pRec, 72))) <= crt.P2U(unsafe.Pointer(_215_pLast)) { @@ -50002,33 +52388,33 @@ _831: } }() func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81198), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_215_nByte) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(16)) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = int32(_215_nByte) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(16)) if _215_nZero != 0 { - *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int32(_215_nZero) + *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int32(_215_nZero) { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) | i32(16384)) sink14(*p) } } - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _pOut) } goto _250 _143: func() { - if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))).X0) != i32(0) { + if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))).X0) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66219))) crt.X__builtin_abort(tls) } }() - _228_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))).X14)))))) + _228_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))).X14)))))) func() { if _228_pCrsr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807))) @@ -50041,11 +52427,11 @@ _143: goto _abort_due_to_error } _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _228_nEntry + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _228_nEntry goto _250 _144: _229_p1 = _pOp.X3 - _229_zName = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _229_zName = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { if (*XSavepoint)(_db.X73) != nil && int32(_db.X15) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81255), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66262))) @@ -50059,7 +52445,7 @@ _144: } }() func() { - if (*XSavepoint)(_db.X73) == nil && int32(_db.X23) != i32(0) { + if _db.X73 == nil && int32(_db.X23) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81257), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66368))) crt.X__builtin_abort(tls) } @@ -50071,7 +52457,7 @@ _144: } }() func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81259), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } @@ -50079,19 +52465,19 @@ _144: if _229_p1 != i32(0) { goto _862 } - if (_db.X36) > i32(0) { + if _db.X36 > i32(0) { _sqlite3VdbeError(tls, _p, str(66453)) _rc = i32(5) goto _864 } _229_nName = _sqlite3Strlen30(tls, _229_zName) func() { - if int32(_db.X15) != i32(0) && (_db.X64) != i32(0) { + if int32(_db.X15) != i32(0) && _db.X64 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66504))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3VtabSavepoint(tls, _db, i32(0), (_db.X76)+(_db.X75)) + _rc = _sqlite3VtabSavepoint(tls, _db, i32(0), _db.X76+_db.X75) if _rc != i32(0) { goto _abort_due_to_error } @@ -50099,19 +52485,19 @@ _144: if _229_pNew == nil { goto _869 } - *(**int8)(unsafe.Pointer(&(_229_pNew.X0))) = (*int8)(unsafe.Pointer((*XSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_229_pNew)) + 32*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_229_pNew.X0), (unsafe.Pointer)(_229_zName), uint64(_229_nName+i32(1))) - if (_db.X15) != 0 { - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(1)) + *(**int8)(unsafe.Pointer(&_229_pNew.X0)) = (*int8)(unsafe.Pointer((*XSavepoint)(unsafe.Pointer(uintptr(unsafe.Pointer(_229_pNew)) + 32*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_229_pNew.X0), unsafe.Pointer(_229_zName), uint64(_229_nName+i32(1))) + if _db.X15 != 0 { + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_db.X23)) = uint8(i32(1)) goto _871 } - *(*int32)(unsafe.Pointer(&(_db.X75))) += 1 + *(*int32)(unsafe.Pointer(&_db.X75)) += 1 _871: - *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_229_pNew.X3))))) = (*XSavepoint)(_db.X73) - *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = _229_pNew - *(*int64)(unsafe.Pointer(&(_229_pNew.X1))) = _db.X77 - *(*int64)(unsafe.Pointer(&(_229_pNew.X2))) = _db.X78 + *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_229_pNew.X3)))) = (*XSavepoint)(_db.X73) + *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X73)))) = _229_pNew + *(*int64)(unsafe.Pointer(&_229_pNew.X1)) = _db.X77 + *(*int64)(unsafe.Pointer(&_229_pNew.X2)) = _db.X78 _869: _864: goto _872 @@ -50131,37 +52517,37 @@ _877: _rc = i32(1) goto _882 } - if ((_db.X36) > i32(0)) && (_229_p1 == i32(1)) { + if (_db.X36 > i32(0)) && (_229_p1 == i32(1)) { _sqlite3VdbeError(tls, _p, str(66562)) _rc = i32(5) goto _882 } - _240_isTransaction = bool2int(((*XSavepoint)(_229_pSavepoint.X3) == nil) && ((_db.X23) != 0)) + _240_isTransaction = bool2int(((*XSavepoint)(_229_pSavepoint.X3) == nil) && (_db.X23 != 0)) if _240_isTransaction == 0 || _229_p1 != i32(1) { goto _885 } if store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(1))) != i32(0) { goto _vdbe_return } - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) if _sqlite3VdbeHalt(tls, _p) == i32(5) { - *(*int32)(unsafe.Pointer(&(_p.X9))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X10))) = store1(&_rc, i32(5)) + *(*int32)(unsafe.Pointer(&_p.X9)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X10)) = store1(&_rc, i32(5)) goto _vdbe_return } - *(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_db.X23)) = uint8(i32(0)) _rc = _p.X10 goto _888 _885: - _229_iSavepoint = ((_db.X75) - _229_iSavepoint) - i32(1) + _229_iSavepoint = (_db.X75 - _229_iSavepoint) - i32(1) if _229_p1 != i32(2) { goto _889 } - _244_isSchemaChange = bool2int(((_db.X6) & i32(2)) != i32(0)) + _244_isSchemaChange = bool2int((_db.X6 & i32(2)) != i32(0)) _229_ii = i32(0) _890: - if _229_ii >= (_db.X5) { + if _229_ii >= _db.X5 { goto _893 } _rc = _sqlite3BtreeTripAllCursors(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_229_ii))).X1), i32(516), bool2int(_244_isSchemaChange == i32(0))) @@ -50177,7 +52563,7 @@ _889: _895: _229_ii = i32(0) _896: - if _229_ii >= (_db.X5) { + if _229_ii >= _db.X5 { goto _899 } _rc = _sqlite3BtreeSavepoint(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_229_ii))).X1), _229_p1, _229_iSavepoint) @@ -50190,14 +52576,14 @@ _899: if _244_isSchemaChange != 0 { _sqlite3ExpirePreparedStatements(tls, _db) _sqlite3ResetAllSchemasOfConnection(tls, _db) - *(*int32)(unsafe.Pointer(&(_db.X6))) = (_db.X6) | i32(2) + *(*int32)(unsafe.Pointer(&_db.X6)) = _db.X6 | i32(2) } _888: if (*XSavepoint)(_db.X73) != _229_pSavepoint { _229_pTmp = (*XSavepoint)(_db.X73) - *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_229_pTmp.X3) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_229_pTmp)) - *(*int32)(unsafe.Pointer(&(_db.X75))) -= 1 + *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X73)))) = (*XSavepoint)(_229_pTmp.X3) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pTmp)) + *(*int32)(unsafe.Pointer(&_db.X75)) -= 1 goto _888 } if _229_p1 != i32(1) { @@ -50209,15 +52595,15 @@ _888: crt.X__builtin_abort(tls) } }() - *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_229_pSavepoint.X3) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_229_pSavepoint)) + *(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X73)))) = (*XSavepoint)(_229_pSavepoint.X3) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_229_pSavepoint)) if _240_isTransaction == 0 { - *(*int32)(unsafe.Pointer(&(_db.X75))) -= 1 + *(*int32)(unsafe.Pointer(&_db.X75)) -= 1 } goto _908 _904: - *(*int64)(unsafe.Pointer(&(_db.X77))) = _229_pSavepoint.X1 - *(*int64)(unsafe.Pointer(&(_db.X78))) = _229_pSavepoint.X2 + *(*int64)(unsafe.Pointer(&_db.X77)) = _229_pSavepoint.X1 + *(*int64)(unsafe.Pointer(&_db.X78)) = _229_pSavepoint.X2 _908: if _240_isTransaction != 0 && _229_p1 != i32(2) { goto _910 @@ -50249,13 +52635,13 @@ _145: } }() func() { - if (_db.X34) <= i32(0) { + if _db.X34 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81426), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66725))) crt.X__builtin_abort(tls) } }() func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } @@ -50271,10 +52657,10 @@ _145: } }() _sqlite3RollbackAll(tls, _db, i32(516)) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) goto _932 } - if _256_desiredAutoCommit != 0 && ((_db.X36) > i32(0)) { + if _256_desiredAutoCommit != 0 && (_db.X36 > i32(0)) { _sqlite3VdbeError(tls, _p, str(66764)) _rc = i32(5) goto _abort_due_to_error @@ -50282,22 +52668,22 @@ _145: if store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(1))) != i32(0) { goto _vdbe_return } - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(_256_desiredAutoCommit) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(_256_desiredAutoCommit) _932: if _sqlite3VdbeHalt(tls, _p) == i32(5) { - *(*int32)(unsafe.Pointer(&(_p.X9))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1) - _256_desiredAutoCommit) - *(*int32)(unsafe.Pointer(&(_p.X10))) = store1(&_rc, i32(5)) + *(*int32)(unsafe.Pointer(&_p.X9)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1) - _256_desiredAutoCommit) + *(*int32)(unsafe.Pointer(&_p.X10)) = store1(&_rc, i32(5)) goto _vdbe_return } func() { - if (_db.X76) != i32(0) { + if _db.X76 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81453), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66819))) crt.X__builtin_abort(tls) } }() _sqlite3CloseSavepoints(tls, _db) - if (_p.X10) == i32(0) { + if _p.X10 == i32(0) { _rc = i32(101) goto _937 } @@ -50320,30 +52706,30 @@ _923: goto _abort_due_to_error _146: func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81512), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) && (_pOp.X4) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) && _pOp.X4 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81513), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66969))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81515), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028))) crt.X__builtin_abort(tls) } }() - if (_pOp.X4) != 0 && (((_db.X6) & i32(67108864)) != i32(0)) { + if _pOp.X4 != 0 && ((_db.X6 & i32(67108864)) != i32(0)) { _rc = i32(8) goto _abort_due_to_error } @@ -50356,13 +52742,13 @@ _146: goto _956 } if (_rc & i32(255)) == i32(5) { - *(*int32)(unsafe.Pointer(&(_p.X9))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(*int32)(unsafe.Pointer(&(_p.X10))) = _rc + *(*int32)(unsafe.Pointer(&_p.X9)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(*int32)(unsafe.Pointer(&_p.X10)) = _rc goto _vdbe_return } goto _abort_due_to_error _956: - if (_pOp.X4) == 0 || ((uint32((_p.X32)>>uint(i32(6)))<<uint(i32(31)))>>uint(i32(31))) == 0 || int32(_db.X15) != i32(0) && (_db.X35) <= i32(1) { + if _pOp.X4 == 0 || ((uint32(_p.X32>>uint(i32(6)))<<uint(i32(31)))>>uint(i32(31))) == 0 || int32(_db.X15) != i32(0) && _db.X35 <= i32(1) { goto _961 } func() { @@ -50371,22 +52757,22 @@ _956: crt.X__builtin_abort(tls) } }() - if (_p.X12) == i32(0) { + if _p.X12 == i32(0) { func() { - if (_db.X76) < i32(0) || (_db.X75) < i32(0) { + if _db.X76 < i32(0) || _db.X75 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81540), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67089))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_db.X76))) += 1 - *(*int32)(unsafe.Pointer(&(_p.X12))) = (_db.X75) + (_db.X76) + *(*int32)(unsafe.Pointer(&_db.X76)) += 1 + *(*int32)(unsafe.Pointer(&_p.X12)) = _db.X75 + _db.X76 } - _rc = _sqlite3VtabSavepoint(tls, _db, i32(0), (_p.X12)-i32(1)) + _rc = _sqlite3VtabSavepoint(tls, _db, i32(0), _p.X12-i32(1)) if _rc == i32(0) { _rc = _sqlite3BtreeBeginStmt(tls, _266_pBt, _p.X12) } - *(*int64)(unsafe.Pointer(&(_p.X15))) = _db.X77 - *(*int64)(unsafe.Pointer(&(_p.X16))) = _db.X78 + *(*int64)(unsafe.Pointer(&_p.X15)) = _db.X77 + *(*int64)(unsafe.Pointer(&_p.X16)) = _db.X78 _961: _sqlite3BtreeGetMeta(tls, _266_pBt, i32(1), (*uint32)(unsafe.Pointer(&_266_iMeta))) _266_iGen = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_pOp.X3))).X4).X1 @@ -50400,15 +52786,15 @@ _969: crt.X__builtin_abort(tls) } }() - if (_pOp.X2) == 0 || _266_iMeta == (_pOp.X5) && _266_iGen == (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) { + if _pOp.X2 == 0 || _266_iMeta == _pOp.X5 && _266_iGen == (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) { goto _975 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22)) - *(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3DbStrDup(tls, _db, str(59642)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p.X22)) + *(**int8)(unsafe.Pointer(&_p.X22)) = _sqlite3DbStrDup(tls, _db, str(59642)) if ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_pOp.X3))).X4).X0) != _266_iMeta { _sqlite3ResetOneSchema(tls, _db, _pOp.X3) } - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) _rc = i32(17) _975: if _rc != 0 { @@ -50417,7 +52803,7 @@ _975: goto _250 _147: func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } @@ -50425,13 +52811,13 @@ _147: _277_iDb = _pOp.X3 _277_iCookie = _pOp.X5 func() { - if (_pOp.X5) >= i32(16) { + if _pOp.X5 >= i32(16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81614), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67164))) crt.X__builtin_abort(tls) } }() func() { - if _277_iDb < i32(0) || _277_iDb >= (_db.X5) { + if _277_iDb < i32(0) || _277_iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -50443,36 +52829,36 @@ _147: } }() func() { - if ((_p.X33) & (u32(1) << uint(_277_iDb))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_277_iDb))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81617), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192))) crt.X__builtin_abort(tls) } }() _sqlite3BtreeGetMeta(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_277_iDb))).X1), _277_iCookie, (*uint32)(unsafe.Pointer(&_277_iMeta))) _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_277_iMeta) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_277_iMeta) goto _250 _148: func() { - if (_pOp.X4) >= i32(16) { + if _pOp.X4 >= i32(16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67222))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } @@ -50491,22 +52877,22 @@ _148: } }() _rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_278_pDb.X1), _pOp.X4, uint32(_pOp.X5)) - if (_pOp.X4) == i32(1) { + if _pOp.X4 == i32(1) { *(*int32)(unsafe.Pointer(&((*XSchema)(_278_pDb.X4).X0))) = _pOp.X5 { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } goto _1004 } - if (_pOp.X4) == i32(2) { + if _pOp.X4 == i32(2) { *(*uint8)(unsafe.Pointer(&((*XSchema)(_278_pDb.X4).X7))) = uint8(_pOp.X5) } _1004: - if (_pOp.X3) == i32(1) { + if _pOp.X3 == i32(1) { _sqlite3ExpirePreparedStatements(tls, _db) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 1, 0) } if _rc != 0 { goto _abort_due_to_error @@ -50525,10 +52911,10 @@ _149: crt.X__builtin_abort(tls) } }() - _282_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) - if (_282_pCur != nil) && ((_282_pCur.X17) == uint32(_pOp.X4)) { + _282_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) + if (_282_pCur != nil) && (_282_pCur.X17 == uint32(_pOp.X4)) { func() { - if int32(_282_pCur.X1) != (_pOp.X5) { + if int32(_282_pCur.X1) != _pOp.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67377))) crt.X__builtin_abort(tls) } @@ -50543,13 +52929,13 @@ _1013: } }() func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81752), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pOp.X0) != i32(106) && int32(_pOp.X0) != i32(105) && int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32(_pOp.X0) != i32(106) && int32(_pOp.X0) != i32(105) && int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81753), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67462))) crt.X__builtin_abort(tls) } @@ -50563,13 +52949,13 @@ _1013: _282_p2 = _pOp.X4 _282_iDb = _pOp.X5 func() { - if _282_iDb < i32(0) || _282_iDb >= (_db.X5) { + if _282_iDb < i32(0) || _282_iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_282_iDb))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_282_iDb))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81766), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192))) crt.X__builtin_abort(tls) } @@ -50594,7 +52980,7 @@ _1013: } }() if int32((*XSchema)(_282_pDb.X4).X7) < int32(_p.X31) { - *(*uint8)(unsafe.Pointer(&(_p.X31))) = (*XSchema)(_282_pDb.X4).X7 + *(*uint8)(unsafe.Pointer(&_p.X31)) = (*XSchema)(_282_pDb.X4).X7 } goto _1038 _1034: @@ -50608,12 +52994,12 @@ _1038: } }() func() { - if _282_p2 > (((_p.X6) + i32(1)) - (_p.X7)) { + if _282_p2 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67545))) crt.X__builtin_abort(tls) } }() - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_282_p2))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_282_p2))) func() { if (int32(_pIn2.X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67574))) @@ -50627,7 +53013,7 @@ _1038: } }() _sqlite3VdbeMemIntegerify(tls, _pIn2) - _282_p2 = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))) + _282_p2 = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn2.X0))))) func() { if _282_p2 < i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67618))) @@ -50636,7 +53022,7 @@ _1038: }() } if int32(_pOp.X1) == i32(-5) { - _282_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _282_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) func() { if int32(_282_pKeyInfo.X1) != int32(_db.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67624))) @@ -50653,11 +53039,11 @@ _1038: goto _1056 } if int32(_pOp.X1) == i32(-11) { - _282_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _282_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) } _1056: func() { - if (_pOp.X3) < i32(0) { + if _pOp.X3 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81802), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664))) crt.X__builtin_abort(tls) } @@ -50672,23 +53058,23 @@ _1056: if _282_pCur == nil { goto _no_mem } - *(*uint8)(unsafe.Pointer(&(_282_pCur.X2))) = uint8(i32(1)) - storebits3((*int8)(unsafe.Pointer(&(_282_pCur.X7))), int8(i32(1)), 4, 2) - *(*uint32)(unsafe.Pointer(&(_282_pCur.X17))) = uint32(_282_p2) - *(*uint8)(unsafe.Pointer(&(_282_pCur.X6))) = uint8(_282_wrFlag) - _rc = _sqlite3BtreeCursor(tls, _282_pX, _282_p2, _282_wrFlag, _282_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_282_pCur.X14))))))) - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_282_pCur.X15))))) = _282_pKeyInfo - *(*uint8)(unsafe.Pointer(&(_282_pCur.X4))) = uint8(bool2int(int32(_pOp.X1) != i32(-5))) + *(*uint8)(unsafe.Pointer(&_282_pCur.X2)) = uint8(i32(1)) + storebits3((*int8)(unsafe.Pointer(&_282_pCur.X7)), int8(i32(1)), 4, 2) + *(*uint32)(unsafe.Pointer(&_282_pCur.X17)) = uint32(_282_p2) + *(*uint8)(unsafe.Pointer(&_282_pCur.X6)) = uint8(_282_wrFlag) + _rc = _sqlite3BtreeCursor(tls, _282_pX, _282_p2, _282_wrFlag, _282_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_282_pCur.X14)))))) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_282_pCur.X15)))) = _282_pKeyInfo + *(*uint8)(unsafe.Pointer(&_282_pCur.X4)) = uint8(bool2int(int32(_pOp.X1) != i32(-5))) _open_cursor_set_hints: i32(0) i32(0) - _sqlite3BtreeCursorHintFlags(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_282_pCur.X14)))))), uint32(int32(_pOp.X2)&i32(3))) + _sqlite3BtreeCursorHintFlags(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_282_pCur.X14))))), uint32(int32(_pOp.X2)&i32(3))) if _rc != 0 { goto _abort_due_to_error } goto _250 _152: - _291_pOrig = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X4))) + _291_pOrig = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X4))) func() { if (*XBtree)(_291_pOrig.X8) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81847), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67685))) @@ -50699,11 +53085,11 @@ _152: if _291_pCx == nil { goto _no_mem } - *(*uint8)(unsafe.Pointer(&(_291_pCx.X2))) = uint8(i32(1)) - storebits3((*int8)(unsafe.Pointer(&(_291_pCx.X7))), int8(i32(1)), 1, 0) - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_291_pCx.X15))))) = (*XKeyInfo)(_291_pOrig.X15) - *(*uint8)(unsafe.Pointer(&(_291_pCx.X4))) = _291_pOrig.X4 - _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_291_pOrig.X8), i32(1), i32(4), (*XKeyInfo)(_291_pCx.X15), (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_291_pCx.X14))))))) + *(*uint8)(unsafe.Pointer(&_291_pCx.X2)) = uint8(i32(1)) + storebits3((*int8)(unsafe.Pointer(&_291_pCx.X7)), int8(i32(1)), 1, 0) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_291_pCx.X15)))) = (*XKeyInfo)(_291_pOrig.X15) + *(*uint8)(unsafe.Pointer(&_291_pCx.X4)) = _291_pOrig.X4 + _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_291_pOrig.X8), i32(1), i32(4), (*XKeyInfo)(_291_pCx.X15), (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_291_pCx.X14)))))) func() { if _rc != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81860), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012))) @@ -50713,13 +53099,13 @@ _152: goto _250 _153: func() { - if (_pOp.X3) < i32(0) { + if _pOp.X3 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) < i32(0) { + if _pOp.X4 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81903), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67700))) crt.X__builtin_abort(tls) } @@ -50728,16 +53114,16 @@ _153: if _292_pCx == nil { goto _no_mem } - *(*uint8)(unsafe.Pointer(&(_292_pCx.X2))) = uint8(i32(1)) - storebits3((*int8)(unsafe.Pointer(&(_292_pCx.X7))), int8(i32(1)), 1, 0) - _rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), nil, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_292_pCx.X8))))), i32(5)|int32(_pOp.X2), _sqlite3VdbeExecØ00vfsFlagsØ006) + *(*uint8)(unsafe.Pointer(&_292_pCx.X2)) = uint8(i32(1)) + storebits3((*int8)(unsafe.Pointer(&_292_pCx.X7)), int8(i32(1)), 1, 0) + _rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), nil, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.X8)))), i32(5)|int32(_pOp.X2), _sqlite3VdbeExecØ00vfsFlagsØ006) if _rc == i32(0) { _rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_292_pCx.X8), i32(1)) } if _rc != i32(0) { goto _1074 } - if store50((**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_292_pCx.X15))))), store50(&_292_pKeyInfo, (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))) == nil { + if store50((**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_292_pCx.X15)))), store50(&_292_pKeyInfo, (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))))) == nil { goto _1075 } func() { @@ -50766,29 +53152,29 @@ _153: crt.X__builtin_abort(tls) } }() - _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), _295_pgno, i32(4), _292_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_292_pCx.X14))))))) + _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), _295_pgno, i32(4), _292_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_292_pCx.X14)))))) } - *(*uint8)(unsafe.Pointer(&(_292_pCx.X4))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_292_pCx.X4)) = uint8(i32(0)) goto _1085 _1075: - _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), i32(1), i32(4), nil, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_292_pCx.X14))))))) - *(*uint8)(unsafe.Pointer(&(_292_pCx.X4))) = uint8(i32(1)) + _rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), i32(1), i32(4), nil, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_292_pCx.X14)))))) + *(*uint8)(unsafe.Pointer(&_292_pCx.X4)) = uint8(i32(1)) _1085: _1074: if _rc != 0 { goto _abort_due_to_error } - storebits3((*int8)(unsafe.Pointer(&(_292_pCx.X7))), int8(bool2int(int32(_pOp.X2) != i32(8))), 4, 2) + storebits3((*int8)(unsafe.Pointer(&_292_pCx.X7)), int8(bool2int(int32(_pOp.X2) != i32(8))), 4, 2) goto _250 _155: func() { - if (_pOp.X3) < i32(0) { + if _pOp.X3 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81955), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) < i32(0) { + if _pOp.X4 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81956), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67700))) crt.X__builtin_abort(tls) } @@ -50797,7 +53183,7 @@ _155: if _298_pCx == nil { goto _no_mem } - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_298_pCx.X15))))) = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_298_pCx.X15)))) = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) func() { if (*Xsqlite3)((*XKeyInfo)(_298_pCx.X15).X4) != _db { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67731))) @@ -50817,31 +53203,31 @@ _155: goto _250 _156: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _299_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _299_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_299_pC.X0) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81978), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781))) crt.X__builtin_abort(tls) } }() - if postInc6((*int64)(unsafe.Pointer(&(_299_pC.X9))), int64(1)) == int64(i32(0)) { + if postInc6((*int64)(unsafe.Pointer(&_299_pC.X9)), 1) == int64(i32(0)) { goto _jump_to_p2 } goto _250 _157: func() { - if (_pOp.X3) < i32(0) { + if _pOp.X3 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82004), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) < i32(0) { + if _pOp.X5 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82005), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67794))) crt.X__builtin_abort(tls) } @@ -50850,9 +53236,9 @@ _157: if _301_pCx == nil { goto _no_mem } - *(*uint8)(unsafe.Pointer(&(_301_pCx.X2))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_301_pCx.X14))))) = _pOp.X4 - *(*uint8)(unsafe.Pointer(&(_301_pCx.X4))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_301_pCx.X2)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&_301_pCx.X14)))) = _pOp.X4 + *(*uint8)(unsafe.Pointer(&_301_pCx.X4)) = uint8(i32(1)) func() { if int32(_pOp.X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67805))) @@ -50862,28 +53248,28 @@ _157: goto _250 _158: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82021), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))) - *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) = nil + _sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))) + *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) = nil goto _250 _159: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) == i32(0) { + if _pOp.X4 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67816))) crt.X__builtin_abort(tls) } }() - _303_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _303_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _303_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82148), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -50900,31 +53286,31 @@ _159: i32(0) i32(0) func() { - if ((uint32((_303_pC.X7)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_303_pC.X7>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82153), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67827))) crt.X__builtin_abort(tls) } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82154), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } }() _303_oc = int32(_pOp.X0) _303_eqOnly = i32(0) - *(*uint8)(unsafe.Pointer(&(_303_pC.X2))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_303_pC.X5))) = _pOp.X0 - if (_303_pC.X4) == 0 { + *(*uint8)(unsafe.Pointer(&_303_pC.X2)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_303_pC.X5)) = _pOp.X0 + if _303_pC.X4 == 0 { goto _1126 } func() { - if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), uint32(i32(2))) != i32(0) && (_sqlite3Config.X6) != i32(0) { + if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), uint32(i32(2))) != i32(0) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82164), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67859))) crt.X__builtin_abort(tls) } }() - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if (int32(_pIn3.X1) & i32(14)) == i32(2) { _applyNumericAffinity(tls, _pIn3, i32(0)) } @@ -50935,7 +53321,7 @@ _159: if (int32(_pIn3.X1) & i32(8)) == i32(0) { goto _jump_to_p2 } - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) >= float64(_303_iKey) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) >= float64(_303_iKey) { goto _1133 } i32(0) @@ -50946,7 +53332,7 @@ _159: } goto _1136 _1133: - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) <= float64(_303_iKey) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) <= float64(_303_iKey) { goto _1136 } i32(0) @@ -50957,14 +53343,14 @@ _1133: } _1136: _1131: - _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), nil, int64(uint64(_303_iKey)), i32(0), &_303_res) - *(*int64)(unsafe.Pointer(&(_303_pC.X20))) = _303_iKey + _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), nil, int64(uint64(_303_iKey)), i32(0), &_303_res) + *(*int64)(unsafe.Pointer(&_303_pC.X20)) = _303_iKey if _rc != i32(0) { goto _abort_due_to_error } goto _1139 _1126: - if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), uint32(i32(2))) != 0 { + if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), uint32(i32(2))) != 0 { _303_eqOnly = i32(1) func() { if int32(_pOp.X0) != i32(26) && int32(_pOp.X0) != i32(25) { @@ -50973,37 +53359,37 @@ _1126: } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X0) != i32(39) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X0) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67982))) crt.X__builtin_abort(tls) } }() func() { - if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(1)))).X3) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(0)))).X3) { + if ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(1)))).X3) != ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(0)))).X3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68033))) crt.X__builtin_abort(tls) } }() func() { - if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(1)))).X4) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(0)))).X4) { + if ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(1)))).X4) != ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(0)))).X4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68054))) crt.X__builtin_abort(tls) } }() func() { - if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(1)))).X5) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(0)))).X5) { + if ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(1)))).X5) != ((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(0)))).X5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82225), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68075))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(1)))).X6)))))) != (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(0)))).X6)))))) { + if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(1)))).X6)))))) != (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(0)))).X6)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68096))) crt.X__builtin_abort(tls) } }() } - _303_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _303_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { if int32(_pOp.X1) != i32(-11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82230), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121))) @@ -51016,9 +53402,9 @@ _1126: crt.X__builtin_abort(tls) } }() - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_303_r.X0))))) = (*XKeyInfo)(_303_pC.X15) - *(*uint16)(unsafe.Pointer(&(_303_r.X2))) = uint16(_303_nField) - *(*int8)(unsafe.Pointer(&(_303_r.X3))) = int8(func() int32 { + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_303_r.X0)))) = (*XKeyInfo)(_303_pC.X15) + *(*uint16)(unsafe.Pointer(&_303_r.X2)) = uint16(_303_nField) + *(*int8)(unsafe.Pointer(&_303_r.X3)) = int8(func() int32 { if (i32(1) & (_303_oc - i32(24))) != 0 { return i32(-1) } @@ -51048,7 +53434,7 @@ _1126: crt.X__builtin_abort(tls) } }() - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_303_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_303_r.X1)))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _313_i = i32(0) _1173: if _313_i >= int32(_303_r.X2) { @@ -51063,8 +53449,8 @@ _1173: _313_i += 1 goto _1173 _1176: - *(*uint8)(unsafe.Pointer(&(_303_r.X7))) = uint8(i32(0)) - _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_r, int64(i32(0)), i32(0), &_303_res) + *(*uint8)(unsafe.Pointer(&_303_r.X7)) = uint8(i32(0)) + _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), &_303_r, int64(i32(0)), i32(0), &_303_res) if _rc != i32(0) { goto _abort_due_to_error } @@ -51078,8 +53464,8 @@ _1176: goto _seek_not_found } _1139: - *(*uint8)(unsafe.Pointer(&(_303_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_303_pC.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_303_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_303_pC.X11)) = uint32(i32(0)) if _303_oc < i32(26) { goto _1184 } @@ -51093,7 +53479,7 @@ _1139: goto _1190 } _303_res = i32(0) - _rc = _sqlite3BtreeNext(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_res) + _rc = _sqlite3BtreeNext(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), &_303_res) if _rc != i32(0) { goto _abort_due_to_error } @@ -51113,17 +53499,17 @@ _1184: goto _1199 } _303_res = i32(0) - _rc = _sqlite3BtreePrevious(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_res) + _rc = _sqlite3BtreePrevious(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14))))), &_303_res) if _rc != i32(0) { goto _abort_due_to_error } goto _1201 _1199: - _303_res = _sqlite3BtreeEof(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14))))))) + _303_res = _sqlite3BtreeEof(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_303_pC.X14)))))) _1201: _seek_not_found: func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82289), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } @@ -51133,7 +53519,7 @@ _seek_not_found: } if _303_eqOnly != 0 { func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(1)))).X0) != i32(39) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(1)))).X0) != i32(39) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82294), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67982))) crt.X__builtin_abort(tls) } @@ -51143,7 +53529,7 @@ _seek_not_found: goto _250 _163: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82375), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } @@ -51154,15 +53540,15 @@ _163: crt.X__builtin_abort(tls) } }() - _324_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _324_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _324_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82378), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_324_pC.X5))) = _pOp.X0 - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + *(*uint8)(unsafe.Pointer(&_324_pC.X5)) = _pOp.X0 + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if int32(_324_pC.X0) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82383), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779))) @@ -51170,7 +53556,7 @@ _163: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_324_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_324_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82384), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } @@ -51181,12 +53567,12 @@ _163: crt.X__builtin_abort(tls) } }() - if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) <= i32(0) { + if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) <= i32(0) { goto _1223 } - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_324_r.X0))))) = (*XKeyInfo)(_324_pC.X15) - *(*uint16)(unsafe.Pointer(&(_324_r.X2))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_324_r.X1))))) = _pIn3 + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_324_r.X0)))) = (*XKeyInfo)(_324_pC.X15) + *(*uint16)(unsafe.Pointer(&_324_r.X2)) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_324_r.X1)))) = _pIn3 _324_ii = i32(0) _1224: if _324_ii >= int32(_324_r.X2) { @@ -51207,8 +53593,8 @@ _1224: if _324_ii == 0 { goto _1234 } - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, (_pOp.X5)+_324_ii, (*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+72*uintptr(_324_ii)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X5+_324_ii, (*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+72*uintptr(_324_ii)))) } _1234: _324_ii += 1 @@ -51243,9 +53629,9 @@ _1223: if _324_pIdxKey == nil { goto _no_mem } - _sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_324_pC.X15), _pIn3.X4, (unsafe.Pointer)(_pIn3.X5), _324_pIdxKey) + _sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_324_pC.X15), _pIn3.X4, unsafe.Pointer(_pIn3.X5), _324_pIdxKey) _1235: - *(*int8)(unsafe.Pointer(&(_324_pIdxKey.X3))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_324_pIdxKey.X3)) = int8(i32(0)) _324_takeJump = i32(0) if int32(_pOp.X0) != i32(28) { goto _1245 @@ -51263,18 +53649,18 @@ _1246: goto _1246 _1249: _1245: - _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_324_pC.X14)))))), _324_pIdxKey, int64(i32(0)), i32(0), &_324_res) + _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_324_pC.X14))))), _324_pIdxKey, int64(i32(0)), i32(0), &_324_res) if _324_pFree != nil { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_324_pFree)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_324_pFree)) } if _rc != i32(0) { goto _abort_due_to_error } - *(*int32)(unsafe.Pointer(&(_324_pC.X12))) = _324_res + *(*int32)(unsafe.Pointer(&_324_pC.X12)) = _324_res _324_alreadyExists = bool2int(_324_res == i32(0)) - *(*uint8)(unsafe.Pointer(&(_324_pC.X2))) = uint8(i32(1) - _324_alreadyExists) - *(*uint8)(unsafe.Pointer(&(_324_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_324_pC.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_324_pC.X2)) = uint8(i32(1) - _324_alreadyExists) + *(*uint8)(unsafe.Pointer(&_324_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_324_pC.X11)) = uint32(i32(0)) if int32(_pOp.X0) != i32(30) { goto _1253 } @@ -51289,7 +53675,7 @@ _1253: _1255: goto _250 _166: - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if (int32(_pIn3.X1) & i32(4)) != i32(0) { goto _1258 } @@ -51298,7 +53684,7 @@ _166: goto _jump_to_p2 } _1258: - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if (int32(_pIn3.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63806))) @@ -51306,21 +53692,21 @@ _1258: } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82503), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _334_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _334_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _334_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82505), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_334_pC.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_334_pC.X5)) = uint8(i32(0)) func() { - if (_334_pC.X4) == 0 { + if _334_pC.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82509), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68494))) crt.X__builtin_abort(tls) } @@ -51331,7 +53717,7 @@ _1258: crt.X__builtin_abort(tls) } }() - _334_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_334_pC.X14)))))) + _334_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_334_pC.X14))))) func() { if _334_pCrsr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82512), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68506))) @@ -51339,7 +53725,7 @@ _1258: } }() _334_res = i32(0) - _334_iKey = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) + _334_iKey = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) _rc = _sqlite3BtreeMovetoUnpacked(tls, _334_pCrsr, nil, int64(_334_iKey), i32(0), &_334_res) func() { if _rc != i32(0) && _334_res != i32(0) { @@ -51347,11 +53733,11 @@ _1258: crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_334_pC.X20))) = int64(_334_iKey) - *(*uint8)(unsafe.Pointer(&(_334_pC.X2))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_334_pC.X11))) = uint32(i32(0)) - *(*uint8)(unsafe.Pointer(&(_334_pC.X3))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_334_pC.X12))) = _334_res + *(*int64)(unsafe.Pointer(&_334_pC.X20)) = int64(_334_iKey) + *(*uint8)(unsafe.Pointer(&_334_pC.X2)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_334_pC.X11)) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_334_pC.X3)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_334_pC.X12)) = _334_res if _334_res == i32(0) { goto _1276 } @@ -51361,7 +53747,7 @@ _1258: crt.X__builtin_abort(tls) } }() - if (_pOp.X4) == i32(0) { + if _pOp.X4 == i32(0) { _rc = _sqlite3CorruptError(tls, i32(82526)) goto _1280 } @@ -51374,37 +53760,37 @@ _1276: goto _250 _168: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82544), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() func() { - if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { + if (*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82545), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65574))) crt.X__builtin_abort(tls) } }() func() { - if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))).X0) == i32(2) { + if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))).X0) == i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82546), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68539))) crt.X__builtin_abort(tls) } }() _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = postInc6((*int64)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))).X9))), int64(1)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = postInc6((*int64)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))).X9))), 1) goto _250 _169: _340_v = int64(i32(0)) _340_res = i32(0) _pOut = _out2Prerelease(tls, _p, _pOp) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82579), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _340_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _340_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _340_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -51418,21 +53804,21 @@ _169: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_340_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82583), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } }() func() { - if (_340_pC.X4) == 0 { + if _340_pC.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82598), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68494))) crt.X__builtin_abort(tls) } }() - if ((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_340_pC.X7>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { goto _1300 } - _rc = _sqlite3BtreeLast(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))), &_340_res) + _rc = _sqlite3BtreeLast(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_340_pC.X14))))), &_340_res) if _rc != i32(0) { goto _abort_due_to_error } @@ -51441,42 +53827,42 @@ _169: goto _1303 } func() { - if _sqlite3BtreeCursorIsValid(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14))))))) == 0 { + if _sqlite3BtreeCursorIsValid(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_340_pC.X14)))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68581))) crt.X__builtin_abort(tls) } }() - _340_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14))))))) + _340_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_340_pC.X14)))))) if _340_v >= i64(9223372036854775807) { - storebits3((*int8)(unsafe.Pointer(&(_340_pC.X7))), int8(i32(1)), 2, 1) + storebits3((*int8)(unsafe.Pointer(&_340_pC.X7)), int8(i32(1)), 2, 1) goto _1307 } _340_v += 1 _1307: _1303: _1300: - if (_pOp.X5) == 0 { + if _pOp.X5 == 0 { goto _1308 } func() { - if (_pOp.X5) <= i32(0) { + if _pOp.X5 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82631), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012))) crt.X__builtin_abort(tls) } }() - if (*XVdbeFrame)(_p.X38) == nil { + if _p.X38 == nil { goto _1311 } _340_pFrame = (*XVdbeFrame)(_p.X38) _1312: - if (*XVdbeFrame)(_340_pFrame.X1) == nil { + if _340_pFrame.X1 == nil { goto _1315 } _340_pFrame = (*XVdbeFrame)(_340_pFrame.X1) goto _1312 _1315: func() { - if (_pOp.X5) > (_340_pFrame.X13) { + if _pOp.X5 > _340_pFrame.X13 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82635), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68623))) crt.X__builtin_abort(tls) } @@ -51485,12 +53871,12 @@ _1315: goto _1318 _1311: func() { - if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X5 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022))) crt.X__builtin_abort(tls) } }() - _340_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _340_pMem = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _sqlite3VdbeMemAboutToChange(tls, _p, _340_pMem) _1318: func() { @@ -51499,7 +53885,7 @@ _1318: crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _340_pMem) } _sqlite3VdbeMemIntegerify(tls, _340_pMem) @@ -51509,34 +53895,34 @@ _1318: crt.X__builtin_abort(tls) } }() - if ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) == i64(9223372036854775807)) || (((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0) { + if ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_340_pMem.X0))))) == i64(9223372036854775807)) || (((uint32(_340_pC.X7>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0) { _rc = i32(13) goto _abort_due_to_error } - if _340_v < ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) + int64(i32(1))) { - _340_v = (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) + int64(i32(1)) + if _340_v < ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_340_pMem.X0))))) + int64(i32(1))) { + _340_v = (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_340_pMem.X0))))) + int64(i32(1)) } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0))))) = _340_v + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_340_pMem.X0)))) = _340_v _1308: - if ((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_340_pC.X7>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) == 0 { goto _1329 } func() { - if (_pOp.X5) != i32(0) { + if _pOp.X5 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82663), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68689))) crt.X__builtin_abort(tls) } }() _340_cnt = i32(0) _1332: - Xsqlite3_randomness(tls, int32(u64(8)), (unsafe.Pointer)(&_340_v)) + Xsqlite3_randomness(tls, int32(u64(8)), unsafe.Pointer(&_340_v)) { p := &_340_v *p = (*p) & i64(4611686018427387903) sink6(*p) } _340_v += 1 - if ((store1(&_rc, _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))), nil, int64(uint64(_340_v)), i32(0), &_340_res)) == i32(0)) && (_340_res == i32(0))) && (preInc1(&_340_cnt, 1) < i32(100)) { + if ((store1(&_rc, _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_340_pC.X14))))), nil, int64(uint64(_340_v)), i32(0), &_340_res)) == i32(0)) && (_340_res == i32(0))) && (preInc1(&_340_cnt, 1) < i32(100)) { goto _1332 } if _rc != 0 { @@ -51553,15 +53939,15 @@ _1332: } }() _1329: - *(*uint8)(unsafe.Pointer(&(_340_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_340_pC.X11))) = uint32(i32(0)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _340_v + *(*uint8)(unsafe.Pointer(&_340_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_340_pC.X11)) = uint32(i32(0)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _340_v goto _250 _170: _356_op = i32(0) - _356_pData = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _356_pData = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } @@ -51572,7 +53958,7 @@ _170: crt.X__builtin_abort(tls) } }() - _356_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _356_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _356_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -51586,13 +53972,13 @@ _170: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_356_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_356_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82748), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } }() func() { - if (int32(_pOp.X2)&i32(64)) == 0 && (_356_pC.X4) == 0 { + if (int32(_pOp.X2)&i32(64)) == 0 && _356_pC.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68722))) crt.X__builtin_abort(tls) } @@ -51603,13 +53989,13 @@ _170: crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X4, _356_pData) } if int32(_pOp.X0) != i32(118) { goto _1357 } - _356_pKey = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _356_pKey = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if (int32(_356_pKey.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82755), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68811))) @@ -51622,10 +54008,10 @@ _170: crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _356_pKey) } - *(*int64)(unsafe.Pointer(&(_356_x.X1))) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_356_pKey.X0))))) + *(*int64)(unsafe.Pointer(&_356_x.X1)) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_356_pKey.X0)))) goto _1363 _1357: func() { @@ -51634,9 +54020,9 @@ _1357: crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_356_x.X1))) = int64(_pOp.X5) + *(*int64)(unsafe.Pointer(&_356_x.X1)) = int64(_pOp.X5) _1363: - if (int32(_pOp.X1) == i32(-15)) && ((_db.X50) != nil) { + if (int32(_pOp.X1) == i32(-15)) && (_db.X50 != nil) { func() { if int32(_356_pC.X1) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68876))) @@ -51644,9 +54030,9 @@ _1363: } }() _356_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_356_pC.X1))).X0 - _356_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _356_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) func() { - if (int32(_pOp.X2)&i32(64)) == 0 && ((_356_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) { + if (int32(_pOp.X2)&i32(64)) == 0 && (_356_pTab.X9&uint32(i32(32))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82768), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68887))) crt.X__builtin_abort(tls) } @@ -51663,14 +54049,14 @@ _1363: _356_zDb = nil _1375: if (int32(_pOp.X2) & i32(1)) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X11))) += 1 + *(*int32)(unsafe.Pointer(&_p.X11)) += 1 } if (int32(_pOp.X2) & i32(32)) != 0 { - *(*int64)(unsafe.Pointer(&(_db.X7))) = _356_x.X1 + *(*int64)(unsafe.Pointer(&_db.X7)) = _356_x.X1 } if (int32(_356_pData.X1) & i32(1)) != 0 { - *(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X2))) = nil - *(*int32)(unsafe.Pointer(&(_356_x.X5))) = i32(0) + *(*unsafe.Pointer)(unsafe.Pointer(&_356_x.X2)) = nil + *(*int32)(unsafe.Pointer(&_356_x.X5)) = i32(0) goto _1379 } func() { @@ -51679,41 +54065,41 @@ _1375: crt.X__builtin_abort(tls) } }() - *(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X2))) = (unsafe.Pointer)(_356_pData.X5) - *(*int32)(unsafe.Pointer(&(_356_x.X5))) = _356_pData.X4 + *(*unsafe.Pointer)(unsafe.Pointer(&_356_x.X2)) = unsafe.Pointer(_356_pData.X5) + *(*int32)(unsafe.Pointer(&_356_x.X5)) = _356_pData.X4 _1379: _356_seekResult = func() int32 { if (int32(_pOp.X2) & i32(16)) != 0 { - return (_356_pC.X12) + return _356_pC.X12 } return i32(0) }() if (int32(_356_pData.X1) & i32(16384)) != 0 { - *(*int32)(unsafe.Pointer(&(_356_x.X6))) = *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_356_pData.X0))))) + *(*int32)(unsafe.Pointer(&_356_x.X6)) = *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_356_pData.X0)))) goto _1385 } - *(*int32)(unsafe.Pointer(&(_356_x.X6))) = i32(0) + *(*int32)(unsafe.Pointer(&_356_x.X6)) = i32(0) _1385: - *(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X0))) = nil - _rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_356_pC.X14)))))), &_356_x, int32(_pOp.X2)&i32(10), _356_seekResult) - *(*uint8)(unsafe.Pointer(&(_356_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_356_pC.X11))) = uint32(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer(&_356_x.X0)) = nil + _rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_356_pC.X14))))), &_356_x, int32(_pOp.X2)&i32(10), _356_seekResult) + *(*uint8)(unsafe.Pointer(&_356_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_356_pC.X11)) = uint32(i32(0)) if _rc != 0 { goto _abort_due_to_error } - if ((_db.X50) != nil) && _356_op != 0 { - (_db.X50)(tls, _db.X49, _356_op, _356_zDb, _356_pTab.X0, _356_x.X1) + if (_db.X50 != nil) && _356_op != 0 { + _db.X50(tls, _db.X49, _356_op, _356_zDb, _356_pTab.X0, _356_x.X1) } goto _250 _172: _366_opflags = _pOp.X4 func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82859), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _366_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _366_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _366_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82861), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -51727,7 +54113,7 @@ _172: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_366_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82863), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } @@ -51738,16 +54124,16 @@ _172: crt.X__builtin_abort(tls) } }() - if ((int32(_pOp.X1) == i32(-15)) && ((((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X9) & uint32(i32(32))) == uint32(i32(0)))) && (int32(_pOp.X2) == i32(0)) { - _367_iKey = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14))))))) + if ((int32(_pOp.X1) == i32(-15)) && ((((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X9) & uint32(i32(32))) == uint32(i32(0)))) && (int32(_pOp.X2) == i32(0)) { + _367_iKey = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_366_pC.X14)))))) func() { - if (_366_pC.X20) != _367_iKey { + if _366_pC.X20 != _367_iKey { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82872), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68987))) crt.X__builtin_abort(tls) } }() } - if int32(_pOp.X1) != i32(-15) || (_db.X50) == nil { + if int32(_pOp.X1) != i32(-15) || _db.X50 == nil { goto _1406 } func() { @@ -51757,15 +54143,15 @@ _172: } }() func() { - if (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil { + if (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82883), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69010))) crt.X__builtin_abort(tls) } }() _366_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_366_pC.X1))).X0 - _366_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - if ((int32(_pOp.X2) & i32(2)) != i32(0)) && ((_366_pC.X4) != 0) { - *(*int64)(unsafe.Pointer(&(_366_pC.X20))) = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14))))))) + _366_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + if ((int32(_pOp.X2) & i32(2)) != i32(0)) && (_366_pC.X4 != 0) { + *(*int64)(unsafe.Pointer(&_366_pC.X20)) = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_366_pC.X14)))))) } goto _1413 _1406: @@ -51786,22 +54172,22 @@ _1413: if ((int32((uint32(_366_pC.X7)<<uint(i32(31)))>>uint(i32(31))) == i32(0)) && ((int32(_pOp.X2) & i32(4)) == i32(0))) && ((int32(_366_pC.X6) & i32(8)) == i32(0)) { _nExtraDelete += 1 } - if ((_pOp.X4) & i32(1)) != 0 { + if (_pOp.X4 & i32(1)) != 0 { _nExtraDelete -= 1 } _1416: - _rc = _sqlite3BtreeDelete(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))), uint8(_pOp.X2)) - *(*uint32)(unsafe.Pointer(&(_366_pC.X11))) = uint32(i32(0)) - *(*int32)(unsafe.Pointer(&(_366_pC.X12))) = i32(0) + _rc = _sqlite3BtreeDelete(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_366_pC.X14))))), uint8(_pOp.X2)) + *(*uint32)(unsafe.Pointer(&_366_pC.X11)) = uint32(i32(0)) + *(*int32)(unsafe.Pointer(&_366_pC.X12)) = i32(0) if _rc != 0 { goto _abort_due_to_error } if (_366_opflags & i32(1)) == 0 { goto _1422 } - *(*int32)(unsafe.Pointer(&(_p.X11))) += 1 - if ((_db.X50) != nil) && (((_366_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) { - (_db.X50)(tls, _db.X49, i32(9), _366_zDb, _366_pTab.X0, _366_pC.X20) + *(*int32)(unsafe.Pointer(&_p.X11)) += 1 + if (_db.X50 != nil) && ((_366_pTab.X9 & uint32(i32(32))) == uint32(i32(0))) { + _db.X50(tls, _db.X49, i32(9), _366_zDb, _366_pTab.X0, _366_pC.X20) func() { if int32(_366_pC.X1) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82940), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68876))) @@ -51813,10 +54199,10 @@ _1422: goto _250 _173: _sqlite3VdbeSetChanges(tls, _db, _p.X11) - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) goto _250 _174: - _377_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _377_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_377_pC.X0) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82980), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781))) @@ -51829,8 +54215,8 @@ _174: crt.X__builtin_abort(tls) } }() - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) - _377_nKeyCol = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) + _377_nKeyCol = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) _377_res = i32(0) _rc = _sqlite3VdbeSorterCompare(tls, _377_pC, _pIn3, _377_nKeyCol, &_377_res) if _rc != 0 { @@ -51841,8 +54227,8 @@ _174: } goto _250 _175: - _pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) - _378_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _pOut = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) + _378_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_378_pC.X0) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781))) @@ -51857,7 +54243,7 @@ _175: } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } @@ -51865,17 +54251,17 @@ _175: if _rc != 0 { goto _abort_due_to_error } - *(*uint32)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X5)))).X11))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X5)))).X11))) = uint32(i32(0)) goto _250 _176: _pOut = _out2Prerelease(tls, _p, _pOp) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83053), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _379_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _379_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _379_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83055), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -51901,12 +54287,12 @@ _176: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_379_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_379_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } }() - _379_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_379_pC.X14)))))) + _379_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_379_pC.X14))))) func() { if int32(_379_pC.X3) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83070), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965))) @@ -51920,33 +54306,33 @@ _176: } }() _379_n = _sqlite3BtreePayloadSize(tls, _379_pCrsr) - if _379_n > uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if _379_n > uint32(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { goto _too_big } _rc = _sqlite3VdbeMemFromBtree(tls, _379_pCrsr, uint32(i32(0)), _379_n, _pOut) if _rc != 0 { goto _abort_due_to_error } - if (_pOp.X5) != 0 { + if _pOp.X5 != 0 { goto _1463 } if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 { goto _no_mem } _1463: - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X4, _pOut) } goto _250 _177: _pOut = _out2Prerelease(tls, _p, _pOp) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83107), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _382_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _382_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _382_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -51954,16 +54340,16 @@ _177: } }() func() { - if int32(_382_pC.X0) == i32(3) && (_382_pC.X2) == 0 { + if int32(_382_pC.X0) == i32(3) && _382_pC.X2 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65642))) crt.X__builtin_abort(tls) } }() - if (_382_pC.X2) != 0 { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1)) + if _382_pC.X2 != 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(1)) goto _250 } - if (_382_pC.X3) != 0 { + if _382_pC.X3 != 0 { _382_v = _382_pC.X20 goto _1483 } @@ -51971,24 +54357,23 @@ _177: goto _1477 } func() { - if (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))) == nil { + if (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_382_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83118), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69154))) crt.X__builtin_abort(tls) } }() - _382_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))).X0) + _382_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_382_pC.X14))))).X0) _382_pModule = (*Xsqlite3_module)(_382_pVtab.X0) func() { - if (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_382_pModule.X12)}))) == nil { + if _382_pModule.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83121), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69170))) crt.X__builtin_abort(tls) } }() - _rc = (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_382_pModule.X12)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))), &_382_v) + _rc = func() func(*crt.TLS, *Xsqlite3_file, *int64) int32 { + v := _382_pModule.X12 + return *(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_382_pC.X14))))), &_382_v) _sqlite3VtabImportErrmsg(tls, _p, _382_pVtab) if _rc != 0 { goto _abort_due_to_error @@ -52002,7 +54387,7 @@ _1477: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_382_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83128), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } @@ -52011,48 +54396,48 @@ _1477: if _rc != 0 { goto _abort_due_to_error } - if (_382_pC.X2) != 0 { - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1)) + if _382_pC.X2 != 0 { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(1)) goto _250 } - _382_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14))))))) + _382_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_382_pC.X14)))))) _1483: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _382_v + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _382_v goto _250 _178: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83150), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _388_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _388_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _388_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83152), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_388_pC.X2))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&(_388_pC.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_388_pC.X2)) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_388_pC.X11)) = uint32(i32(0)) if int32(_388_pC.X0) == i32(0) { func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_388_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_388_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83156), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } }() - _sqlite3BtreeClearCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_388_pC.X14))))))) + _sqlite3BtreeClearCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_388_pC.X14)))))) } goto _250 _179: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _390_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _390_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _390_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83188), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52065,7 +54450,7 @@ _179: crt.X__builtin_abort(tls) } }() - _390_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_390_pC.X14)))))) + _390_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_390_pC.X14))))) _390_res = i32(0) func() { if _390_pCrsr == nil { @@ -52073,19 +54458,19 @@ _179: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_390_pC.X12))) = _pOp.X5 - *(*uint8)(unsafe.Pointer(&(_390_pC.X5))) = uint8(i32(33)) - if (_pOp.X5) != i32(0) && _sqlite3BtreeCursorIsValidNN(tls, _390_pCrsr) != 0 { + *(*int32)(unsafe.Pointer(&_390_pC.X12)) = _pOp.X5 + *(*uint8)(unsafe.Pointer(&_390_pC.X5)) = uint8(i32(33)) + if _pOp.X5 != i32(0) && _sqlite3BtreeCursorIsValidNN(tls, _390_pCrsr) != 0 { goto _1508 } _rc = _sqlite3BtreeLast(tls, _390_pCrsr, &_390_res) - *(*uint8)(unsafe.Pointer(&(_390_pC.X2))) = uint8(_390_res) - *(*uint8)(unsafe.Pointer(&(_390_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_390_pC.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_390_pC.X2)) = uint8(_390_res) + *(*uint8)(unsafe.Pointer(&_390_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_390_pC.X11)) = uint32(i32(0)) if _rc != 0 { goto _abort_due_to_error } - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { goto _1510 } if _390_res != 0 { @@ -52095,7 +54480,7 @@ _1510: goto _1512 _1508: func() { - if (_pOp.X4) != i32(0) { + if _pOp.X4 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83208), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69186))) crt.X__builtin_abort(tls) } @@ -52104,19 +54489,19 @@ _1512: goto _250 _180: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _394_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _394_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _394_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) crt.X__builtin_abort(tls) } }() - _394_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_394_pC.X14)))))) + _394_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_394_pC.X14))))) func() { if _394_pCrsr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83228), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807))) @@ -52140,7 +54525,7 @@ _180: crt.X__builtin_abort(tls) return i32(0) }() - }() != 0 && (int32(_sqlite3LogEst(tls, uint64(_394_sz))) < (_pOp.X5)) { + }() != 0 && (int32(_sqlite3LogEst(tls, uint64(_394_sz))) < _pOp.X5) { _394_res = i32(1) } _1523: @@ -52149,15 +54534,15 @@ _1523: } goto _250 _181: - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(2)))) += 1 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_p.X35)))) + 4*uintptr(i32(2)))) += 1 _183: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _397_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _397_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _397_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83290), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52171,7 +54556,7 @@ _183: } }() _397_res = i32(1) - *(*uint8)(unsafe.Pointer(&(_397_pC.X5))) = uint8(i32(37)) + *(*uint8)(unsafe.Pointer(&_397_pC.X5)) = uint8(i32(37)) if int32(_397_pC.X0) == i32(1) { _rc = _sqlite3VdbeSorterRewind(tls, _397_pC, &_397_res) goto _1537 @@ -52182,7 +54567,7 @@ _183: crt.X__builtin_abort(tls) } }() - _397_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_397_pC.X14)))))) + _397_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_397_pC.X14))))) func() { if _397_pCrsr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83301), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807))) @@ -52190,15 +54575,15 @@ _183: } }() _rc = _sqlite3BtreeFirst(tls, _397_pCrsr, &_397_res) - *(*uint8)(unsafe.Pointer(&(_397_pC.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_397_pC.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_397_pC.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_397_pC.X11)) = uint32(i32(0)) _1537: if _rc != 0 { goto _abort_due_to_error } - *(*uint8)(unsafe.Pointer(&(_397_pC.X2))) = uint8(_397_res) + *(*uint8)(unsafe.Pointer(&_397_pC.X2)) = uint8(_397_res) func() { - if (_pOp.X4) <= i32(0) || (_pOp.X4) >= (_p.X27) { + if _pOp.X4 <= i32(0) || _pOp.X4 >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69240))) crt.X__builtin_abort(tls) } @@ -52208,7 +54593,7 @@ _1537: } goto _250 _184: - _400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_400_pC.X0) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781))) @@ -52219,12 +54604,12 @@ _184: _rc = _sqlite3VdbeSorterNext(tls, _db, _400_pC, &_400_res) goto _next_tail _185: - if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { + if (*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3)))) == nil { goto _250 } _1549: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83399), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } @@ -52235,7 +54620,7 @@ _1549: crt.X__builtin_abort(tls) } }() - _400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) _400_res = _pOp.X5 func() { if _400_pC == nil { @@ -52264,9 +54649,10 @@ _1549: func() { if int32(_pOp.X0) == i32(7) && *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 - }{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XBtCursor, *int32) int32 { + v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 }{_sqlite3BtreeNext})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83408), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69336))) @@ -52276,9 +54662,10 @@ _1549: func() { if int32(_pOp.X0) == i32(6) && *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 - }{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XBtCursor, *int32) int32 { + v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 }{_sqlite3BtreePrevious})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83409), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69395))) @@ -52288,9 +54675,10 @@ _1549: func() { if int32(_pOp.X0) == i32(5) && *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 - }{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XBtCursor, *int32) int32 { + v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 }{_sqlite3BtreeNext})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83410), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69458))) @@ -52300,9 +54688,10 @@ _1549: func() { if int32(_pOp.X0) == i32(4) && *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 - }{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *XBtCursor, *int32) int32 { + v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *XBtCursor, *int32) int32 }{_sqlite3BtreePrevious})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83411), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69523))) @@ -52321,29 +54710,30 @@ _1549: crt.X__builtin_abort(tls) } }() - _rc = (*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_400_pC.X14)))))), &_400_res) + _rc = func() func(*crt.TLS, *XBtCursor, *int32) int32 { + v := *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + return *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_400_pC.X14))))), &_400_res) _next_tail: - *(*uint32)(unsafe.Pointer(&(_400_pC.X11))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_400_pC.X11)) = uint32(i32(0)) if _rc != 0 { goto _abort_due_to_error } if _400_res == i32(0) { - *(*uint8)(unsafe.Pointer(&(_400_pC.X2))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(_pOp.X2))) += 1 + *(*uint8)(unsafe.Pointer(&_400_pC.X2)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_p.X35)))) + 4*uintptr(_pOp.X2))) += 1 goto _jump_to_p2_and_check_for_interrupt } - *(*uint8)(unsafe.Pointer(&(_400_pC.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_400_pC.X2)) = uint8(i32(1)) goto _check_for_interrupt _189: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83480), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _403_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _403_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _403_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83482), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52356,7 +54746,7 @@ _189: crt.X__builtin_abort(tls) } }() - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) func() { if (int32(_pIn2.X1) & i32(16)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83485), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69911))) @@ -52364,7 +54754,7 @@ _189: } }() if (int32(_pOp.X2) & i32(1)) != 0 { - *(*int32)(unsafe.Pointer(&(_p.X11))) += 1 + *(*int32)(unsafe.Pointer(&_p.X11)) += 1 } func() { if int32(_403_pC.X0) != i32(0) && int32(_pOp.X0) != i32(127) { @@ -52391,13 +54781,13 @@ _189: _rc = _sqlite3VdbeSorterWrite(tls, _403_pC, _pIn2) goto _1612 } - *(*int64)(unsafe.Pointer(&(_403_x.X1))) = int64(_pIn2.X4) - *(*unsafe.Pointer)(unsafe.Pointer(&(_403_x.X0))) = (unsafe.Pointer)(_pIn2.X5) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_403_x.X3))))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.X5)*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(72))))))))))) - *(*uint16)(unsafe.Pointer(&(_403_x.X4))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - _rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_403_pC.X14)))))), &_403_x, int32(_pOp.X2)&i32(10), func() int32 { + *(*int64)(unsafe.Pointer(&_403_x.X1)) = int64(_pIn2.X4) + *(*unsafe.Pointer)(unsafe.Pointer(&_403_x.X0)) = unsafe.Pointer(_pIn2.X5) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_403_x.X3)))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.X5)*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(72))))))))))) + *(*uint16)(unsafe.Pointer(&_403_x.X4)) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + _rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_403_pC.X14))))), &_403_x, int32(_pOp.X2)&i32(10), func() int32 { if (int32(_pOp.X2) & i32(16)) != 0 { - return (_403_pC.X12) + return _403_pC.X12 } return i32(0) }()) @@ -52407,7 +54797,7 @@ _189: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_403_pC.X11))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_403_pC.X11)) = uint32(i32(0)) _1612: if _rc != 0 { goto _abort_due_to_error @@ -52415,24 +54805,24 @@ _1612: goto _250 _191: func() { - if (_pOp.X5) <= i32(0) { + if _pOp.X5 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83522), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) <= i32(0) || ((_pOp.X4)+(_pOp.X5)) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) { + if _pOp.X4 <= i32(0) || (_pOp.X4+_pOp.X5) > (((_p.X6+i32(1))-_p.X7)+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83523), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69994))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83524), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _406_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _406_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _406_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83526), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52445,7 +54835,7 @@ _191: crt.X__builtin_abort(tls) } }() - _406_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_406_pC.X14)))))) + _406_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_406_pC.X14))))) func() { if _406_pCrsr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83529), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68506))) @@ -52458,10 +54848,10 @@ _191: crt.X__builtin_abort(tls) } }() - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_406_r.X0))))) = (*XKeyInfo)(_406_pC.X15) - *(*uint16)(unsafe.Pointer(&(_406_r.X2))) = uint16(_pOp.X5) - *(*int8)(unsafe.Pointer(&(_406_r.X3))) = int8(i32(0)) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_406_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_406_r.X0)))) = (*XKeyInfo)(_406_pC.X15) + *(*uint16)(unsafe.Pointer(&_406_r.X2)) = uint16(_pOp.X5) + *(*int8)(unsafe.Pointer(&_406_r.X3)) = int8(i32(0)) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_406_r.X1)))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _rc = _sqlite3BtreeMovetoUnpacked(tls, _406_pCrsr, &_406_r, int64(i32(0)), i32(0), &_406_res) if _rc != 0 { goto _abort_due_to_error @@ -52480,17 +54870,17 @@ _1635: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_406_pC.X11))) = uint32(i32(0)) - *(*int32)(unsafe.Pointer(&(_406_pC.X12))) = i32(0) + *(*uint32)(unsafe.Pointer(&_406_pC.X11)) = uint32(i32(0)) + *(*int32)(unsafe.Pointer(&_406_pC.X12)) = i32(0) goto _250 _192: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _408_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _408_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _408_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83583), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52504,7 +54894,7 @@ _192: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_408_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83585), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } @@ -52522,7 +54912,7 @@ _192: } }() func() { - if (_408_pC.X2) != 0 && int32(_pOp.X0) != i32(131) { + if _408_pC.X2 != 0 && int32(_pOp.X0) != i32(131) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83588), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70051))) crt.X__builtin_abort(tls) } @@ -52540,22 +54930,22 @@ _192: }() != 0 { goto _abort_due_to_error } - if (_408_pC.X2) != 0 { + if _408_pC.X2 != 0 { goto _1658 } _408_rowid = int64(i32(0)) - _rc = _sqlite3VdbeIdxRowid(tls, _db, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pC.X14)))))), &_408_rowid) + _rc = _sqlite3VdbeIdxRowid(tls, _db, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_408_pC.X14))))), &_408_rowid) if _rc != i32(0) { goto _abort_due_to_error } if int32(_pOp.X0) == i32(130) { func() { - if (_pOp.X5) < i32(0) || (_pOp.X5) >= (_p.X7) { + if _pOp.X5 < i32(0) || _pOp.X5 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83606), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70092))) crt.X__builtin_abort(tls) } }() - _408_pTabCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X5))) + _408_pTabCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X5))) func() { if _408_pTabCur == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83608), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70125))) @@ -52569,32 +54959,32 @@ _192: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pTabCur.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_408_pTabCur.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83610), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70169))) crt.X__builtin_abort(tls) } }() func() { - if (_408_pTabCur.X4) == 0 { + if _408_pTabCur.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70192))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_408_pTabCur.X2))) = uint8(i32(0)) - *(*int64)(unsafe.Pointer(&(_408_pTabCur.X20))) = _408_rowid - *(*uint8)(unsafe.Pointer(&(_408_pTabCur.X3))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_408_pTabCur.X2)) = uint8(i32(0)) + *(*int64)(unsafe.Pointer(&_408_pTabCur.X20)) = _408_rowid + *(*uint8)(unsafe.Pointer(&_408_pTabCur.X3)) = uint8(i32(1)) func() { - if int32(_pOp.X1) != i32(-12) && (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil { + if int32(_pOp.X1) != i32(-12) && (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70209))) crt.X__builtin_abort(tls) } }() - *(**int32)(unsafe.Pointer(&(_408_pTabCur.X10))) = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) - *(**XVdbeCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_408_pTabCur.X13))))) = _408_pC + *(**int32)(unsafe.Pointer(&_408_pTabCur.X10)) = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) + *(**XVdbeCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_408_pTabCur.X13)))) = _408_pC goto _1675 } _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _408_rowid + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _408_rowid _1675: goto _1676 _1658: @@ -52604,17 +54994,17 @@ _1658: crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4)))) + _sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4)))) _1676: goto _250 _194: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83681), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _414_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _414_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _414_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52622,7 +55012,7 @@ _194: } }() func() { - if ((uint32((_414_pC.X7)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_414_pC.X7>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83684), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67827))) crt.X__builtin_abort(tls) } @@ -52634,7 +55024,7 @@ _194: } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_414_pC.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_414_pC.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83686), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841))) crt.X__builtin_abort(tls) } @@ -52657,8 +55047,8 @@ _194: crt.X__builtin_abort(tls) } }() - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_414_r.X0))))) = (*XKeyInfo)(_414_pC.X15) - *(*uint16)(unsafe.Pointer(&(_414_r.X2))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_414_r.X0)))) = (*XKeyInfo)(_414_pC.X15) + *(*uint16)(unsafe.Pointer(&_414_r.X2)) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) if int32(_pOp.X0) < i32(40) { func() { if int32(_pOp.X0) != i32(38) && int32(_pOp.X0) != i32(39) { @@ -52666,7 +55056,7 @@ _194: crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(&(_414_r.X3))) = int8(i32(-1)) + *(*int8)(unsafe.Pointer(&_414_r.X3)) = int8(i32(-1)) goto _1701 } func() { @@ -52675,9 +55065,9 @@ _194: crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(&(_414_r.X3))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_414_r.X3)) = int8(i32(0)) _1701: - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_414_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_414_r.X1)))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _417_i = i32(0) _1705: if _417_i >= int32(_414_r.X2) { @@ -52722,35 +55112,35 @@ _1715: goto _250 _198: func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83750), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X3) <= i32(1) { + if _pOp.X3 <= i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83751), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70489))) crt.X__builtin_abort(tls) } }() _pOut = _out2Prerelease(tls, _p, _pOp) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1)) - if (_db.X35) > ((_db.X38) + i32(1)) { + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(1)) + if _db.X35 > (_db.X38 + i32(1)) { _rc = i32(6) - *(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_p.X30)) = uint8(i32(2)) goto _abort_due_to_error } _420_iDb = _pOp.X5 func() { - if ((_p.X33) & (u32(1) << uint(_420_iDb))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_420_iDb))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83760), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192))) crt.X__builtin_abort(tls) } }() _420_iMoved = i32(0) _rc = _sqlite3BtreeDropTable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_420_iDb))).X1), _pOp.X3, &_420_iMoved) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_420_iMoved) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_420_iMoved) if _rc != 0 { goto _abort_due_to_error } @@ -52768,41 +55158,41 @@ _198: _199: _424_nChange = i32(0) func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_pOp.X4))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_pOp.X4))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70550))) crt.X__builtin_abort(tls) } }() _rc = _sqlite3BtreeClearTable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_pOp.X4))).X1), _pOp.X3, func() *int32 { - if (_pOp.X5) != 0 { + if _pOp.X5 != 0 { return &_424_nChange } return nil }()) - if (_pOp.X5) == 0 { + if _pOp.X5 == 0 { goto _1740 } { - p := (*int32)(unsafe.Pointer(&(_p.X11))) + p := (*int32)(unsafe.Pointer(&_p.X11)) *p = (*p) + _424_nChange sink1(*p) } - if (_pOp.X5) > i32(0) { + if _pOp.X5 > i32(0) { func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63056))) crt.X__builtin_abort(tls) } }() - _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5)))) + _sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5)))) { - p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))).X0))))) + p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))).X0))))) *p = (*p) + int64(_424_nChange) sink6(*p) } @@ -52814,12 +55204,12 @@ _1740: goto _250 _200: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83828), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541))) crt.X__builtin_abort(tls) } }() - _427_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _427_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if _427_pC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83830), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595))) @@ -52827,7 +55217,7 @@ _200: } }() if int32(_427_pC.X0) == i32(1) { - _sqlite3VdbeSorterReset(tls, _db, (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_427_pC.X14))))))) + _sqlite3VdbeSorterReset(tls, _db, (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_427_pC.X14)))))) goto _1751 } func() { @@ -52842,7 +55232,7 @@ _200: crt.X__builtin_abort(tls) } }() - _rc = _sqlite3BtreeClearTableOfCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_427_pC.X14))))))) + _rc = _sqlite3BtreeClearTableOfCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_427_pC.X14)))))) if _rc != 0 { goto _abort_due_to_error } @@ -52852,19 +55242,19 @@ _201: _pOut = _out2Prerelease(tls, _p, _pOp) _430_pgno = i32(0) func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83874), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83875), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83876), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } @@ -52886,12 +55276,12 @@ _1767: if _rc != 0 { goto _abort_due_to_error } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_430_pgno) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_430_pgno) goto _250 _203: - *(*uint8)(unsafe.Pointer(&(_db.X26))) += 1 - _rc = Xsqlite3_exec(tls, _db, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), nil, nil, nil) - *(*uint8)(unsafe.Pointer(&(_db.X26))) -= 1 + *(*uint8)(unsafe.Pointer(&_db.X26)) += 1 + _rc = Xsqlite3_exec(tls, _db, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))), nil, nil, nil) + *(*uint8)(unsafe.Pointer(&_db.X26)) -= 1 if _rc != 0 { goto _abort_due_to_error } @@ -52899,7 +55289,7 @@ _203: _204: _434_iDb = i32(0) _1770: - if _434_iDb >= (_db.X5) { + if _434_iDb >= _db.X5 { goto _1773 } func() { @@ -52913,7 +55303,7 @@ _1770: _1773: _434_iDb = _pOp.X3 func() { - if _434_iDb < i32(0) || _434_iDb >= (_db.X5) { + if _434_iDb < i32(0) || _434_iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83928), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -52925,34 +55315,34 @@ _1773: } }() _434_zMaster = str(50026) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_434_initData.X0))))) = _db - *(*int32)(unsafe.Pointer(&(_434_initData.X2))) = _pOp.X3 - *(***int8)(unsafe.Pointer(&(_434_initData.X1))) = (**int8)(unsafe.Pointer(&(_p.X22))) - _434_zSql = _sqlite3MPrintf(tls, _db, str(70640), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_434_iDb))).X0), unsafe.Pointer(_434_zMaster), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_434_initData.X0)))) = _db + *(*int32)(unsafe.Pointer(&_434_initData.X2)) = _pOp.X3 + *(***int8)(unsafe.Pointer(&_434_initData.X1)) = (**int8)(unsafe.Pointer(&_p.X22)) + _434_zSql = _sqlite3MPrintf(tls, _db, str(70640), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_434_iDb))).X0), unsafe.Pointer(_434_zMaster), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) if _434_zSql == nil { _rc = _sqlite3NomemError(tls, i32(83939)) goto _1783 } func() { - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83941), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(49896))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_434_initData.X3))) = i32(0) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X2))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_434_initData.X3)) = i32(0) func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83944), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } }() - _rc = Xsqlite3_exec(tls, _db, _434_zSql, _sqlite3InitCallback, (unsafe.Pointer)(&_434_initData), nil) + _rc = Xsqlite3_exec(tls, _db, _434_zSql, _sqlite3InitCallback, unsafe.Pointer(&_434_initData), nil) if _rc == i32(0) { _rc = _434_initData.X3 } - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_434_zSql)) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(0)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_434_zSql)) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X2))) = uint8(i32(0)) _1783: if _rc == 0 { goto _1789 @@ -52966,7 +55356,7 @@ _1789: goto _250 _205: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } @@ -52977,23 +55367,23 @@ _205: } goto _250 _206: - _sqlite3UnlinkAndDeleteTable(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _sqlite3UnlinkAndDeleteTable(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _250 _207: - _sqlite3UnlinkAndDeleteIndex(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _sqlite3UnlinkAndDeleteIndex(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _250 _208: - _sqlite3UnlinkAndDeleteTrigger(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _sqlite3UnlinkAndDeleteTrigger(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) goto _250 _209: func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84043), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } }() _445_nRoot = _pOp.X4 - _445_aRoot = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _445_aRoot = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { if _445_nRoot <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70704))) @@ -53001,18 +55391,18 @@ _209: } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_445_aRoot)) + 4*uintptr(_445_nRoot)))) != i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_445_aRoot)) + 4*uintptr(_445_nRoot)))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84047), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70712))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84048), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() - _445_pnErr = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _445_pnErr = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { if (int32(_445_pnErr.X1) & i32(4)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84050), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70728))) @@ -53025,20 +55415,20 @@ _209: crt.X__builtin_abort(tls) } }() - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { - if int32(_pOp.X2) >= (_db.X5) { + if int32(_pOp.X2) >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84053), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70795))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(int32(_pOp.X2)))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(int32(_pOp.X2)))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84054), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70811))) crt.X__builtin_abort(tls) } }() - _445_z = _sqlite3BtreeIntegrityCheck(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_pOp.X2))).X1), _445_aRoot, _445_nRoot, int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_445_pnErr.X0))))))+i32(1), &_445_nErr) + _445_z = _sqlite3BtreeIntegrityCheck(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_pOp.X2))).X1), _445_aRoot, _445_nRoot, int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_445_pnErr.X0)))))+i32(1), &_445_nErr) _sqlite3VdbeMemSetNull(tls, _pIn1) if _445_nErr == i32(0) { func() { @@ -53053,7 +55443,7 @@ _209: goto _no_mem } { - p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_445_pnErr.X0))))) + p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_445_pnErr.X0)))) *p = (*p) - int64(_445_nErr-i32(1)) sink6(*p) } @@ -53062,8 +55452,8 @@ _1817: _sqlite3VdbeChangeEncoding(tls, _pIn1, int32(_encoding)) goto _250 _210: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) func() { if (int32(_pIn2.X1) & i32(4)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84083), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67591))) @@ -53078,20 +55468,20 @@ _210: goto _no_mem } _1820: - _sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))) + _sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn2.X0))))) goto _250 _211: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - if ((int32(_pIn1.X1) & i32(32)) == i32(0)) || (_sqlite3RowSetNext(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), &_451_val) == i32(0)) { + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + if ((int32(_pIn1.X1) & i32(32)) == i32(0)) || (_sqlite3RowSetNext(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))), &_451_val) == i32(0)) { _sqlite3VdbeMemSetNull(tls, _pIn1) goto _jump_to_p2_and_check_for_interrupt } - _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X5))), _451_val) + _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X5))), _451_val) goto _check_for_interrupt _212: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) - _454_iSet = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) + _454_iSet = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) func() { if (int32(_pIn3.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84149), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70850))) @@ -53121,31 +55511,31 @@ _1827: if _454_iSet == 0 { goto _1834 } - _454_exists = _sqlite3RowSetTest(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), _454_iSet, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) + _454_exists = _sqlite3RowSetTest(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))), _454_iSet, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) if _454_exists != 0 { goto _jump_to_p2 } _1834: if _454_iSet >= i32(0) { - _sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) + _sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) } goto _250 _213: - _458_pProgram = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - _458_pRt = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _458_pProgram = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + _458_pRt = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) func() { - if (_458_pProgram.X1) <= i32(0) { + if _458_pProgram.X1 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84202), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70890))) crt.X__builtin_abort(tls) } }() - if (_pOp.X2) == 0 { + if _pOp.X2 == 0 { goto _1839 } _458_t = _458_pProgram.X5 _458_pFrame = (*XVdbeFrame)(_p.X38) _1840: - if _458_pFrame == nil || (_458_pFrame.X7) == _458_t { + if _458_pFrame == nil || _458_pFrame.X7 == _458_t { goto _1844 } _458_pFrame = (*XVdbeFrame)(_458_pFrame.X1) @@ -53155,7 +55545,7 @@ _1844: goto _250 } _1839: - if (_p.X40) >= (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(10))))) { + if _p.X40 >= (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(10))))) { _rc = i32(1) _sqlite3VdbeError(tls, _p, str(70906)) goto _abort_due_to_error @@ -53163,144 +55553,144 @@ _1839: if (int32(_458_pRt.X1) & i32(64)) != i32(0) { goto _1847 } - _458_nMem = (_458_pProgram.X2) + (_458_pProgram.X3) + _458_nMem = _458_pProgram.X2 + _458_pProgram.X3 func() { if _458_nMem <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70943))) crt.X__builtin_abort(tls) } }() - if (_458_pProgram.X3) == i32(0) { + if _458_pProgram.X3 == i32(0) { _458_nMem += 1 } - _458_nByte = int32(((u64(112) + (uint64(_458_nMem) * u64(72))) + (uint64(_458_pProgram.X3) * u64(8))) + uint64(((_458_pProgram.X1)+i32(7))/i32(8))) + _458_nByte = int32(((u64(112) + (uint64(_458_nMem) * u64(72))) + (uint64(_458_pProgram.X3) * u64(8))) + uint64((_458_pProgram.X1+i32(7))/i32(8))) _458_pFrame = (*XVdbeFrame)(_sqlite3DbMallocZero(tls, _db, uint64(_458_nByte))) if _458_pFrame == nil { goto _no_mem } _sqlite3VdbeMemRelease(tls, _458_pRt) - *(*uint16)(unsafe.Pointer(&(_458_pRt.X1))) = uint16(i32(64)) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_458_pRt.X0))))))) = _458_pFrame - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X0))))) = _p - *(*int32)(unsafe.Pointer(&(_458_pFrame.X14))) = _458_nMem - *(*int32)(unsafe.Pointer(&(_458_pFrame.X15))) = _458_pProgram.X3 - *(*int32)(unsafe.Pointer(&(_458_pFrame.X11))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X4))))) = (*XMem)(_p.X18) - *(*int32)(unsafe.Pointer(&(_458_pFrame.X13))) = _p.X6 - *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X5))))) = (**XVdbeCursor)(unsafe.Pointer(_p.X23)) - *(*int32)(unsafe.Pointer(&(_458_pFrame.X10))) = _p.X7 - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X2))))) = (*XVdbeOp)(_p.X17) - *(*int32)(unsafe.Pointer(&(_458_pFrame.X12))) = _p.X27 - *(*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X7))) = _458_pProgram.X5 - _458_pEnd = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame))+1*uintptr(u64(112)))))) + 72*uintptr(_458_pFrame.X14))) - _458_pMem = (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame)) + 1*uintptr(u64(112)))))) + *(*uint16)(unsafe.Pointer(&_458_pRt.X1)) = uint16(i32(64)) + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_458_pRt.X0)))))) = _458_pFrame + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X0)))) = _p + *(*int32)(unsafe.Pointer(&_458_pFrame.X14)) = _458_nMem + *(*int32)(unsafe.Pointer(&_458_pFrame.X15)) = _458_pProgram.X3 + *(*int32)(unsafe.Pointer(&_458_pFrame.X11)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X4)))) = (*XMem)(_p.X18) + *(*int32)(unsafe.Pointer(&_458_pFrame.X13)) = _p.X6 + *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X5)))) = (**XVdbeCursor)(unsafe.Pointer(_p.X23)) + *(*int32)(unsafe.Pointer(&_458_pFrame.X10)) = _p.X7 + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X2)))) = (*XVdbeOp)(_p.X17) + *(*int32)(unsafe.Pointer(&_458_pFrame.X12)) = _p.X27 + *(*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X7)) = _458_pProgram.X5 + _458_pEnd = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_458_pFrame))+1*uintptr(u64(112)))))) + 72*uintptr(_458_pFrame.X14))) + _458_pMem = (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_458_pFrame)) + 1*uintptr(u64(112)))))) _1852: if _458_pMem == _458_pEnd { goto _1855 } - *(*uint16)(unsafe.Pointer(&(_458_pMem.X1))) = uint16(i32(128)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pMem.X9))))) = _db + *(*uint16)(unsafe.Pointer(&_458_pMem.X1)) = uint16(i32(128)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pMem.X9)))) = _db *(*uintptr)(unsafe.Pointer(&_458_pMem)) += uintptr(72) goto _1852 _1855: goto _1856 _1847: - _458_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_458_pRt.X0)))))) + _458_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_458_pRt.X0))))) func() { - if ((_458_pProgram.X2)+(_458_pProgram.X3)) != (_458_pFrame.X14) && ((_458_pProgram.X3) != i32(0) || ((_458_pProgram.X2)+i32(1)) != (_458_pFrame.X14)) { + if (_458_pProgram.X2+_458_pProgram.X3) != _458_pFrame.X14 && (_458_pProgram.X3 != i32(0) || (_458_pProgram.X2+i32(1)) != _458_pFrame.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84274), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70950))) crt.X__builtin_abort(tls) } }() func() { - if (_458_pProgram.X3) != (_458_pFrame.X15) { + if _458_pProgram.X3 != _458_pFrame.X15 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71061))) crt.X__builtin_abort(tls) } }() func() { - if int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) != (_458_pFrame.X11) { + if int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)) != _458_pFrame.X11 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84277), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71095))) crt.X__builtin_abort(tls) } }() _1856: - *(*int32)(unsafe.Pointer(&(_p.X40))) += 1 - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X1))))) = (*XVdbeFrame)(_p.X38) - *(*int64)(unsafe.Pointer(&(_458_pFrame.X8))) = _db.X7 - *(*int32)(unsafe.Pointer(&(_458_pFrame.X16))) = _p.X11 - *(*int32)(unsafe.Pointer(&(_458_pFrame.X17))) = (*Xsqlite3)(_p.X0).X29 + *(*int32)(unsafe.Pointer(&_p.X40)) += 1 + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X1)))) = (*XVdbeFrame)(_p.X38) + *(*int64)(unsafe.Pointer(&_458_pFrame.X8)) = _db.X7 + *(*int32)(unsafe.Pointer(&_458_pFrame.X16)) = _p.X11 + *(*int32)(unsafe.Pointer(&_458_pFrame.X17)) = (*Xsqlite3)(_p.X0).X29 func() { if (*XAuxData)(_458_pFrame.X9) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84285), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71124))) crt.X__builtin_abort(tls) } }() - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X9))))) = (*XAuxData)(_p.X43) - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))) = nil - *(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0) - *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = _458_pFrame - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = store20(&_aMem, (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame))+1*uintptr(u64(112))))))) - *(*int32)(unsafe.Pointer(&(_p.X6))) = _458_pFrame.X14 - *(*int32)(unsafe.Pointer(&(_p.X7))) = int32(uint16(_458_pFrame.X15)) - *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X23))))) = (**XVdbeCursor)(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_p.X6))))) - *(**uint8)(unsafe.Pointer(&(_458_pFrame.X6))) = (*uint8)(unsafe.Pointer((**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_458_pProgram.X3))))) - crt.Xmemset(tls, (unsafe.Pointer)(_458_pFrame.X6), i32(0), uint64(((_458_pProgram.X1)+i32(7))/i32(8))) - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = store40(&_aOp, (*XVdbeOp)(_458_pProgram.X0)) - *(*int32)(unsafe.Pointer(&(_p.X27))) = _458_pProgram.X1 - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 32*uintptr(i32(-1)))) + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_458_pFrame.X9)))) = (*XAuxData)(_p.X43) + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X43)))) = nil + *(*int32)(unsafe.Pointer(&_p.X11)) = i32(0) + *(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X38)))) = _458_pFrame + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X18)))) = store20(&_aMem, (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_458_pFrame))+1*uintptr(u64(112))))))) + *(*int32)(unsafe.Pointer(&_p.X6)) = _458_pFrame.X14 + *(*int32)(unsafe.Pointer(&_p.X7)) = int32(uint16(_458_pFrame.X15)) + *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X23)))) = (**XVdbeCursor)(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_p.X6))))) + *(**uint8)(unsafe.Pointer(&_458_pFrame.X6)) = (*uint8)(unsafe.Pointer((**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_458_pProgram.X3))))) + crt.Xmemset(tls, unsafe.Pointer(_458_pFrame.X6), i32(0), uint64((_458_pProgram.X1+i32(7))/i32(8))) + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X17)))) = store40(&_aOp, (*XVdbeOp)(_458_pProgram.X0)) + *(*int32)(unsafe.Pointer(&_p.X27)) = _458_pProgram.X1 + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 32*uintptr(i32(-1)))) goto _250 _214: _pOut = _out2Prerelease(tls, _p, _pOp) _465_pFrame = (*XVdbeFrame)(_p.X38) - _465_pIn = (*XMem)(unsafe.Pointer(uintptr(_465_pFrame.X4) + 72*uintptr((_pOp.X3)+((*XVdbeOp)(unsafe.Pointer(uintptr(_465_pFrame.X2)+32*uintptr(_465_pFrame.X11))).X3)))) + _465_pIn = (*XMem)(unsafe.Pointer(uintptr(_465_pFrame.X4) + 72*uintptr(_pOp.X3+((*XVdbeOp)(unsafe.Pointer(uintptr(_465_pFrame.X2)+32*uintptr(_465_pFrame.X11))).X3)))) _sqlite3VdbeMemShallowCopy(tls, _pOut, _465_pIn, i32(4096)) goto _250 _215: - if ((_db.X6) & i32(33554432)) != 0 { + if (_db.X6 & i32(33554432)) != 0 { { - p := (*int64)(unsafe.Pointer(&(_db.X78))) + p := (*int64)(unsafe.Pointer(&_db.X78)) *p = (*p) + int64(_pOp.X4) sink6(*p) } goto _1870 } - if (_pOp.X3) != 0 { + if _pOp.X3 != 0 { { - p := (*int64)(unsafe.Pointer(&(_db.X77))) + p := (*int64)(unsafe.Pointer(&_db.X77)) *p = (*p) + int64(_pOp.X4) sink6(*p) } goto _1870 } { - p := (*int64)(unsafe.Pointer(&(_p.X14))) + p := (*int64)(unsafe.Pointer(&_p.X14)) *p = (*p) + int64(_pOp.X4) sink6(*p) } _1870: goto _250 _216: - if (_pOp.X3) == 0 { + if _pOp.X3 == 0 { goto _1871 } - if ((_db.X77) == int64(i32(0))) && ((_db.X78) == int64(i32(0))) { + if (_db.X77 == int64(i32(0))) && (_db.X78 == int64(i32(0))) { goto _jump_to_p2 } goto _1874 _1871: - if ((_p.X14) == int64(i32(0))) && ((_db.X78) == int64(i32(0))) { + if (_p.X14 == int64(i32(0))) && (_db.X78 == int64(i32(0))) { goto _jump_to_p2 } _1874: goto _250 _217: - if (*XVdbeFrame)(_p.X38) == nil { + if _p.X38 == nil { goto _1877 } _473_pFrame = (*XVdbeFrame)(_p.X38) _1878: - if (*XVdbeFrame)(_473_pFrame.X1) == nil { + if _473_pFrame.X1 == nil { goto _1881 } _473_pFrame = (*XVdbeFrame)(_473_pFrame.X1) @@ -53309,7 +55699,7 @@ _1881: _pIn1 = (*XMem)(unsafe.Pointer(uintptr(_473_pFrame.X4) + 72*uintptr(_pOp.X3))) goto _1882 _1877: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) _1882: func() { if (int32(_pIn1.X1) & i32(128)) != i32(0) { @@ -53318,23 +55708,23 @@ _1882: } }() _sqlite3VdbeMemIntegerify(tls, _pIn1) - _pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X4))) + _pIn2 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4))) _sqlite3VdbeMemIntegerify(tls, _pIn2) - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0))))) + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn2.X0))))) { + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn2.X0)))) } goto _250 _218: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_pIn1.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144))) crt.X__builtin_abort(tls) } }() - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > int64(i32(0)) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) > int64(i32(0)) { { - p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) + p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) *p = (*p) - int64(_pOp.X5) sink6(*p) } @@ -53342,8 +55732,8 @@ _218: } goto _250 _219: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) - _pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn3 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _pOut = _out2Prerelease(tls, _p, _pOp) func() { if (int32(_pIn1.X1) & i32(4)) == 0 { @@ -53357,48 +55747,48 @@ _219: crt.X__builtin_abort(tls) } }() - _479_x = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) + _479_x = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) if (_479_x <= int64(i32(0))) || _sqlite3AddInt64(tls, &_479_x, func() int64 { - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) > int64(i32(0)) { - return (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) > int64(i32(0)) { + return (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn3.X0))))) } return int64(i32(0)) }()) != 0 { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(i32(-1)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(i32(-1)) goto _1897 } - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _479_x + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = _479_x _1897: goto _250 _220: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_pIn1.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144))) crt.X__builtin_abort(tls) } }() - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) == 0 { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) == 0 { goto _1900 } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > int64(i32(0)) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) -= 1 + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) > int64(i32(0)) { + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) -= 1 } goto _jump_to_p2 _1900: goto _250 _221: - _pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _pIn1 = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_pIn1.X1) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84494), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144))) crt.X__builtin_abort(tls) } }() - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > i64(-9223372036854775808) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) -= 1 + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) > i64(-9223372036854775808) { + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0)))) -= 1 } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) == int64(i32(0)) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pIn1.X0))))) == int64(i32(0)) { goto _jump_to_p2 } goto _250 @@ -53411,19 +55801,19 @@ _222: }() _485_n = int32(_pOp.X2) func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() func() { - if _485_n != i32(0) && ((_pOp.X4) <= i32(0) || ((_pOp.X4)+_485_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1))) { + if _485_n != i32(0) && (_pOp.X4 <= i32(0) || (_pOp.X4+_485_n) > (((_p.X6+i32(1))-_p.X7)+i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64488))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X5) >= (_pOp.X4) && (_pOp.X5) < ((_pOp.X4)+_485_n) { + if _pOp.X5 >= _pOp.X4 && _pOp.X5 < (_pOp.X4+_485_n) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84538), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64549))) crt.X__builtin_abort(tls) } @@ -53432,14 +55822,14 @@ _222: if _485_pCtx == nil { goto _no_mem } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X2))))) = nil - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X1))))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(*int32)(unsafe.Pointer(&(_485_pCtx.X4))) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X3))))) = _p - *(*uint8)(unsafe.Pointer(&(_485_pCtx.X8))) = uint8(_485_n) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-16)) - *(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _485_pCtx - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(151)) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_485_pCtx.X2)))) = nil + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_485_pCtx.X1)))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(*int32)(unsafe.Pointer(&_485_pCtx.X4)) = int32(int64((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 32)) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_485_pCtx.X3)))) = _p + *(*uint8)(unsafe.Pointer(&_485_pCtx.X8)) = uint8(_485_n) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-16)) + *(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) = _485_pCtx + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(151)) _223: func() { if int32(_pOp.X1) != i32(-16) { @@ -53447,18 +55837,18 @@ _223: crt.X__builtin_abort(tls) } }() - _486_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - _486_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _486_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + _486_pMem = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) if (*XMem)(_486_pCtx.X2) == _486_pMem { goto _1921 } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X2))))) = _486_pMem + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X2)))) = _486_pMem _486_i = int32(_486_pCtx.X8) - i32(1) _1922: if _486_i < i32(0) { goto _1925 } - *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 8*uintptr(_486_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr((_pOp.X4)+_486_i))) + *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X9)))) + 8*uintptr(_486_i))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X4+_486_i))) _486_i -= 1 goto _1922 _1925: @@ -53469,29 +55859,30 @@ _1926: goto _1929 } func() { - if (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 8*uintptr(_486_i)))).X1) & i32(128)) != i32(0) { + if (int32((*(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X9)))) + 8*uintptr(_486_i)))).X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64611))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { - _registerTrace(tls, (_pOp.X4)+_486_i, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 8*uintptr(_486_i)))) + if (_db.X6 & i32(1)) != 0 { + _registerTrace(tls, _pOp.X4+_486_i, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X9)))) + 8*uintptr(_486_i)))) } _486_i += 1 goto _1926 _1929: - *(*int32)(unsafe.Pointer(&(_486_pMem.X4))) += 1 + *(*int32)(unsafe.Pointer(&_486_pMem.X4)) += 1 _sqlite3VdbeMemInit(tls, &_486_t, _db, uint16(i32(1))) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X0))))) = &_486_t - *(*uint8)(unsafe.Pointer(&(_486_pCtx.X7))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_486_pCtx.X6))) = uint8(i32(0)) - (*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{((*XFuncDef)(_486_pCtx.X1).X4)})))(tls, _486_pCtx, int32(_486_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9)))))) - if (_486_pCtx.X7) == 0 { + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X0)))) = &_486_t + *(*uint8)(unsafe.Pointer(&_486_pCtx.X7)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_486_pCtx.X6)) = uint8(i32(0)) + func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) { + v := (*XFuncDef)(_486_pCtx.X1).X4 + return *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&v)) + }()(tls, _486_pCtx, int32(_486_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_486_pCtx.X9))))) + if _486_pCtx.X7 == 0 { goto _1933 } - if (_486_pCtx.X5) != 0 { + if _486_pCtx.X5 != 0 { _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, &_486_t))) _rc = _486_pCtx.X5 } @@ -53508,36 +55899,36 @@ _1933: } }() _1936: - if (_486_pCtx.X6) == 0 { + if _486_pCtx.X6 == 0 { goto _1939 } func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X0) != i32(68) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X0) != i32(68) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84594), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71204))) crt.X__builtin_abort(tls) } }() - _486_i = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(-1)))).X3 + _486_i = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(-1)))).X3 if _486_i != 0 { - _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_486_i))), int64(i32(1))) + _sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_486_i))), int64(i32(1))) } _1939: goto _250 _224: func() { - if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X3 <= i32(0) || _pOp.X3 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149))) crt.X__builtin_abort(tls) } }() - _493_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _493_pMem = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { if (int32(_493_pMem.X1) & i32(-8194)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71231))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3VdbeMemFinalize(tls, _493_pMem, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) + _rc = _sqlite3VdbeMemFinalize(tls, _493_pMem, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) if _rc != 0 { _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, _493_pMem))) goto _abort_due_to_error @@ -53549,20 +55940,20 @@ _224: goto _250 _225: func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(0) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(1)))) = store1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(2)))), i32(-1)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes)) + 4*uintptr(i32(1)))) = store1((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes))+4*uintptr(i32(2)))), i32(-1)) func() { - if (_pOp.X4) != i32(0) && (_pOp.X4) != i32(1) && (_pOp.X4) != i32(2) && (_pOp.X4) != i32(3) { + if _pOp.X4 != i32(0) && _pOp.X4 != i32(1) && _pOp.X4 != i32(2) && _pOp.X4 != i32(3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84652), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71270))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3Checkpoint(tls, _db, _pOp.X3, _pOp.X4, (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(1)))), (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(2))))) + _rc = _sqlite3Checkpoint(tls, _db, _pOp.X3, _pOp.X4, (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes))+4*uintptr(i32(1)))), (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes))+4*uintptr(i32(2))))) if _rc == 0 { goto _1957 } @@ -53570,14 +55961,14 @@ _225: goto _abort_due_to_error } _rc = i32(0) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(1) _1957: - *func() **XMem { _496_i = i32(0); return &_496_pMem }() = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + *func() **XMem { _496_i = i32(0); return &_496_pMem }() = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _1959: if _496_i >= i32(3) { goto _1962 } - _sqlite3VdbeMemSetInt64(tls, _496_pMem, int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(_496_i))))) + _sqlite3VdbeMemSetInt64(tls, _496_pMem, int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_496_aRes)) + 4*uintptr(_496_i))))) *(*uintptr)(unsafe.Pointer(func() **XMem { _496_i += 1; return &_496_pMem }())) += uintptr(72) goto _1959 _1962: @@ -53592,13 +55983,13 @@ _226: } }() func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84702), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } @@ -53619,7 +56010,7 @@ _226: if _499_eNew == _499_eOld || _499_eOld != i32(5) && _499_eNew != i32(5) { goto _1983 } - if ((_db.X15) == 0) || ((_db.X35) > i32(1)) { + if (_db.X15 == 0) || (_db.X35 > i32(1)) { _rc = i32(1) _sqlite3VdbeError(tls, _p, str(71648), unsafe.Pointer(func() *int8 { if _499_eNew == i32(5) { @@ -53661,10 +56052,10 @@ _1983: _499_eNew = _499_eOld } _499_eNew = _sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2562)) - *(**int8)(unsafe.Pointer(&(_pOut.X5))) = _sqlite3JournalModename(tls, _499_eNew) - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = _sqlite3Strlen30(tls, _pOut.X5) - *(*uint8)(unsafe.Pointer(&(_pOut.X2))) = uint8(i32(1)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(2562)) + *(**int8)(unsafe.Pointer(&_pOut.X5)) = _sqlite3JournalModename(tls, _499_eNew) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = _sqlite3Strlen30(tls, _pOut.X5) + *(*uint8)(unsafe.Pointer(&_pOut.X2)) = uint8(i32(1)) _sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding)) if _rc != 0 { goto _abort_due_to_error @@ -53672,31 +56063,31 @@ _1983: goto _250 _227: func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3RunVacuum(tls, (**int8)(unsafe.Pointer(&(_p.X22))), _db, _pOp.X3) + _rc = _sqlite3RunVacuum(tls, (**int8)(unsafe.Pointer(&_p.X22)), _db, _pOp.X3) if _rc != 0 { goto _abort_due_to_error } goto _250 _228: func() { - if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) { + if _pOp.X3 < i32(0) || _pOp.X3 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } @@ -53714,27 +56105,27 @@ _228: _2010: goto _250 _229: - if (_pOp.X3) == 0 { + if _pOp.X3 == 0 { _sqlite3ExpirePreparedStatements(tls, _db) goto _2013 } - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) _2013: goto _250 _230: _514_isWriteLock = uint8(_pOp.X5) - if _514_isWriteLock == 0 && i32(0) != ((_db.X6)&i32(16384)) { + if _514_isWriteLock == 0 && i32(0) != (_db.X6&i32(16384)) { goto _2015 } _515_p1 = _pOp.X3 func() { - if _515_p1 < i32(0) || _515_p1 >= (_db.X5) { + if _515_p1 < i32(0) || _515_p1 >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71742))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X33) & (u32(1) << uint(_515_p1))) == uint32(i32(0)) { + if (_p.X33 & (u32(1) << uint(_515_p1))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71762))) crt.X__builtin_abort(tls) } @@ -53750,7 +56141,7 @@ _230: goto _2024 } if (_rc & i32(255)) == i32(6) { - _517_z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) + _517_z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) _sqlite3VdbeError(tls, _p, str(71824), unsafe.Pointer(_517_z)) } goto _abort_due_to_error @@ -53758,7 +56149,7 @@ _2024: _2015: goto _250 _231: - _518_pVTab = (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + _518_pVTab = (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) _rc = _sqlite3VtabBegin(tls, _db, _518_pVTab) if _518_pVTab != nil { _sqlite3VtabImportErrmsg(tls, _p, (*Xsqlite3_vtab)(_518_pVTab.X2)) @@ -53768,21 +56159,21 @@ _231: } goto _250 _232: - crt.Xmemset(tls, (unsafe.Pointer)(&_519_sMem), i32(0), u64(72)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_519_sMem.X9))))) = _db + crt.Xmemset(tls, unsafe.Pointer(&_519_sMem), i32(0), u64(72)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_519_sMem.X9)))) = _db func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(2)) == i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(2)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84903), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71853))) crt.X__builtin_abort(tls) } }() func() { - if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(2048)) == i32(0) { + if (int32((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4))).X1) & i32(2048)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84904), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71888))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3VdbeMemCopy(tls, &_519_sMem, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOp.X4)))) + _rc = _sqlite3VdbeMemCopy(tls, &_519_sMem, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOp.X4)))) func() { if _rc != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012))) @@ -53791,13 +56182,13 @@ _232: }() _519_zTab = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, &_519_sMem))) func() { - if _519_zTab == nil && (_db.X17) == 0 { + if _519_zTab == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84908), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71926))) crt.X__builtin_abort(tls) } }() if _519_zTab != nil { - _rc = _sqlite3VtabCallCreate(tls, _db, _pOp.X3, _519_zTab, (**int8)(unsafe.Pointer(&(_p.X22)))) + _rc = _sqlite3VtabCallCreate(tls, _db, _pOp.X3, _519_zTab, (**int8)(unsafe.Pointer(&_p.X22))) } _sqlite3VdbeMemRelease(tls, &_519_sMem) if _rc != 0 { @@ -53805,23 +56196,23 @@ _232: } goto _250 _233: - *(*int32)(unsafe.Pointer(&(_db.X38))) += 1 - _rc = _sqlite3VtabCallDestroy(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(*int32)(unsafe.Pointer(&(_db.X38))) -= 1 + *(*int32)(unsafe.Pointer(&_db.X38)) += 1 + _rc = _sqlite3VtabCallDestroy(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(*int32)(unsafe.Pointer(&_db.X38)) -= 1 if _rc != 0 { goto _abort_due_to_error } goto _250 _234: func() { - if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_p.X32>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84946), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440))) crt.X__builtin_abort(tls) } }() _522_pCur = nil _522_pVCur = nil - _522_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2) + _522_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X2) if (_522_pVtab == nil) || func() int32 { if (*Xsqlite3_module)(_522_pVtab.X0) == nil { return func() int32 { @@ -53836,43 +56227,45 @@ _234: goto _abort_due_to_error } _522_pModule = (*Xsqlite3_module)(_522_pVtab.X0) - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32 - }{(_522_pModule.X6)})))(tls, _522_pVtab, &_522_pVCur) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_file) int32 { + v := _522_pModule.X6 + return *(*func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _522_pVtab, &_522_pVCur) _sqlite3VtabImportErrmsg(tls, _p, _522_pVtab) if _rc != 0 { goto _abort_due_to_error } - *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_522_pVCur.X0))))) = _522_pVtab + *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_522_pVCur.X0)))) = _522_pVtab _522_pCur = _allocateCursor(tls, _p, _pOp.X3, i32(0), i32(-1), uint8(i32(2))) if _522_pCur != nil { - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_522_pCur.X14))))))) = _522_pVCur - *(*int32)(unsafe.Pointer(&(_522_pVtab.X1))) += 1 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_522_pCur.X14)))))) = _522_pVCur + *(*int32)(unsafe.Pointer(&_522_pVtab.X1)) += 1 goto _2048 } func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_522_pModule.X7)})))(tls, _522_pVCur) + func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := _522_pModule.X7 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _522_pVCur) goto _no_mem _2048: goto _250 _235: - _526_pQuery = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) - _526_pArgc = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_pQuery)) + 72*uintptr(i32(1)))) - _526_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _526_pQuery = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) + _526_pArgc = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_526_pQuery)) + 72*uintptr(i32(1)))) + _526_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if (int32(_526_pQuery.X1) & i32(128)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71951))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _526_pQuery) } func() { @@ -53881,7 +56274,7 @@ _235: crt.X__builtin_abort(tls) } }() - _526_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_526_pCur.X14)))))) + _526_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_526_pCur.X14))))) _526_pVtab = (*Xsqlite3_vtab)(_526_pVCur.X0) _526_pModule = (*Xsqlite3_module)(_526_pVtab.X0) func() { @@ -53890,8 +56283,8 @@ _235: crt.X__builtin_abort(tls) } }() - _526_nArg = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_526_pArgc.X0)))))) - _526_iQuery = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_526_pQuery.X0)))))) + _526_nArg = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_526_pArgc.X0))))) + _526_iQuery = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_526_pQuery.X0))))) _526_res = i32(0) _526_apArg = (**XMem)(unsafe.Pointer(_p.X19)) _526_i = i32(0) @@ -53899,27 +56292,29 @@ _2059: if _526_i >= _526_nArg { goto _2062 } - *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_apArg)) + 8*uintptr(_526_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_pArgc)) + 72*uintptr(_526_i+i32(1)))) + *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_526_apArg)) + 8*uintptr(_526_i))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_526_pArgc)) + 72*uintptr(_526_i+i32(1)))) _526_i += 1 goto _2059 _2062: - _rc = (*(*func(*crt.TLS, *Xsqlite3_file, int32, *int8, int32, **XMem) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32 - }{(_526_pModule.X8)})))(tls, _526_pVCur, _526_iQuery, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), _526_nArg, _526_apArg) + _rc = func() func(*crt.TLS, *Xsqlite3_file, int32, *int8, int32, **XMem) int32 { + v := _526_pModule.X8 + return *(*func(*crt.TLS, *Xsqlite3_file, int32, *int8, int32, **XMem) int32)(unsafe.Pointer(&v)) + }()(tls, _526_pVCur, _526_iQuery, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))), _526_nArg, _526_apArg) _sqlite3VtabImportErrmsg(tls, _p, _526_pVtab) if _rc != 0 { goto _abort_due_to_error } - _526_res = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_526_pModule.X10)})))(tls, _526_pVCur) - *(*uint8)(unsafe.Pointer(&(_526_pCur.X2))) = uint8(i32(0)) + _526_res = func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := _526_pModule.X10 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _526_pVCur) + *(*uint8)(unsafe.Pointer(&_526_pCur.X2)) = uint8(i32(0)) if _526_res != 0 { goto _jump_to_p2 } goto _250 _236: - _528_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _528_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_528_pCur.X0) != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85056), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71970))) @@ -53927,39 +56322,38 @@ _236: } }() func() { - if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) { + if _pOp.X5 <= i32(0) || _pOp.X5 > ((_p.X6+i32(1))-_p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85057), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441))) crt.X__builtin_abort(tls) } }() - _528_pDest = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _528_pDest = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _sqlite3VdbeMemAboutToChange(tls, _p, _528_pDest) - if (_528_pCur.X2) != 0 { + if _528_pCur.X2 != 0 { _sqlite3VdbeMemSetNull(tls, _528_pDest) goto _250 } - _528_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_528_pCur.X14)))))).X0) + _528_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_528_pCur.X14))))).X0) _528_pModule = (*Xsqlite3_module)(_528_pVtab.X0) func() { - if (*(*func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32 - }{(_528_pModule.X11)}))) == nil { + if _528_pModule.X11 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85066), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72051))) crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_528_sContext), i32(0), u64(56)) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_528_sContext.X0))))) = _528_pDest - *(*uint16)(unsafe.Pointer(&(_528_pDest.X1))) = uint16((int32(_528_pDest.X1) & i32(-49664)) | i32(1)) - _rc = (*(*func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32 - }{(_528_pModule.X11)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_528_pCur.X14)))))), &_528_sContext, _pOp.X4) + crt.Xmemset(tls, unsafe.Pointer(&_528_sContext), i32(0), u64(56)) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_528_sContext.X0)))) = _528_pDest + *(*uint16)(unsafe.Pointer(&_528_pDest.X1)) = uint16((int32(_528_pDest.X1) & i32(-49664)) | i32(1)) + _rc = func() func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32 { + v := _528_pModule.X11 + return *(*func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_528_pCur.X14))))), &_528_sContext, _pOp.X4) _sqlite3VtabImportErrmsg(tls, _p, _528_pVtab) - if (_528_sContext.X5) != 0 { + if _528_sContext.X5 != 0 { _rc = _528_sContext.X5 } _sqlite3VdbeChangeEncoding(tls, _528_pDest, int32(_encoding)) - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X5, _528_pDest) } if _sqlite3VdbeMemTooBig(tls, _528_pDest) != 0 { @@ -53971,47 +56365,45 @@ _236: goto _250 _237: _532_res = i32(0) - _532_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_pOp.X3))) + _532_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_pOp.X3))) func() { if int32(_532_pCur.X0) != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85102), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71970))) crt.X__builtin_abort(tls) } }() - if (_532_pCur.X2) != 0 { + if _532_pCur.X2 != 0 { goto _250 } - _532_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14)))))).X0) + _532_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_532_pCur.X14))))).X0) _532_pModule = (*Xsqlite3_module)(_532_pVtab.X0) func() { - if (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_532_pModule.X9)}))) == nil { + if _532_pModule.X9 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85108), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72068))) crt.X__builtin_abort(tls) } }() - _rc = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_532_pModule.X9)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14))))))) + _rc = func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := _532_pModule.X9 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_532_pCur.X14)))))) _sqlite3VtabImportErrmsg(tls, _p, _532_pVtab) if _rc != 0 { goto _abort_due_to_error } - _532_res = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_532_pModule.X10)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14))))))) + _532_res = func() func(*crt.TLS, *Xsqlite3_file) int32 { + v := _532_pModule.X10 + return *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_532_pCur.X14)))))) if _532_res == 0 { goto _jump_to_p2_and_check_for_interrupt } goto _check_for_interrupt _238: - _535_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2) - _535_pName = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X3))) + _535_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X2) + _535_pName = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X3))) func() { - if (*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) int32 - }{((*Xsqlite3_module)(_535_pVtab.X0).X19)}))) == nil { + if ((*Xsqlite3_module)(_535_pVtab.X0).X19) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85142), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72083))) crt.X__builtin_abort(tls) } @@ -54023,12 +56415,12 @@ _238: } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) != 0 { + if (_db.X6 & i32(1)) != 0 { _registerTrace(tls, _pOp.X3, _535_pName) } func() { @@ -54041,29 +56433,30 @@ _238: if _rc != 0 { goto _abort_due_to_error } - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) int32 - }{((*Xsqlite3_module)(_535_pVtab.X0).X19)})))(tls, _535_pVtab, _535_pName.X5) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 { + v := (*Xsqlite3_module)(_535_pVtab.X0).X19 + return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _535_pVtab, _535_pName.X5) _sqlite3VtabImportErrmsg(tls, _p, _535_pVtab) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 1, 0) if _rc != 0 { goto _abort_due_to_error } goto _250 _239: func() { - if (_pOp.X4) != i32(1) && int32(_pOp.X2) != i32(3) && int32(_pOp.X2) != i32(1) && int32(_pOp.X2) != i32(2) && int32(_pOp.X2) != i32(4) && int32(_pOp.X2) != i32(5) { + if _pOp.X4 != i32(1) && int32(_pOp.X2) != i32(3) && int32(_pOp.X2) != i32(1) && int32(_pOp.X2) != i32(2) && int32(_pOp.X2) != i32(4) && int32(_pOp.X2) != i32(5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72148))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32((_p.X32)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_p.X32>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85200), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250))) crt.X__builtin_abort(tls) } }() - _536_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2) + _536_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X2) if (_536_pVtab == nil) || func() int32 { if (*Xsqlite3_module)(_536_pVtab.X0) == nil { return func() int32 { @@ -54086,9 +56479,7 @@ _239: } }() if func() int32 { - if (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32 - }{(_536_pModule.X13)}))) != nil { + if _536_pModule.X13 != nil { return i32(1) } return func() int32 { @@ -54101,7 +56492,7 @@ _239: } _538_vtabOnConflict = _db.X22 _536_apArg = (**XMem)(unsafe.Pointer(_p.X19)) - _536_pX = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 72*uintptr(_pOp.X5))) + _536_pX = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + 72*uintptr(_pOp.X5))) _536_i = i32(0) _2113: if _536_i >= _536_nArg { @@ -54114,34 +56505,35 @@ _2113: } }() _sqlite3VdbeMemAboutToChange(tls, _p, _536_pX) - *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 8*uintptr(_536_i))) = _536_pX + *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_536_apArg)) + 8*uintptr(_536_i))) = _536_pX *(*uintptr)(unsafe.Pointer(&_536_pX)) += uintptr(72) _536_i += 1 goto _2113 _2116: - *(*uint8)(unsafe.Pointer(&(_db.X22))) = uint8(_pOp.X2) - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32 - }{(_536_pModule.X13)})))(tls, _536_pVtab, _536_nArg, _536_apArg, &_536_rowid) - *(*uint8)(unsafe.Pointer(&(_db.X22))) = _538_vtabOnConflict + *(*uint8)(unsafe.Pointer(&_db.X22)) = uint8(_pOp.X2) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 { + v := _536_pModule.X13 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _536_pVtab, _536_nArg, _536_apArg, &_536_rowid) + *(*uint8)(unsafe.Pointer(&_db.X22)) = _538_vtabOnConflict _sqlite3VtabImportErrmsg(tls, _p, _536_pVtab) - if (_rc == i32(0)) && (_pOp.X3) != 0 { + if (_rc == i32(0)) && _pOp.X3 != 0 { func() { - if _536_nArg <= i32(1) || (*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 8*uintptr(i32(0))))) == nil || (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 8*uintptr(i32(0))))).X1)&i32(1)) == 0 { + if _536_nArg <= i32(1) || (*(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_536_apArg)) + 8*uintptr(i32(0))))) == nil || (int32((*(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_536_apArg)) + 8*uintptr(i32(0))))).X1)&i32(1)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72305))) crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_db.X7))) = _536_rowid + *(*int64)(unsafe.Pointer(&_db.X7)) = _536_rowid } - if (_rc&i32(255)) != i32(19) || ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X4) == 0 { + if (_rc&i32(255)) != i32(19) || ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))).X4) == 0 { goto _2126 } if int32(_pOp.X2) == i32(4) { _rc = i32(0) goto _2128 } - *(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_p.X30)) = uint8(func() int32 { if int32(_pOp.X2) == i32(5) { return i32(2) } @@ -54150,7 +56542,7 @@ _2116: _2128: goto _2131 _2126: - *(*int32)(unsafe.Pointer(&(_p.X11))) += 1 + *(*int32)(unsafe.Pointer(&_p.X11)) += 1 _2131: if _rc != 0 { goto _abort_due_to_error @@ -54159,13 +56551,13 @@ _2112: goto _250 _240: _pOut = _out2Prerelease(tls, _p, _pOp) - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_sqlite3BtreeLastPage(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_pOp.X3))).X1))) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_sqlite3BtreeLastPage(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_pOp.X3))).X1))) goto _250 _241: _pOut = _out2Prerelease(tls, _p, _pOp) _546_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_pOp.X3))).X1) _546_newMax = uint32(i32(0)) - if (_pOp.X5) == 0 { + if _pOp.X5 == 0 { goto _2133 } _546_newMax = _sqlite3BtreeLastPage(tls, _546_pBt) @@ -54173,11 +56565,11 @@ _241: _546_newMax = uint32(_pOp.X5) } _2133: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_sqlite3BtreeMaxPageCount(tls, _546_pBt, int32(_546_newMax))) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pOut.X0)))) = int64(_sqlite3BtreeMaxPageCount(tls, _546_pBt, int32(_546_newMax))) goto _250 _242: func() { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil && crt.Xstrncmp(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), str(72354), uint64(i32(3))) != i32(0) { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil && crt.Xstrncmp(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))), str(72354), uint64(i32(3))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85309), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72358))) crt.X__builtin_abort(tls) } @@ -54188,52 +56580,53 @@ _242: crt.X__builtin_abort(tls) } }() - if (int32(_db.X24)&i32(129)) == i32(0) || ((uint32((_p.X32)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != 0 || store0(&_548_zTrace, func() *int8 { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil { - return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + if (int32(_db.X24)&i32(129)) == i32(0) || ((uint32(_p.X32>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != 0 || store0(&_548_zTrace, func() *int8 { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil { + return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) } - return (_p.X36) + return _p.X36 }()) == nil { goto _2144 } if (int32(_db.X24) & i32(128)) != 0 { - _550_x = *(*func(*crt.TLS, unsafe.Pointer, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32 - }{(_db.X41)})) + _550_x = func() func(*crt.TLS, unsafe.Pointer, *int8) { + v := _db.X41 + return *(*func(*crt.TLS, unsafe.Pointer, *int8))(unsafe.Pointer(&v)) + }() _550_z = _sqlite3VdbeExpandSql(tls, _p, _548_zTrace) _550_x(tls, _db.X42, _550_z) - Xsqlite3_free(tls, (unsafe.Pointer)(_550_z)) + Xsqlite3_free(tls, unsafe.Pointer(_550_z)) goto _2148 } - if (_db.X37) > i32(1) { + if _db.X37 > i32(1) { _551_z = _sqlite3MPrintf(tls, _db, str(72421), unsafe.Pointer(_548_zTrace)) - (_db.X41)(tls, uint32(i32(1)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(_551_z)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_551_z)) + _db.X41(tls, uint32(i32(1)), _db.X42, unsafe.Pointer(_p), unsafe.Pointer(_551_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_551_z)) goto _2148 } - (_db.X41)(tls, uint32(i32(1)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(_548_zTrace)) + _db.X41(tls, uint32(i32(1)), _db.X42, unsafe.Pointer(_p), unsafe.Pointer(_548_zTrace)) _2148: _2144: - if (((_db.X6) & i32(512)) != i32(0)) && (store0(&_548_zTrace, func() *int8 { - if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil { - return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + if ((_db.X6 & i32(512)) != i32(0)) && (store0(&_548_zTrace, func() *int8 { + if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) != nil { + return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) } - return (_p.X36) + return _p.X36 }()) != nil) { _sqlite3DebugPrintf(tls, str(72427), unsafe.Pointer(_548_zTrace)) } func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85351), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } }() - if (_pOp.X3) < (_sqlite3Config.X39) { + if _pOp.X3 < _sqlite3Config.X39 { goto _2155 } _548_i = i32(1) _2156: - if _548_i >= (_p.X27) { + if _548_i >= _p.X27 { goto _2159 } if int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_548_i))).X0) == i32(20) { @@ -54242,9 +56635,9 @@ _2156: _548_i += 1 goto _2156 _2159: - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = i32(0) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = i32(0) _2155: - *(*int32)(unsafe.Pointer(&(_pOp.X3))) += 1 + *(*int32)(unsafe.Pointer(&_pOp.X3)) += 1 goto _jump_to_p2 _243: func() { @@ -54256,29 +56649,29 @@ _243: goto _250 _250: func() { - if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+32*uintptr(i32(-1)))))) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+32*uintptr((_p.X27)-i32(1)))))) { + if crt.P2U(unsafe.Pointer(_pOp)) < crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+32*uintptr(i32(-1)))))) || crt.P2U(unsafe.Pointer(_pOp)) >= crt.P2U(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+32*uintptr(_p.X27-i32(1)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85423), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72490))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(1)) == 0 { + if (_db.X6 & i32(1)) == 0 { goto _2167 } - _557_opProperty = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOrigOp.X0))) + _557_opProperty = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOrigOp.X0))) if _rc != i32(0) { crt.Xprintf(tls, str(72526), _rc) } if (int32(_557_opProperty) & i32(16)) != 0 { - _registerTrace(tls, _pOrigOp.X4, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOrigOp.X4)))) + _registerTrace(tls, _pOrigOp.X4, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOrigOp.X4)))) } if (int32(_557_opProperty) & i32(32)) != 0 { - _registerTrace(tls, _pOrigOp.X5, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+72*uintptr(_pOrigOp.X5)))) + _registerTrace(tls, _pOrigOp.X5, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+72*uintptr(_pOrigOp.X5)))) } _2167: *(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(32) goto _30 _abort_due_to_error: - if (_db.X17) != 0 { + if _db.X17 != 0 { _rc = _sqlite3NomemError(tls, i32(85444)) } func() { @@ -54287,10 +56680,10 @@ _abort_due_to_error: crt.X__builtin_abort(tls) } }() - if ((_p.X22) == nil) && (_rc != i32(3082)) { + if (_p.X22 == nil) && (_rc != i32(3082)) { _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc))) } - *(*int32)(unsafe.Pointer(&(_p.X10))) = _rc + *(*int32)(unsafe.Pointer(&_p.X10)) = _rc _sqlite3SystemError(tls, _db, _rc) Xsqlite3_log(tls, _rc, str(72536), int32(int64((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/32)), unsafe.Pointer(_p.X36), unsafe.Pointer(_p.X22)) _sqlite3VdbeHalt(tls, _p) @@ -54303,7 +56696,7 @@ _abort_due_to_error: } _vdbe_return: { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(4)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_p.X35)))) + 4*uintptr(i32(4)))) *p = (*p) + uint32(int32(_nVmStep)) sink5(*p) } @@ -54327,18 +56720,18 @@ _no_mem: goto _abort_due_to_error _abort_due_to_interrupt: func() { - if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) == 0 { + if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72652))) crt.X__builtin_abort(tls) } }() _rc = func() int32 { - if (_db.X17) != 0 { + if _db.X17 != 0 { return _sqlite3NomemError(tls, i32(85494)) } return i32(9) }() - *(*int32)(unsafe.Pointer(&(_p.X10))) = _rc + *(*int32)(unsafe.Pointer(&_p.X10)) = _rc _sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc))) goto _abort_due_to_error _ = _94_uA @@ -54364,25 +56757,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeExecØ00__func__Ø000[0], str(72673), 16) } -// Print the SQL that was used to generate a VDBE program. +// C comment +// /* +// ** Print the SQL that was used to generate a VDBE program. +// */ func _sqlite3VdbePrintSql(tls *crt.TLS, _p *TVdbe) { var _z *int8 var _2_pOp *XVdbeOp _z = nil - if (_p.X36) != nil { + if _p.X36 != nil { _z = _p.X36 goto _2 } - if (_p.X27) < i32(1) { + if _p.X27 < i32(1) { goto _2 } _2_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(i32(0)))) - if int32(_2_pOp.X0) != i32(51) || (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_2_pOp.X6)))))) == nil { + if int32(_2_pOp.X0) != i32(51) || (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_2_pOp.X6))))) == nil { goto _4 } - _z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_2_pOp.X6))))) + _z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_2_pOp.X6)))) _5: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _5 } @@ -54400,7 +56796,10 @@ func _registerTrace(tls *crt.TLS, _iReg int32, _p *XMem) { _sqlite3VdbeCheckMemInvariants(tls, _p) } -// Print the value of a register for tracing purposes: +// C comment +// /* +// ** Print the value of a register for tracing purposes: +// */ func _memTracePrint(tls *crt.TLS, _p *XMem) { var _7_zBuf [200]int8 if (int32(_p.X1) & i32(128)) != 0 { @@ -54412,15 +56811,15 @@ func _memTracePrint(tls *crt.TLS, _p *XMem) { goto _11 } if (int32(_p.X1) & i32(6)) == i32(6) { - crt.Xprintf(tls, str(72728), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) + crt.Xprintf(tls, str(72728), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) goto _11 } if (int32(_p.X1) & i32(4)) != 0 { - crt.Xprintf(tls, str(72737), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) + crt.Xprintf(tls, str(72737), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) goto _11 } if (int32(_p.X1) & i32(8)) != 0 { - crt.Xprintf(tls, str(72745), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) + crt.Xprintf(tls, str(72745), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) goto _11 } if (int32(_p.X1) & i32(32)) != 0 { @@ -54436,8 +56835,11 @@ _11: _ = _7_zBuf } -// Write a nice string representation of the contents of cell pMem -// into buffer zBuf, length nBuf. +// C comment +// /* +// ** Write a nice string representation of the contents of cell pMem +// ** into buffer zBuf, length nBuf. +// */ func _sqlite3VdbeMemPrettyPrint(tls *crt.TLS, _pMem *XMem, _zBuf *int8) { var _f, _1_i, _9_j, _9_k int32 var _1_c, _7_z int8 @@ -54484,18 +56886,18 @@ _12: Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72868), _pMem.X4) { p := &_zCsr - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) sink0(*p) } _1_i = i32(0) _13: - if _1_i >= i32(16) || _1_i >= (_pMem.X4) { + if _1_i >= i32(16) || _1_i >= _pMem.X4 { goto _17 } - Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72872), int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_1_i))))&i32(255)) + Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72872), int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_1_i))))&i32(255)) { p := &_zCsr - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) sink0(*p) } _1_i += 1 @@ -54503,10 +56905,10 @@ _13: _17: _1_i = i32(0) _18: - if _1_i >= i32(16) || _1_i >= (_pMem.X4) { + if _1_i >= i32(16) || _1_i >= _pMem.X4 { goto _22 } - _7_z = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_1_i))) + _7_z = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_1_i))) if (int32(_7_z) < i32(32)) || (int32(_7_z) > i32(126)) { *postInc0(&_zCsr, 1) = int8(i32(46)) goto _25 @@ -54518,10 +56920,10 @@ _25: _22: *postInc0(&_zCsr, 1) = int8(i32(93)) if (_f & i32(16384)) != 0 { - Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72877), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72877), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) { p := &_zCsr - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr)))) sink0(*p) } } @@ -54531,9 +56933,9 @@ _0: if (_f & i32(2)) == 0 { goto _28 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(32)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(32)) if (_f & i32(1024)) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(122)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(122)) func() { if (_f & i32(6144)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78630), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72777))) @@ -54543,7 +56945,7 @@ _0: goto _40 } if (_f & i32(2048)) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(116)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(116)) func() { if (_f & i32(5120)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78633), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72809))) @@ -54553,7 +56955,7 @@ _0: goto _40 } if (_f & i32(4096)) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(101)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(101)) func() { if (_f & i32(3072)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78636), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72838))) @@ -54562,39 +56964,39 @@ _0: }() goto _40 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(115)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(115)) _40: _9_k = i32(2) - Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))), str(37915), _pMem.X4) + Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf))+1*uintptr(_9_k))), str(37915), _pMem.X4) { p := &_9_k - *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k)))) + *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf))+1*uintptr(_9_k)))) sink1(*p) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(91)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc1(&_9_k, 1)))) = int8(i32(91)) _9_j = i32(0) _41: - if _9_j >= i32(15) || _9_j >= (_pMem.X4) { + if _9_j >= i32(15) || _9_j >= _pMem.X4 { goto _45 } - _14_c = uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_9_j)))) + _14_c = uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_9_j)))) if (int32(_14_c) >= i32(32)) && (int32(_14_c) < i32(127)) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(_14_c) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc1(&_9_k, 1)))) = int8(_14_c) goto _48 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(46)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc1(&_9_k, 1)))) = int8(i32(46)) _48: _9_j += 1 goto _41 _45: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(93)) - Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeMemPrettyPrintØ00encnamesØ001)) + 8*uintptr(_pMem.X2)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc1(&_9_k, 1)))) = int8(i32(93)) + Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf))+1*uintptr(_9_k))), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00encnamesØ001)) + 8*uintptr(_pMem.X2)))) { p := &_9_k - *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k)))) + *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf))+1*uintptr(_9_k)))) sink1(*p) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc1(&_9_k, 1)))) = int8(i32(0)) _28: } @@ -54610,32 +57012,35 @@ func init() { _sqlite3VdbeMemPrettyPrintØ00encnamesØ001 = [4]*int8{str(72908), str(72912), str(72916), str(72923)} } -// This routine prepares a memory cell for modification by breaking -// its link to a shallow copy and by marking any current shallow -// copies of this cell as invalid. -// -// This is used for testing and debugging only - to make sure shallow -// copies are not misused. +// C comment +// /* +// ** This routine prepares a memory cell for modification by breaking +// ** its link to a shallow copy and by marking any current shallow +// ** copies of this cell as invalid. +// ** +// ** This is used for testing and debugging only - to make sure shallow +// ** copies are not misused. +// */ func _sqlite3VdbeMemAboutToChange(tls *crt.TLS, _pVdbe *TVdbe, _pMem *XMem) { var _i int32 var _pX *XMem *func() **XMem { _i = i32(0); return &_pX }() = (*XMem)(_pVdbe.X18) _0: - if _i >= (_pVdbe.X6) { + if _i >= _pVdbe.X6 { goto _3 } if (*XMem)(_pX.X11) == _pMem { { - p := (*uint16)(unsafe.Pointer(&(_pX.X1))) + p := (*uint16)(unsafe.Pointer(&_pX.X1)) *p = uint16(int32(*p) | i32(128)) sink14(*p) } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X11))))) = nil + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pX.X11)))) = nil } *(*uintptr)(unsafe.Pointer(func() **XMem { _i += 1; return &_pX }())) += uintptr(72) goto _0 _3: - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X11))))) = nil + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.X11)))) = nil } var _sqlite3VdbeExecØ00azTypeØ001 [4]*int8 @@ -54647,13 +57052,13 @@ func init() { func _out2Prerelease(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp) (r0 *XMem) { var _pOut *XMem func() { - if (_pOp.X4) <= i32(0) { + if _pOp.X4 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78831), unsafe.Pointer((*int8)(unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000))), unsafe.Pointer(str(62895))) crt.X__builtin_abort(tls) } }() func() { - if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) { + if _pOp.X4 > ((_p.X6 + i32(1)) - _p.X7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78832), unsafe.Pointer((*int8)(unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000))), unsafe.Pointer(str(62905))) crt.X__builtin_abort(tls) } @@ -54663,7 +57068,7 @@ func _out2Prerelease(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp) (r0 *XMem) { if (int32(_pOut.X1) & i32(9312)) != i32(0) { return _out2PrereleaseWithClear(tls, _pOut) } - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) return _pOut } @@ -54673,16 +57078,22 @@ func init() { crt.Xstrncpy(nil, &_out2PrereleaseØ00__func__Ø000[0], str(72951), 15) } -// Return the register of pOp->p2 after first preparing it to be -// overwritten with an integer value. +// C comment +// /* +// ** Return the register of pOp->p2 after first preparing it to be +// ** overwritten with an integer value. +// */ func _out2PrereleaseWithClear(tls *crt.TLS, _pOut *XMem) (r0 *XMem) { _sqlite3VdbeMemSetNull(tls, _pOut) - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4)) + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16(i32(4)) return _pOut } -// Return true if the Mem object contains a TEXT or BLOB that is -// too large - whose size exceeds SQLITE_MAX_LENGTH. +// C comment +// /* +// ** Return true if the Mem object contains a TEXT or BLOB that is +// ** too large - whose size exceeds SQLITE_MAX_LENGTH. +// */ func _sqlite3VdbeMemTooBig(tls *crt.TLS, _p *XMem) (r0 int32) { var _1_n int32 func() { @@ -54698,11 +57109,11 @@ func _sqlite3VdbeMemTooBig(tls *crt.TLS, _p *XMem) (r0 int32) { if (int32(_p.X1) & i32(16384)) != 0 { { p := &_1_n - *p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))) + *p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_p.X0))))) sink1(*p) } } - return bool2int(_1_n > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X9).X31))))) + 4*uintptr(i32(0)))))) + return bool2int(_1_n > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X9).X31))))) + 4*uintptr(i32(0)))))) _2: return i32(0) @@ -54731,10 +57142,10 @@ func _sqlite3VdbeMemShallowCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _srcType _vdbeClrCopy(tls, _pTo, _pFrom, _srcType) return } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u64(24)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), u64(24)) if (int32(_pFrom.X1) & i32(2048)) == i32(0) { { - p := (*uint16)(unsafe.Pointer(&(_pTo.X1))) + p := (*uint16)(unsafe.Pointer(&_pTo.X1)) *p = uint16(int32(*p) & i32(-7169)) sink14(*p) } @@ -54745,7 +57156,7 @@ func _sqlite3VdbeMemShallowCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _srcType } }() { - p := (*uint16)(unsafe.Pointer(&(_pTo.X1))) + p := (*uint16)(unsafe.Pointer(&_pTo.X1)) *p = uint16(int32(*p) | _srcType) sink14(*p) } @@ -54758,10 +57169,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemShallowCopyØ00__func__Ø000[0], str(73079), 26) } -// Make an shallow copy of pFrom into pTo. Prior contents of -// pTo are freed. The pFrom->z field is not duplicated. If -// pFrom->z is used, then pTo->z points to the same thing as pFrom->z -// and flags gets srcType (either MEM_Ephem or MEM_Static). +// C comment +// /* +// ** Make an shallow copy of pFrom into pTo. Prior contents of +// ** pTo are freed. The pFrom->z field is not duplicated. If +// ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z +// ** and flags gets srcType (either MEM_Ephem or MEM_Static). +// */ func _vdbeClrCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _eType int32) { _vdbeMemClearExternAndSetNull(tls, _pTo) func() { @@ -54779,10 +57193,13 @@ func init() { crt.Xstrncpy(nil, &_vdbeClrCopyØ00__func__Ø000[0], str(73126), 12) } -// Transfer the contents of pFrom to pTo. Any existing value in pTo is -// freed. If pFrom contains ephemeral data, a copy is made. -// -// pFrom contains an SQL NULL when this routine returns. +// C comment +// /* +// ** Transfer the contents of pFrom to pTo. Any existing value in pTo is +// ** freed. If pFrom contains ephemeral data, a copy is made. +// ** +// ** pFrom contains an SQL NULL when this routine returns. +// */ func _sqlite3VdbeMemMove(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) { func() { if (*Xsqlite3)(_pFrom.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pFrom.X9).X3)) == 0 { @@ -54803,9 +57220,9 @@ func _sqlite3VdbeMemMove(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) { } }() _sqlite3VdbeMemRelease(tls, _pTo) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u64(72)) - *(*uint16)(unsafe.Pointer(&(_pFrom.X1))) = uint16(i32(1)) - *(*int32)(unsafe.Pointer(&(_pFrom.X7))) = i32(0) + crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), u64(72)) + *(*uint16)(unsafe.Pointer(&_pFrom.X1)) = uint16(i32(1)) + *(*int32)(unsafe.Pointer(&_pFrom.X7)) = i32(0) } var _sqlite3VdbeMemMoveØ00__func__Ø000 [19]int8 @@ -54814,11 +57231,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemMoveØ00__func__Ø000[0], str(73289), 19) } -// Return the numeric type for pMem, either MEM_Int or MEM_Real or both or -// none. -// -// Unlike applyNumericAffinity(), this routine does not modify pMem->flags. -// But it does set pMem->u.r and pMem->u.i appropriately. +// C comment +// /* +// ** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or +// ** none. +// ** +// ** Unlike applyNumericAffinity(), this routine does not modify pMem->flags. +// ** But it does set pMem->u.r and pMem->u.i appropriately. +// */ func _numericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) { if (int32(_pMem.X1) & i32(12)) != 0 { return uint16(int32(_pMem.X1) & i32(12)) @@ -54829,10 +57249,13 @@ func _numericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) { return uint16(i32(0)) } -// pMem currently only holds a string type (or maybe a BLOB that we can -// interpret as a string if we want to). Compute its corresponding -// numeric type, if has one. Set the pMem->u.r and pMem->u.i fields -// accordingly. +// C comment +// /* +// ** pMem currently only holds a string type (or maybe a BLOB that we can +// ** interpret as a string if we want to). Compute its corresponding +// ** numeric type, if has one. Set the pMem->u.r and pMem->u.i fields +// ** accordingly. +// */ func _computeNumericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) { func() { if (int32(_pMem.X1) & i32(12)) != i32(0) { @@ -54846,10 +57269,10 @@ func _computeNumericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) { crt.X__builtin_abort(tls) } }() - if _sqlite3AtoF(tls, _pMem.X5, (*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) == i32(0) { + if _sqlite3AtoF(tls, _pMem.X5, (*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))), _pMem.X4, _pMem.X2) == i32(0) { return uint16(i32(0)) } - if _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) == i32(0) { + if _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))), _pMem.X4, _pMem.X2) == i32(0) { return uint16(i32(4)) } return uint16(i32(8)) @@ -54861,10 +57284,13 @@ func init() { crt.Xstrncpy(nil, &_computeNumericTypeØ00__func__Ø000[0], str(73384), 19) } -// Attempt to add, substract, or multiply the 64-bit signed value iB against -// the other 64-bit signed integer at *pA and store the result in *pA. -// Return 0 on success. Or if the operation would have resulted in an -// overflow, leave *pA unchanged and return 1. +// C comment +// /* +// ** Attempt to add, substract, or multiply the 64-bit signed value iB against +// ** the other 64-bit signed integer at *pA and store the result in *pA. +// ** Return 0 on success. Or if the operation would have resulted in an +// ** overflow, leave *pA unchanged and return 1. +// */ func _sqlite3AddInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) { var _iA int64 _iA = *_pA @@ -54949,13 +57375,16 @@ _4: return i32(0) } -// Compare the values contained by the two memory cells, returning -// negative, zero or positive if pMem1 is less than, equal to, or greater -// than pMem2. Sorting order is NULL's first, followed by numbers (integers -// and reals) sorted numerically, followed by text ordered by the collating -// sequence pColl and finally blob's ordered by memcmp(). -// -// Two NULL values are considered equal by this function. +// C comment +// /* +// ** Compare the values contained by the two memory cells, returning +// ** negative, zero or positive if pMem1 is less than, equal to, or greater +// ** than pMem2. Sorting order is NULL's first, followed by numbers (integers +// ** and reals) sorted numerically, followed by text ordered by the collating +// ** sequence pColl and finally blob's ordered by memcmp(). +// ** +// ** Two NULL values are considered equal by this function. +// */ func _sqlite3MemCompare(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq) (r0 int32) { var _f1, _f2, _combined_flags int32 _f1 = int32(_pMem1.X1) @@ -54976,10 +57405,10 @@ func _sqlite3MemCompare(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollS if ((_f1 & _f2) & i32(4)) == i32(0) { goto _4 } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0))))) { return i32(-1) } - if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) { + if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0))))) { return i32(1) } return i32(0) @@ -54988,10 +57417,10 @@ _4: if ((_f1 & _f2) & i32(8)) == i32(0) { goto _7 } - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0))))) { return i32(-1) } - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0))))) { return i32(1) } return i32(0) @@ -55001,7 +57430,7 @@ _7: goto _10 } if (_f2 & i32(8)) != i32(0) { - return _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) + return _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0)))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0))))) } return i32(-1) @@ -55010,7 +57439,7 @@ _10: goto _13 } if (_f2 & i32(4)) != i32(0) { - return -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) + return -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem2.X0)))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem1.X0))))) } return i32(-1) @@ -55040,7 +57469,7 @@ _3: } }() func() { - if _pColl != nil && (_pColl.X3) == nil { + if _pColl != nil && _pColl.X3 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75321), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000))), unsafe.Pointer(str(73570))) crt.X__builtin_abort(tls) } @@ -55058,9 +57487,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MemCompareØ00__func__Ø000[0], str(73592), 18) } -// Do a comparison between a 64-bit signed integer and a 64-bit floating-point -// number. Return negative, zero, or positive if the first (i64) is less than, -// equal to, or greater than the second (double). +// C comment +// /* +// ** Do a comparison between a 64-bit signed integer and a 64-bit floating-point +// ** number. Return negative, zero, or positive if the first (i64) is less than, +// ** equal to, or greater than the second (double). +// */ func _sqlite3IntFloatCompare(tls *crt.TLS, _i int64, _r float64) (r0 int32) { var _2_y int64 var _1_x, _2_s float64 @@ -55098,16 +57530,19 @@ _7: panic(0) } -// Both *pMem1 and *pMem2 contain string values. Compare the two values -// using the collation sequence pColl. As usual, return a negative , zero -// or positive value if *pMem1 is less than, equal to or greater than -// *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);". +// C comment +// /* +// ** Both *pMem1 and *pMem2 contain string values. Compare the two values +// ** using the collation sequence pColl. As usual, return a negative , zero +// ** or positive value if *pMem1 is less than, equal to or greater than +// ** *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);". +// */ func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq, _prcErr *uint8) (r0 int32) { var _2_rc, _2_n1, _2_n2 int32 var _2_v1, _2_v2 unsafe.Pointer var _2_c1, _2_c2 XMem if int32(_pMem1.X2) == int32(_pColl.X1) { - return (_pColl.X3)(tls, _pColl.X2, _pMem1.X4, (unsafe.Pointer)(_pMem1.X5), _pMem2.X4, (unsafe.Pointer)(_pMem2.X5)) + return _pColl.X3(tls, _pColl.X2, _pMem1.X4, unsafe.Pointer(_pMem1.X5), _pMem2.X4, unsafe.Pointer(_pMem2.X5)) } _sqlite3VdbeMemInit(tls, &_2_c1, (*Xsqlite3)(_pMem1.X9), uint16(i32(1))) _sqlite3VdbeMemInit(tls, &_2_c2, (*Xsqlite3)(_pMem1.X9), uint16(i32(1))) @@ -55118,16 +57553,16 @@ func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCo if _2_v1 == nil { return i32(0) } - return (_2_c1.X4) + return _2_c1.X4 }() _2_v2 = _sqlite3ValueText(tls, &_2_c2, _pColl.X1) _2_n2 = func() int32 { if _2_v2 == nil { return i32(0) } - return (_2_c2.X4) + return _2_c2.X4 }() - _2_rc = (_pColl.X3)(tls, _pColl.X2, _2_n1, _2_v1, _2_n2, _2_v2) + _2_rc = _pColl.X3(tls, _pColl.X2, _2_n1, _2_v1, _2_n2, _2_v2) if ((_2_v1 == nil) || (_2_v2 == nil)) && (_prcErr != nil) { *_prcErr = uint8(_sqlite3NomemError(tls, i32(75166))) } @@ -55140,9 +57575,12 @@ func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCo panic(0) } -// Initialize bulk memory to be a consistent Mem object. -// -// The minimum amount of initialization feasible is performed. +// C comment +// /* +// ** Initialize bulk memory to be a consistent Mem object. +// ** +// ** The minimum amount of initialization feasible is performed. +// */ func _sqlite3VdbeMemInit(tls *crt.TLS, _pMem *XMem, _db *Xsqlite3, _flags uint16) { func() { if (int32(_flags) & i32(-33280)) != i32(0) { @@ -55150,9 +57588,9 @@ func _sqlite3VdbeMemInit(tls *crt.TLS, _pMem *XMem, _db *Xsqlite3, _flags uint16 crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = _flags - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X9))))) = _db - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = _flags + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.X9)))) = _db + *(*int32)(unsafe.Pointer(&_pMem.X7)) = i32(0) } var _sqlite3VdbeMemInitØ00__func__Ø000 [19]int8 @@ -55161,9 +57599,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemInitØ00__func__Ø000[0], str(73637), 19) } -// Compare two blobs. Return negative, zero, or positive if the first -// is less than, equal to, or greater than the second, respectively. -// If one blob is a prefix of the other, then the shorter is the lessor. +// C comment +// /* +// ** Compare two blobs. Return negative, zero, or positive if the first +// ** is less than, equal to, or greater than the second, respectively. +// ** If one blob is a prefix of the other, then the shorter is the lessor. +// */ func _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) { var _c, _n1, _n2 int32 _n1 = _pB1.X4 @@ -55184,7 +57625,7 @@ func _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) { goto _6 } if ((int32(_pB1.X1) & int32(_pB2.X1)) & i32(16384)) != 0 { - return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB1.X0)))))) - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB2.X0)))))) + return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pB1.X0))))) - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pB2.X0))))) } if (int32(_pB1.X1) & i32(16384)) == 0 { goto _9 @@ -55192,16 +57633,16 @@ func _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) { if _isAllZero(tls, _pB2.X5, _pB2.X4) == 0 { return i32(-1) } - return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB1.X0)))))) - _n2 + return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pB1.X0))))) - _n2 _9: if _isAllZero(tls, _pB1.X5, _pB1.X4) == 0 { return i32(1) } - return _n1 - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB2.X0)))))) + return _n1 - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pB2.X0))))) _6: - _c = crt.Xmemcmp(tls, (unsafe.Pointer)(_pB1.X5), (unsafe.Pointer)(_pB2.X5), uint64(func() int32 { + _c = crt.Xmemcmp(tls, unsafe.Pointer(_pB1.X5), unsafe.Pointer(_pB2.X5), uint64(func() int32 { if _n1 > _n2 { return _n2 } @@ -55219,8 +57660,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BlobCompareØ00__func__Ø000[0], str(73728), 19) } -// The input pBlob is guaranteed to be a Blob that is not marked -// with MEM_Zero. Return true if it could be a zero-blob. +// C comment +// /* +// ** The input pBlob is guaranteed to be a Blob that is not marked +// ** with MEM_Zero. Return true if it could be a zero-blob. +// */ func _isAllZero(tls *crt.TLS, _z *int8, _n int32) (r0 int32) { var _i int32 _i = i32(0) @@ -55228,7 +57672,7 @@ _0: if _i >= _n { goto _3 } - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != 0 { return i32(0) } _i += 1 @@ -55249,17 +57693,20 @@ func init() { _sqlite3VdbeExecØ00or_logicØ003 = [9]uint8{0, 1, 2, 1, 1, 1, 2, 1, 2} } -// Make sure the cursor p is ready to read or write the row to which it -// was last positioned. Return an error code if an OOM fault or I/O error -// prevents us from positioning the cursor to its correct position. -// -// If a MoveTo operation is pending on the given cursor, then do that -// MoveTo now. If no move is pending, check to see if the row has been -// deleted out from under the cursor and if it has, mark the row as -// a NULL row. -// -// If the cursor is already pointing to the correct row and that row has -// not been deleted out from under the cursor, then this routine is a no-op. +// C comment +// /* +// ** Make sure the cursor p is ready to read or write the row to which it +// ** was last positioned. Return an error code if an OOM fault or I/O error +// ** prevents us from positioning the cursor to its correct position. +// ** +// ** If a MoveTo operation is pending on the given cursor, then do that +// ** MoveTo now. If no move is pending, check to see if the row has been +// ** deleted out from under the cursor and if it has, mark the row as +// ** a NULL row. +// ** +// ** If the cursor is already pointing to the correct row and that row has +// ** not been deleted out from under the cursor, then this routine is a no-op. +// */ func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r0 int32) { var _2_iMap int32 var _p *XVdbeCursor @@ -55267,10 +57714,10 @@ func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r if int32(_p.X0) != i32(0) { goto _0 } - if (_p.X3) == 0 { + if _p.X3 == 0 { goto _1 } - if ((_p.X10) != nil) && (store1(&_2_iMap, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X10)) + 4*uintptr(i32(1)+(*_piCol))))) > i32(0)) { + if (_p.X10 != nil) && (store1(&_2_iMap, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X10)) + 4*uintptr(i32(1)+(*_piCol))))) > i32(0)) { *_pp = (*XVdbeCursor)(_p.X13) *_piCol = _2_iMap - i32(1) return i32(0) @@ -55278,26 +57725,29 @@ func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r return _handleDeferredMoveto(tls, _p) _1: - if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) != 0 { + if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14)))))) != 0 { return _handleMovedCursor(tls, _p) } _0: return i32(0) } -// The cursor "p" has a pending seek operation that has not yet been -// carried out. Seek the cursor now. If an error occurs, return -// the appropriate error code. +// C comment +// /* +// ** The cursor "p" has a pending seek operation that has not yet been +// ** carried out. Seek the cursor now. If an error occurs, return +// ** the appropriate error code. +// */ func _handleDeferredMoveto(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { var _res, _rc int32 func() { - if (_p.X3) == 0 { + if _p.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74477), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000))), unsafe.Pointer(str(73747))) crt.X__builtin_abort(tls) } }() func() { - if (_p.X4) == 0 { + if _p.X4 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74478), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000))), unsafe.Pointer(str(73765))) crt.X__builtin_abort(tls) } @@ -55308,15 +57758,15 @@ func _handleDeferredMoveto(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { crt.X__builtin_abort(tls) } }() - _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))), nil, _p.X20, i32(0), &_res) + _rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14))))), nil, _p.X20, i32(0), &_res) if _rc != 0 { return _rc } if _res != i32(0) { return _sqlite3CorruptError(tls, i32(74482)) } - *(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(0)) - *(*uint32)(unsafe.Pointer(&(_p.X11))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_p.X3)) = uint8(i32(0)) + *(*uint32)(unsafe.Pointer(&_p.X11)) = uint32(i32(0)) return i32(0) } @@ -55326,35 +57776,37 @@ func init() { crt.Xstrncpy(nil, &_handleDeferredMovetoØ00__func__Ø000[0], str(73803), 21) } -// Move the cursor so that it points to an entry near the key -// specified by pIdxKey or intKey. Return a success code. -// -// For INTKEY tables, the intKey parameter is used. pIdxKey -// must be NULL. For index tables, pIdxKey is used and intKey -// is ignored. -// -// If an exact match is not found, then the cursor is always -// left pointing at a leaf page which would hold the entry if it -// were present. The cursor might point to an entry that comes -// before or after the key. -// -// An integer is written into *pRes which is the result of -// comparing the key with the entry to which the cursor is -// pointing. The meaning of the integer written into -// *pRes is as follows: -// -// *pRes<0 The cursor is left pointing at an entry that -// is smaller than intKey/pIdxKey or if the table is empty -// and the cursor is therefore left point to nothing. -// -// *pRes==0 The cursor is left pointing at an entry that -// exactly matches intKey/pIdxKey. -// -// *pRes>0 The cursor is left pointing at an entry that -// is larger than intKey/pIdxKey. -// -// For index tables, the pIdxKey->eqSeen field is set to 1 if there -// exists an entry in the table that exactly matches pIdxKey. +// C comment +// /* Move the cursor so that it points to an entry near the key +// ** specified by pIdxKey or intKey. Return a success code. +// ** +// ** For INTKEY tables, the intKey parameter is used. pIdxKey +// ** must be NULL. For index tables, pIdxKey is used and intKey +// ** is ignored. +// ** +// ** If an exact match is not found, then the cursor is always +// ** left pointing at a leaf page which would hold the entry if it +// ** were present. The cursor might point to an entry that comes +// ** before or after the key. +// ** +// ** An integer is written into *pRes which is the result of +// ** comparing the key with the entry to which the cursor is +// ** pointing. The meaning of the integer written into +// ** *pRes is as follows: +// ** +// ** *pRes<0 The cursor is left pointing at an entry that +// ** is smaller than intKey/pIdxKey or if the table is empty +// ** and the cursor is therefore left point to nothing. +// ** +// ** *pRes==0 The cursor is left pointing at an entry that +// ** exactly matches intKey/pIdxKey. +// ** +// ** *pRes>0 The cursor is left pointing at an entry that +// ** is larger than intKey/pIdxKey. +// ** +// ** For index tables, the pIdxKey->eqSeen field is set to 1 if there +// ** exists an entry in the table that exactly matches pIdxKey. +// */ func _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpackedRecord, _intKey int64, _biasRight int32, _pRes *int32) (r0 int32) { var _rc, _12_lwr, _12_upr, _12_idx, _12_c, _25_nCell int32 var _14_nCellKey int64 @@ -55396,18 +57848,18 @@ func _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpa if _pIdxKey != nil || int32(_pCur.X12) != i32(1) || (int32(_pCur.X10)&i32(2)) == i32(0) { goto _13 } - if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) == _intKey { + if ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0) == _intKey { *_pRes = i32(0) return i32(0) } - if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) >= _intKey { + if ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0) >= _intKey { goto _15 } if (int32(_pCur.X10) & i32(8)) != i32(0) { *_pRes = i32(-1) return i32(0) } - if (((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)+int64(i32(1))) != _intKey || (_pCur.X9) != 0 { + if (((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0)+int64(i32(1))) != _intKey || _pCur.X9 != 0 { goto _18 } *_pRes = i32(0) @@ -55419,7 +57871,7 @@ func _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpa goto _20 } _getCellInfo(tls, _pCur) - if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) == _intKey { + if ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0) == _intKey { return i32(0) } _20: @@ -55428,7 +57880,7 @@ _15: _13: if _pIdxKey != nil { _xRecordCompare = _sqlite3VdbeFindCompare(tls, _pIdxKey) - *(*uint8)(unsafe.Pointer(&(_pIdxKey.X4))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pIdxKey.X4)) = uint8(i32(0)) func() { if int32(_pIdxKey.X3) != i32(1) && int32(_pIdxKey.X3) != i32(0) && int32(_pIdxKey.X3) != i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73997))) @@ -55444,19 +57896,19 @@ _27: return _rc } func() { - if (_pCur.X7) != uint32(i32(0)) && (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) == nil { + if _pCur.X7 != uint32(i32(0)) && (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64233), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74073))) crt.X__builtin_abort(tls) } }() func() { - if (_pCur.X7) != uint32(i32(0)) && ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X0) == 0 { + if _pCur.X7 != uint32(i32(0)) && ((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X0) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74120))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pCur.X12) != i32(0) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) <= i32(0) { + if int32(_pCur.X12) != i32(0) && int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64235), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74175))) crt.X__builtin_abort(tls) } @@ -55464,7 +57916,7 @@ _27: if int32(_pCur.X12) == i32(0) { *_pRes = i32(-1) func() { - if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { + if _pCur.X7 != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74242))) crt.X__builtin_abort(tls) } @@ -55472,19 +57924,19 @@ _27: return i32(0) } func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(i32(0))))).X2) != int32(_pCur.X15) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(i32(0))))).X2) != int32(_pCur.X15) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64241), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74299))) crt.X__builtin_abort(tls) } }() func() { - if (_pCur.X15) == 0 && _pIdxKey == nil { + if _pCur.X15 == 0 && _pIdxKey == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64242), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74340))) crt.X__builtin_abort(tls) } }() _47: - _12_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + _12_pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) func() { if int32(_12_pPage.X14) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64255), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74367))) @@ -55506,7 +57958,7 @@ _47: } }() _12_idx = _12_upr >> uint(i32(1)-_biasRight) - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_idx) if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32 }{_xRecordCompare})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { @@ -55515,8 +57967,8 @@ _47: goto _57 } _58: - _12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(1))))))))) - if (_12_pPage.X3) == 0 { + _12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(1))))))))) + if _12_pPage.X3 == 0 { goto _61 } _62: @@ -55556,18 +58008,18 @@ _68: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx) - if (_12_pPage.X5) == 0 { + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_idx) + if _12_pPage.X5 == 0 { _12_lwr = _12_idx goto _moveto_next_layer } { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(2)) sink2(*p) } - *(*int64)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0))) = _14_nCellKey - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + *(*int64)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0))) = _14_nCellKey + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) *_pRes = i32(0) return i32(0) @@ -55584,21 +58036,22 @@ _60: goto _77 _57: _78: - _12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(1))))))))) - _25_nCell = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pCell)) + 1*uintptr(i32(0))))) + _12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(1))))))))) + _25_nCell = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) + 1*uintptr(i32(0))))) if _25_nCell <= int32(_12_pPage.X8) { - _12_c = _xRecordCompare(tls, _25_nCell, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pCell))+1*uintptr(i32(1))))), _pIdxKey) + _12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell))+1*uintptr(i32(1))))), _pIdxKey) goto _85 } - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pCell)) + 1*uintptr(i32(1))))) & i32(128)) == 0) && (store1(&_25_nCell, ((_25_nCell&i32(127))<<uint(i32(7)))+int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pCell)) + 1*uintptr(i32(1)))))) <= int32(_12_pPage.X10)) { - _12_c = _xRecordCompare(tls, _25_nCell, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pCell))+1*uintptr(i32(2))))), _pIdxKey) + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) + 1*uintptr(i32(1))))) & i32(128)) == 0) && (store1(&_25_nCell, ((_25_nCell&i32(127))<<uint(i32(7)))+int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) + 1*uintptr(i32(1)))))) <= int32(_12_pPage.X10)) { + _12_c = _xRecordCompare(tls, _25_nCell, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell))+1*uintptr(i32(2))))), _pIdxKey) goto _85 } _28_pCellBody = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pCell)) - uintptr(_12_pPage.X7))) - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_12_pPage.X25)})))(tls, _12_pPage, _28_pCellBody, (*XCellInfo)(unsafe.Pointer(&(_pCur.X4)))) - _25_nCell = int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _12_pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _12_pPage, _28_pCellBody, (*XCellInfo)(unsafe.Pointer(&_pCur.X4))) + _25_nCell = int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0) if _25_nCell < i32(2) { _rc = _sqlite3CorruptError(tls, i32(64341)) goto _moveto_finish @@ -55608,10 +58061,10 @@ _78: _rc = _sqlite3NomemError(tls, i32(64346)) goto _moveto_finish } - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_idx) _rc = _accessPayload(tls, _pCur, uint32(i32(0)), uint32(_25_nCell), (*uint8)(_28_pCellKey), i32(0)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-5)) sink2(*p) } @@ -55644,8 +58097,8 @@ _85: }() *_pRes = i32(0) _rc = i32(0) - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx) - if (_pIdxKey.X4) != 0 { + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_idx) + if _pIdxKey.X4 != 0 { _rc = i32(11) } goto _moveto_finish @@ -55664,44 +58117,44 @@ _97: _80: _77: func() { - if _12_lwr != (_12_upr+i32(1)) && ((_12_pPage.X2) == 0 || (_12_pPage.X5) != 0) { + if _12_lwr != (_12_upr+i32(1)) && (_12_pPage.X2 == 0 || _12_pPage.X5 != 0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64380), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74585))) crt.X__builtin_abort(tls) } }() func() { - if (_12_pPage.X0) == 0 { + if _12_pPage.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64381), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74631))) crt.X__builtin_abort(tls) } }() - if (_12_pPage.X5) != 0 { + if _12_pPage.X5 != 0 { func() { - if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) { + if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64383), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(10597))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_idx) *_pRes = _12_c _rc = i32(0) goto _moveto_finish } _moveto_next_layer: if _12_lwr >= int32(_12_pPage.X14) { - _12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X19))+1*uintptr(int32(_12_pPage.X6)+i32(8))))) + _12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X19))+1*uintptr(int32(_12_pPage.X6)+i32(8))))) goto _114 } - _12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X19))+uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_lwr))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_lwr))))) + 1*uintptr(i32(1)))))))))) + _12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X19))+uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_lwr))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X21))+1*uintptr(i32(2)*_12_lwr))))) + 1*uintptr(i32(1)))))))))) _114: - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_lwr) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(_12_lwr) _rc = _moveToChild(tls, _pCur, _12_chldPg) if _rc != 0 { goto _moveto_finish } goto _47 _moveto_finish: - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) func() { if (int32(_pCur.X10) & i32(4)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64401), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74645))) @@ -55711,13 +58164,15 @@ _moveto_finish: return _rc } -// Verify that the cursor and the BtShared agree about what is the current -// database connetion. This is important in shared-cache mode. If the database -// connection pointers get out-of-sync, it is possible for routines like -// btreeInitPage() to reference an stale connection pointer that references a -// a connection that has already closed. This routine is used inside assert() -// statements only and for the purpose of double-checking that the btree code -// does keep the database connection pointers up-to-date. +// C comment +// /* Verify that the cursor and the BtShared agree about what is the current +// ** database connetion. This is important in shared-cache mode. If the database +// ** connection pointers get out-of-sync, it is possible for routines like +// ** btreeInitPage() to reference an stale connection pointer that references a +// ** a connection that has already closed. This routine is used inside assert() +// ** statements only and for the purpose of double-checking that the btree code +// ** does keep the database connection pointers up-to-date. +// */ func _cursorOwnsBtShared(tls *crt.TLS, _p *XBtCursor) (r0 int32) { func() { if _cursorHoldsMutex(tls, _p) == 0 { @@ -55761,14 +58216,14 @@ func _sqlite3BtreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) } }() func() { - if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) { + if _pCur.X9 != i32(0) && int32(_pCur.X12) == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64538), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeNextØ00__func__Ø000))), unsafe.Pointer(str(74777))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-7)) sink2(*p) } @@ -55776,12 +58231,12 @@ func _sqlite3BtreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) if int32(_pCur.X12) != i32(1) { return _btreeNext(tls, _pCur, _pRes) } - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) - if int32(preInc14((*uint16)(unsafe.Pointer(&(_pCur.X16))), uint16(1))) >= int32(_pPage.X14) { - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) -= 1 + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) + if int32(preInc14((*uint16)(unsafe.Pointer(&_pCur.X16)), uint16(1))) >= int32(_pPage.X14) { + *(*uint16)(unsafe.Pointer(&_pCur.X16)) -= 1 return _btreeNext(tls, _pCur, _pRes) } - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { return i32(0) } return _moveToLeftmost(tls, _pCur) @@ -55793,25 +58248,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeNextØ00__func__Ø000[0], str(74825), 17) } -// Advance the cursor to the next entry in the database. If -// successful then set *pRes=0. If the cursor -// was already pointing to the last entry in the database before -// this routine was called, then set *pRes=1. -// -// The main entry point is sqlite3BtreeNext(). That routine is optimized -// for the common case of merely incrementing the cell counter BtCursor.aiIdx -// to the next cell on the current page. The (slower) btreeNext() helper -// routine is called when it is necessary to move to a different page or -// to restore the cursor. -// -// The calling function will set *pRes to 0 or 1. The initial *pRes value -// will be 1 if the cursor being stepped corresponds to an SQL index and -// if this routine could have been skipped if that SQL index had been -// a unique index. Otherwise the caller will have set *pRes to zero. -// Zero is the common case. The btree implementation is free to use the -// initial *pRes value as a hint to improve performance, but the current -// SQLite btree implementation does not. (Note that the comdb2 btree -// implementation does use this hint, however.) +// C comment +// /* +// ** Advance the cursor to the next entry in the database. If +// ** successful then set *pRes=0. If the cursor +// ** was already pointing to the last entry in the database before +// ** this routine was called, then set *pRes=1. +// ** +// ** The main entry point is sqlite3BtreeNext(). That routine is optimized +// ** for the common case of merely incrementing the cell counter BtCursor.aiIdx +// ** to the next cell on the current page. The (slower) btreeNext() helper +// ** routine is called when it is necessary to move to a different page or +// ** to restore the cursor. +// ** +// ** The calling function will set *pRes to 0 or 1. The initial *pRes value +// ** will be 1 if the cursor being stepped corresponds to an SQL index and +// ** if this routine could have been skipped if that SQL index had been +// ** a unique index. Otherwise the caller will have set *pRes to zero. +// ** Zero is the common case. The btree implementation is free to use the +// ** initial *pRes value as a hint to improve performance, but the current +// ** SQLite btree implementation does not. (Note that the comdb2 btree +// ** implementation does use this hint, however.) +// */ func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { var _rc, _idx int32 var _pPage *XMemPage @@ -55822,7 +58280,7 @@ func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { } }() func() { - if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) { + if _pCur.X9 != i32(0) && int32(_pCur.X12) == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64472), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74777))) crt.X__builtin_abort(tls) } @@ -55855,7 +58313,7 @@ func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { *_pRes = i32(1) return i32(0) } - if (_pCur.X9) == 0 { + if _pCur.X9 == 0 { goto _14 } func() { @@ -55864,18 +58322,18 @@ func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1)) - if (_pCur.X9) > i32(0) { - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(1)) + if _pCur.X9 > i32(0) { + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(0) return i32(0) } - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0) + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(0) _14: _7: - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) - _idx = int32(preInc14((*uint16)(unsafe.Pointer(&(_pCur.X16))), uint16(1))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) + _idx = int32(preInc14((*uint16)(unsafe.Pointer(&_pCur.X16)), uint16(1))) func() { - if (_pPage.X0) == 0 { + if _pPage.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64497), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74631))) crt.X__builtin_abort(tls) } @@ -55883,10 +58341,10 @@ _7: if _idx < int32(_pPage.X14) { goto _21 } - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _22 } - _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8)))))) + _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8)))))) if _rc != 0 { return _rc } @@ -55895,21 +58353,21 @@ _7: _22: if int32(_pCur.X14) == i32(0) { *_pRes = i32(1) - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) return i32(0) } _moveToParent(tls, _pCur) - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) if int32(_pCur.X16) >= int32(_pPage.X14) { goto _22 } - if (_pPage.X2) != 0 { + if _pPage.X2 != 0 { return _sqlite3BtreeNext(tls, _pCur, _pRes) } return i32(0) _21: - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { return i32(0) } return _moveToLeftmost(tls, _pCur) @@ -55921,11 +58379,14 @@ func init() { crt.Xstrncpy(nil, &_btreeNextØ00__func__Ø000[0], str(74911), 10) } -// Restore the cursor to the position it was in (or as close to as possible) -// when saveCursorPosition() was called. Note that this call deletes the -// saved position info stored by saveCursorPosition(), so there can be -// at most one effective restoreCursorPosition() call after each -// saveCursorPosition(). +// C comment +// /* +// ** Restore the cursor to the position it was in (or as close to as possible) +// ** when saveCursorPosition() was called. Note that this call deletes the +// ** saved position info stored by saveCursorPosition(), so there can be +// ** at most one effective restoreCursorPosition() call after each +// ** saveCursorPosition(). +// */ func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc, _skipNext int32 func() { @@ -55943,13 +58404,13 @@ func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { if int32(_pCur.X12) == i32(4) { return _pCur.X9 } - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) _rc = _btreeMoveto(tls, _pCur, _pCur.X6, _pCur.X5, i32(0), &_skipNext) if _rc != i32(0) { goto _5 } Xsqlite3_free(tls, _pCur.X6) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_pCur.X6)) = nil func() { if int32(_pCur.X12) != i32(1) && int32(_pCur.X12) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59842), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(74954))) @@ -55957,12 +58418,12 @@ func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() { - p := (*int32)(unsafe.Pointer(&(_pCur.X9))) + p := (*int32)(unsafe.Pointer(&_pCur.X9)) *p = (*p) | _skipNext sink1(*p) } - if (_pCur.X9) != 0 && (int32(_pCur.X12) == i32(1)) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(2)) + if _pCur.X9 != 0 && (int32(_pCur.X12) == i32(1)) { + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(2)) } _5: return _rc @@ -55974,9 +58435,12 @@ func init() { crt.Xstrncpy(nil, &_btreeRestoreCursorPositionØ00__func__Ø000[0], str(75013), 27) } -// In this version of BtreeMoveto, pKey is a packed index record -// such as is generated by the OP_MakeRecord opcode. Unpack the -// record and then call BtreeMovetoUnpacked() to do the work. +// C comment +// /* +// ** In this version of BtreeMoveto, pKey is a packed index record +// ** such as is generated by the OP_MakeRecord opcode. Unpack the +// ** record and then call BtreeMovetoUnpacked() to do the work. +// */ func _btreeMoveto(tls *crt.TLS, _pCur *XBtCursor, _pKey unsafe.Pointer, _nKey int64, _bias int32, _pRes *int32) (r0 int32) { var _rc int32 var _pIdxKey *XUnpackedRecord @@ -56005,7 +58469,7 @@ _5: _rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, _pIdxKey, _nKey, _bias, _pRes) _moveto_done: if _pIdxKey != nil { - _sqlite3DbFree(tls, (*Xsqlite3)((*XKeyInfo)(_pCur.X18).X4), (unsafe.Pointer)(_pIdxKey)) + _sqlite3DbFree(tls, (*Xsqlite3)((*XKeyInfo)(_pCur.X18).X4), unsafe.Pointer(_pIdxKey)) } return _rc } @@ -56016,18 +58480,21 @@ func init() { crt.Xstrncpy(nil, &_btreeMovetoØ00__func__Ø000[0], str(75061), 12) } -// This routine is used to allocate sufficient space for an UnpackedRecord -// structure large enough to be used with sqlite3VdbeRecordUnpack() if -// the first argument is a pointer to KeyInfo structure pKeyInfo. -// -// The space is either allocated using sqlite3DbMallocRaw() or from within -// the unaligned buffer passed via the second and third arguments (presumably -// stack space). If the former, then *ppFree is set to a pointer that should -// be eventually freed by the caller using sqlite3DbFree(). Or, if the -// allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL -// before returning. -// -// If an OOM error occurs, NULL is returned. +// C comment +// /* +// ** This routine is used to allocate sufficient space for an UnpackedRecord +// ** structure large enough to be used with sqlite3VdbeRecordUnpack() if +// ** the first argument is a pointer to KeyInfo structure pKeyInfo. +// ** +// ** The space is either allocated using sqlite3DbMallocRaw() or from within +// ** the unaligned buffer passed via the second and third arguments (presumably +// ** stack space). If the former, then *ppFree is set to a pointer that should +// ** be eventually freed by the caller using sqlite3DbFree(). Or, if the +// ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL +// ** before returning. +// ** +// ** If an OOM error occurs, NULL is returned. +// */ func _sqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, _pKeyInfo *XKeyInfo) (r0 *XUnpackedRecord) { var _nByte int32 var _p *XUnpackedRecord @@ -56036,15 +58503,15 @@ func _sqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, _pKeyInfo *XKeyInfo) (r0 *XUn if _p == nil { return nil } - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XMem)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(u64(24)))))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = (*XMem)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(u64(24)))))) func() { - if (_pKeyInfo.X5) == nil { + if _pKeyInfo.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74948), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000))), unsafe.Pointer(str(37852))) crt.X__builtin_abort(tls) } }() - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pKeyInfo - *(*uint16)(unsafe.Pointer(&(_p.X2))) = uint16(int32(_pKeyInfo.X2) + i32(1)) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _pKeyInfo + *(*uint16)(unsafe.Pointer(&_p.X2)) = uint16(int32(_pKeyInfo.X2) + i32(1)) return _p } @@ -56062,7 +58529,7 @@ func _sqlite3VdbeRecordUnpack(tls *crt.TLS, _pKeyInfo *XKeyInfo, _nKey int32, _p var _pMem *XMem _aKey = (*uint8)(_pKey) _pMem = (*XMem)(_p.X1) - *(*int8)(unsafe.Pointer(&(_p.X3))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_p.X3)) = int8(i32(0)) func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000))), unsafe.Pointer(str(6321))) @@ -56084,23 +58551,23 @@ _4: { p := &_idx *p = (*p) + uint32(uint8(func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(_idx)))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(_idx)))) < int32(u8(128)) { return func() int32 { - _1_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(_idx)))) + _1_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(_idx)))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey))+1*uintptr(_idx))), &_1_serial_type)) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+1*uintptr(_idx))), &_1_serial_type)) }())) sink5(*p) } - *(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _pKeyInfo.X1 - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X9))))) = (*Xsqlite3)(_pKeyInfo.X4) - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0) - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil + *(*uint8)(unsafe.Pointer(&_pMem.X2)) = _pKeyInfo.X1 + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMem.X9)))) = (*Xsqlite3)(_pKeyInfo.X4) + *(*int32)(unsafe.Pointer(&_pMem.X7)) = i32(0) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = nil { p := &_d - *p = int32(uint32(*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey))+1*uintptr(_d))), _1_serial_type, _pMem)) + *p = int32(uint32(*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+1*uintptr(_d))), _1_serial_type, _pMem)) sink1(*p) } *(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(72) @@ -56115,7 +58582,7 @@ _5: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_p.X2))) = _u + *(*uint16)(unsafe.Pointer(&_p.X2)) = _u } var _sqlite3VdbeRecordUnpackØ00__func__Ø000 [24]int8 @@ -56124,15 +58591,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeRecordUnpackØ00__func__Ø000[0], str(75128), 24) } -// Read a 32-bit variable-length integer from memory starting at p[0]. -// Return the number of bytes read. The value is stored in *v. -// -// If the varint stored in p[0] is larger than can fit in a 32-bit unsigned -// integer, then set *v to 0xffffffff. -// -// A MACRO version, getVarint32, is provided which inlines the -// single-byte case. All code should use the MACRO version as -// this function assumes the single-byte case has already been handled. +// C comment +// /* +// ** Read a 32-bit variable-length integer from memory starting at p[0]. +// ** Return the number of bytes read. The value is stored in *v. +// ** +// ** If the varint stored in p[0] is larger than can fit in a 32-bit unsigned +// ** integer, then set *v to 0xffffffff. +// ** +// ** A MACRO version, getVarint32, is provided which inlines the +// ** single-byte case. All code should use the MACRO version as +// ** this function assumes the single-byte case has already been handled. +// */ func _sqlite3GetVarint32(tls *crt.TLS, _p *uint8, _v *uint32) (r0 uint8) { var _a, _b uint32 var _3_v64 uint64 @@ -56174,7 +58644,7 @@ func _sqlite3GetVarint32(tls *crt.TLS, _p *uint8, _v *uint32) (r0 uint8) { } { p := &_p - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(i32(2)))) sink13(*p) } _3_n = _sqlite3GetVarint(tls, _p, &_3_v64) @@ -56230,45 +58700,45 @@ func _sqlite3VdbeSerialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem } _1: - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(1)) goto _14 _4: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0)))))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0)))))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(1)) _5: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1)))))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1)))))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(2)) _6: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2)))))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(2)))))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(3)) _7: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((((i32(16777216) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))) << uint(i32(16)))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(3)))))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64((((i32(16777216) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1))))) << uint(i32(16)))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(2))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(3)))))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(4)) _8: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1))))))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(6)) _9: return _serialGet(tls, _buf, _serial_type, _pMem) _11: - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_serial_type - uint32(i32(8))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = int64(_serial_type - uint32(i32(8))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) return uint32(i32(0)) _13: - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = (*int8)(unsafe.Pointer(_buf)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32((_serial_type - uint32(i32(12))) / uint32(i32(2))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeSerialGetØ00aFlagØ001)) + 2*uintptr(_serial_type&uint32(i32(1))))) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = (*int8)(unsafe.Pointer(_buf)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = int32((_serial_type - uint32(i32(12))) / uint32(i32(2))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3VdbeSerialGetØ00aFlagØ001)) + 2*uintptr(_serial_type&uint32(i32(1))))) return uint32(_pMem.X4) _14: @@ -56278,25 +58748,25 @@ _14: func _serialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) { var _y uint32 var _x, _2_t2 uint64 - _x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(3)))))) - _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(3))))) + _x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(3)))))) + _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(i32(4)))))) + 1*uintptr(i32(3))))) _x = (_x << uint(i32(32))) + uint64(_y) if _serial_type == uint32(i32(6)) { - *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = *(*int64)(unsafe.Pointer(&_x)) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4)) + *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) = *(*int64)(unsafe.Pointer(&_x)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4)) goto _1 } _2_t2 = _serialGetØ00t1Ø001 func() { - if i32(1) == 0 || crt.Xmemcmp(tls, (unsafe.Pointer)(&_serialGetØ00r1Ø002), (unsafe.Pointer)(&_2_t2), u64(8)) != i32(0) { + if i32(1) == 0 || crt.Xmemcmp(tls, unsafe.Pointer(&_serialGetØ00r1Ø002), unsafe.Pointer(&_2_t2), u64(8)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74831), unsafe.Pointer((*int8)(unsafe.Pointer(&_serialGetØ00__func__Ø000))), unsafe.Pointer(str(75183))) crt.X__builtin_abort(tls) } }() i32(0) - crt.Xmemcpy(tls, (unsafe.Pointer)((*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))), (unsafe.Pointer)(&_x), u64(8)) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(func() int32 { - if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) != 0 { + crt.Xmemcpy(tls, unsafe.Pointer((*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))), unsafe.Pointer(&_x), u64(8)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(func() int32 { + if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) != 0 { return i32(1) } return i32(8) @@ -56332,13 +58802,16 @@ func init() { _sqlite3VdbeSerialGetØ00aFlagØ001 = [2]uint16{u16(4112), u16(4098)} } -// Move the cursor down to a new child page. The newPgno argument is the -// page number of the child page to move to. -// -// This function returns SQLITE_CORRUPT if the page-header flags field of -// 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). +// C comment +// /* +// ** Move the cursor down to a new child page. The newPgno argument is the +// ** page number of the child page to move to. +// ** +// ** This function returns SQLITE_CORRUPT if the page-header flags field of +// ** 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 *crt.TLS, _pCur *XBtCursor, _newPgno uint32) (r0 int32) { var _pBt *XBtShared _pBt = (*XBtShared)(_pCur.X1) @@ -56369,15 +58842,15 @@ func _moveToChild(tls *crt.TLS, _pCur *XBtCursor, _newPgno uint32) (r0 int32) { if int32(_pCur.X14) >= i32(19) { return _sqlite3CorruptError(tls, i32(63867)) } - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-7)) sink2(*p) } - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(1))))) = _pCur.X16 - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0)) - return _getAndInitPage(tls, _pBt, _newPgno, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+8*uintptr(_pCur.X14))), _pCur, int32(_pCur.X11)) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(postInc3((*int8)(unsafe.Pointer(&_pCur.X14)), 1)))) = _pCur.X16 + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(i32(0)) + return _getAndInitPage(tls, _pBt, _newPgno, (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19))))+8*uintptr(_pCur.X14))), _pCur, int32(_pCur.X11)) } var _moveToChildØ00__func__Ø000 [12]int8 @@ -56386,17 +58859,20 @@ func init() { crt.Xstrncpy(nil, &_moveToChildØ00__func__Ø000[0], str(75297), 12) } -// Get a page from the pager and initialize it. -// -// If pCur!=0 then the page is being fetched as part of a moveToChild() -// call. Do additional sanity checking on the page in this case. -// And if the fetch fails, this routine must decrement pCur->iPage. -// -// The page is fetched as read-write unless pCur is not NULL and is -// a read-only cursor. -// -// If an error occurs, then *ppPage is undefined. It -// may remain unchanged, or it may be set to an invalid value. +// C comment +// /* +// ** Get a page from the pager and initialize it. +// ** +// ** If pCur!=0 then the page is being fetched as part of a moveToChild() +// ** call. Do additional sanity checking on the page in this case. +// ** And if the fetch fails, this routine must decrement pCur->iPage. +// ** +// ** The page is fetched as read-write unless pCur is not NULL and is +// ** a read-only cursor. +// ** +// ** If an error occurs, then *ppPage is undefined. It +// ** may remain unchanged, or it may be set to an invalid value. +// */ func _getAndInitPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _pCur *XBtCursor, _bReadOnly int32) (r0 int32) { var _rc int32 var _pDbPage *XPgHdr @@ -56407,7 +58883,7 @@ func _getAndInitPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMem } }() func() { - if _pCur != nil && _ppPage != (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+8*uintptr(_pCur.X14))) { + if _pCur != nil && _ppPage != (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19))))+8*uintptr(_pCur.X14))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61082), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75309))) crt.X__builtin_abort(tls) } @@ -56464,7 +58940,7 @@ _13: _getAndInitPage_error: if _pCur != nil { - *(*int8)(unsafe.Pointer(&(_pCur.X14))) -= 1 + *(*int8)(unsafe.Pointer(&_pCur.X14)) -= 1 } func() { if _pgno == uint32(i32(0)) && _rc != i32(11) { @@ -56481,11 +58957,14 @@ func init() { crt.Xstrncpy(nil, &_getAndInitPageØ00__func__Ø000[0], str(75521), 15) } -// Move the cursor down to the left-most leaf entry beneath the -// entry to which it is currently pointing. -// -// The left-most leaf is the one with the smallest key - the first -// in ascending order. +// C comment +// /* +// ** Move the cursor down to the left-most leaf entry beneath the +// ** entry to which it is currently pointing. +// ** +// ** The left-most leaf is the one with the smallest key - the first +// ** in ascending order. +// */ func _moveToLeftmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc int32 var _pgno uint32 @@ -56504,14 +58983,14 @@ func _moveToLeftmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() _4: - if (_rc == i32(0)) && ((store52(&_pPage, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X5) == 0) { + if (_rc == i32(0)) && ((store52(&_pPage, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X5) == 0) { func() { if int32(_pCur.X16) >= int32(_pPage.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64036), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000))), unsafe.Pointer(str(10682))) crt.X__builtin_abort(tls) } }() - _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*int32(_pCur.X16)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*int32(_pCur.X16)))))) + 1*uintptr(i32(1)))))))))) + _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*int32(_pCur.X16)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*int32(_pCur.X16)))))) + 1*uintptr(i32(1)))))))))) _rc = _moveToChild(tls, _pCur, _pgno) goto _4 } @@ -56524,12 +59003,15 @@ func init() { crt.Xstrncpy(nil, &_moveToLeftmostØ00__func__Ø000[0], str(75536), 15) } -// Move the cursor up to the parent page. -// -// pCur->idx is set to the cell index that contains the pointer -// to the page we are coming from. If we are coming from the -// right-most child page then pCur->idx is set to one more than -// the largest cell index. +// C comment +// /* +// ** Move the cursor up to the parent page. +// ** +// ** pCur->idx is set to the cell index that contains the pointer +// ** to the page we are coming from. If we are coming from the +// ** right-most child page then pCur->idx is set to one more than +// ** the largest cell index. +// */ func _moveToParent(tls *crt.TLS, _pCur *XBtCursor) { func() { if _cursorOwnsBtShared(tls, _pCur) == 0 { @@ -56550,20 +59032,20 @@ func _moveToParent(tls *crt.TLS, _pCur *XBtCursor) { } }() func() { - if (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) == nil { + if (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63911), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToParentØ00__func__Ø000))), unsafe.Pointer(str(75565))) crt.X__builtin_abort(tls) } }() - _assertParentIndex(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(int32(_pCur.X14)-i32(1)))), int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(int32(_pCur.X14)-i32(1))))), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X4) - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + _assertParentIndex(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(int32(_pCur.X14)-i32(1)))), int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(int32(_pCur.X14)-i32(1))))), (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X4) + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-7)) sink2(*p) } - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(int32(_pCur.X14)-i32(1)))) - _releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1)))))) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(int32(_pCur.X14)-i32(1)))) + _releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&_pCur.X14)), -1))))) } var _moveToParentØ00__func__Ø000 [13]int8 @@ -56572,13 +59054,16 @@ func init() { crt.Xstrncpy(nil, &_moveToParentØ00__func__Ø000[0], str(75591), 13) } -// Page pParent is an internal (non-leaf) tree page. This function -// asserts that page number iChild is the left-child if the iIdx'th -// cell in page pParent. Or, if iIdx is equal to the total number of -// cells in pParent, that page number iChild is the right-child of -// the page. +// C comment +// /* +// ** Page pParent is an internal (non-leaf) tree page. This function +// ** asserts that page number iChild is the left-child if the iIdx'th +// ** cell in page pParent. Or, if iIdx is equal to the total number of +// ** cells in pParent, that page number iChild is the right-child of +// ** the page. +// */ func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild uint32) { - if (_sqlite3Config.X6) == i32(0) { + if _sqlite3Config.X6 == i32(0) { return } func() { @@ -56589,7 +59074,7 @@ func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild u }() if _iIdx == int32(_pParent.X14) { func() { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X19))+1*uintptr(int32(_pParent.X6)+i32(8))))) != _iChild { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19))+1*uintptr(int32(_pParent.X6)+i32(8))))) != _iChild { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63890), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertParentIndexØ00__func__Ø000))), unsafe.Pointer(str(75625))) crt.X__builtin_abort(tls) } @@ -56597,7 +59082,7 @@ func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild u goto _6 } func() { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19))+uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*_iIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*_iIdx))))) + 1*uintptr(i32(1)))))))))) != _iChild { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19))+uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*_iIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*_iIdx))))) + 1*uintptr(i32(1)))))))))) != _iChild { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63892), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertParentIndexØ00__func__Ø000))), unsafe.Pointer(str(75681))) crt.X__builtin_abort(tls) } @@ -56611,27 +59096,30 @@ func init() { crt.Xstrncpy(nil, &_assertParentIndexØ00__func__Ø000[0], str(75723), 18) } -// Return a pointer to an sqlite3VdbeRecordCompare() compatible function -// suitable for comparing serialized records to the unpacked record passed -// as the only argument. +// C comment +// /* +// ** Return a pointer to an sqlite3VdbeRecordCompare() compatible function +// ** suitable for comparing serialized records to the unpacked record passed +// ** as the only argument. +// */ func _sqlite3VdbeFindCompare(tls *crt.TLS, _p *XUnpackedRecord) (r0 func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32) { var _1_flags int32 if (int32((*XKeyInfo)(_p.X0).X2) + int32((*XKeyInfo)(_p.X0).X3)) > i32(13) { goto _0 } _1_flags = int32((*XMem)(unsafe.Pointer(uintptr(_p.X1) + 72*uintptr(i32(0)))).X1) - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)(_p.X0).X5)) + 1*uintptr(i32(0))))) != 0 { - *(*int8)(unsafe.Pointer(&(_p.X5))) = int8(i32(1)) - *(*int8)(unsafe.Pointer(&(_p.X6))) = int8(i32(-1)) + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XKeyInfo)(_p.X0).X5)) + 1*uintptr(i32(0))))) != 0 { + *(*int8)(unsafe.Pointer(&_p.X5)) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X6)) = int8(i32(-1)) goto _2 } - *(*int8)(unsafe.Pointer(&(_p.X5))) = int8(i32(-1)) - *(*int8)(unsafe.Pointer(&(_p.X6))) = int8(i32(1)) + *(*int8)(unsafe.Pointer(&_p.X5)) = int8(i32(-1)) + *(*int8)(unsafe.Pointer(&_p.X6)) = int8(i32(1)) _2: if (_1_flags & i32(4)) != 0 { return _vdbeRecordCompareInt } - if ((_1_flags & i32(25)) == i32(0)) && ((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&((*XKeyInfo)(_p.X0).X6))))) + 8*uintptr(i32(0))))) == nil) { + if ((_1_flags & i32(25)) == i32(0)) && ((*(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&((*XKeyInfo)(_p.X0).X6))))) + 8*uintptr(i32(0))))) == nil) { func() { if (_1_flags & i32(2)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75785), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFindCompareØ00__func__Ø000))), unsafe.Pointer(str(75741))) @@ -56644,13 +59132,16 @@ _0: return _sqlite3VdbeRecordCompare } -// This function is an optimized version of sqlite3VdbeRecordCompare() -// that (a) the first field of pPKey2 is an integer, and (b) the -// size-of-header varint at the start of (pKey1/nKey1) fits in a single -// byte (i.e. is less than 128). -// -// To avoid concerns about buffer overreads, this routine is only used -// on schemas where the maximum valid header size is 63 bytes or less. +// C comment +// /* +// ** This function is an optimized version of sqlite3VdbeRecordCompare() +// ** that (a) the first field of pPKey2 is an integer, and (b) the +// ** size-of-header varint at the start of (pKey1/nKey1) fits in a single +// ** byte (i.e. is less than 128). +// ** +// ** To avoid concerns about buffer overreads, this routine is only used +// ** on schemas where the maximum valid header size is 63 bytes or less. +// */ func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) { var _serial_type, _res int32 var _v, _lhs int64 @@ -56661,7 +59152,7 @@ func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _p _serial_type = int32(*(*uint8)(unsafe.Pointer(uintptr(_pKey1) + 1*uintptr(i32(1))))) _vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.X0)) func() { - if int32(*(*uint8)(_pKey1)) > i32(63) && (_sqlite3Config.X6) != i32(0) { + if int32(*(*uint8)(_pKey1)) > i32(63) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75613), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000))), unsafe.Pointer(str(75757))) crt.X__builtin_abort(tls) } @@ -56692,24 +59183,24 @@ func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _p } _4: - _lhs = int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0)))))) + _lhs = int64(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0)))))) goto _15 _5: - _lhs = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))) + _lhs = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))) goto _15 _6: - _lhs = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))) + _lhs = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))) goto _15 _7: - _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(3))))) + _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(3))))) _lhs = int64(*(*int32)(unsafe.Pointer(&_y))) goto _15 _8: - _lhs = int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))))) + _lhs = int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1))))))) goto _15 _9: - _x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(3)))))) - _x = (_x << uint(i32(32))) | uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(3)))))) + _x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(3)))))) + _x = (_x << uint(i32(32))) | uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(3)))))) _lhs = *(*int64)(unsafe.Pointer(&_x)) goto _15 _10: @@ -56739,7 +59230,7 @@ _15: goto _21 } _res = int32(_pPKey2.X3) - *(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPKey2.X7)) = uint8(i32(1)) _21: func() { if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 { @@ -56753,22 +59244,25 @@ _21: panic(0) } -// Count the number of fields (a.k.a. columns) in the record given by -// pKey,nKey. The verify that this count is less than or equal to the -// limit given by pKeyInfo->nField + pKeyInfo->nXField. -// -// If this constraint is not satisfied, it means that the high-speed -// vdbeRecordCompareInt() and vdbeRecordCompareString() routines will -// not work correctly. If this assert() ever fires, it probably means -// that the KeyInfo.nField or KeyInfo.nXField values were computed -// incorrectly. +// C comment +// /* +// ** Count the number of fields (a.k.a. columns) in the record given by +// ** pKey,nKey. The verify that this count is less than or equal to the +// ** limit given by pKeyInfo->nField + pKeyInfo->nXField. +// ** +// ** If this constraint is not satisfied, it means that the high-speed +// ** vdbeRecordCompareInt() and vdbeRecordCompareString() routines will +// ** not work correctly. If this assert() ever fires, it probably means +// ** that the KeyInfo.nField or KeyInfo.nXField values were computed +// ** incorrectly. +// */ func _vdbeAssertFieldCountWithinLimits(tls *crt.TLS, _nKey int32, _pKey unsafe.Pointer, _pKeyInfo *XKeyInfo) { var _nField int32 var _szHdr, _idx, _notUsed uint32 var _aKey *uint8 _nField = i32(0) _aKey = (*uint8)(_pKey) - if (_sqlite3Config.X6) == i32(0) { + if _sqlite3Config.X6 == i32(0) { return } _idx = uint32(uint8(func() int32 { @@ -56832,25 +59326,28 @@ func _sqlite3VdbeRecordCompare(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, i32(0)) } -// This function compares the two table rows or index records -// specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero -// or positive integer if key1 is less than, equal to or -// greater than key2. The {nKey1, pKey1} key must be a blob -// created by the OP_MakeRecord opcode of the VDBE. The pPKey2 -// key must be a parsed key such as obtained from -// sqlite3VdbeParseRecord. -// -// If argument bSkip is non-zero, it is assumed that the caller has already -// determined that the first fields of the keys are equal. -// -// Key1 and Key2 do not have to contain the same number of fields. If all -// fields that appear in both keys are equal, then pPKey2->default_rc is -// returned. -// -// If database corruption is discovered, set pPKey2->errCode to -// SQLITE_CORRUPT and return 0. If an OOM error is encountered, -// pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the -// malloc-failed flag set on database handle (pPKey2->pKeyInfo->db). +// C comment +// /* +// ** This function compares the two table rows or index records +// ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero +// ** or positive integer if key1 is less than, equal to or +// ** greater than key2. The {nKey1, pKey1} key must be a blob +// ** created by the OP_MakeRecord opcode of the VDBE. The pPKey2 +// ** key must be a parsed key such as obtained from +// ** sqlite3VdbeParseRecord. +// ** +// ** If argument bSkip is non-zero, it is assumed that the caller has already +// ** determined that the first fields of the keys are equal. +// ** +// ** Key1 and Key2 do not have to contain the same number of fields. If all +// ** fields that appear in both keys are equal, then pPKey2->default_rc is +// ** returned. +// ** +// ** If database corruption is discovered, set pPKey2->errCode to +// ** SQLITE_CORRUPT and return 0. If an OOM error is encountered, +// ** pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the +// ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db). +// */ func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _bSkip int32) (r0 int32) { var _i, _rc, _26_nCmp, _29_nStr, _34_nCmp int32 var _9_lhs, _9_rhs int64 @@ -56865,15 +59362,15 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe _aKey1 = (*uint8)(_pKey1) if _bSkip != 0 { _idx1 = uint32(i32(1) + int32(uint8(func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { return func() int32 { - _1_s1 = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1))))) + _1_s1 = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(1))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(i32(1)))), &_1_s1)) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(i32(1)))), &_1_s1)) }()))) - _szHdr1 = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(0))))) + _szHdr1 = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(0))))) _d1 = _szHdr1 + _sqlite3VdbeSerialTypeLen(tls, _1_s1) _i = i32(1) *(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(72) @@ -56887,14 +59384,14 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe }())) _d1 = _szHdr1 if _d1 > uint32(_nKey1) { - *(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75426))) + *(*uint8)(unsafe.Pointer(&_pPKey2.X4)) = uint8(_sqlite3CorruptError(tls, i32(75426))) return i32(0) } _i = i32(0) _3: - *(*int32)(unsafe.Pointer(&(_mem1.X7))) = i32(0) + *(*int32)(unsafe.Pointer(&_mem1.X7)) = i32(0) func() { - if (int32((*XKeyInfo)(_pPKey2.X0).X2)+int32((*XKeyInfo)(_pPKey2.X0).X3)) < int32(_pPKey2.X2) && (_sqlite3Config.X6) != i32(0) { + if (int32((*XKeyInfo)(_pPKey2.X0).X2)+int32((*XKeyInfo)(_pPKey2.X0).X3)) < int32(_pPKey2.X2) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75433), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(75965))) crt.X__builtin_abort(tls) } @@ -56912,7 +59409,7 @@ _3: } }() func() { - if _idx1 > _szHdr1 && (_sqlite3Config.X6) != i32(0) { + if _idx1 > _szHdr1 && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76105))) crt.X__builtin_abort(tls) } @@ -56921,7 +59418,7 @@ _17: if (int32(_pRhs.X1) & i32(4)) == 0 { goto _18 } - _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) + _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) if _4_serial_type >= uint32(i32(10)) { _rc = i32(1) goto _24 @@ -56931,12 +59428,12 @@ _17: goto _24 } if _4_serial_type == uint32(i32(7)) { - _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1) - _rc = -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0)))))) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1) + _rc = -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0)))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_mem1.X0))))) goto _24 } - _9_lhs = _vdbeRecordDecodeInt(tls, _4_serial_type, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1)))) - _9_rhs = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0))))) + _9_lhs = _vdbeRecordDecodeInt(tls, _4_serial_type, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1)))) + _9_rhs = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0)))) if _9_lhs < _9_rhs { _rc = i32(-1) goto _27 @@ -56951,7 +59448,7 @@ _18: if (int32(_pRhs.X1) & i32(8)) == 0 { goto _29 } - _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) + _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) if _4_serial_type >= uint32(i32(10)) { _rc = i32(1) goto _33 @@ -56960,21 +59457,21 @@ _18: _rc = i32(-1) goto _33 } - _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1) if _4_serial_type != uint32(i32(7)) { goto _34 } - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0)))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_mem1.X0))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0))))) { _rc = i32(-1) goto _37 } - if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0)))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) { + if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_mem1.X0))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0))))) { _rc = i32(1) } _37: goto _38 _34: - _rc = _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) + _rc = _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_mem1.X0)))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0))))) _38: _33: goto _73 @@ -56983,13 +59480,13 @@ _29: goto _40 } func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) < int32(u8(128)) { return func() int32 { - _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) + _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)) }() if _4_serial_type < uint32(i32(12)) { _rc = i32(-1) @@ -56999,28 +59496,28 @@ _29: _rc = i32(1) goto _46 } - *(*int32)(unsafe.Pointer(&(_mem1.X4))) = int32((_4_serial_type - uint32(i32(12))) / uint32(i32(2))) + *(*int32)(unsafe.Pointer(&_mem1.X4)) = int32((_4_serial_type - uint32(i32(12))) / uint32(i32(2))) if (_d1 + uint32(_mem1.X4)) > uint32(_nKey1) { - *(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75501))) + *(*uint8)(unsafe.Pointer(&_pPKey2.X4)) = uint8(_sqlite3CorruptError(tls, i32(75501))) return i32(0) } - if (*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 8*uintptr(_i)))) != nil { - *(*uint8)(unsafe.Pointer(&(_mem1.X2))) = _pKeyInfo.X1 - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem1.X9))))) = (*Xsqlite3)(_pKeyInfo.X4) - *(*uint16)(unsafe.Pointer(&(_mem1.X1))) = uint16(i32(2)) - *(**int8)(unsafe.Pointer(&(_mem1.X5))) = (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_d1))))) - _rc = _vdbeCompareMemString(tls, &_mem1, _pRhs, *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 8*uintptr(_i))), (*uint8)(unsafe.Pointer(&(_pPKey2.X4)))) + if (*(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X6)))) + 8*uintptr(_i)))) != nil { + *(*uint8)(unsafe.Pointer(&_mem1.X2)) = _pKeyInfo.X1 + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem1.X9)))) = (*Xsqlite3)(_pKeyInfo.X4) + *(*uint16)(unsafe.Pointer(&_mem1.X1)) = uint16(i32(2)) + *(**int8)(unsafe.Pointer(&_mem1.X5)) = (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_d1))))) + _rc = _vdbeCompareMemString(tls, &_mem1, _pRhs, *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X6)))) + 8*uintptr(_i))), (*uint8)(unsafe.Pointer(&_pPKey2.X4))) goto _50 } _26_nCmp = func() int32 { - if (_mem1.X4) < (_pRhs.X4) { - return (_mem1.X4) + if _mem1.X4 < _pRhs.X4 { + return _mem1.X4 } - return (_pRhs.X4) + return _pRhs.X4 }() - _rc = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1)))), (unsafe.Pointer)(_pRhs.X5), uint64(_26_nCmp)) + _rc = crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1)))), unsafe.Pointer(_pRhs.X5), uint64(_26_nCmp)) if _rc == i32(0) { - _rc = (_mem1.X4) - (_pRhs.X4) + _rc = _mem1.X4 - _pRhs.X4 } _50: _46: @@ -57030,19 +59527,19 @@ _40: goto _55 } func() { - if (int32(_pRhs.X1)&i32(16384)) != i32(0) && (_pRhs.X4) != i32(0) { + if (int32(_pRhs.X1)&i32(16384)) != i32(0) && _pRhs.X4 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75521), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76132))) crt.X__builtin_abort(tls) } }() func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) < int32(u8(128)) { return func() int32 { - _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) + _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)) }() if (_4_serial_type < uint32(i32(12))) || ((_4_serial_type & uint32(i32(1))) != 0) { _rc = i32(-1) @@ -57050,41 +59547,41 @@ _40: } _29_nStr = int32((_4_serial_type - uint32(i32(12))) / uint32(i32(2))) if (_d1 + uint32(_29_nStr)) > uint32(_nKey1) { - *(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75531))) + *(*uint8)(unsafe.Pointer(&_pPKey2.X4)) = uint8(_sqlite3CorruptError(tls, i32(75531))) return i32(0) } if (int32(_pRhs.X1) & i32(16384)) == 0 { goto _66 } - if _isAllZero(tls, (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))))), _29_nStr) == 0 { + if _isAllZero(tls, (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1))))), _29_nStr) == 0 { _rc = i32(1) goto _68 } - _rc = _29_nStr - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) + _rc = _29_nStr - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pRhs.X0))))) _68: goto _69 _66: _34_nCmp = func() int32 { - if _29_nStr < (_pRhs.X4) { + if _29_nStr < _pRhs.X4 { return _29_nStr } - return (_pRhs.X4) + return _pRhs.X4 }() - _rc = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1)))), (unsafe.Pointer)(_pRhs.X5), uint64(_34_nCmp)) + _rc = crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1)))), unsafe.Pointer(_pRhs.X5), uint64(_34_nCmp)) if _rc == i32(0) { - _rc = _29_nStr - (_pRhs.X4) + _rc = _29_nStr - _pRhs.X4 } _69: _63: goto _73 _55: - _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) + _4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(_idx1)))) _rc = bool2int(_4_serial_type != uint32(i32(0))) _73: if _rc == i32(0) { goto _74 } - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 { _rc = -_rc } func() { @@ -57094,7 +59591,7 @@ _73: } }() func() { - if (_mem1.X7) != i32(0) { + if _mem1.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75558), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76223))) crt.X__builtin_abort(tls) } @@ -57118,36 +59615,39 @@ _74: goto _17 } func() { - if (_mem1.X7) != i32(0) { + if _mem1.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76223))) crt.X__builtin_abort(tls) } }() func() { - if (_sqlite3Config.X6) != i32(0) && _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, int32(_pPKey2.X3)) == 0 && ((*Xsqlite3)(_pKeyInfo.X4).X17) == 0 { + if _sqlite3Config.X6 != i32(0) && _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, int32(_pPKey2.X3)) == 0 && ((*Xsqlite3)(_pKeyInfo.X4).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76240))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPKey2.X7)) = uint8(i32(1)) return int32(_pPKey2.X3) _ = _mem1 panic(0) } -// Return the length of the data corresponding to the supplied serial-type. +// C comment +// /* +// ** Return the length of the data corresponding to the supplied serial-type. +// */ func _sqlite3VdbeSerialTypeLen(tls *crt.TLS, _serial_type uint32) (r0 uint32) { if _serial_type >= uint32(i32(128)) { return (_serial_type - uint32(i32(12))) / uint32(i32(2)) } func() { - if _serial_type >= uint32(i32(12)) && uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))) != ((_serial_type-uint32(i32(12)))/uint32(i32(2))) { + if _serial_type >= uint32(i32(12)) && uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))) != ((_serial_type-uint32(i32(12)))/uint32(i32(2))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeLenØ00__func__Ø000))), unsafe.Pointer(str(76349))) crt.X__builtin_abort(tls) } }() - return uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))) + return uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))) } var _sqlite3SmallTypeSizes [128]uint8 @@ -57168,16 +59668,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000[0], str(76449), 33) } -// The first argument passed to this function is a serial-type that -// corresponds to an integer - all values between 1 and 9 inclusive -// except 7. The second points to a buffer containing an integer value -// serialized according to serial_type. This function deserializes -// and returns the value. +// C comment +// /* +// ** The first argument passed to this function is a serial-type that +// ** corresponds to an integer - all values between 1 and 9 inclusive +// ** except 7. The second points to a buffer containing an integer value +// ** serialized according to serial_type. This function deserializes +// ** and returns the value. +// */ func _vdbeRecordDecodeInt(tls *crt.TLS, _serial_type uint32, _aKey *uint8) (r0 int64) { var _y uint32 var _4_x uint64 func() { - if (_sqlite3Config.X6) != i32(0) && (_serial_type < uint32(i32(1)) || _serial_type > uint32(i32(9)) || _serial_type == uint32(i32(7))) { + if _sqlite3Config.X6 != i32(0) && (_serial_type < uint32(i32(1)) || _serial_type > uint32(i32(9)) || _serial_type == uint32(i32(7))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75344), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordDecodeIntØ00__func__Ø000))), unsafe.Pointer(str(76482))) crt.X__builtin_abort(tls) } @@ -57202,24 +59705,24 @@ func _vdbeRecordDecodeInt(tls *crt.TLS, _serial_type uint32, _aKey *uint8) (r0 i } _6: - return int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0)))))) + return int64(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0)))))) _8: - return int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))) + return int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))) _9: - return int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))) + return int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))) _10: - _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(3))))) + _y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(3))))) return int64(*(*int32)(unsafe.Pointer(&_y))) _11: - return int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))))) + return int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(2)))))) + 1*uintptr(i32(3)))))) + (i64(4294967296) * int64((i32(256)*int32(int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0)))))))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1))))))) _12: - _4_x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(3)))))) - _4_x = (_4_x << uint(i32(32))) | uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(3)))))) + _4_x = uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(1)))))<<uint(i32(16)))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(2)))))<<uint(i32(8)))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + 1*uintptr(i32(3)))))) + _4_x = (_4_x << uint(i32(32))) | uint64((((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(0)))))<<uint(i32(24)))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(1)))))<<uint(i32(16))))|uint32(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(2)))))<<uint(i32(8))))|uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(i32(4)))))) + 1*uintptr(i32(3)))))) return *(*int64)(unsafe.Pointer(&_4_x)) _13: @@ -57235,15 +59738,18 @@ func init() { crt.Xstrncpy(nil, &_vdbeRecordDecodeIntØ00__func__Ø000[0], str(76549), 20) } -// This function compares two index or table record keys in the same way -// as the sqlite3VdbeRecordCompare() routine. Unlike VdbeRecordCompare(), -// this function deserializes and compares values using the -// sqlite3VdbeSerialGet() and sqlite3MemCompare() functions. It is used -// in assert() statements to ensure that the optimized code in -// sqlite3VdbeRecordCompare() returns results with these two primitives. -// -// Return true if the result of comparison is equivalent to desiredResult. -// Return false if there is a disagreement. +// C comment +// /* +// ** This function compares two index or table record keys in the same way +// ** as the sqlite3VdbeRecordCompare() routine. Unlike VdbeRecordCompare(), +// ** this function deserializes and compares values using the +// ** sqlite3VdbeSerialGet() and sqlite3MemCompare() functions. It is used +// ** in assert() statements to ensure that the optimized code in +// ** sqlite3VdbeRecordCompare() returns results with these two primitives. +// ** +// ** Return true if the result of comparison is equivalent to desiredResult. +// ** Return false if there is a disagreement. +// */ func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _desiredResult int32) (r0 int32) { var _i, _rc int32 var _d1, _idx1, _szHdr1, _1_serial_type1 uint32 @@ -57257,9 +59763,9 @@ func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, if (*Xsqlite3)(_pKeyInfo.X4) == nil { return i32(1) } - *(*uint8)(unsafe.Pointer(&(_mem1.X2))) = _pKeyInfo.X1 - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem1.X9))))) = (*Xsqlite3)(_pKeyInfo.X4) - *(*int32)(unsafe.Pointer(&(_mem1.X7))) = i32(0) + *(*uint8)(unsafe.Pointer(&_mem1.X2)) = _pKeyInfo.X1 + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem1.X9)))) = (*Xsqlite3)(_pKeyInfo.X4) + *(*int32)(unsafe.Pointer(&_mem1.X7)) = i32(0) _idx1 = uint32(uint8(func() int32 { if int32(*_aKey1) < int32(u8(128)) { return func() int32 { _szHdr1 = uint32(*_aKey1); return i32(1) }() @@ -57271,13 +59777,13 @@ func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, } _d1 = _szHdr1 func() { - if (int32(_pKeyInfo.X2)+int32(_pKeyInfo.X3)) < int32(_pPKey2.X2) && (_sqlite3Config.X6) != i32(0) { + if (int32(_pKeyInfo.X2)+int32(_pKeyInfo.X3)) < int32(_pPKey2.X2) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75039), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76569))) crt.X__builtin_abort(tls) } }() func() { - if (_pKeyInfo.X5) == nil { + if _pKeyInfo.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75040), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(37852))) crt.X__builtin_abort(tls) } @@ -57289,7 +59795,7 @@ func _vdbeRecordCompareDebug(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, } }() func() { - if _idx1 > _szHdr1 && (_sqlite3Config.X6) != i32(0) { + if _idx1 > _szHdr1 && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75042), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76105))) crt.X__builtin_abort(tls) } @@ -57313,20 +59819,20 @@ _14: } { p := &_d1 - *p = (*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _1_serial_type1, &_mem1) + *p = (*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_d1))), _1_serial_type1, &_mem1) sink5(*p) } - _rc = _sqlite3MemCompare(tls, &_mem1, (*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+72*uintptr(_i))), *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 8*uintptr(_i)))) + _rc = _sqlite3MemCompare(tls, &_mem1, (*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+72*uintptr(_i))), *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X6)))) + 8*uintptr(_i)))) if _rc == i32(0) { goto _20 } func() { - if (_mem1.X7) != i32(0) { + if _mem1.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75069), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76223))) crt.X__builtin_abort(tls) } }() - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 { _rc = -_rc } goto _debugCompareEnd @@ -57337,7 +59843,7 @@ _20: } _19: func() { - if (_mem1.X7) != i32(0) { + if _mem1.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75082), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76223))) crt.X__builtin_abort(tls) } @@ -57353,7 +59859,7 @@ _debugCompareEnd: if (_desiredResult > i32(0)) && (_rc > i32(0)) { return i32(1) } - if (_sqlite3Config.X6) == i32(0) { + if _sqlite3Config.X6 == i32(0) { return i32(1) } if ((*Xsqlite3)(_pKeyInfo.X4).X17) != 0 { @@ -57371,8 +59877,11 @@ func init() { crt.Xstrncpy(nil, &_vdbeRecordCompareDebugØ00__func__Ø000[0], str(76653), 23) } -// Return the number of bytes that will be needed to store the given -// 64-bit integer. +// C comment +// /* +// ** Return the number of bytes that will be needed to store the given +// ** 64-bit integer. +// */ func _sqlite3VarintLen(tls *crt.TLS, _v uint64) (r0 int32) { var _i int32 _i = i32(1) @@ -57404,10 +59913,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeFindCompareØ00__func__Ø000[0], str(76698), 23) } -// This function is an optimized version of sqlite3VdbeRecordCompare() -// that (a) the first field of pPKey2 is a string, that (b) the first field -// uses the collation sequence BINARY and (c) that the size-of-header varint -// at the start of (pKey1/nKey1) fits in a single byte. +// C comment +// /* +// ** This function is an optimized version of sqlite3VdbeRecordCompare() +// ** that (a) the first field of pPKey2 is a string, that (b) the first field +// ** uses the collation sequence BINARY and (c) that the size-of-header varint +// ** at the start of (pKey1/nKey1) fits in a single byte. +// */ func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) { var _serial_type, _res, _3_nCmp, _3_nStr, _3_szHdr int32 var _aKey1 *uint8 @@ -57420,13 +59932,13 @@ func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, }() _vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.X0)) func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { return func() int32 { - _serial_type = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1)))))) + _serial_type = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(1)))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_serial_type)))) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_serial_type)))) }() if _serial_type < i32(12) { _res = int32(_pPKey2.X5) @@ -57436,10 +59948,10 @@ func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _res = int32(_pPKey2.X6) goto _7 } - _3_szHdr = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(0))))) + _3_szHdr = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + 1*uintptr(i32(0))))) _3_nStr = (_serial_type - i32(12)) / i32(2) if (_3_szHdr + _3_nStr) > _nKey1 { - *(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75716))) + *(*uint8)(unsafe.Pointer(&_pPKey2.X4)) = uint8(_sqlite3CorruptError(tls, i32(75716))) return i32(0) } _3_nCmp = func() int32 { @@ -57448,7 +59960,7 @@ func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, } return _3_nStr }() - _res = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_3_szHdr)))), (unsafe.Pointer)((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+72*uintptr(i32(0)))).X5), uint64(_3_nCmp)) + _res = crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+1*uintptr(_3_szHdr)))), unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+72*uintptr(i32(0)))).X5), uint64(_3_nCmp)) if _res != i32(0) { goto _11 } @@ -57461,7 +59973,7 @@ func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, goto _14 } _res = int32(_pPKey2.X3) - *(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPKey2.X7)) = uint8(i32(1)) _14: goto _17 _12: @@ -57481,7 +59993,7 @@ _11: _20: _7: func() { - if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 && (_sqlite3Config.X6) != i32(0) && ((*Xsqlite3)((*XKeyInfo)(_pPKey2.X0).X4).X17) == 0 { + if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 && _sqlite3Config.X6 != i32(0) && ((*Xsqlite3)((*XKeyInfo)(_pPKey2.X0).X4).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75743), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000))), unsafe.Pointer(str(76753))) crt.X__builtin_abort(tls) } @@ -57495,25 +60007,28 @@ func init() { crt.Xstrncpy(nil, &_vdbeRecordCompareStringØ00__func__Ø000[0], str(76855), 24) } -// Move the cursor to point to the root page of its b-tree structure. -// -// If the table has a virtual root page, then the cursor is moved to point -// to the virtual root page instead of the actual root page. A table has a -// virtual root page when the actual root page contains no cells and a -// single child page. This can only happen with the table rooted at page 1. -// -// If the b-tree structure is empty, the cursor state is set to -// CURSOR_INVALID. Otherwise, the cursor is set to point to the first -// cell located on the root (or virtual root) page and the cursor state -// is set to CURSOR_VALID. -// -// If this function returns successfully, it may be assumed that the -// page-header flags indicate that the [virtual] root-page is the expected -// kind of b-tree page (i.e. if when opening the cursor the caller did not -// specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D, -// indicating a table b-tree, or if the caller did specify a KeyInfo -// structure the flags byte is set to 0x02 or 0x0A, indicating an index -// b-tree). +// C comment +// /* +// ** Move the cursor to point to the root page of its b-tree structure. +// ** +// ** If the table has a virtual root page, then the cursor is moved to point +// ** to the virtual root page instead of the actual root page. A table has a +// ** virtual root page when the actual root page contains no cells and a +// ** single child page. This can only happen with the table rooted at page 1. +// ** +// ** If the b-tree structure is empty, the cursor state is set to +// ** CURSOR_INVALID. Otherwise, the cursor is set to point to the first +// ** cell located on the root (or virtual root) page and the cursor state +// ** is set to CURSOR_VALID. +// ** +// ** If this function returns successfully, it may be assumed that the +// ** page-header flags indicate that the [virtual] root-page is the expected +// ** kind of b-tree page (i.e. if when opening the cursor the caller did not +// ** specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D, +// ** indicating a table b-tree, or if the caller did specify a KeyInfo +// ** structure the flags byte is set to 0x02 or 0x0A, indicating an index +// ** b-tree). +// */ func _moveToRoot(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc int32 var _11_subpage uint32 @@ -57533,7 +60048,7 @@ func _moveToRoot(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } if int32(_pCur.X12) == i32(4) { func() { - if (_pCur.X9) == i32(0) { + if _pCur.X9 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63955), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76879))) crt.X__builtin_abort(tls) } @@ -57545,26 +60060,26 @@ _2: if int32(_pCur.X14) < i32(0) { goto _6 } - if (_pCur.X14) == 0 { + if _pCur.X14 == 0 { goto _7 } _8: func() { - if (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) == nil { + if (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63964), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76905))) crt.X__builtin_abort(tls) } }() - _releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1)))))) - if (_pCur.X14) != 0 { + _releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&_pCur.X14)), -1))))) + if _pCur.X14 != 0 { goto _8 } goto _skip_init _7: goto _13 _6: - if (_pCur.X7) == uint32(i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + if _pCur.X7 == uint32(i32(0)) { + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) return i32(0) } func() { @@ -57573,17 +60088,17 @@ _6: crt.X__builtin_abort(tls) } }() - _rc = _getAndInitPage(tls, (*XBtShared)((*XBtree)(_pCur.X0).X1), _pCur.X7, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+8*uintptr(i32(0)))), nil, int32(_pCur.X11)) + _rc = _getAndInitPage(tls, (*XBtShared)((*XBtree)(_pCur.X0).X1), _pCur.X7, (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19))))+8*uintptr(i32(0)))), nil, int32(_pCur.X11)) if _rc != i32(0) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) return _rc } - *(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pCur.X15))) = (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(i32(0))))).X2 + *(*int8)(unsafe.Pointer(&_pCur.X14)) = int8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X15)) = (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(i32(0))))).X2 _13: - _pRoot = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(i32(0)))) + _pRoot = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(i32(0)))) func() { - if (_pRoot.X4) != (_pCur.X7) { + if _pRoot.X4 != _pCur.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63984), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76952))) crt.X__builtin_abort(tls) } @@ -57598,30 +60113,30 @@ _13: return _sqlite3CorruptError(tls, i32(63998)) } _skip_init: - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-15)) sink2(*p) } - _pRoot = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(i32(0)))) + _pRoot = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(i32(0)))) if int32(_pRoot.X14) > i32(0) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(1)) goto _28 } - if (_pRoot.X5) != 0 { + if _pRoot.X5 != 0 { goto _26 } - if (_pRoot.X4) != uint32(i32(1)) { + if _pRoot.X4 != uint32(i32(1)) { return _sqlite3CorruptError(tls, i32(64011)) } - _11_subpage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8))))) - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1)) + _11_subpage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8))))) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(1)) _rc = _moveToChild(tls, _pCur, _11_subpage) goto _28 _26: - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) _28: return _rc } @@ -57632,25 +60147,31 @@ func init() { crt.Xstrncpy(nil, &_moveToRootØ00__func__Ø000[0], str(77017), 11) } -// Determine whether or not a cursor has moved from the position where -// it was last placed, or has been invalidated for any other reason. -// Cursors can move when the row they are pointing at is deleted out -// from under them, for example. Cursor might also move if a btree -// is rebalanced. -// -// Calling this routine with a NULL cursor pointer returns false. -// -// Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor -// back to where it ought to be if this routine returns true. +// C comment +// /* +// ** Determine whether or not a cursor has moved from the position where +// ** it was last placed, or has been invalidated for any other reason. +// ** Cursors can move when the row they are pointing at is deleted out +// ** from under them, for example. Cursor might also move if a btree +// ** is rebalanced. +// ** +// ** Calling this routine with a NULL cursor pointer returns false. +// ** +// ** Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor +// ** back to where it ought to be if this routine returns true. +// */ func _sqlite3BtreeCursorHasMoved(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { return bool2int(int32(_pCur.X12) != i32(1)) } -// Something has moved cursor "p" out of place. Maybe the row it was -// pointed to was deleted out from under it. Or maybe the btree was -// rebalanced. Whatever the cause, try to restore "p" to the place it -// is supposed to be pointing. If the row was deleted out from under the -// cursor, set the cursor to point to a NULL row. +// C comment +// /* +// ** Something has moved cursor "p" out of place. Maybe the row it was +// ** pointed to was deleted out from under it. Or maybe the btree was +// ** rebalanced. Whatever the cause, try to restore "p" to the place it +// ** is supposed to be pointing. If the row was deleted out from under the +// ** cursor, set the cursor to point to a NULL row. +// */ func _handleMovedCursor(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { var _isDifferentRow, _rc int32 func() { @@ -57660,21 +60181,21 @@ func _handleMovedCursor(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { } }() func() { - if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))) == nil { + if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74501), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000))), unsafe.Pointer(str(77028))) crt.X__builtin_abort(tls) } }() func() { - if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) == 0 { + if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14)))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74502), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000))), unsafe.Pointer(str(77045))) crt.X__builtin_abort(tls) } }() - _rc = _sqlite3BtreeCursorRestore(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))), &_isDifferentRow) - *(*uint32)(unsafe.Pointer(&(_p.X11))) = uint32(i32(0)) + _rc = _sqlite3BtreeCursorRestore(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14))))), &_isDifferentRow) + *(*uint32)(unsafe.Pointer(&_p.X11)) = uint32(i32(0)) if _isDifferentRow != 0 { - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(1)) } return _rc } @@ -57685,17 +60206,20 @@ func init() { crt.Xstrncpy(nil, &_handleMovedCursorØ00__func__Ø000[0], str(77087), 18) } -// This routine restores a cursor back to its original position after it -// has been moved by some outside activity (such as a btree rebalance or -// a row having been deleted out from under the cursor). -// -// On success, the *pDifferentRow parameter is false if the cursor is left -// pointing at exactly the same row. *pDifferntRow is the row the cursor -// was pointing to has been deleted, forcing the cursor to point to some -// nearby row. -// -// This routine should only be called for a cursor that just returned -// TRUE from sqlite3BtreeCursorHasMoved(). +// C comment +// /* +// ** This routine restores a cursor back to its original position after it +// ** has been moved by some outside activity (such as a btree rebalance or +// ** a row having been deleted out from under the cursor). +// ** +// ** On success, the *pDifferentRow parameter is false if the cursor is left +// ** pointing at exactly the same row. *pDifferntRow is the row the cursor +// ** was pointing to has been deleted, forcing the cursor to point to some +// ** nearby row. +// ** +// ** This routine should only be called for a cursor that just returned +// ** TRUE from sqlite3BtreeCursorHasMoved(). +// */ func _sqlite3BtreeCursorRestore(tls *crt.TLS, _pCur *XBtCursor, _pDifferentRow *int32) (r0 int32) { var _rc int32 func() { @@ -57725,7 +60249,7 @@ func _sqlite3BtreeCursorRestore(tls *crt.TLS, _pCur *XBtCursor, _pDifferentRow * goto _8 } func() { - if (_pCur.X9) != i32(0) { + if _pCur.X9 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59898), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000))), unsafe.Pointer(str(77140))) crt.X__builtin_abort(tls) } @@ -57741,52 +60265,62 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCursorRestoreØ00__func__Ø000[0], str(77158), 26) } -// The next routine used only within assert() statements +// C comment +// /* The next routine used only within assert() statements */ -// Return true if the given BtCursor is valid. A valid cursor is one -// that is currently pointing to a row in a (non-empty) table. -// This is a verification routine is used only within assert() statements. +// C comment +// /* +// ** Return true if the given BtCursor is valid. A valid cursor is one +// ** that is currently pointing to a row in a (non-empty) table. +// ** This is a verification routine is used only within assert() statements. +// */ func _sqlite3BtreeCursorIsValid(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { return bool2int((_pCur != nil) && (int32(_pCur.X12) == i32(1))) } -// For the entry that cursor pCur is point to, return as -// many bytes of the key or data as are available on the local -// b-tree page. Write the number of available bytes into *pAmt. -// -// The pointer returned is ephemeral. The key/data may move -// or be destroyed on the next call to any Btree routine, -// including calls from other threads against the same cache. -// Hence, a mutex on the BtShared should be held prior to calling -// this routine. -// -// These routines is used to get quick access to key and data -// in the common case where no overflow pages are used. +// C comment +// /* +// ** For the entry that cursor pCur is point to, return as +// ** many bytes of the key or data as are available on the local +// ** b-tree page. Write the number of available bytes into *pAmt. +// ** +// ** The pointer returned is ephemeral. The key/data may move +// ** or be destroyed on the next call to any Btree routine, +// ** including calls from other threads against the same cache. +// ** Hence, a mutex on the BtShared should be held prior to calling +// ** this routine. +// ** +// ** These routines is used to get quick access to key and data +// ** in the common case where no overflow pages are used. +// */ func _sqlite3BtreePayloadFetch(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) { return _fetchPayload(tls, _pCur, _pAmt) } -// Return a pointer to payload information from the entry that the -// pCur cursor is pointing to. The pointer is to the beginning of -// the key if index btrees (pPage->intKey==0) and is the data for -// table btrees (pPage->intKey==1). The number of bytes of available -// key/data is written into *pAmt. If *pAmt==0, then the value -// returned will not be a valid pointer. -// -// This routine is an optimization. It is common for the entire key -// and data to fit on the local page and for there to be no overflow -// pages. When that is so, this routine can be used to access the -// key and data without making a copy. If the key and/or data spills -// onto overflow pages, then accessPayload() must be used to reassemble -// the key/data and copy it into a preallocated buffer. -// -// The pointer returned by this routine looks directly into the cached -// page of the database. The data might change or move the next time -// any btree routine is called. +// C comment +// /* +// ** Return a pointer to payload information from the entry that the +// ** pCur cursor is pointing to. The pointer is to the beginning of +// ** the key if index btrees (pPage->intKey==0) and is the data for +// ** table btrees (pPage->intKey==1). The number of bytes of available +// ** key/data is written into *pAmt. If *pAmt==0, then the value +// ** returned will not be a valid pointer. +// ** +// ** This routine is an optimization. It is common for the entire key +// ** and data to fit on the local page and for there to be no overflow +// ** pages. When that is so, this routine can be used to access the +// ** key and data without making a copy. If the key and/or data spills +// ** onto overflow pages, then accessPayload() must be used to reassemble +// ** the key/data and copy it into a preallocated buffer. +// ** +// ** The pointer returned by this routine looks directly into the cached +// ** page of the database. The data might change or move the next time +// ** any btree routine is called. +// */ func _fetchPayload(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) { var _amt uint32 func() { - if _pCur == nil || int32(_pCur.X14) < i32(0) || (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) == nil { + if _pCur == nil || int32(_pCur.X14) < i32(0) || (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63816), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77184))) crt.X__builtin_abort(tls) } @@ -57810,35 +60344,35 @@ func _fetchPayload(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Poi } }() func() { - if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) { + if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63820), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(10597))) crt.X__builtin_abort(tls) } }() func() { - if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) <= i32(0) { + if int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63821), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77239))) crt.X__builtin_abort(tls) } }() func() { - if crt.P2U(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1)) <= crt.P2U(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X19)) && (_sqlite3Config.X6) != i32(0) { + if crt.P2U(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X1)) <= crt.P2U(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X19)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63822), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77258))) crt.X__builtin_abort(tls) } }() func() { - if crt.P2U(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1)) >= crt.P2U(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X20)) && (_sqlite3Config.X6) != i32(0) { + if crt.P2U(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X1)) >= crt.P2U(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X20)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63823), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77325))) crt.X__builtin_abort(tls) } }() - _amt = uint32(int32(int64((uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X20)) - uintptr(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1))) / 1))) - if uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) < _amt { - _amt = uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) + _amt = uint32(int32(int64((uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X20)) - uintptr(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X1))) / 1))) + if uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) < _amt { + _amt = uint32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X3) } *_pAmt = _amt - return (unsafe.Pointer)((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1) + return unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X1) } var _fetchPayloadØ00__func__Ø000 [13]int8 @@ -57879,9 +60413,9 @@ func _sqlite3VdbeMemFromBtree(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _a } }() if (_offset + _amt) <= _available { - *(**int8)(unsafe.Pointer(&(_pMem.X5))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zData)) + 1*uintptr(_offset))) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4112)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(_amt) + *(**int8)(unsafe.Pointer(&_pMem.X5)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zData)) + 1*uintptr(_offset))) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(4112)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = int32(_amt) goto _9 } _rc = _vdbeMemFromBtreeResize(tls, _pCur, _offset, _amt, _pMem) @@ -57895,31 +60429,34 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemFromBtreeØ00__func__Ø000[0], str(77470), 24) } -// Move data out of a btree key or data field and into a Mem structure. -// The data is payload from the entry that pCur is currently pointing -// to. offset and amt determine what portion of the data or key to retrieve. -// The result is written into the pMem element. -// -// The pMem object must have been initialized. This routine will use -// pMem->zMalloc to hold the content from the btree, if possible. New -// pMem->zMalloc space will be allocated if necessary. The calling routine -// is responsible for making sure that the pMem object is eventually -// destroyed. -// -// If this routine fails for any reason (malloc returns NULL or unable -// to read from the disk) then the pMem is left in an inconsistent state. +// C comment +// /* +// ** Move data out of a btree key or data field and into a Mem structure. +// ** The data is payload from the entry that pCur is currently pointing +// ** to. offset and amt determine what portion of the data or key to retrieve. +// ** The result is written into the pMem element. +// ** +// ** The pMem object must have been initialized. This routine will use +// ** pMem->zMalloc to hold the content from the btree, if possible. New +// ** pMem->zMalloc space will be allocated if necessary. The calling routine +// ** is responsible for making sure that the pMem object is eventually +// ** destroyed. +// ** +// ** If this routine fails for any reason (malloc returns NULL or unable +// ** to read from the disk) then the pMem is left in an inconsistent state. +// */ func _vdbeMemFromBtreeResize(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) { var _rc int32 - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(1)) if i32(0) != store1(&_rc, _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(_amt+uint32(i32(2))))) { goto _0 } - _rc = _sqlite3BtreePayload(tls, _pCur, _offset, _amt, (unsafe.Pointer)(_pMem.X5)) + _rc = _sqlite3BtreePayload(tls, _pCur, _offset, _amt, unsafe.Pointer(_pMem.X5)) if _rc == i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_amt))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_amt+uint32(i32(1))))) = int8(i32(0)) - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(528)) - *(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(_amt) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_amt))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(_amt+uint32(i32(1))))) = int8(i32(0)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(528)) + *(*int32)(unsafe.Pointer(&_pMem.X4)) = int32(_amt) goto _2 } _sqlite3VdbeMemRelease(tls, _pMem) @@ -57935,7 +60472,7 @@ func _sqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, _serial_type uint8) (r0 uint crt.X__builtin_abort(tls) } }() - return *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type))) + return *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type))) } var _sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000 [32]int8 @@ -57952,7 +60489,10 @@ func init() { var _sqlite3VdbeExecØ00aZeroØ005 [16]uint8 -// Return the serial-type for the value stored in pMem. +// C comment +// /* +// ** Return the serial-type for the value stored in pMem. +// */ func _sqlite3VdbeSerialType(tls *crt.TLS, _pMem *XMem, _file_format int32, _pLen *uint32) (r0 uint32) { var _flags int32 var _2_i int64 @@ -57972,7 +60512,7 @@ func _sqlite3VdbeSerialType(tls *crt.TLS, _pMem *XMem, _file_format int32, _pLen if (_flags & i32(4)) == 0 { goto _3 } - _2_i = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) + _2_i = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))) if _2_i < int64(i32(0)) { _2_u = uint64(^_2_i) goto _5 @@ -58021,7 +60561,7 @@ _3: } }() func() { - if (_pMem.X4) < i32(0) { + if _pMem.X4 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000))), unsafe.Pointer(str(6001))) crt.X__builtin_abort(tls) } @@ -58030,7 +60570,7 @@ _3: if (_flags & i32(16384)) != 0 { { p := &_n - *p = (*p) + uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + *p = (*p) + uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) sink5(*p) } } @@ -58046,32 +60586,35 @@ func init() { func _sqlite3PutVarint(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) { if _v <= uint64(i32(127)) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(_v & uint64(i32(127))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(0)))) = uint8(_v & uint64(i32(127))) return i32(1) } if _v <= uint64(i32(16383)) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(((_v >> uint(i32(7))) & uint64(i32(127))) | uint64(i32(128))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))) = uint8(_v & uint64(i32(127))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(0)))) = uint8(((_v >> uint(i32(7))) & uint64(i32(127))) | uint64(i32(128))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(1)))) = uint8(_v & uint64(i32(127))) return i32(2) } return _putVarint64(tls, _p, _v) } -// Write a 64-bit variable-length integer to memory starting at p[0]. -// The length of data write will be between 1 and 9 bytes. The number -// of bytes written is returned. -// -// A variable-length integer consists of the lower 7 bits of each byte -// for all bytes that have the 8th bit set and one byte with the 8th -// bit clear. Except, if we get to the 9th byte, it stores the full -// 8 bits and is the last byte. +// C comment +// /* +// ** Write a 64-bit variable-length integer to memory starting at p[0]. +// ** The length of data write will be between 1 and 9 bytes. The number +// ** of bytes written is returned. +// ** +// ** A variable-length integer consists of the lower 7 bits of each byte +// ** for all bytes that have the 8th bit set and one byte with the 8th +// ** bit clear. Except, if we get to the 9th byte, it stores the full +// ** 8 bits and is the last byte. +// */ func _putVarint64(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) { var _i, _j, _n int32 var _buf [10]uint8 if (_v & u64(18374686479671623680)) == 0 { goto _0 } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(8)))) = uint8(_v) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(i32(8)))) = uint8(_v) { p := &_v *p = (*p) >> uint(i32(8)) @@ -58082,7 +60625,7 @@ _1: if _i < i32(0) { goto _4 } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(_i))) = uint8((_v & uint64(i32(127))) | uint64(i32(128))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(_i))) = uint8((_v & uint64(i32(127))) | uint64(i32(128))) { p := &_v *p = (*p) >> uint(i32(7)) @@ -58096,7 +60639,7 @@ _4: _0: _n = i32(0) _5: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(postInc1(&_n, int32(1))))) = uint8((_v & uint64(i32(127))) | uint64(i32(128))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(postInc1(&_n, 1)))) = uint8((_v & uint64(i32(127))) | uint64(i32(128))) { p := &_v *p = (*p) >> uint(i32(7)) @@ -58106,7 +60649,7 @@ _5: goto _5 } { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(i32(0)))) *p = uint8(int32(*p) & i32(127)) sink2(*p) } @@ -58121,7 +60664,7 @@ _8: if _j < i32(0) { goto _11 } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(_j))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_buf)) + 1*uintptr(_j))) *func() *int32 { _j -= 1; return &_i }() += 1 goto _8 _11: @@ -58145,12 +60688,12 @@ func _sqlite3VdbeSerialPut(tls *crt.TLS, _buf *uint8, _pMem *XMem, _serial_type } if _serial_type == uint32(i32(7)) { i32(0) - crt.Xmemcpy(tls, (unsafe.Pointer)(&_1_v), (unsafe.Pointer)((*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))), u64(8)) + crt.Xmemcpy(tls, unsafe.Pointer(&_1_v), unsafe.Pointer((*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))), u64(8)) goto _3 } - _1_v = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + _1_v = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) _3: - _len = store5(&_1_i, uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type))))) + _len = store5(&_1_i, uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type))))) func() { if _1_i <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000))), unsafe.Pointer(str(12970))) @@ -58158,7 +60701,7 @@ _3: } }() _6: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(preInc5(&_1_i, uint32(4294967295))))) = uint8(_1_v & uint64(i32(255))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(preInc5(&_1_i, uint32(4294967295))))) = uint8(_1_v & uint64(i32(255))) { p := &_1_v *p = (*p) >> uint(i32(8)) @@ -58174,9 +60717,9 @@ _1: goto _7 } func() { - if ((_pMem.X4) + func() int32 { + if (_pMem.X4 + func() int32 { if (int32(_pMem.X1) & i32(16384)) != 0 { - return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) + return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) } return i32(0) }()) != int32(_sqlite3VdbeSerialTypeLen(tls, _serial_type)) { @@ -58186,7 +60729,7 @@ _1: }() _len = uint32(_pMem.X4) if _len > uint32(i32(0)) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_buf), (unsafe.Pointer)(_pMem.X5), uint64(_len)) + crt.Xmemcpy(tls, unsafe.Pointer(_buf), unsafe.Pointer(_pMem.X5), uint64(_len)) } return _len @@ -58200,18 +60743,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSerialPutØ00__func__Ø000[0], str(77739), 21) } -// The first argument, pCur, is a cursor opened on some b-tree. Count the -// number of entries in the b-tree and write the result to *pnEntry. -// -// SQLITE_OK is returned if the operation is successfully executed. -// Otherwise, if an error is encountered (i.e. an IO error or database -// corruption) an SQLite error code is returned. +// C comment +// /* +// ** The first argument, pCur, is a cursor opened on some b-tree. Count the +// ** number of entries in the b-tree and write the result to *pnEntry. +// ** +// ** SQLITE_OK is returned if the operation is successfully executed. +// ** Otherwise, if an error is encountered (i.e. an IO error or database +// ** corruption) an SQLite error code is returned. +// */ func _sqlite3BtreeCount(tls *crt.TLS, _pCur *XBtCursor, _pnEntry *int64) (r0 int32) { var _rc, _2_iIdx int32 var _nEntry int64 var _2_pPage *XMemPage _nEntry = i64(0) - if (_pCur.X7) == uint32(i32(0)) { + if _pCur.X7 == uint32(i32(0)) { *_pnEntry = int64(i32(0)) return i32(0) } @@ -58220,15 +60766,15 @@ _1: if _rc != i32(0) { goto _2 } - _2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) - if ((_2_pPage.X5) != 0) || ((_2_pPage.X2) == 0) { + _2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) + if (_2_pPage.X5 != 0) || (_2_pPage.X2 == 0) { { p := &_nEntry *p = (*p) + int64(_2_pPage.X14) sink6(*p) } } - if (_2_pPage.X5) == 0 { + if _2_pPage.X5 == 0 { goto _5 } _6: @@ -58237,32 +60783,35 @@ _6: return _moveToRoot(tls, _pCur) } _moveToParent(tls, _pCur) - if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) { + if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) { goto _6 } - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) += 1 - _2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) += 1 + _2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) _5: _2_iIdx = int32(_pCur.X16) if _2_iIdx == int32(_2_pPage.X14) { - _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pPage.X19))+1*uintptr(int32(_2_pPage.X6)+i32(8)))))) + _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X19))+1*uintptr(int32(_2_pPage.X6)+i32(8)))))) goto _9 } - _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X19))+uintptr(int32(_2_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pPage.X21))+1*uintptr(i32(2)*_2_iIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pPage.X21))+1*uintptr(i32(2)*_2_iIdx))))) + 1*uintptr(i32(1))))))))))) + _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X19))+uintptr(int32(_2_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X21))+1*uintptr(i32(2)*_2_iIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X21))+1*uintptr(i32(2)*_2_iIdx))))) + 1*uintptr(i32(1))))))))))) _9: goto _1 _2: return _rc } -// This function is only called from within an assert() expression. It -// checks that the sqlite3.nTransaction variable is correctly set to -// the number of non-transaction savepoints currently in the -// linked list starting at sqlite3.pSavepoint. -// -// Usage: -// -// assert( checkSavepointCount(db) ); +// C comment +// /* +// ** This function is only called from within an assert() expression. It +// ** checks that the sqlite3.nTransaction variable is correctly set to +// ** the number of non-transaction savepoints currently in the +// ** linked list starting at sqlite3.pSavepoint. +// ** +// ** Usage: +// ** +// ** assert( checkSavepointCount(db) ); +// */ func _checkSavepointCount(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _n int32 var _p *XSavepoint @@ -58277,7 +60826,7 @@ _0: goto _0 _3: func() { - if _n != ((_db.X75) + int32(_db.X23)) { + if _n != (_db.X75 + int32(_db.X23)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78815), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkSavepointCountØ00__func__Ø000))), unsafe.Pointer(str(77760))) crt.X__builtin_abort(tls) } @@ -58291,22 +60840,25 @@ func init() { crt.Xstrncpy(nil, &_checkSavepointCountØ00__func__Ø000[0], str(77809), 20) } -// Start a statement subtransaction. The subtransaction can be rolled -// back independently of the main transaction. You must start a transaction -// before starting a subtransaction. The subtransaction is ended automatically -// if the main transaction commits or rolls back. -// -// Statement subtransactions are used around individual SQL statements -// that are contained within a BEGIN...COMMIT block. If a constraint -// error occurs within the statement, the effect of that one statement -// can be rolled back without having to rollback the entire transaction. -// -// A statement sub-transaction is implemented as an anonymous savepoint. The -// value passed as the second parameter is the total number of savepoints, -// including the new anonymous savepoint, open on the B-Tree. i.e. if there -// are no active savepoints and no other statement-transactions open, -// iStatement is 1. This anonymous savepoint can be released or rolled back -// using the sqlite3BtreeSavepoint() function. +// C comment +// /* +// ** Start a statement subtransaction. The subtransaction can be rolled +// ** back independently of the main transaction. You must start a transaction +// ** before starting a subtransaction. The subtransaction is ended automatically +// ** if the main transaction commits or rolls back. +// ** +// ** Statement subtransactions are used around individual SQL statements +// ** that are contained within a BEGIN...COMMIT block. If a constraint +// ** error occurs within the statement, the effect of that one statement +// ** can be rolled back without having to rollback the entire transaction. +// ** +// ** A statement sub-transaction is implemented as an anonymous savepoint. The +// ** value passed as the second parameter is the total number of savepoints, +// ** including the new anonymous savepoint, open on the B-Tree. i.e. if there +// ** are no active savepoints and no other statement-transactions open, +// ** iStatement is 1. This anonymous savepoint can be released or rolled back +// ** using the sqlite3BtreeSavepoint() function. +// */ func _sqlite3BtreeBeginStmt(tls *crt.TLS, _p *XBtree, _iStatement int32) (r0 int32) { var _rc int32 var _pBt *XBtShared @@ -58353,8 +60905,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeBeginStmtØ00__func__Ø000[0], str(77930), 22) } -// Write meta-information back into the database. Meta[0] is -// read-only and may not be written. +// C comment +// /* +// ** Write meta-information back into the database. Meta[0] is +// ** read-only and may not be written. +// */ func _sqlite3BtreeUpdateMeta(tls *crt.TLS, _p *XBtree, _idx int32, _iMeta uint32) (r0 int32) { var _rc int32 var _pP1 *uint8 @@ -58384,10 +60939,10 @@ func _sqlite3BtreeUpdateMeta(tls *crt.TLS, _p *XBtree, _idx int32, _iMeta uint32 if _rc != i32(0) { goto _7 } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pP1))+1*uintptr(i32(36)+(_idx*i32(4))))), _iMeta) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pP1))+1*uintptr(i32(36)+(_idx*i32(4))))), _iMeta) if _idx == i32(7) { func() { - if (_pBt.X5) == 0 && _iMeta != uint32(i32(0)) { + if _pBt.X5 == 0 && _iMeta != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67901), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(77985))) crt.X__builtin_abort(tls) } @@ -58398,7 +60953,7 @@ func _sqlite3BtreeUpdateMeta(tls *crt.TLS, _p *XBtree, _idx int32, _iMeta uint32 crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(_iMeta) + *(*uint8)(unsafe.Pointer(&_pBt.X6)) = uint8(_iMeta) } _7: _sqlite3BtreeLeave(tls, _p) @@ -58411,15 +60966,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeUpdateMetaØ00__func__Ø000[0], str(78034), 23) } -// Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL -// if we run out of memory. +// C comment +// /* +// ** Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL +// ** if we run out of memory. +// */ func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb int32, _eCurType uint8) (r0 *XVdbeCursor) { var _nByte int32 var _pMem *XMem var _pCx *XVdbeCursor _pMem = func() *XMem { if _iCur > i32(0) { - return (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 72*uintptr((_p.X6)-_iCur))) + return (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 72*uintptr(_p.X6-_iCur))) } return (*XMem)(_p.X18) }() @@ -58431,38 +60989,41 @@ func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb i return i32(0) }())) func() { - if _iCur < i32(0) || _iCur >= (_p.X7) { + if _iCur < i32(0) || _iCur >= _p.X7 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78418), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateCursorØ00__func__Ø000))), unsafe.Pointer(str(78057))) crt.X__builtin_abort(tls) } }() - if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_iCur)))) != nil { - _sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_iCur)))) - *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_iCur))) = nil + if (*(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_iCur)))) != nil { + _sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_iCur)))) + *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_iCur))) = nil } if i32(0) != _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) { goto _8 } - *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 8*uintptr(_iCur))) = store53(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.X5))) - crt.Xmemset(tls, (unsafe.Pointer)(_pCx), i32(0), u64(40)) - *(*uint8)(unsafe.Pointer(&(_pCx.X0))) = _eCurType - *(*int8)(unsafe.Pointer(&(_pCx.X1))) = int8(_iDb) - *(*int16)(unsafe.Pointer(&(_pCx.X18))) = int16(_nField) - *(**uint32)(unsafe.Pointer(&(_pCx.X21))) = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_pCx.X25))))) + 4*uintptr(_nField))) + *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X23)) + 8*uintptr(_iCur))) = store53(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.X5))) + crt.Xmemset(tls, unsafe.Pointer(_pCx), i32(0), u64(40)) + *(*uint8)(unsafe.Pointer(&_pCx.X0)) = _eCurType + *(*int8)(unsafe.Pointer(&_pCx.X1)) = int8(_iDb) + *(*int16)(unsafe.Pointer(&_pCx.X18)) = int16(_nField) + *(**uint32)(unsafe.Pointer(&_pCx.X21)) = (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_pCx.X25)))) + 4*uintptr(_nField))) if int32(_eCurType) == i32(0) { - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14))))))) = (*XBtCursor)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(u64(120)+(u64(8)*uint64(_nField))))))) - _sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14))))))) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCx.X14)))))) = (*XBtCursor)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMem.X5)) + 1*uintptr(u64(120)+(u64(8)*uint64(_nField))))))) + _sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCx.X14)))))) } _8: return _pCx } -// Return the size of a BtCursor object in bytes. -// -// This interfaces is needed so that users of cursors can preallocate -// sufficient storage to hold a cursor. The BtCursor object is opaque -// to users so they cannot do the sizeof() themselves - they must call -// this routine. +// C comment +// /* +// ** Return the size of a BtCursor object in bytes. +// ** +// ** This interfaces is needed so that users of cursors can preallocate +// ** sufficient storage to hold a cursor. The BtCursor object is opaque +// ** to users so they cannot do the sizeof() themselves - they must call +// ** this routine. +// */ func _sqlite3BtreeCursorSize(tls *crt.TLS) (r0 int32) { return int32(u64(304)) } @@ -58473,14 +61034,17 @@ func init() { crt.Xstrncpy(nil, &_allocateCursorØ00__func__Ø000[0], str(78084), 15) } -// Initialize memory that will be converted into a BtCursor object. -// -// The simple approach here would be to memset() the entire object -// to zero. But it turns out that the apPage[] and aiIdx[] arrays -// do not need to be zeroed and they are large, so we can save a lot -// of run-time by skipping the initialization of those elements. +// C comment +// /* +// ** Initialize memory that will be converted into a BtCursor object. +// ** +// ** The simple approach here would be to memset() the entire object +// ** to zero. But it turns out that the apPage[] and aiIdx[] arrays +// ** do not need to be zeroed and they are large, so we can save a lot +// ** of run-time by skipping the initialization of those elements. +// */ func _sqlite3BtreeCursorZero(tls *crt.TLS, _p *XBtCursor) { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(88)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(88)) } func _sqlite3BtreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) { @@ -58496,46 +61060,49 @@ _1: return _rc } -// Create a new cursor for the BTree whose root is on the page -// iTable. If a read-only cursor is requested, it is assumed that -// the caller already has at least a read-only transaction open -// on the database already. If a write-cursor is requested, then -// the caller is assumed to have an open write transaction. -// -// If the BTREE_WRCSR bit of wrFlag is clear, then the cursor can only -// be used for reading. If the BTREE_WRCSR bit is set, then the cursor -// can be used for reading or for writing if other conditions for writing -// are also met. These are the conditions that must be met in order -// for writing to be allowed: -// -// 1: The cursor must have been opened with wrFlag containing BTREE_WRCSR -// -// 2: Other database connections that share the same pager cache -// but which are not in the READ_UNCOMMITTED state may not have -// cursors open with wrFlag==0 on the same table. Otherwise -// the changes made by this write cursor would be visible to -// the read cursors in the other database connection. -// -// 3: The database must be writable (not on read-only media) -// -// 4: There must be an active transaction. -// -// The BTREE_FORDELETE bit of wrFlag may optionally be set if BTREE_WRCSR -// is set. If FORDELETE is set, that is a hint to the implementation that -// this cursor will only be used to seek to and delete entries of an index -// as part of a larger DELETE statement. The FORDELETE hint is not used by -// this implementation. But in a hypothetical alternative storage engine -// in which index entries are automatically deleted when corresponding table -// rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE -// operations on this cursor can be no-ops and all READ operations can -// return a null row (2-bytes: 0x01 0x00). -// -// No checking is done to make sure that page iTable really is the -// root page of a b-tree. If it is not, then the cursor acquired -// will not work correctly. -// -// It is assumed that the sqlite3BtreeCursorZero() has been called -// on pCur to initialize the memory space prior to invoking this routine. +// C comment +// /* +// ** Create a new cursor for the BTree whose root is on the page +// ** iTable. If a read-only cursor is requested, it is assumed that +// ** the caller already has at least a read-only transaction open +// ** on the database already. If a write-cursor is requested, then +// ** the caller is assumed to have an open write transaction. +// ** +// ** If the BTREE_WRCSR bit of wrFlag is clear, then the cursor can only +// ** be used for reading. If the BTREE_WRCSR bit is set, then the cursor +// ** can be used for reading or for writing if other conditions for writing +// ** are also met. These are the conditions that must be met in order +// ** for writing to be allowed: +// ** +// ** 1: The cursor must have been opened with wrFlag containing BTREE_WRCSR +// ** +// ** 2: Other database connections that share the same pager cache +// ** but which are not in the READ_UNCOMMITTED state may not have +// ** cursors open with wrFlag==0 on the same table. Otherwise +// ** the changes made by this write cursor would be visible to +// ** the read cursors in the other database connection. +// ** +// ** 3: The database must be writable (not on read-only media) +// ** +// ** 4: There must be an active transaction. +// ** +// ** The BTREE_FORDELETE bit of wrFlag may optionally be set if BTREE_WRCSR +// ** is set. If FORDELETE is set, that is a hint to the implementation that +// ** this cursor will only be used to seek to and delete entries of an index +// ** as part of a larger DELETE statement. The FORDELETE hint is not used by +// ** this implementation. But in a hypothetical alternative storage engine +// ** in which index entries are automatically deleted when corresponding table +// ** rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE +// ** operations on this cursor can be no-ops and all READ operations can +// ** return a null row (2-bytes: 0x01 0x00). +// ** +// ** No checking is done to make sure that page iTable really is the +// ** root page of a b-tree. If it is not, then the cursor acquired +// ** will not work correctly. +// ** +// ** It is assumed that the sqlite3BtreeCursorZero() has been called +// ** on pCur to initialize the memory space prior to invoking this routine. +// */ func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) { var _pBt *XBtShared var _pX *XBtCursor @@ -58582,7 +61149,7 @@ func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyI } }() func() { - if (*XMemPage)(_pBt.X3) == nil || ((*XMemPage)(_pBt.X3).X19) == nil { + if _pBt.X3 == nil || ((*XMemPage)(_pBt.X3).X19) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63230), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78314))) crt.X__builtin_abort(tls) } @@ -58597,7 +61164,7 @@ func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyI goto _24 } _allocateTempSpace(tls, _pBt) - if (_pBt.X27) == nil { + if _pBt.X27 == nil { return _sqlite3NomemError(tls, i32(63235)) } _24: @@ -58610,18 +61177,18 @@ _24: }() _iTable = i32(0) } - *(*uint32)(unsafe.Pointer(&(_pCur.X7))) = uint32(_iTable) - *(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(-1)) - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X18))))) = _pKeyInfo - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X0))))) = _p - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X1))))) = _pBt - *(*uint8)(unsafe.Pointer(&(_pCur.X10))) = uint8(func() int32 { + *(*uint32)(unsafe.Pointer(&_pCur.X7)) = uint32(_iTable) + *(*int8)(unsafe.Pointer(&_pCur.X14)) = int8(i32(-1)) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCur.X18)))) = _pKeyInfo + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCur.X0)))) = _p + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCur.X1)))) = _pBt + *(*uint8)(unsafe.Pointer(&_pCur.X10)) = uint8(func() int32 { if _wrFlag != 0 { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pCur.X11))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pCur.X11)) = uint8(func() int32 { if _wrFlag != 0 { return i32(0) } @@ -58632,14 +61199,14 @@ _34: if _pX == nil { goto _37 } - if (_pX.X7) == uint32(_iTable) { + if _pX.X7 == uint32(_iTable) { { - p := (*uint8)(unsafe.Pointer(&(_pX.X10))) + p := (*uint8)(unsafe.Pointer(&_pX.X10)) *p = uint8(int32(*p) | i32(32)) sink2(*p) } { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(32)) sink2(*p) } @@ -58647,9 +61214,9 @@ _34: _pX = (*XBtCursor)(_pX.X2) goto _34 _37: - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X2))))) = (*XBtCursor)(_pBt.X2) - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X2))))) = _pCur - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCur.X2)))) = (*XBtCursor)(_pBt.X2) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X2)))) = _pCur + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) return i32(0) } @@ -58659,26 +61226,29 @@ func init() { crt.Xstrncpy(nil, &_btreeCursorØ00__func__Ø000[0], str(78406), 12) } -// **** This function is only used as part of an assert() statement. *** -// -// Check to see if pBtree holds the required locks to read or write to the -// table with root page iRoot. Return 1 if it does and 0 if not. -// -// For example, when writing to a table with root-page iRoot via -// Btree connection pBtree: -// -// assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) ); -// -// When writing to an index that resides in a sharable database, the -// caller should have first obtained a lock specifying the root page of -// the corresponding table. This makes things a bit more complicated, -// as this module treats each table as a separate structure. To determine -// the table corresponding to the index being written, this -// function has to search through the database schema. -// -// Instead of a lock on the table/index rooted at page iRoot, the caller may -// hold a write-lock on the schema table (root page 1). This is also -// acceptable. +// C comment +// /* +// **** This function is only used as part of an assert() statement. *** +// ** +// ** Check to see if pBtree holds the required locks to read or write to the +// ** table with root page iRoot. Return 1 if it does and 0 if not. +// ** +// ** For example, when writing to a table with root-page iRoot via +// ** Btree connection pBtree: +// ** +// ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) ); +// ** +// ** When writing to an index that resides in a sharable database, the +// ** caller should have first obtained a lock specifying the root page of +// ** the corresponding table. This makes things a bit more complicated, +// ** as this module treats each table as a separate structure. To determine +// ** the table corresponding to the index being written, this +// ** function has to search through the database schema. +// ** +// ** Instead of a lock on the table/index rooted at page iRoot, the caller may +// ** hold a write-lock on the schema table (root page 1). This is also +// ** acceptable. +// */ func _hasSharedCacheTableLock(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32, _isIndex int32, _eLockType int32) (r0 int32) { var _iTab uint32 var _pSchema *XSchema @@ -58696,13 +61266,13 @@ func _hasSharedCacheTableLock(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32, _isI if _isIndex == 0 { goto _6 } - _3_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2) + _3_p = (*XHashElem)((*XHash)(unsafe.Pointer(&_pSchema.X3)).X2) _7: if _3_p == nil { goto _10 } _4_pIdx = (*XIndex)(_3_p.X2) - if (_4_pIdx.X11) != int32(_iRoot) { + if _4_pIdx.X11 != int32(_iRoot) { goto _11 } if _iTab != 0 { @@ -58722,7 +61292,7 @@ _14: if _pLock == nil { goto _17 } - if (((*XBtree)(_pLock.X0) == _pBtree) && (((_pLock.X1) == _iTab) || ((int32(_pLock.X2) == i32(2)) && ((_pLock.X1) == uint32(i32(1)))))) && (int32(_pLock.X2) >= _eLockType) { + if (((*XBtree)(_pLock.X0) == _pBtree) && ((_pLock.X1 == _iTab) || ((int32(_pLock.X2) == i32(2)) && (_pLock.X1 == uint32(i32(1)))))) && (int32(_pLock.X2) >= _eLockType) { return i32(1) } _pLock = (*XBtLock)(_pLock.X3) @@ -58731,22 +61301,25 @@ _17: return i32(0) } -// **** This function may be used as part of assert() statements only. **** -// -// Return true if it would be illegal for pBtree to write into the -// table or index rooted at iRoot because other shared connections are -// simultaneously reading that same table or index. -// -// It is illegal for pBtree to write if some other Btree object that -// shares the same BtShared object is currently reading or writing -// the iRoot table. Except, if the other Btree object has the -// read-uncommitted flag set, then it is OK for the other object to -// have a read cursor. -// -// For example, before writing to any part of the table or index -// rooted at page iRoot, one should call: -// -// assert( !hasReadConflicts(pBtree, iRoot) ); +// C comment +// /* +// **** This function may be used as part of assert() statements only. **** +// ** +// ** Return true if it would be illegal for pBtree to write into the +// ** table or index rooted at iRoot because other shared connections are +// ** simultaneously reading that same table or index. +// ** +// ** It is illegal for pBtree to write if some other Btree object that +// ** shares the same BtShared object is currently reading or writing +// ** the iRoot table. Except, if the other Btree object has the +// ** read-uncommitted flag set, then it is OK for the other object to +// ** have a read cursor. +// ** +// ** For example, before writing to any part of the table or index +// ** rooted at page iRoot, one should call: +// ** +// ** assert( !hasReadConflicts(pBtree, iRoot) ); +// */ func _hasReadConflicts(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32) (r0 int32) { var _p *XBtCursor _p = (*XBtCursor)((*XBtShared)(_pBtree.X1).X2) @@ -58754,7 +61327,7 @@ _0: if _p == nil { goto _3 } - if (((_p.X7) == _iRoot) && ((*XBtree)(_p.X0) != _pBtree)) && (i32(0) == (((*Xsqlite3)((*XBtree)(_p.X0).X0).X6) & i32(16384))) { + if ((_p.X7 == _iRoot) && ((*XBtree)(_p.X0) != _pBtree)) && (i32(0) == (((*Xsqlite3)((*XBtree)(_p.X0).X0).X6) & i32(16384))) { return i32(1) } _p = (*XBtCursor)(_p.X2) @@ -58763,26 +61336,32 @@ _3: return i32(0) } -// Make sure pBt->pTmpSpace points to an allocation of -// MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child -// pointer. +// C comment +// /* +// ** Make sure pBt->pTmpSpace points to an allocation of +// ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child +// ** pointer. +// */ func _allocateTempSpace(tls *crt.TLS, _pBt *XBtShared) { - if (_pBt.X27) != nil { + if _pBt.X27 != nil { goto _0 } - *(**uint8)(unsafe.Pointer(&(_pBt.X27))) = (*uint8)(_sqlite3PageMalloc(tls, int32(_pBt.X15))) - if (_pBt.X27) != nil { - crt.Xmemset(tls, (unsafe.Pointer)(_pBt.X27), i32(0), uint64(i32(8))) + *(**uint8)(unsafe.Pointer(&_pBt.X27)) = (*uint8)(_sqlite3PageMalloc(tls, int32(_pBt.X15))) + if _pBt.X27 != nil { + crt.Xmemset(tls, unsafe.Pointer(_pBt.X27), i32(0), uint64(i32(8))) { - p := (**uint8)(unsafe.Pointer(&(_pBt.X27))) - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(4)))) + p := (**uint8)(unsafe.Pointer(&_pBt.X27)) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(4)))) sink13(*p) } } _0: } -// Provide flag hints to the cursor. +// C comment +// /* +// ** Provide flag hints to the cursor. +// */ func _sqlite3BtreeCursorHintFlags(tls *crt.TLS, _pCur *XBtCursor, _x uint32) { func() { if _x != uint32(i32(2)) && _x != uint32(i32(1)) && _x != uint32(i32(0)) { @@ -58790,7 +61369,7 @@ func _sqlite3BtreeCursorHintFlags(tls *crt.TLS, _pCur *XBtCursor, _x uint32) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pCur.X13))) = uint8(_x) + *(*uint8)(unsafe.Pointer(&_pCur.X13)) = uint8(_x) } var _sqlite3BtreeCursorHintFlagsØ00__func__Ø000 [28]int8 @@ -58799,25 +61378,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCursorHintFlagsØ00__func__Ø000[0], str(78464), 28) } -// Open a database file. -// -// zFilename is the name of the database file. If zFilename is NULL -// then an ephemeral database is created. The ephemeral database might -// be exclusively in memory, or it might use a disk-based memory cache. -// Either way, the ephemeral database will be automatically deleted -// when sqlite3BtreeClose() is called. -// -// If zFilename is ":memory:" then an in-memory database is created -// that is automatically destroyed when it is closed. -// -// The "flags" parameter is a bitmask that might contain bits like -// BTREE_OMIT_JOURNAL and/or BTREE_MEMORY. -// -// If the database is already opened in the same database connection -// and we are in shared cache mode, then the open will fail with an -// SQLITE_CONSTRAINT error. We cannot allow two or more BtShared -// objects in the same database connection since doing so will lead -// to problems with locking. +// C comment +// /* +// ** Open a database file. +// ** +// ** zFilename is the name of the database file. If zFilename is NULL +// ** then an ephemeral database is created. The ephemeral database might +// ** be exclusively in memory, or it might use a disk-based memory cache. +// ** Either way, the ephemeral database will be automatically deleted +// ** when sqlite3BtreeClose() is called. +// ** +// ** If zFilename is ":memory:" then an in-memory database is created +// ** that is automatically destroyed when it is closed. +// ** +// ** The "flags" parameter is a bitmask that might contain bits like +// ** BTREE_OMIT_JOURNAL and/or BTREE_MEMORY. +// ** +// ** If the database is already opened in the same database connection +// ** and we are in shared cache mode, then the open will fail with an +// ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared +// ** objects in the same database connection since doing so will lead +// ** to problems with locking. +// */ func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db *Xsqlite3, _ppBtree **XBtree, _flags int32, _vfsFlags int32) (r0 int32) { var _rc, _isTempDb, _isMemdb, _5_nFilename, _5_nFullPathname, _11_iDb, _25_i int32 var _5_zFullPathname *int8 @@ -58830,7 +61412,7 @@ func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db _pBt = nil _mutexOpen = nil _rc = i32(0) - _isTempDb = bool2int((_zFilename == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == i32(0))) + _isTempDb = bool2int((_zFilename == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) == i32(0))) _isMemdb = bool2int((((_zFilename != nil) && (crt.Xstrcmp(tls, _zFilename, str(78492)) == i32(0))) || (_isTempDb != 0 && _sqlite3TempInMemory(tls, _db) != 0)) || ((_vfsFlags & i32(128)) != i32(0))) func() { if _db == nil { @@ -58882,10 +61464,10 @@ func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db if _p == nil { return _sqlite3NomemError(tls, i32(61275)) } - *(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X0))))) = _p - *(*uint32)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X1))) = uint32(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X2)) = uint8(i32(0)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _db + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&_p.X11)).X0))))) = _p + *(*uint32)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&_p.X11)).X1))) = uint32(i32(1)) if _isTempDb != i32(0) || _isMemdb != i32(0) && (_vfsFlags&i32(64)) == i32(0) { goto _26 } @@ -58893,26 +61475,26 @@ func _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db goto _27 } _5_nFilename = _sqlite3Strlen30(tls, _zFilename) + i32(1) - _5_nFullPathname = (_pVfs.X2) + i32(1) + _5_nFullPathname = _pVfs.X2 + i32(1) _5_zFullPathname = (*int8)(_sqlite3Malloc(tls, uint64(func() int32 { if _5_nFullPathname > _5_nFilename { return _5_nFullPathname } return _5_nFilename }()))) - *(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X3)) = uint8(i32(1)) if _5_zFullPathname == nil { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) return _sqlite3NomemError(tls, i32(61299)) } if _isMemdb != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_5_zFullPathname), (unsafe.Pointer)(_zFilename), uint64(_5_nFilename)) + crt.Xmemcpy(tls, unsafe.Pointer(_5_zFullPathname), unsafe.Pointer(_zFilename), uint64(_5_nFilename)) goto _32 } _rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _5_nFullPathname, _5_zFullPathname) if _rc != 0 { - Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname)) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) return _rc } _32: @@ -58926,7 +61508,7 @@ _34: goto _37 } func() { - if (_pBt.X23) <= i32(0) { + if _pBt.X23 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61319), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78625))) crt.X__builtin_abort(tls) } @@ -58934,7 +61516,7 @@ _34: if i32(0) != crt.Xstrcmp(tls, _5_zFullPathname, _sqlite3PagerFilename(tls, (*XPager)(_pBt.X0), i32(0))) || _sqlite3PagerVfs(tls, (*XPager)(_pBt.X0)) != _pVfs { goto _41 } - _11_iDb = (_db.X5) - i32(1) + _11_iDb = _db.X5 - i32(1) _42: if _11_iDb < i32(0) { goto _45 @@ -58943,25 +61525,25 @@ _42: if (_12_pExisting != nil) && ((*XBtShared)(_12_pExisting.X1) == _pBt) { Xsqlite3_mutex_leave(tls, _5_mutexShared) Xsqlite3_mutex_leave(tls, _mutexOpen) - Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname)) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) return i32(19) } _11_iDb -= 1 goto _42 _45: - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pBt - *(*int32)(unsafe.Pointer(&(_pBt.X23))) += 1 + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _pBt + *(*int32)(unsafe.Pointer(&_pBt.X23)) += 1 goto _37 _41: _pBt = (*XBtShared)(_pBt.X24) goto _34 _37: Xsqlite3_mutex_leave(tls, _5_mutexShared) - Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname)) + Xsqlite3_free(tls, unsafe.Pointer(_5_zFullPathname)) goto _48 _27: - *(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X3)) = uint8(i32(1)) _48: _26: if _pBt != nil { @@ -58977,7 +61559,7 @@ _26: _rc = _sqlite3NomemError(tls, i32(61367)) goto _btree_open_out } - _rc = _sqlite3PagerOpen(tls, _pVfs, (**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X0))))), _zFilename, int32(u64(136)), _flags, _vfsFlags, _pageReinit) + _rc = _sqlite3PagerOpen(tls, _pVfs, (**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X0)))), _zFilename, int32(u64(136)), _flags, _vfsFlags, _pageReinit) if _rc == i32(0) { _sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.X0), _db.X8) _rc = _sqlite3PagerReadFileheader(tls, (*XPager)(_pBt.X0), int32(u64(100)), (*uint8)(unsafe.Pointer(&_zDbHeader))) @@ -58985,115 +61567,115 @@ _26: if _rc != i32(0) { goto _btree_open_out } - *(*uint8)(unsafe.Pointer(&(_pBt.X4))) = uint8(_flags) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X1))))) = _db - _sqlite3PagerSetBusyhandler(tls, (*XPager)(_pBt.X0), _btreeInvokeBusyHandler, (unsafe.Pointer)(_pBt)) - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pBt - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X2))))) = nil - *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil + *(*uint8)(unsafe.Pointer(&_pBt.X4)) = uint8(_flags) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X1)))) = _db + _sqlite3PagerSetBusyhandler(tls, (*XPager)(_pBt.X0), _btreeInvokeBusyHandler, unsafe.Pointer(_pBt)) + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _pBt + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X2)))) = nil + *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X3)))) = nil if _sqlite3PagerIsreadonly(tls, (*XPager)(_pBt.X0)) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } } - *(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(17))))) << uint(i32(16)))) - if (_pBt.X15) >= uint32(i32(512)) && (_pBt.X15) <= uint32(i32(65536)) && (((_pBt.X15)-uint32(i32(1)))&(_pBt.X15)) == uint32(i32(0)) { + *(*uint32)(unsafe.Pointer(&_pBt.X15)) = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDbHeader)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDbHeader)) + 1*uintptr(i32(17))))) << uint(i32(16)))) + if _pBt.X15 >= uint32(i32(512)) && _pBt.X15 <= uint32(i32(65536)) && ((_pBt.X15-uint32(i32(1)))&_pBt.X15) == uint32(i32(0)) { goto _56 } - *(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pBt.X15)) = uint32(i32(0)) if (_zFilename != nil) && (_isMemdb == 0) { - *(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pBt.X5)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pBt.X6)) = uint8(i32(0)) } _nReserve = uint8(i32(0)) goto _59 _56: - _nReserve = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(20)))) + _nReserve = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDbHeader)) + 1*uintptr(i32(20)))) { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(2)) sink14(*p) } - *(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader))+1*uintptr(i32(52))))) != 0 { + *(*uint8)(unsafe.Pointer(&_pBt.X5)) = uint8(func() int32 { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDbHeader))+1*uintptr(i32(52))))) != 0 { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 { - if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader))+1*uintptr(i32(64))))) != 0 { + *(*uint8)(unsafe.Pointer(&_pBt.X6)) = uint8(func() int32 { + if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDbHeader))+1*uintptr(i32(64))))) != 0 { return i32(1) } return i32(0) }()) _59: - _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), int32(_nReserve)) + _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&_pBt.X15)), int32(_nReserve)) if _rc != 0 { goto _btree_open_out } - *(*uint32)(unsafe.Pointer(&(_pBt.X16))) = (_pBt.X15) - uint32(_nReserve) + *(*uint32)(unsafe.Pointer(&_pBt.X16)) = _pBt.X15 - uint32(_nReserve) func() { - if ((_pBt.X15) & uint32(i32(7))) != uint32(i32(0)) { + if (_pBt.X15 & uint32(i32(7))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61424), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78637))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pBt.X23))) = i32(1) - if (_p.X3) == 0 { + *(*int32)(unsafe.Pointer(&_pBt.X23)) = i32(1) + if _p.X3 == 0 { goto _67 } _22_mutexShared = _sqlite3MutexAlloc(tls, i32(2)) - if i32(1) == 0 || (_sqlite3Config.X1) == 0 { + if i32(1) == 0 || _sqlite3Config.X1 == 0 { goto _69 } - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X21))))) = _sqlite3MutexAlloc(tls, i32(0)) + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X21)))) = _sqlite3MutexAlloc(tls, i32(0)) if (*Xsqlite3_mutex)(_pBt.X21) == nil { _rc = _sqlite3NomemError(tls, i32(61436)) goto _btree_open_out } _69: Xsqlite3_mutex_enter(tls, _22_mutexShared) - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X24))))) = _sqlite3SharedCacheList + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X24)))) = _sqlite3SharedCacheList _sqlite3SharedCacheList = _pBt bug20530(_sqlite3SharedCacheList) Xsqlite3_mutex_leave(tls, _22_mutexShared) _67: _49: - if (_p.X3) == 0 { + if _p.X3 == 0 { goto _71 } _25_i = i32(0) _72: - if _25_i >= (_db.X5) { + if _25_i >= _db.X5 { goto _75 } - if store54(&_25_pSib, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_25_i))).X1)) == nil || (_25_pSib.X3) == 0 { + if store54(&_25_pSib, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_25_i))).X1)) == nil || _25_pSib.X3 == 0 { goto _77 } _78: - if (*XBtree)(_25_pSib.X10) != nil { + if _25_pSib.X10 != nil { _25_pSib = (*XBtree)(_25_pSib.X10) goto _78 } if uint64(crt.P2U(unsafe.Pointer((*XBtShared)(_p.X1)))) < uint64(crt.P2U(unsafe.Pointer((*XBtShared)(_25_pSib.X1)))) { - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _25_pSib - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))) = nil - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_25_pSib.X10))))) = _p + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = _25_pSib + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X10)))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_25_pSib.X10)))) = _p goto _81 } _82: - if ((*XBtree)(_25_pSib.X9) != nil) && (uint64(crt.P2U(unsafe.Pointer((*XBtShared)((*XBtree)(_25_pSib.X9).X1)))) < uint64(crt.P2U(unsafe.Pointer((*XBtShared)(_p.X1))))) { + if (_25_pSib.X9 != nil) && (uint64(crt.P2U(unsafe.Pointer((*XBtShared)((*XBtree)(_25_pSib.X9).X1)))) < uint64(crt.P2U(unsafe.Pointer((*XBtShared)(_p.X1))))) { _25_pSib = (*XBtree)(_25_pSib.X9) goto _82 } - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = (*XBtree)(_25_pSib.X9) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))) = _25_pSib - if (*XBtree)(_p.X9) != nil { + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = (*XBtree)(_25_pSib.X9) + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X10)))) = _25_pSib + if _p.X9 != nil { *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X9).X10))))) = _p } - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_25_pSib.X9))))) = _p + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_25_pSib.X9)))) = _p _81: goto _75 _77: @@ -59106,11 +61688,11 @@ _btree_open_out: if _rc == i32(0) { goto _86 } - if (_pBt != nil) && ((*XPager)(_pBt.X0) != nil) { + if (_pBt != nil) && (_pBt.X0 != nil) { _sqlite3PagerClose(tls, (*XPager)(_pBt.X0), nil) } - Xsqlite3_free(tls, (unsafe.Pointer)(_pBt)) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_pBt)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) *_ppBtree = nil goto _89 _86: @@ -59118,8 +61700,8 @@ _86: _sqlite3PagerSetCachesize(tls, (*XPager)((*XBtShared)(_p.X1).X0), i32(-2000)) } _35_pFile = _sqlite3PagerFile(tls, (*XPager)(_pBt.X0)) - if (*Xsqlite3_io_methods)(_35_pFile.X0) != nil { - _sqlite3OsFileControlHint(tls, _35_pFile, i32(30), (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X1))))) + if _35_pFile.X0 != nil { + _sqlite3OsFileControlHint(tls, _35_pFile, i32(30), unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X1)))) } _89: if _mutexOpen != nil { @@ -59150,47 +61732,54 @@ func init() { } func _sqlite3OsFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nPathOut int32, _zPathOut *int8) (r0 int32) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPathOut)) + 1*uintptr(i32(0)))) = int8(i32(0)) - return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32 - }{(_pVfs.X9)})))(tls, _pVfs, _zPath, _nPathOut, _zPathOut) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPathOut)) + 1*uintptr(i32(0)))) = int8(i32(0)) + return func() func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32 { + v := _pVfs.X9 + return *(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _pVfs, _zPath, _nPathOut, _zPathOut) } -// Return the VFS structure for the pager. +// C comment +// /* +// ** Return the VFS structure for the pager. +// */ func _sqlite3PagerVfs(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_vfs) { return (*Xsqlite3_vfs)(_pPager.X0) } -// Allocate and initialize a new Pager object and put a pointer to it -// in *ppPager. The pager should eventually be freed by passing it -// to sqlite3PagerClose(). -// -// The zFilename argument is the path to the database file to open. -// If zFilename is NULL then a randomly-named temporary file is created -// and used as the file to be cached. Temporary files are be deleted -// automatically when they are closed. If zFilename is ":memory:" then -// all information is held in cache. It is never written to disk. -// This can be used to implement an in-memory database. -// -// The nExtra parameter specifies the number of bytes of space allocated -// along with each page reference. This space is available to the user -// via the sqlite3PagerGetExtra() API. When a new page is allocated, the -// first 8 bytes of this space are zeroed but the remainder is uninitialized. -// (The extra space is used by btree as the MemPage object.) -// -// The flags argument is used to specify properties that affect the -// operation of the pager. It should be passed some bitwise combination -// of the PAGER_* flags. -// -// The vfsFlags parameter is a bitmask to pass to the flags parameter -// of the xOpen() method of the supplied VFS when opening files. -// -// If the pager object is allocated and the specified file opened -// successfully, SQLITE_OK is returned and *ppPager set to point to -// the new pager object. If an error occurs, *ppPager is set to NULL -// and error code returned. This function may return SQLITE_NOMEM -// (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or -// various SQLITE_IO_XXX errors. +// C comment +// /* +// ** Allocate and initialize a new Pager object and put a pointer to it +// ** in *ppPager. The pager should eventually be freed by passing it +// ** to sqlite3PagerClose(). +// ** +// ** The zFilename argument is the path to the database file to open. +// ** If zFilename is NULL then a randomly-named temporary file is created +// ** and used as the file to be cached. Temporary files are be deleted +// ** automatically when they are closed. If zFilename is ":memory:" then +// ** all information is held in cache. It is never written to disk. +// ** This can be used to implement an in-memory database. +// ** +// ** The nExtra parameter specifies the number of bytes of space allocated +// ** along with each page reference. This space is available to the user +// ** via the sqlite3PagerGetExtra() API. When a new page is allocated, the +// ** first 8 bytes of this space are zeroed but the remainder is uninitialized. +// ** (The extra space is used by btree as the MemPage object.) +// ** +// ** The flags argument is used to specify properties that affect the +// ** operation of the pager. It should be passed some bitwise combination +// ** of the PAGER_* flags. +// ** +// ** The vfsFlags parameter is a bitmask to pass to the flags parameter +// ** of the xOpen() method of the supplied VFS when opening files. +// ** +// ** If the pager object is allocated and the specified file opened +// ** successfully, SQLITE_OK is returned and *ppPager set to point to +// ** the new pager object. If an error occurs, *ppPager is set to NULL +// ** and error code returned. This function may return SQLITE_NOMEM +// ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or +// ** various SQLITE_IO_XXX errors. +// */ func _sqlite3PagerOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _ppPager **XPager, _zFilename *int8, _nExtra int32, _flags int32, _vfsFlags int32, _xReinit func(*crt.TLS, *XPgHdr)) (r0 int32) { var _rc, _tempFile, _memDb, _readOnly, _journalFileSize, _nPathname, _useJournal, _pcacheSize, _nUri, _10_fout, _11_iDc int32 var _szPageDflt uint32 @@ -59215,7 +61804,7 @@ func _sqlite3PagerOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _ppPager **XPager, _zF goto _0 } _memDb = i32(1) - if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 { + if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) == 0 { goto _2 } _zPathname = _sqlite3DbStrDup(tls, nil, _zFilename) @@ -59226,78 +61815,78 @@ func _sqlite3PagerOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _ppPager **XPager, _zF _zFilename = nil _2: _0: - if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 { + if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) == 0 { goto _5 } - _nPathname = (_pVfs.X2) + i32(1) + _nPathname = _pVfs.X2 + i32(1) _zPathname = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_nPathname*i32(2)))) if _zPathname == nil { return _sqlite3NomemError(tls, i32(51617)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPathname)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPathname)) + 1*uintptr(i32(0)))) = int8(i32(0)) _rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _nPathname, _zPathname) _nPathname = _sqlite3Strlen30(tls, _zPathname) - _3_z = store0(&_zUri, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename))+1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1))))) + _3_z = store0(&_zUri, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename))+1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1))))) _7: if (*_3_z) != 0 { { p := &_3_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1)))) sink0(*p) } { p := &_3_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1)))) sink0(*p) } goto _7 } - _nUri = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_z))+1*uintptr(i32(1)))))) - uintptr(unsafe.Pointer(_zUri))) / 1)) + _nUri = int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_z))+1*uintptr(i32(1)))))) - uintptr(unsafe.Pointer(_zUri))) / 1)) func() { if _nUri < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51628), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78764))) crt.X__builtin_abort(tls) } }() - if (_rc == i32(0)) && ((_nPathname + i32(8)) > (_pVfs.X2)) { + if (_rc == i32(0)) && ((_nPathname + i32(8)) > _pVfs.X2) { _rc = _sqlite3CantopenError(tls, i32(51636)) } if _rc != i32(0) { - _sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname)) + _sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname)) return _rc } _5: - _pPtr = (*uint8)(_sqlite3MallocZero(tls, (((((((((((u64(304)+uint64((_pcacheSize+i32(7))&i32(-8)))+uint64(((_pVfs.X1)+i32(7))&i32(-8)))+uint64(_journalFileSize*i32(2)))+uint64(_nPathname))+uint64(i32(1)))+uint64(_nUri))+uint64(_nPathname))+uint64(i32(8)))+uint64(i32(2)))+uint64(_nPathname))+uint64(i32(4)))+uint64(i32(2)))) + _pPtr = (*uint8)(_sqlite3MallocZero(tls, (((((((((((u64(304)+uint64((_pcacheSize+i32(7))&i32(-8)))+uint64((_pVfs.X1+i32(7))&i32(-8)))+uint64(_journalFileSize*i32(2)))+uint64(_nPathname))+uint64(i32(1)))+uint64(_nUri))+uint64(_nPathname))+uint64(i32(8)))+uint64(i32(2)))+uint64(_nPathname))+uint64(i32(4)))+uint64(i32(2)))) func() { - if (int64((uintptr(unsafe.Pointer((*int8)((unsafe.Pointer)(crt.U2P(uintptr(int64(_journalFileSize)))))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { + if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(crt.U2P(uintptr(int64(_journalFileSize)))))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78772))) crt.X__builtin_abort(tls) } }() if _pPtr == nil { - _sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname)) + _sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname)) return _sqlite3NomemError(tls, i32(51670)) } _pPager = (*XPager)(unsafe.Pointer(_pPtr)) - *(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X59))))) = (*XPCache)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X59)))) = (*XPCache)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u64(304)))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(u64(304)))) }()))) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X31))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X31)))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_pcacheSize+i32(7))&i32(-8)))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr((_pcacheSize+i32(7))&i32(-8)))) }()))) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X33))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X33)))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(((_pVfs.X1)+i32(7))&i32(-8)))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr((_pVfs.X1+i32(7))&i32(-8)))) }()))) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X32))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X32)))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_journalFileSize))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_journalFileSize))) }()))) - *(**int8)(unsafe.Pointer(&(_pPager.X51))) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**int8)(unsafe.Pointer(&_pPager.X51)) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_journalFileSize))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_journalFileSize))) }()))) func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*Xsqlite3_file)(_pPager.X32)))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { @@ -59314,24 +61903,24 @@ _5: crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pPager.X52))) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) { + *(**int8)(unsafe.Pointer(&_pPager.X52)) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) { p := &_pPtr - return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_nPathname+i32(1))+_nUri))) + return p, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr((_nPathname+i32(1))+_nUri))) }()))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X51), (unsafe.Pointer)(_zPathname), uint64(_nPathname)) + crt.Xmemcpy(tls, unsafe.Pointer(_pPager.X51), unsafe.Pointer(_zPathname), uint64(_nPathname)) if _nUri != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X51))+1*uintptr(_nPathname+i32(1))))), (unsafe.Pointer)(_zUri), uint64(_nUri)) - } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X52), (unsafe.Pointer)(_zPathname), uint64(_nPathname)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X52))+1*uintptr(_nPathname)))), (unsafe.Pointer)(str(78875)), uint64(i32(10))) - *(**int8)(unsafe.Pointer(&(_pPager.X61))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X52)) + 1*uintptr((_nPathname+i32(8))+i32(1)))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X61), (unsafe.Pointer)(_zPathname), uint64(_nPathname)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X61))+1*uintptr(_nPathname)))), (unsafe.Pointer)(str(78885)), uint64(i32(5))) - _sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPager.X51))+1*uintptr(_nPathname+i32(1))))), unsafe.Pointer(_zUri), uint64(_nUri)) + } + crt.Xmemcpy(tls, unsafe.Pointer(_pPager.X52), unsafe.Pointer(_zPathname), uint64(_nPathname)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPager.X52))+1*uintptr(_nPathname)))), unsafe.Pointer(str(78875)), uint64(i32(10))) + *(**int8)(unsafe.Pointer(&_pPager.X61)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPager.X52)) + 1*uintptr((_nPathname+i32(8))+i32(1)))) + crt.Xmemcpy(tls, unsafe.Pointer(_pPager.X61), unsafe.Pointer(_zPathname), uint64(_nPathname)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPager.X61))+1*uintptr(_nPathname)))), unsafe.Pointer(str(78885)), uint64(i32(5))) + _sqlite3DbFree(tls, nil, unsafe.Pointer(_zPathname)) _19: - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X0))))) = _pVfs - *(*uint32)(unsafe.Pointer(&(_pPager.X46))) = uint32(_vfsFlags) - if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 { + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X0)))) = _pVfs + *(*uint32)(unsafe.Pointer(&_pPager.X46)) = uint32(_vfsFlags) + if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) == 0 { goto _24 } _10_fout = i32(0) @@ -59352,10 +61941,10 @@ _19: } _setSectorSize(tls, _pPager) i32(0) - if _szPageDflt >= (_pPager.X47) { + if _szPageDflt >= _pPager.X47 { goto _29 } - if (_pPager.X47) > uint32(i32(8192)) { + if _pPager.X47 > uint32(i32(8192)) { _szPageDflt = uint32(i32(8192)) goto _31 } @@ -59363,7 +61952,7 @@ _19: _31: _29: _28: - *(*uint8)(unsafe.Pointer(&(_pPager.X11))) = uint8(Xsqlite3_uri_boolean(tls, _zFilename, str(78898), i32(0))) + *(*uint8)(unsafe.Pointer(&_pPager.X11)) = uint8(Xsqlite3_uri_boolean(tls, _zFilename, str(78898), i32(0))) if ((_11_iDc & i32(8192)) != i32(0)) || Xsqlite3_uri_boolean(tls, _zFilename, str(78905), i32(0)) != 0 { { p := &_vfsFlags @@ -59377,9 +61966,9 @@ _27: _24: _act_like_temp_file: _tempFile = i32(1) - *(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(i32(4)) - *(*uint8)(unsafe.Pointer(&(_pPager.X11))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X14)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X15)) = uint8(i32(4)) + *(*uint8)(unsafe.Pointer(&_pPager.X11)) = uint8(i32(1)) _readOnly = _vfsFlags & i32(1) _34: if _rc == i32(0) { @@ -59404,17 +61993,17 @@ _34: return _pagerStress } return nil - }(), (unsafe.Pointer)(_pPager), (*XPCache)(_pPager.X59)) + }(), unsafe.Pointer(_pPager), (*XPCache)(_pPager.X59)) } if _rc != i32(0) { _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X31)) - _sqlite3PageFree(tls, (unsafe.Pointer)(_pPager.X58)) - Xsqlite3_free(tls, (unsafe.Pointer)(_pPager)) + _sqlite3PageFree(tls, unsafe.Pointer(_pPager.X58)) + Xsqlite3_free(tls, unsafe.Pointer(_pPager)) return _rc } - *(*uint8)(unsafe.Pointer(&(_pPager.X3))) = uint8(_useJournal) - *(*uint32)(unsafe.Pointer(&(_pPager.X49))) = uint32(i32(1073741823)) - *(*uint8)(unsafe.Pointer(&(_pPager.X10))) = uint8(_tempFile) + *(*uint8)(unsafe.Pointer(&_pPager.X3)) = uint8(_useJournal) + *(*uint32)(unsafe.Pointer(&_pPager.X49)) = uint32(i32(1073741823)) + *(*uint8)(unsafe.Pointer(&_pPager.X10)) = uint8(_tempFile) func() { if _tempFile != i32(0) && _tempFile != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78957))) @@ -59422,18 +62011,18 @@ _34: } }() i32(0) - *(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(_tempFile) - *(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10 - *(*uint8)(unsafe.Pointer(&(_pPager.X13))) = uint8(_memDb) - *(*uint8)(unsafe.Pointer(&(_pPager.X12))) = uint8(_readOnly) + *(*uint8)(unsafe.Pointer(&_pPager.X1)) = uint8(_tempFile) + *(*uint8)(unsafe.Pointer(&_pPager.X16)) = _pPager.X10 + *(*uint8)(unsafe.Pointer(&_pPager.X13)) = uint8(_memDb) + *(*uint8)(unsafe.Pointer(&_pPager.X12)) = uint8(_readOnly) func() { - if _useJournal == 0 && (_pPager.X10) == 0 { + if _useJournal == 0 && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79033))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X4))) = _pPager.X10 - if (_pPager.X4) != 0 { + *(*uint8)(unsafe.Pointer(&_pPager.X4)) = _pPager.X10 + if _pPager.X4 != 0 { func() { if int32(_pPager.X5) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51818), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79064))) @@ -59466,14 +62055,14 @@ _34: }() goto _62 } - *(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2)) - *(*uint8)(unsafe.Pointer(&(_pPager.X8))) = uint8(i32(34)) - *(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X5)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X6)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X9)) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X8)) = uint8(i32(34)) + *(*uint8)(unsafe.Pointer(&_pPager.X7)) = uint8(i32(2)) _62: - *(*uint16)(unsafe.Pointer(&(_pPager.X44))) = uint16(_nExtra) - *(*int64)(unsafe.Pointer(&(_pPager.X50))) = int64(i32(-1)) + *(*uint16)(unsafe.Pointer(&_pPager.X44)) = uint16(_nExtra) + *(*int64)(unsafe.Pointer(&_pPager.X50)) = int64(i32(-1)) func() { if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _tempFile == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51835), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79175))) @@ -59482,30 +62071,36 @@ _62: }() _setSectorSize(tls, _pPager) if _useJournal == 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X2)) = uint8(i32(2)) goto _68 } if _memDb != 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(4)) + *(*uint8)(unsafe.Pointer(&_pPager.X2)) = uint8(i32(4)) } _68: - *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pPager.X56))))) = _xReinit + *(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pPager.X56)))) = _xReinit _setGetterMethod(tls, _pPager) *_ppPager = _pPager return i32(0) } -// Return the size in bytes of a PCache object. +// C comment +// /* +// ** Return the size in bytes of a PCache object. +// */ func _sqlite3PcacheSize(tls *crt.TLS) (r0 int32) { return int32(u64(72)) } -// Return the number of bytes required to store a JournalFile that uses vfs -// pVfs to create the underlying on-disk files. +// C comment +// /* +// ** Return the number of bytes required to store a JournalFile that uses vfs +// ** pVfs to create the underlying on-disk files. +// */ func _sqlite3JournalSize(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) { return func() int32 { - if (_pVfs.X1) > i32(88) { - return (_pVfs.X1) + if _pVfs.X1 > i32(88) { + return _pVfs.X1 } return i32(88) }() @@ -59517,7 +62112,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerOpenØ00__func__Ø000[0], str(79206), 17) } -// Return a boolean value for a query parameter. +// C comment +// /* +// ** Return a boolean value for a query parameter. +// */ func Xsqlite3_uri_boolean(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int32) (r0 int32) { var _z *int8 _z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam) @@ -59530,15 +62128,18 @@ func Xsqlite3_uri_boolean(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt }() } -// This is a utility routine, useful to VFS implementations, that checks -// to see if a database file was a URI that contained a specific query -// parameter, and if so obtains the value of the query parameter. -// -// The zFilename argument is the filename pointer passed into the xOpen() -// method of a VFS implementation. The zParam argument is the name of the -// query parameter we seek. This routine returns the value of the zParam -// parameter if it exists. If the parameter does not exist, this routine -// returns a NULL pointer. +// C comment +// /* +// ** This is a utility routine, useful to VFS implementations, that checks +// ** to see if a database file was a URI that contained a specific query +// ** parameter, and if so obtains the value of the query parameter. +// ** +// ** The zFilename argument is the filename pointer passed into the xOpen() +// ** method of a VFS implementation. The zParam argument is the name of the +// ** query parameter we seek. This routine returns the value of the zParam +// ** parameter if it exists. If the parameter does not exist, this routine +// ** returns a NULL pointer. +// */ func Xsqlite3_uri_parameter(tls *crt.TLS, _zFilename *int8, _zParam *int8) (r0 *int8) { var _1_x int32 if (_zFilename == nil) || (_zParam == nil) { @@ -59546,17 +62147,17 @@ func Xsqlite3_uri_parameter(tls *crt.TLS, _zFilename *int8, _zParam *int8) (r0 * } { p := &_zFilename - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) sink0(*p) } _2: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) == 0 { goto _3 } _1_x = crt.Xstrcmp(tls, _zFilename, _zParam) { p := &_zFilename - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) sink0(*p) } if _1_x == i32(0) { @@ -59564,7 +62165,7 @@ _2: } { p := &_zFilename - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))) sink0(*p) } goto _2 @@ -59572,23 +62173,29 @@ _3: return nil } -// Interpret the given string as a boolean value. +// C comment +// /* +// ** Interpret the given string as a boolean value. +// */ func _sqlite3GetBoolean(tls *crt.TLS, _z *int8, _dflt uint8) (r0 uint8) { return uint8(bool2int(int32(_getSafetyLevel(tls, _z, i32(1), _dflt)) != i32(0))) } -// Interpret the given string as a safety level. Return 0 for OFF, -// 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or -// unrecognized string argument. The FULL and EXTRA option is disallowed -// if the omitFull parameter it 1. -// -// Note that the values returned are one less that the values that -// should be passed into sqlite3BtreeSetSafetyLevel(). The is done -// to support legacy SQL code. The safety level used to be boolean -// and older scripts may have used numbers 0 for OFF and 1 for ON. +// C comment +// /* +// ** Interpret the given string as a safety level. Return 0 for OFF, +// ** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or +// ** unrecognized string argument. The FULL and EXTRA option is disallowed +// ** if the omitFull parameter it 1. +// ** +// ** Note that the values returned are one less that the values that +// ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done +// ** to support legacy SQL code. The safety level used to be boolean +// ** and older scripts may have used numbers 0 for OFF and 1 for ON. +// */ func _getSafetyLevel(tls *crt.TLS, _z *int8, _omitFull int32, _dflt uint8) (r0 uint8) { var _i, _n int32 - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(4)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(4)) != 0 { return uint8(_sqlite3Atoi(tls, _z)) } _n = _sqlite3Strlen30(tls, _z) @@ -59597,8 +62204,8 @@ _1: if _i >= i32(8) { goto _4 } - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iLengthØ003)) + 1*uintptr(_i)))) == _n) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00zTextØ001))+1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iOffsetØ002)) + 1*uintptr(_i)))))), _z, _n) == i32(0))) && ((_omitFull == 0) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i)))) <= i32(1))) { - return *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i))) + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getSafetyLevelØ00iLengthØ003)) + 1*uintptr(_i)))) == _n) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getSafetyLevelØ00zTextØ001))+1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getSafetyLevelØ00iOffsetØ002)) + 1*uintptr(_i)))))), _z, _n) == i32(0))) && ((_omitFull == 0) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i)))) <= i32(1))) { + return *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i))) } _i += 1 goto _1 @@ -59630,32 +62237,35 @@ func init() { _getSafetyLevelØ00iValueØ004 = [8]uint8{1, 0, 0, 0, 1, 1, 3, 2} } -// Create a new PCache object. Storage space to hold the object -// has already been allocated and is passed in as the p pointer. -// The caller discovers how much space needs to be allocated by -// calling sqlite3PcacheSize(). -// -// szExtra is some extra space allocated for each page. The first -// 8 bytes of the extra space will be zeroed as the page is allocated, -// but remaining content will be uninitialized. Though it is opaque -// to this module, the extra space really ends up being the MemPage -// structure in the pager. +// C comment +// /* +// ** Create a new PCache object. Storage space to hold the object +// ** has already been allocated and is passed in as the p pointer. +// ** The caller discovers how much space needs to be allocated by +// ** calling sqlite3PcacheSize(). +// ** +// ** szExtra is some extra space allocated for each page. The first +// ** 8 bytes of the extra space will be zeroed as the page is allocated, +// ** but remaining content will be uninitialized. Though it is opaque +// ** to this module, the extra space really ends up being the MemPage +// ** structure in the pager. +// */ func _sqlite3PcacheOpen(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32, _xStress func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32, _pStress unsafe.Pointer, _p *XPCache) (r0 int32) { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(72)) - *(*int32)(unsafe.Pointer(&(_p.X6))) = i32(1) - *(*int32)(unsafe.Pointer(&(_p.X7))) = _szExtra + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(72)) + *(*int32)(unsafe.Pointer(&_p.X6)) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X7)) = _szExtra func() { if _szExtra < i32(8) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44428), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheOpenØ00__func__Ø000))), unsafe.Pointer(str(79248))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_p.X8))) = uint8(_bPurgeable) - *(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(2)) - *(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_p.X10))))) = _xStress - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))) = _pStress - *(*int32)(unsafe.Pointer(&(_p.X4))) = i32(100) - *(*int32)(unsafe.Pointer(&(_p.X5))) = i32(1) + *(*uint8)(unsafe.Pointer(&_p.X8)) = uint8(_bPurgeable) + *(*uint8)(unsafe.Pointer(&_p.X9)) = uint8(i32(2)) + *(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_p.X10)))) = _xStress + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X11)) = _pStress + *(*int32)(unsafe.Pointer(&_p.X4)) = i32(100) + *(*int32)(unsafe.Pointer(&_p.X5)) = i32(1) return _sqlite3PcacheSetPageSize(tls, _p, _szPage) } @@ -59665,23 +62275,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheOpenØ00__func__Ø000[0], str(79259), 18) } -// This function is called by the pcache layer when it has reached some -// soft memory limit. The first argument is a pointer to a Pager object -// (cast as a void*). The pager is always 'purgeable' (not an in-memory -// database). The second argument is a reference to a page that is -// currently dirty but has no outstanding references. The page -// is always associated with the Pager object passed as the first -// argument. -// -// The job of this function is to make pPg clean by writing its contents -// out to the database file, if possible. This may involve syncing the -// journal file. -// -// If successful, sqlite3PcacheMakeClean() is called on the page and -// SQLITE_OK returned. If an IO error occurs while trying to make the -// page clean, the IO error code is returned. If the page cannot be -// made clean for some other reason, but no error occurs, then SQLITE_OK -// is returned by sqlite3PcacheMakeClean() is not called. +// C comment +// /* +// ** This function is called by the pcache layer when it has reached some +// ** soft memory limit. The first argument is a pointer to a Pager object +// ** (cast as a void*). The pager is always 'purgeable' (not an in-memory +// ** database). The second argument is a reference to a page that is +// ** currently dirty but has no outstanding references. The page +// ** is always associated with the Pager object passed as the first +// ** argument. +// ** +// ** The job of this function is to make pPg clean by writing its contents +// ** out to the database file, if possible. This may involve syncing the +// ** journal file. +// ** +// ** If successful, sqlite3PcacheMakeClean() is called on the page and +// ** SQLITE_OK returned. If an IO error occurs while trying to make the +// ** page clean, the IO error code is returned. If the page cannot be +// ** made clean for some other reason, but no error occurs, then SQLITE_OK +// ** is returned by sqlite3PcacheMakeClean() is not called. +// */ func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) { var _rc int32 var _pPager *XPager @@ -59700,7 +62313,7 @@ func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) { } }() if func() int32 { - if (_pPager.X26) != 0 { + if _pPager.X26 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51470), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerStressØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -59711,10 +62324,10 @@ func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) { }() != 0 { return i32(0) } - if ((_pPager.X18) != 0) && (((int32(_pPager.X18) & i32(3)) != i32(0)) || ((int32(_pPg.X6) & i32(8)) != i32(0))) { + if (_pPager.X18 != 0) && (((int32(_pPager.X18) & i32(3)) != i32(0)) || ((int32(_pPg.X6) & i32(8)) != i32(0))) { return i32(0) } - *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X3))))) = nil + *(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPg.X3)))) = nil if (*XWal)(_pPager.X60) == nil { goto _10 } @@ -59749,12 +62362,15 @@ func init() { crt.Xstrncpy(nil, &_pagerStressØ00__func__Ø000[0], str(79309), 12) } -// During a rollback, when the pager reloads information into the cache -// so that the cache is restored to its original state at the start of -// the transaction, for each page restored this routine is called. -// -// This routine needs to reset the extra data section at the end of the -// page to agree with the restored data. +// C comment +// /* +// ** During a rollback, when the pager reloads information into the cache +// ** so that the cache is restored to its original state at the start of +// ** the transaction, for each page restored this routine is called. +// ** +// ** This routine needs to reset the extra data section at the end of the +// ** page to agree with the restored data. +// */ func _pageReinit(tls *crt.TLS, _pData *XPgHdr) { var _pPage *XMemPage _pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pData)) @@ -59764,7 +62380,7 @@ func _pageReinit(tls *crt.TLS, _pData *XPgHdr) { crt.X__builtin_abort(tls) } }() - if (_pPage.X0) == 0 { + if _pPage.X0 == 0 { goto _2 } func() { @@ -59773,7 +62389,7 @@ func _pageReinit(tls *crt.TLS, _pData *XPgHdr) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = uint8(i32(0)) if _sqlite3PagerPageRefcount(tls, _pData) > i32(1) { _btreeInitPage(tls, _pPage) } @@ -59786,30 +62402,36 @@ func init() { crt.Xstrncpy(nil, &_pageReinitØ00__func__Ø000[0], str(79355), 11) } -// Change the maximum size of any memory mapping made of the database file. +// C comment +// /* +// ** Change the maximum size of any memory mapping made of the database file. +// */ func _sqlite3PagerSetMmapLimit(tls *crt.TLS, _pPager *XPager, _szMmap int64) { - *(*int64)(unsafe.Pointer(&(_pPager.X42))) = _szMmap + *(*int64)(unsafe.Pointer(&_pPager.X42)) = _szMmap _pagerFixMaplimit(tls, _pPager) } -// Read the first N bytes from the beginning of the file into memory -// that pDest points to. -// -// If the pager was opened on a transient file (zFilename==""), or -// opened on a file less than N bytes in size, the output buffer is -// zeroed and SQLITE_OK returned. The rationale for this is that this -// function is used to read database headers, and a new transient or -// zero sized database has a header than consists entirely of zeroes. -// -// If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered, -// the error code is returned to the caller and the contents of the -// output buffer undefined. +// C comment +// /* +// ** Read the first N bytes from the beginning of the file into memory +// ** that pDest points to. +// ** +// ** If the pager was opened on a transient file (zFilename==""), or +// ** opened on a file less than N bytes in size, the output buffer is +// ** zeroed and SQLITE_OK returned. The rationale for this is that this +// ** function is used to read database headers, and a new transient or +// ** zero sized database has a header than consists entirely of zeroes. +// ** +// ** If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered, +// ** the error code is returned to the caller and the contents of the +// ** output buffer undefined. +// */ func _sqlite3PagerReadFileheader(tls *crt.TLS, _pPager *XPager, _N int32, _pDest *uint8) (r0 int32) { var _rc int32 _rc = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(_pDest), i32(0), uint64(_N)) + crt.Xmemset(tls, unsafe.Pointer(_pDest), i32(0), uint64(_N)) func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000))), unsafe.Pointer(str(19565))) crt.X__builtin_abort(tls) } @@ -59823,7 +62445,7 @@ func _sqlite3PagerReadFileheader(tls *crt.TLS, _pPager *XPager, _N int32, _pDest if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil { goto _5 } - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_pDest), _N, int64(i32(0))) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), unsafe.Pointer(_pDest), _N, int64(i32(0))) if _rc == i32(522) { _rc = i32(0) } @@ -59837,35 +62459,41 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerReadFileheaderØ00__func__Ø000[0], str(79366), 27) } -// Set the busy handler function. -// -// The pager invokes the busy-handler if sqlite3OsLock() returns -// SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, -// or when trying to upgrade from a RESERVED lock to an EXCLUSIVE -// lock. It does *not* invoke the busy handler when upgrading from -// SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE -// (which occurs during hot-journal rollback). Summary: -// -// Transition | Invokes xBusyHandler -// -------------------------------------------------------- -// NO_LOCK -> SHARED_LOCK | Yes -// SHARED_LOCK -> RESERVED_LOCK | No -// SHARED_LOCK -> EXCLUSIVE_LOCK | No -// RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes -// -// If the busy-handler callback returns non-zero, the lock is -// retried. If it returns zero, then the SQLITE_BUSY error is -// returned to the caller of the pager API function. +// C comment +// /* +// ** Set the busy handler function. +// ** +// ** The pager invokes the busy-handler if sqlite3OsLock() returns +// ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, +// ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE +// ** lock. It does *not* invoke the busy handler when upgrading from +// ** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE +// ** (which occurs during hot-journal rollback). Summary: +// ** +// ** Transition | Invokes xBusyHandler +// ** -------------------------------------------------------- +// ** NO_LOCK -> SHARED_LOCK | Yes +// ** SHARED_LOCK -> RESERVED_LOCK | No +// ** SHARED_LOCK -> EXCLUSIVE_LOCK | No +// ** RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes +// ** +// ** If the busy-handler callback returns non-zero, the lock is +// ** retried. If it returns zero, then the SQLITE_BUSY error is +// ** returned to the caller of the pager API function. +// */ func _sqlite3PagerSetBusyhandler(tls *crt.TLS, _pPager *XPager, _xBusyHandler func(*crt.TLS, unsafe.Pointer) int32, _pBusyHandlerArg unsafe.Pointer) { var _1_ap *unsafe.Pointer - *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_pPager.X53))) = _xBusyHandler - *(*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X54))) = _pBusyHandlerArg + *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_pPager.X53)) = _xBusyHandler + *(*unsafe.Pointer)(unsafe.Pointer(&_pPager.X54)) = _pBusyHandlerArg if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil { - _1_ap = (*unsafe.Pointer)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_pPager.X53))))) + _1_ap = (*unsafe.Pointer)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_pPager.X53)))) func() { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f unsafe.Pointer }{(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ap)) + 8*uintptr(i32(0)))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, unsafe.Pointer) int32 { + v := *(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_ap)) + 8*uintptr(i32(0)))) + return *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 }{_xBusyHandler})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50605), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000))), unsafe.Pointer(str(79393))) @@ -59873,12 +62501,12 @@ func _sqlite3PagerSetBusyhandler(tls *crt.TLS, _pPager *XPager, _xBusyHandler fu } }() func() { - if *(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ap)) + 8*uintptr(i32(1)))) != _pBusyHandlerArg { + if *(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_ap)) + 8*uintptr(i32(1)))) != _pBusyHandlerArg { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50606), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000))), unsafe.Pointer(str(79433))) crt.X__builtin_abort(tls) } }() - _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(15), (unsafe.Pointer)(_1_ap)) + _sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(15), unsafe.Pointer(_1_ap)) } } @@ -59888,52 +62516,64 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerSetBusyhandlerØ00__func__Ø000[0], str(79456), 27) } -// Return TRUE if the database file is opened read-only. Return FALSE -// if the database is (in theory) writable. +// C comment +// /* +// ** Return TRUE if the database file is opened read-only. Return FALSE +// ** if the database is (in theory) writable. +// */ func _sqlite3PagerIsreadonly(tls *crt.TLS, _pPager *XPager) (r0 uint8) { return _pPager.X12 } -// This function returns a pointer to a blob of memory associated with -// a single shared-btree. The memory is used by client code for its own -// purposes (for example, to store a high-level schema associated with -// the shared-btree). The btree layer manages reference counting issues. -// -// The first time this is called on a shared-btree, nBytes bytes of memory -// are allocated, zeroed, and returned to the caller. For each subsequent -// call the nBytes parameter is ignored and a pointer to the same blob -// of memory returned. -// -// If the nBytes parameter is 0 and the blob of memory has not yet been -// allocated, a null pointer is returned. If the blob has already been -// allocated, it is returned as normal. -// -// Just before the shared-btree is closed, the function passed as the -// xFree argument when the memory allocation was made is invoked on the -// blob of allocated memory. The xFree function should not call sqlite3_free() -// on the memory, the btree layer does that. +// C comment +// /* +// ** This function returns a pointer to a blob of memory associated with +// ** a single shared-btree. The memory is used by client code for its own +// ** purposes (for example, to store a high-level schema associated with +// ** the shared-btree). The btree layer manages reference counting issues. +// ** +// ** The first time this is called on a shared-btree, nBytes bytes of memory +// ** are allocated, zeroed, and returned to the caller. For each subsequent +// ** call the nBytes parameter is ignored and a pointer to the same blob +// ** of memory returned. +// ** +// ** If the nBytes parameter is 0 and the blob of memory has not yet been +// ** allocated, a null pointer is returned. If the blob has already been +// ** allocated, it is returned as normal. +// ** +// ** Just before the shared-btree is closed, the function passed as the +// ** xFree argument when the memory allocation was made is invoked on the +// ** blob of allocated memory. The xFree function should not call sqlite3_free() +// ** on the memory, the btree layer does that. +// */ func _sqlite3BtreeSchema(tls *crt.TLS, _p *XBtree, _nBytes int32, _xFree func(*crt.TLS, unsafe.Pointer)) (r0 unsafe.Pointer) { var _pBt *XBtShared _pBt = (*XBtShared)(_p.X1) _sqlite3BtreeEnter(tls, _p) - if ((_pBt.X19) == nil) && _nBytes != 0 { - *(*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X19))) = _sqlite3DbMallocZero(tls, nil, uint64(_nBytes)) - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pBt.X20))) = _xFree + if (_pBt.X19 == nil) && _nBytes != 0 { + *(*unsafe.Pointer)(unsafe.Pointer(&_pBt.X19)) = _sqlite3DbMallocZero(tls, nil, uint64(_nBytes)) + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pBt.X20)) = _xFree } _sqlite3BtreeLeave(tls, _p) return _pBt.X19 } -// Return the file handle for the database file associated -// with the pager. This might return NULL if the file has -// not yet been opened. +// C comment +// /* +// ** Return the file handle for the database file associated +// ** with the pager. This might return NULL if the file has +// ** not yet been opened. +// */ func _sqlite3PagerFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) { return (*Xsqlite3_file)(_pPager.X31) } -// Return the number of connections to the BtShared object accessed by -// the Btree handle passed as the only argument. For private caches -// this is always 1. For shared caches it may be 1 or greater. +// C comment +// /* +// ** Return the number of connections to the BtShared object accessed by +// ** the Btree handle passed as the only argument. For private caches +// ** this is always 1. For shared caches it may be 1 or greater. +// */ func _sqlite3BtreeConnectionCount(tls *crt.TLS, _p *XBtree) (r0 int32) { return (*XBtShared)(_p.X1).X23 } @@ -59952,15 +62592,18 @@ func _sqlite3BtreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _flags return _rc } -// Create a new BTree table. Write into *piTable the page -// number for the root page of the new table. -// -// The type of type is determined by the flags parameter. Only the -// following values of flags are currently in use. Other values for -// flags might not work: -// -// BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys -// BTREE_ZERODATA Used for SQL indices +// C comment +// /* +// ** Create a new BTree table. Write into *piTable the page +// ** number for the root page of the new table. +// ** +// ** The type of type is determined by the flags parameter. Only the +// ** following values of flags are currently in use. Other values for +// ** flags might not work: +// ** +// ** BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys +// ** BTREE_ZERODATA Used for SQL indices +// */ func _btreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _createTabFlags int32) (r0 int32) { var _rc, _ptfFlags int32 var _pgnoRoot, _1_pgnoMove, _4_iPtrPage uint32 @@ -59986,19 +62629,19 @@ func _btreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _createTabFlag crt.X__builtin_abort(tls) } }() - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _6 } _invalidateAllOverflowCache(tls, _pBt) _sqlite3BtreeGetMeta(tls, _p, i32(4), &_pgnoRoot) _pgnoRoot += 1 _7: - if (_pgnoRoot == _ptrmapPageno(tls, _pBt, _pgnoRoot)) || (_pgnoRoot == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_pgnoRoot == _ptrmapPageno(tls, _pBt, _pgnoRoot)) || (_pgnoRoot == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { _pgnoRoot += 1 goto _7 } func() { - if _pgnoRoot < uint32(i32(3)) && (_sqlite3Config.X6) != i32(0) { + if _pgnoRoot < uint32(i32(3)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67518), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79483))) crt.X__builtin_abort(tls) } @@ -60121,23 +62764,26 @@ func init() { crt.Xstrncpy(nil, &_btreeCreateTableØ00__func__Ø000[0], str(79691), 17) } -// Initialize the temporary index cursor just opened as a sorter cursor. -// -// Usually, the sorter module uses the value of (pCsr->pKeyInfo->nField) -// to determine the number of fields that should be compared from the -// records being sorted. However, if the value passed as argument nField -// is non-zero and the sorter is able to guarantee a stable sort, nField -// is used instead. This is used when sorting records for a CREATE INDEX -// statement. In this case, keys are always delivered to the sorter in -// order of the primary key, which happens to be make up the final part -// of the records being sorted. So if the sort is stable, there is never -// any reason to compare PK fields and they can be ignored for a small -// performance boost. -// -// The sorter can guarantee a stable sort when running in single-threaded -// mode, but not in multi-threaded mode. -// -// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** Initialize the temporary index cursor just opened as a sorter cursor. +// ** +// ** Usually, the sorter module uses the value of (pCsr->pKeyInfo->nField) +// ** to determine the number of fields that should be compared from the +// ** records being sorted. However, if the value passed as argument nField +// ** is non-zero and the sorter is able to guarantee a stable sort, nField +// ** is used instead. This is used when sorting records for a CREATE INDEX +// ** statement. In this case, keys are always delivered to the sorter in +// ** order of the primary key, which happens to be make up the final part +// ** of the records being sorted. So if the sort is stable, there is never +// ** any reason to compare PK fields and they can be ignored for a small +// ** performance boost. +// ** +// ** The sorter can guarantee a stable sort when running in single-threaded +// ** mode, but not in multi-threaded mode. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// */ func _sqlite3VdbeSorterInit(tls *crt.TLS, _db *Xsqlite3, _nField int32, _pCsr *XVdbeCursor) (r0 int32) { var _pgsz, _i, _szKeyInfo, _sz, _rc, _nWorker int32 var _7_mxCache int64 @@ -60146,14 +62792,14 @@ func _sqlite3VdbeSorterInit(tls *crt.TLS, _db *Xsqlite3, _nField int32, _pCsr *X var _pSorter *XVdbeSorter var _6_pTask *XSortSubtask _rc = i32(0) - if _sqlite3TempInMemory(tls, _db) != 0 || ((_sqlite3Config.X1) == i32(0)) { + if _sqlite3TempInMemory(tls, _db) != 0 || (_sqlite3Config.X1 == i32(0)) { _nWorker = i32(0) goto _2 } - _nWorker = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(11)))) + _nWorker = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(11)))) _2: func() { - if (*XKeyInfo)(_pCsr.X15) == nil || (*XBtree)(_pCsr.X8) != nil { + if _pCsr.X15 == nil || (*XBtree)(_pCsr.X8) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000))), unsafe.Pointer(str(79708))) crt.X__builtin_abort(tls) } @@ -60167,34 +62813,34 @@ _2: _szKeyInfo = int32(u64(40) + (uint64(int32((*XKeyInfo)(_pCsr.X15).X2)-i32(1)) * u64(8))) _sz = int32(u64(200) + (uint64(_nWorker) * u64(104))) _pSorter = (*XVdbeSorter)(_sqlite3DbMallocZero(tls, _db, uint64(_sz+_szKeyInfo))) - *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))) = _pSorter + *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14)))))) = _pSorter if _pSorter == nil { _rc = _sqlite3NomemError(tls, i32(86983)) goto _9 } - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X7))))) = store50(&_pKeyInfo, (*XKeyInfo)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pSorter))))+uintptr(_sz)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pKeyInfo), _pCsr.X15, uint64(_szKeyInfo)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X4))))) = nil + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X7)))) = store50(&_pKeyInfo, (*XKeyInfo)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pSorter))))+uintptr(_sz)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_pKeyInfo), _pCsr.X15, uint64(_szKeyInfo)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X4)))) = nil if _nField != 0 && (_nWorker == i32(0)) { { - p := (*uint16)(unsafe.Pointer(&(_pKeyInfo.X3))) + p := (*uint16)(unsafe.Pointer(&_pKeyInfo.X3)) *p = uint16(int32(*p) + (int32(_pKeyInfo.X2) - _nField)) sink14(*p) } - *(*uint16)(unsafe.Pointer(&(_pKeyInfo.X2))) = uint16(_nField) + *(*uint16)(unsafe.Pointer(&_pKeyInfo.X2)) = uint16(_nField) } - *(*int32)(unsafe.Pointer(&(_pSorter.X3))) = store1(&_pgsz, _sqlite3BtreeGetPageSize(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1))) - *(*uint8)(unsafe.Pointer(&(_pSorter.X15))) = uint8(_nWorker + i32(1)) - *(*uint8)(unsafe.Pointer(&(_pSorter.X14))) = uint8(_nWorker - i32(1)) - *(*uint8)(unsafe.Pointer(&(_pSorter.X13))) = uint8(bool2int(int32(_pSorter.X15) > i32(1))) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X6))))) = _db + *(*int32)(unsafe.Pointer(&_pSorter.X3)) = store1(&_pgsz, _sqlite3BtreeGetPageSize(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1))) + *(*uint8)(unsafe.Pointer(&_pSorter.X15)) = uint8(_nWorker + i32(1)) + *(*uint8)(unsafe.Pointer(&_pSorter.X14)) = uint8(_nWorker - i32(1)) + *(*uint8)(unsafe.Pointer(&_pSorter.X13)) = uint8(bool2int(int32(_pSorter.X15) > i32(1))) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X6)))) = _db _i = i32(0) _12: if _i >= int32(_pSorter.X15) { goto _15 } - _6_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_i))) - *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pTask.X2))))) = _pSorter + _6_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_i))) + *(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pTask.X2)))) = _pSorter _i += 1 goto _12 _15: @@ -60202,7 +62848,7 @@ _15: goto _16 } _7_szPma = _sqlite3Config.X27 - *(*int32)(unsafe.Pointer(&(_pSorter.X0))) = int32(_7_szPma * uint32(_pgsz)) + *(*int32)(unsafe.Pointer(&_pSorter.X0)) = int32(_7_szPma * uint32(_pgsz)) _7_mxCache = int64((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X10) if _7_mxCache < int64(i32(0)) { _7_mxCache = _7_mxCache * int64(i32(-1024)) @@ -60216,9 +62862,9 @@ _18: } return int64(i32(536870912)) }() - *(*int32)(unsafe.Pointer(&(_pSorter.X1))) = func() int32 { - if (_pSorter.X0) > int32(_7_mxCache) { - return (_pSorter.X0) + *(*int32)(unsafe.Pointer(&_pSorter.X1)) = func() int32 { + if _pSorter.X0 > int32(_7_mxCache) { + return _pSorter.X0 } return int32(_7_mxCache) }() @@ -60226,20 +62872,20 @@ _18: goto _23 } func() { - if (_pSorter.X10) != i32(0) { + if _pSorter.X10 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87023), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000))), unsafe.Pointer(str(79740))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _pgsz - *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pgsz))) - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + *(*int32)(unsafe.Pointer(&_pSorter.X11)) = _pgsz + *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pgsz))) + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { _rc = _sqlite3NomemError(tls, i32(87026)) } _23: _16: - if ((int32(_pKeyInfo.X2) + int32(_pKeyInfo.X3)) < i32(13)) && (((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 8*uintptr(i32(0))))) == nil) || ((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 8*uintptr(i32(0))))) == (*XCollSeq)(_db.X2))) { - *(*uint8)(unsafe.Pointer(&(_pSorter.X16))) = uint8(i32(3)) + if ((int32(_pKeyInfo.X2) + int32(_pKeyInfo.X3)) < i32(13)) && (((*(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X6)))) + 8*uintptr(i32(0))))) == nil) || ((*(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyInfo.X6)))) + 8*uintptr(i32(0))))) == (*XCollSeq)(_db.X2))) { + *(*uint8)(unsafe.Pointer(&_pSorter.X16)) = uint8(i32(3)) } _9: return _rc @@ -60251,8 +62897,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterInitØ00__func__Ø000[0], str(79760), 22) } -// Return true if the cursor has a hint specified. This routine is -// only used from within assert() statements +// C comment +// /* +// ** Return true if the cursor has a hint specified. This routine is +// ** only used from within assert() statements +// */ func _sqlite3BtreeCursorHasHint(tls *crt.TLS, _pCsr *XBtCursor, _mask uint32) (r0 int32) { return bool2int((uint32(_pCsr.X13) & _mask) != uint32(i32(0))) } @@ -60277,22 +62926,22 @@ func _sqlite3BtreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int } }() func() { - if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) { + if _pCur.X9 != i32(0) && int32(_pCur.X12) == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74777))) crt.X__builtin_abort(tls) } }() *_pRes = i32(0) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-15)) sink2(*p) } - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) - if ((int32(_pCur.X12) != i32(1)) || (int32(_pCur.X16) == i32(0))) || (int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X5) == i32(0)) { + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) + if ((int32(_pCur.X12) != i32(1)) || (int32(_pCur.X16) == i32(0))) || (int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X5) == i32(0)) { return _btreePrevious(tls, _pCur, _pRes) } - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) -= 1 + *(*uint16)(unsafe.Pointer(&_pCur.X16)) -= 1 return i32(0) } @@ -60302,25 +62951,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreePreviousØ00__func__Ø000[0], str(79782), 21) } -// Step the cursor to the back to the previous entry in the database. If -// successful then set *pRes=0. If the cursor -// was already pointing to the first entry in the database before -// this routine was called, then set *pRes=1. -// -// The main entry point is sqlite3BtreePrevious(). That routine is optimized -// for the common case of merely decrementing the cell counter BtCursor.aiIdx -// to the previous cell on the current page. The (slower) btreePrevious() -// helper routine is called when it is necessary to move to a different page -// or to restore the cursor. -// -// The calling function will set *pRes to 0 or 1. The initial *pRes value -// will be 1 if the cursor being stepped corresponds to an SQL index and -// if this routine could have been skipped if that SQL index had been -// a unique index. Otherwise the caller will have set *pRes to zero. -// Zero is the common case. The btree implementation is free to use the -// initial *pRes value as a hint to improve performance, but the current -// SQLite btree implementation does not. (Note that the comdb2 btree -// implementation does use this hint, however.) +// C comment +// /* +// ** Step the cursor to the back to the previous entry in the database. If +// ** successful then set *pRes=0. If the cursor +// ** was already pointing to the first entry in the database before +// ** this routine was called, then set *pRes=1. +// ** +// ** The main entry point is sqlite3BtreePrevious(). That routine is optimized +// ** for the common case of merely decrementing the cell counter BtCursor.aiIdx +// ** to the previous cell on the current page. The (slower) btreePrevious() +// ** helper routine is called when it is necessary to move to a different page +// ** or to restore the cursor. +// ** +// ** The calling function will set *pRes to 0 or 1. The initial *pRes value +// ** will be 1 if the cursor being stepped corresponds to an SQL index and +// ** if this routine could have been skipped if that SQL index had been +// ** a unique index. Otherwise the caller will have set *pRes to zero. +// ** Zero is the common case. The btree implementation is free to use the +// ** initial *pRes value as a hint to improve performance, but the current +// ** SQLite btree implementation does not. (Note that the comdb2 btree +// ** implementation does use this hint, however.) +// */ func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { var _rc, _6_idx int32 var _pPage *XMemPage @@ -60343,7 +62995,7 @@ func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { } }() func() { - if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) { + if _pCur.X9 != i32(0) && int32(_pCur.X12) == i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64583), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74777))) crt.X__builtin_abort(tls) } @@ -60355,7 +63007,7 @@ func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { } }() func() { - if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) != i32(0) { + if int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64585), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(79869))) crt.X__builtin_abort(tls) } @@ -60376,7 +63028,7 @@ func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { *_pRes = i32(1) return i32(0) } - if (_pCur.X9) == 0 { + if _pCur.X9 == 0 { goto _18 } func() { @@ -60385,26 +63037,26 @@ func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1)) - if (_pCur.X9) < i32(0) { - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(1)) + if _pCur.X9 < i32(0) { + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(0) return i32(0) } - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0) + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(0) _18: _13: - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) func() { - if (_pPage.X0) == 0 { + if _pPage.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64607), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74631))) crt.X__builtin_abort(tls) } }() - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _25 } _6_idx = int32(_pCur.X16) - _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_6_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_6_idx))))) + 1*uintptr(i32(1))))))))))) + _rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_6_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_6_idx))))) + 1*uintptr(i32(1))))))))))) if _rc != 0 { return _rc } @@ -60416,7 +63068,7 @@ _28: goto _29 } if int32(_pCur.X14) == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) *_pRes = i32(1) return i32(0) } @@ -60424,7 +63076,7 @@ _28: goto _28 _29: func() { - if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) != i32(0) { + if int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64622), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(79869))) crt.X__builtin_abort(tls) } @@ -60435,9 +63087,9 @@ _29: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) -= 1 - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) - if ((_pPage.X2) != 0) && ((_pPage.X5) == 0) { + *(*uint16)(unsafe.Pointer(&_pCur.X16)) -= 1 + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) + if (_pPage.X2 != 0) && (_pPage.X5 == 0) { _rc = _sqlite3BtreePrevious(tls, _pCur, _pRes) goto _37 } @@ -60453,14 +63105,17 @@ func init() { crt.Xstrncpy(nil, &_btreePreviousØ00__func__Ø000[0], str(79928), 14) } -// Move the cursor down to the right-most leaf entry beneath the -// page to which it is currently pointing. Notice the difference -// between moveToLeftmost() and moveToRightmost(). moveToLeftmost() -// finds the left-most entry beneath the *entry* whereas moveToRightmost() -// finds the right-most entry beneath the *page*. -// -// The right-most entry is the one with the largest key - the last -// key in ascending order. +// C comment +// /* +// ** Move the cursor down to the right-most leaf entry beneath the +// ** page to which it is currently pointing. Notice the difference +// ** between moveToLeftmost() and moveToRightmost(). moveToLeftmost() +// ** finds the left-most entry beneath the *entry* whereas moveToRightmost() +// ** finds the right-most entry beneath the *page*. +// ** +// ** The right-most entry is the one with the largest key - the last +// ** key in ascending order. +// */ func _moveToRightmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc int32 var _pgno uint32 @@ -60480,20 +63135,20 @@ func _moveToRightmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { } }() _4: - if (store52(&_pPage, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X5) != 0 { + if (store52(&_pPage, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X5) != 0 { goto _5 } - _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = _pPage.X14 + _pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = _pPage.X14 _rc = _moveToChild(tls, _pCur, _pgno) if _rc != 0 { return _rc } goto _4 _5: - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(int32(_pPage.X14) - i32(1)) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(int32(_pPage.X14) - i32(1)) func() { - if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) != i32(0) { + if int32((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64067), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRightmostØ00__func__Ø000))), unsafe.Pointer(str(79869))) crt.X__builtin_abort(tls) } @@ -60513,18 +63168,23 @@ func init() { crt.Xstrncpy(nil, &_moveToRightmostØ00__func__Ø000[0], str(79979), 16) } -// Return TRUE if the cursor is not pointing at an entry of the table. -// -// TRUE will be returned after a call to sqlite3BtreeNext() moves -// past the last entry in the table or sqlite3BtreePrev() moves past -// the first entry. TRUE is also returned if the table is empty. +// C comment +// /* +// ** Return TRUE if the cursor is not pointing at an entry of the table. +// ** +// ** TRUE will be returned after a call to sqlite3BtreeNext() moves +// ** past the last entry in the table or sqlite3BtreePrev() moves past +// ** the first entry. TRUE is also returned if the table is empty. +// */ func _sqlite3BtreeEof(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { return bool2int(i32(1) != int32(_pCur.X12)) } -// 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. +// C comment +// /* 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 _sqlite3BtreeLast(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { var _rc, _1_ii int32 func() { @@ -60548,7 +63208,7 @@ _6: goto _9 } func() { - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(_1_ii)))) != int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_1_ii)))).X14) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(_1_ii)))) != int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_1_ii)))).X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(79995))) crt.X__builtin_abort(tls) } @@ -60557,13 +63217,13 @@ _6: goto _6 _9: func() { - if int32(_pCur.X16) != (int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) - i32(1)) { + if int32(_pCur.X16) != (int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) - i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64114), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(80036))) crt.X__builtin_abort(tls) } }() func() { - if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X5) == 0 { + if ((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X5) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64115), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(80081))) crt.X__builtin_abort(tls) } @@ -60577,7 +63237,7 @@ _5: } if i32(0) == int32(_pCur.X12) { func() { - if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { + if _pCur.X7 != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64123), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(74242))) crt.X__builtin_abort(tls) } @@ -60595,14 +63255,14 @@ _5: _rc = _moveToRightmost(tls, _pCur) if _rc == i32(0) { { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(8)) sink2(*p) } goto _25 } { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-9)) sink2(*p) } @@ -60618,34 +63278,37 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeLastØ00__func__Ø000[0], str(80113), 17) } -// Insert a new record into the BTree. The content of the new record -// is described by the pX object. The pCur cursor is used only to -// define what table the record should be inserted into, and is left -// pointing at a random location. -// -// For a table btree (used for rowid tables), only the pX.nKey value of -// the key is used. The pX.pKey value must be NULL. The pX.nKey is the -// rowid or INTEGER PRIMARY KEY of the row. The pX.nData,pData,nZero fields -// hold the content of the row. -// -// For an index btree (used for indexes and WITHOUT ROWID tables), the -// key is an arbitrary byte sequence stored in pX.pKey,nKey. The -// pX.pData,nData,nZero fields must be zero. -// -// If the seekResult parameter is non-zero, then a successful call to -// MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already -// been performed. In other words, if seekResult!=0 then the cursor -// is currently pointing to a cell that will be adjacent to the cell -// to be inserted. If seekResult<0 then pCur points to a cell that is -// smaller then (pKey,nKey). If seekResult>0 then pCur points to a cell -// that is larger than (pKey,nKey). -// -// If seekResult==0, that means pCur is pointing at some unknown location. -// In that case, this routine must seek the cursor to the correct insertion -// point for (pKey,nKey) before doing the insertion. For index btrees, -// if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked -// key values and pX->aMem can be used instead of pX->pKey to avoid having -// to decode the key. +// C comment +// /* +// ** Insert a new record into the BTree. The content of the new record +// ** is described by the pX object. The pCur cursor is used only to +// ** define what table the record should be inserted into, and is left +// ** pointing at a random location. +// ** +// ** For a table btree (used for rowid tables), only the pX.nKey value of +// ** the key is used. The pX.pKey value must be NULL. The pX.nKey is the +// ** rowid or INTEGER PRIMARY KEY of the row. The pX.nData,pData,nZero fields +// ** hold the content of the row. +// ** +// ** For an index btree (used for indexes and WITHOUT ROWID tables), the +// ** key is an arbitrary byte sequence stored in pX.pKey,nKey. The +// ** pX.pData,nData,nZero fields must be zero. +// ** +// ** If the seekResult parameter is non-zero, then a successful call to +// ** MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already +// ** been performed. In other words, if seekResult!=0 then the cursor +// ** is currently pointing to a cell that will be adjacent to the cell +// ** to be inserted. If seekResult<0 then pCur points to a cell that is +// ** smaller then (pKey,nKey). If seekResult>0 then pCur points to a cell +// ** that is larger than (pKey,nKey). +// ** +// ** If seekResult==0, that means pCur is pointing at some unknown location. +// ** In that case, this routine must seek the cursor to the correct insertion +// ** point for (pKey,nKey) before doing the insertion. For index btrees, +// ** if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked +// ** key values and pX->aMem can be used instead of pX->pKey to avoid having +// ** to decode the key. +// */ func _sqlite3BtreeInsert(tls *crt.TLS, _pCur *XBtCursor, _pX *XBtreePayload, _flags int32, _seekResult int32) (r0 int32) { var _rc, _loc, _szNew, _idx int32 var _oldCell, _newCell *uint8 @@ -60667,7 +63330,7 @@ func _sqlite3BtreeInsert(tls *crt.TLS, _pCur *XBtCursor, _pX *XBtreePayload, _fl }() if int32(_pCur.X12) == i32(4) { func() { - if (_pCur.X9) == i32(0) { + if _pCur.X9 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(76879))) crt.X__builtin_abort(tls) } @@ -60717,12 +63380,12 @@ _15: }() _invalidateIncrblobCursors(tls, _p, _pCur.X7, _pX.X1, i32(0)) func() { - if (_flags&i32(2)) != i32(0) && ((int32(_pCur.X10)&i32(2)) == i32(0) || (_pX.X1) != ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)) { + if (_flags&i32(2)) != i32(0) && ((int32(_pCur.X10)&i32(2)) == i32(0) || _pX.X1 != ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67153), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80403))) crt.X__builtin_abort(tls) } }() - if ((int32(_pCur.X10) & i32(2)) != i32(0)) && ((_pX.X1) == ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)) { + if ((int32(_pCur.X10) & i32(2)) != i32(0)) && (_pX.X1 == ((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0)) { _loc = i32(0) goto _27 } @@ -60739,15 +63402,15 @@ _17: if _loc != i32(0) || (_flags&i32(2)) != i32(0) { goto _31 } - if (_pX.X4) != 0 { - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_r.X0))))) = (*XKeyInfo)(_pCur.X18) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_r.X1))))) = (*XMem)(_pX.X3) - *(*uint16)(unsafe.Pointer(&(_7_r.X2))) = _pX.X4 - *(*int8)(unsafe.Pointer(&(_7_r.X3))) = int8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_7_r.X4))) = uint8(i32(0)) - *(*int8)(unsafe.Pointer(&(_7_r.X5))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(&(_7_r.X6))) = int8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_7_r.X7))) = uint8(i32(0)) + if _pX.X4 != 0 { + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_7_r.X0)))) = (*XKeyInfo)(_pCur.X18) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_7_r.X1)))) = (*XMem)(_pX.X3) + *(*uint16)(unsafe.Pointer(&_7_r.X2)) = _pX.X4 + *(*int8)(unsafe.Pointer(&_7_r.X3)) = int8(i32(0)) + *(*uint8)(unsafe.Pointer(&_7_r.X4)) = uint8(i32(0)) + *(*int8)(unsafe.Pointer(&_7_r.X5)) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_7_r.X6)) = int8(i32(0)) + *(*uint8)(unsafe.Pointer(&_7_r.X7)) = uint8(i32(0)) _rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, &_7_r, int64(i32(0)), bool2int(_flags != i32(0)), &_loc) goto _33 } @@ -60763,21 +63426,21 @@ _31: crt.X__builtin_abort(tls) } }() - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) func() { - if (_pPage.X2) == 0 && (_pX.X1) < int64(i32(0)) { + if _pPage.X2 == 0 && _pX.X1 < int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80572))) crt.X__builtin_abort(tls) } }() func() { - if (_pPage.X5) == 0 && (_pPage.X2) != 0 { + if _pPage.X5 == 0 && _pPage.X2 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80601))) crt.X__builtin_abort(tls) } }() func() { - if (_pPage.X0) == 0 { + if _pPage.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67191), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(74631))) crt.X__builtin_abort(tls) } @@ -60794,15 +63457,16 @@ _31: goto _end_insert } func() { - if _szNew != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, _newCell)) { + if _szNew != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, _newCell)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67196), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80642))) crt.X__builtin_abort(tls) } }() func() { - if _szNew > int32((_pBt.X15)-uint32(i32(8))) { + if _szNew > int32(_pBt.X15-uint32(i32(8))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80682))) crt.X__builtin_abort(tls) } @@ -60821,12 +63485,12 @@ _31: if _rc != 0 { goto _end_insert } - _oldCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_idx))))) + 1*uintptr(i32(1))))))))) - if (_pPage.X5) == 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_newCell), (unsafe.Pointer)(_oldCell), uint64(i32(4))) + _oldCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_idx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_idx))))) + 1*uintptr(i32(1))))))))) + if _pPage.X5 == 0 { + crt.Xmemcpy(tls, unsafe.Pointer(_newCell), unsafe.Pointer(_oldCell), uint64(i32(4))) } _rc = _clearCell(tls, _pPage, _oldCell, &_9_info) - if int32(_9_info.X4) != _szNew || uint32(_9_info.X3) != (_9_info.X2) || (_pBt.X5) != 0 && _szNew >= int32(_pPage.X11) { + if int32(_9_info.X4) != _szNew || uint32(_9_info.X3) != _9_info.X2 || _pBt.X5 != 0 && _szNew >= int32(_pPage.X11) { goto _62 } func() { @@ -60838,7 +63502,7 @@ _31: if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_oldCell))+uintptr(_szNew))))) > crt.P2U(unsafe.Pointer(_pPage.X20)) { return _sqlite3CorruptError(tls, i32(67224)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_oldCell), (unsafe.Pointer)(_newCell), uint64(_szNew)) + crt.Xmemcpy(tls, unsafe.Pointer(_oldCell), unsafe.Pointer(_newCell), uint64(_szNew)) return i32(0) _62: @@ -60850,21 +63514,21 @@ _62: _54: if (_loc < i32(0)) && (int32(_pPage.X14) > i32(0)) { func() { - if (_pPage.X5) == 0 { + if _pPage.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80726))) crt.X__builtin_abort(tls) } }() - _idx = int32(preInc14((*uint16)(unsafe.Pointer(&(_pCur.X16))), uint16(1))) + _idx = int32(preInc14((*uint16)(unsafe.Pointer(&_pCur.X16)), uint16(1))) { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-3)) sink2(*p) } goto _72 } func() { - if (_pPage.X5) == 0 { + if _pPage.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67235), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80726))) crt.X__builtin_abort(tls) } @@ -60883,8 +63547,8 @@ _72: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0)) - if (_pPage.X9) == 0 { + *(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X4))) = uint16(i32(0)) + if _pPage.X9 == 0 { goto _82 } func() { @@ -60894,18 +63558,18 @@ _72: } }() { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) & i32(-3)) sink2(*p) } _rc = _balance(tls, _pCur) - *(*uint8)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X9))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X9))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(0)) if (_flags&i32(2)) == 0 || _rc != i32(0) { goto _86 } _rc = _moveToRoot(tls, _pCur) - if (*XKeyInfo)(_pCur.X18) == nil { + if _pCur.X18 == nil { goto _87 } func() { @@ -60914,7 +63578,7 @@ _72: crt.X__builtin_abort(tls) } }() - *(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = _sqlite3Malloc(tls, uint64(_pX.X1)) + *(*unsafe.Pointer)(unsafe.Pointer(&_pCur.X6)) = _sqlite3Malloc(tls, uint64(_pX.X1)) if _pCur.X6 == nil { _rc = i32(7) goto _91 @@ -60922,12 +63586,12 @@ _72: crt.Xmemcpy(tls, _pCur.X6, _pX.X0, uint64(_pX.X1)) _91: _87: - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3)) - *(*int64)(unsafe.Pointer(&(_pCur.X5))) = _pX.X1 + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(3)) + *(*int64)(unsafe.Pointer(&_pCur.X5)) = _pX.X1 _86: _82: func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X9) != i32(0) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X9) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80843))) crt.X__builtin_abort(tls) } @@ -60946,17 +63610,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeInsertØ00__func__Ø000[0], str(80883), 19) } -// This function is called before modifying the contents of a table -// to invalidate any incrblob cursors that are open on the -// row or one of the rows being modified. -// -// If argument isClearTable is true, then the entire contents of the -// table is about to be deleted. In this case invalidate all incrblob -// cursors open on any row within the table with root-page pgnoRoot. -// -// Otherwise, if argument isClearTable is false, then the row with -// rowid iRow is being replaced or deleted. In this case invalidate -// only those incrblob cursors open on that specific row. +// C comment +// /* +// ** This function is called before modifying the contents of a table +// ** to invalidate any incrblob cursors that are open on the +// ** row or one of the rows being modified. +// ** +// ** If argument isClearTable is true, then the entire contents of the +// ** table is about to be deleted. In this case invalidate all incrblob +// ** cursors open on any row within the table with root-page pgnoRoot. +// ** +// ** Otherwise, if argument isClearTable is false, then the row with +// ** rowid iRow is being replaced or deleted. In this case invalidate +// ** only those incrblob cursors open on that specific row. +// */ func _invalidateIncrblobCursors(tls *crt.TLS, _pBtree *XBtree, _pgnoRoot uint32, _iRow int64, _isClearTable int32) { var _p *XBtCursor if int32(_pBtree.X5) == i32(0) { @@ -60968,7 +63635,7 @@ func _invalidateIncrblobCursors(tls *crt.TLS, _pBtree *XBtree, _pgnoRoot uint32, crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pBtree.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pBtree.X5)) = uint8(i32(0)) _p = (*XBtCursor)((*XBtShared)(_pBtree.X1).X2) _3: if _p == nil { @@ -60977,9 +63644,9 @@ _3: if (int32(_p.X10) & i32(16)) == i32(0) { goto _7 } - *(*uint8)(unsafe.Pointer(&(_pBtree.X5))) = uint8(i32(1)) - if ((_p.X7) == _pgnoRoot) && (_isClearTable != 0 || (((*XCellInfo)(unsafe.Pointer(&(_p.X4))).X0) == _iRow)) { - *(*uint8)(unsafe.Pointer(&(_p.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pBtree.X5)) = uint8(i32(1)) + if (_p.X7 == _pgnoRoot) && (_isClearTable != 0 || (((*XCellInfo)(unsafe.Pointer(&_p.X4)).X0) == _iRow)) { + *(*uint8)(unsafe.Pointer(&_p.X12)) = uint8(i32(0)) } _7: _p = (*XBtCursor)(_p.X2) @@ -60993,16 +63660,19 @@ func init() { crt.Xstrncpy(nil, &_invalidateIncrblobCursorsØ00__func__Ø000[0], str(80933), 26) } -// Create the byte sequence used to represent a cell on page pPage -// and write that byte sequence into pCell[]. Overflow pages are -// allocated and filled in as necessary. The calling procedure -// is responsible for making sure sufficient space has been allocated -// for pCell[]. -// -// Note that pCell does not necessary need to point to the pPage->aData -// area. pCell might point to some temporary storage. The cell will -// be constructed in this temporary area then copied into pPage->aData -// later. +// C comment +// /* +// ** Create the byte sequence used to represent a cell on page pPage +// ** and write that byte sequence into pCell[]. Overflow pages are +// ** allocated and filled in as necessary. The calling procedure +// ** is responsible for making sure sufficient space has been allocated +// ** for pCell[]. +// ** +// ** Note that pCell does not necessary need to point to the pPage->aData +// ** area. pCell might point to some temporary storage. The cell will +// ** be constructed in this temporary area then copied into pPage->aData +// ** later. +// */ func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePayload, _pnSize *int32) (r0 int32) { var _nPayload, _nSrc, _n, _rc, _spaceLeft, _nHeader, _4_mn int32 var _pgnoOvfl, _7_pgnoPtrmap uint32 @@ -61022,18 +63692,18 @@ func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePaylo } }() func() { - if crt.P2U(unsafe.Pointer(_pCell)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { + if crt.P2U(unsafe.Pointer(_pCell)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65237), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(80959))) crt.X__builtin_abort(tls) } }() _nHeader = int32(_pPage.X7) - if (_pPage.X2) != 0 { - _nPayload = (_pX.X5) + (_pX.X6) + if _pPage.X2 != 0 { + _nPayload = _pX.X5 + _pX.X6 _pSrc = (*uint8)(_pX.X2) _nSrc = _pX.X5 func() { - if (_pPage.X3) == 0 { + if _pPage.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65246), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(53565))) crt.X__builtin_abort(tls) } @@ -61043,23 +63713,23 @@ func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePaylo *p = (*p) + int32(uint8(func() int32 { if uint32(_nPayload) < u32(128) { return func() int32 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload) return i32(1) }() } - return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload)) + return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload)) }())) sink1(*p) } { p := &_nHeader - *p = (*p) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), *(*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&(_pX.X1)))))) + *p = (*p) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(_nHeader))), *(*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&_pX.X1))))) sink1(*p) } goto _11 } func() { - if (_pX.X1) > int64(i32(2147483647)) || (_pX.X0) == nil { + if _pX.X1 > int64(i32(2147483647)) || _pX.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65250), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81060))) crt.X__builtin_abort(tls) } @@ -61071,11 +63741,11 @@ func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePaylo *p = (*p) + int32(uint8(func() int32 { if uint32(_nPayload) < u32(128) { return func() int32 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload) return i32(1) }() } - return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload)) + return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload)) }())) sink1(*p) } @@ -61099,12 +63769,13 @@ _17: } _spaceLeft = _n *_pnSize = (_n + _nHeader) + i32(4) - _pPrior = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader+_n))) + _pPrior = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + 1*uintptr(_nHeader+_n))) _19: - _pPayload = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader))) - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, &_5_info) + _pPayload = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + 1*uintptr(_nHeader))) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, &_5_info) func() { if _nHeader != int32(int64((uintptr(unsafe.Pointer(_5_info.X1))-uintptr(unsafe.Pointer(_pCell)))/1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65293), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81096))) @@ -61112,7 +63783,7 @@ _19: } }() func() { - if (_5_info.X0) != (_pX.X1) { + if _5_info.X0 != _pX.X1 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65294), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81134))) crt.X__builtin_abort(tls) } @@ -61137,17 +63808,17 @@ _29: goto _31 } _7_pgnoPtrmap = _pgnoOvfl - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _32 } _33: _pgnoOvfl += 1 - if (_ptrmapPageno(tls, _pBt, _pgnoOvfl) == _pgnoOvfl) || (_pgnoOvfl == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) { + if (_ptrmapPageno(tls, _pBt, _pgnoOvfl) == _pgnoOvfl) || (_pgnoOvfl == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) { goto _33 } _32: _rc = _allocateBtreePage(tls, _pBt, &_pOvfl, &_pgnoOvfl, _pgnoOvfl, uint8(i32(0))) - if (_pBt.X5) == 0 || _rc != i32(0) { + if _pBt.X5 == 0 || _rc != i32(0) { goto _36 } _10_eType = uint8(func() int32 { @@ -61172,7 +63843,7 @@ _36: } }() func() { - if crt.P2U(unsafe.Pointer(_pPrior)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pPrior)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { + if crt.P2U(unsafe.Pointer(_pPrior)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pPrior)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65344), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81263))) crt.X__builtin_abort(tls) } @@ -61182,8 +63853,8 @@ _36: _pToRelease = _pOvfl _pPrior = _pOvfl.X19 _sqlite3Put4byte(tls, _pPrior, uint32(i32(0))) - _pPayload = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOvfl.X19)) + 1*uintptr(i32(4)))) - _spaceLeft = int32((_pBt.X16) - uint32(i32(4))) + _pPayload = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOvfl.X19)) + 1*uintptr(i32(4)))) + _spaceLeft = int32(_pBt.X16 - uint32(i32(4))) _31: _n = _nPayload if _n > _spaceLeft { @@ -61196,7 +63867,7 @@ _31: } }() func() { - if crt.P2U(unsafe.Pointer(_pPayload)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pPayload)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { + if crt.P2U(unsafe.Pointer(_pPayload)) >= crt.P2U(unsafe.Pointer(_pPage.X19)) && crt.P2U(unsafe.Pointer(_pPayload)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65364), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81366))) crt.X__builtin_abort(tls) } @@ -61213,10 +63884,10 @@ _31: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_pPayload), (unsafe.Pointer)(_pSrc), uint64(_n)) + crt.Xmemcpy(tls, unsafe.Pointer(_pPayload), unsafe.Pointer(_pSrc), uint64(_n)) goto _60 _56: - crt.Xmemset(tls, (unsafe.Pointer)(_pPayload), i32(0), uint64(_n)) + crt.Xmemset(tls, unsafe.Pointer(_pPayload), i32(0), uint64(_n)) _60: { p := &_nPayload @@ -61225,12 +63896,12 @@ _60: } { p := &_pPayload - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink13(*p) } { p := &_pSrc - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink13(*p) } { @@ -61258,9 +63929,12 @@ func init() { crt.Xstrncpy(nil, &_fillInCellØ00__func__Ø000[0], str(81478), 11) } -// Free any overflow pages associated with the given Cell. Write the -// local Cell size (the number of bytes on the original page, omitting -// overflow) into *pnSize. +// C comment +// /* +// ** Free any overflow pages associated with the given Cell. Write the +// ** local Cell size (the number of bytes on the original page, omitting +// ** overflow) into *pnSize. +// */ func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) (r0 int32) { var _rc, _nOvfl int32 var _ovflPgno, _ovflPageSize, _3_iNext uint32 @@ -61273,10 +63947,11 @@ func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo crt.X__builtin_abort(tls) } }() - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, _pInfo) - if uint32(_pInfo.X3) == (_pInfo.X2) { + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, _pInfo) + if uint32(_pInfo.X3) == _pInfo.X2 { return i32(0) } if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(_pInfo.X4)))))-uintptr(i32(1)))))) > crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(_pPage.X15))))) { @@ -61284,21 +63959,21 @@ func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo } _ovflPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(_pInfo.X4)))))-uintptr(i32(4))))) func() { - if (_pBt.X16) <= uint32(i32(4)) { + if _pBt.X16 <= uint32(i32(4)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65156), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearCellØ00__func__Ø000))), unsafe.Pointer(str(81489))) crt.X__builtin_abort(tls) } }() - _ovflPageSize = (_pBt.X16) - uint32(i32(4)) - _nOvfl = int32(((((_pInfo.X2) - uint32(_pInfo.X3)) + _ovflPageSize) - uint32(i32(1))) / _ovflPageSize) + _ovflPageSize = _pBt.X16 - uint32(i32(4)) + _nOvfl = int32((((_pInfo.X2 - uint32(_pInfo.X3)) + _ovflPageSize) - uint32(i32(1))) / _ovflPageSize) func() { - if _nOvfl <= i32(0) && ((_sqlite3Config.X6) != i32(0) || ((_pInfo.X2)+_ovflPageSize) >= _ovflPageSize) { + if _nOvfl <= i32(0) && (_sqlite3Config.X6 != i32(0) || (_pInfo.X2+_ovflPageSize) >= _ovflPageSize) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65159), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearCellØ00__func__Ø000))), unsafe.Pointer(str(81509))) crt.X__builtin_abort(tls) } }() _10: - if postInc1(&_nOvfl, int32(-1)) == 0 { + if postInc1(&_nOvfl, -1) == 0 { goto _11 } _3_iNext = uint32(i32(0)) @@ -61338,9 +64013,12 @@ func init() { crt.Xstrncpy(nil, &_clearCellØ00__func__Ø000[0], str(81582), 10) } -// Retrieve a page from the pager cache. If the requested page is not -// already in the pager cache return NULL. Initialize the MemPage.pBt and -// MemPage.aData elements if needed. +// C comment +// /* +// ** Retrieve a page from the pager cache. If the requested page is not +// ** already in the pager cache return NULL. Initialize the MemPage.pBt and +// ** MemPage.aData elements if needed. +// */ func _btreePageLookup(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 *XMemPage) { var _pDbPage *XPgHdr func() { @@ -61362,16 +64040,19 @@ func init() { crt.Xstrncpy(nil, &_btreePageLookupØ00__func__Ø000[0], str(81592), 16) } -// This function is used to add page iPage to the database file free-list. -// It is assumed that the page is not already a part of the free-list. -// -// The value passed as the second argument to this function is optional. -// If the caller happens to have a pointer to the MemPage object -// corresponding to page iPage handy, it may pass it as the second value. -// Otherwise, it may pass NULL. -// -// If a pointer to a MemPage object is passed as the second argument, -// its reference count is not altered by this function. +// C comment +// /* +// ** This function is used to add page iPage to the database file free-list. +// ** It is assumed that the page is not already a part of the free-list. +// ** +// ** The value passed as the second argument to this function is optional. +// ** If the caller happens to have a pointer to the MemPage object +// ** corresponding to page iPage handy, it may pass it as the second value. +// ** Otherwise, it may pass NULL. +// ** +// ** If a pointer to a MemPage object is passed as the second argument, +// ** its reference count is not altered by this function. +// */ func _freePage2(tls *crt.TLS, _pBt *XBtShared, _pMemPage *XMemPage, _iPage uint32) (r0 int32) { var _rc, _nFree int32 var _iTrunk, _6_nLeaf uint32 @@ -61386,13 +64067,13 @@ func _freePage2(tls *crt.TLS, _pBt *XBtShared, _pMemPage *XMemPage, _iPage uint3 } }() func() { - if (_sqlite3Config.X6) != i32(0) && _iPage <= uint32(i32(1)) { + if _sqlite3Config.X6 != i32(0) && _iPage <= uint32(i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65006), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81608))) crt.X__builtin_abort(tls) } }() func() { - if _pMemPage != nil && (_pMemPage.X4) != _iPage { + if _pMemPage != nil && _pMemPage.X4 != _iPage { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65007), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81630))) crt.X__builtin_abort(tls) } @@ -61411,17 +64092,17 @@ _10: if _rc != 0 { goto _freepage_out } - _nFree = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))), uint32(_nFree+i32(1))) + _nFree = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(36)))))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(36)))), uint32(_nFree+i32(1))) if (int32(_pBt.X10) & i32(4)) == 0 { goto _12 } if ((_pPage == nil) && (store1(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, i32(0))) != i32(0))) || (store1(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))) != i32(0)) { goto _freepage_out } - crt.Xmemset(tls, (unsafe.Pointer)(_pPage.X19), i32(0), uint64((*XBtShared)(_pPage.X18).X15)) + crt.Xmemset(tls, unsafe.Pointer(_pPage.X19), i32(0), uint64((*XBtShared)(_pPage.X18).X15)) _12: - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _16 } _ptrmapPut(tls, _pBt, _iPage, uint8(i32(2)), uint32(i32(0)), &_rc) @@ -61432,31 +64113,31 @@ _16: if _nFree == i32(0) { goto _18 } - _iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))) + _iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32))))) _rc = _btreeGetPage(tls, _pBt, _iTrunk, &_pTrunk, i32(0)) if _rc != i32(0) { goto _freepage_out } - _6_nLeaf = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4))))) + _6_nLeaf = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(4))))) func() { - if (_pBt.X16) <= uint32(i32(32)) { + if _pBt.X16 <= uint32(i32(32)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65060), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81665))) crt.X__builtin_abort(tls) } }() - if _6_nLeaf > (((_pBt.X16) / uint32(i32(4))) - uint32(i32(2))) { + if _6_nLeaf > ((_pBt.X16 / uint32(i32(4))) - uint32(i32(2))) { _rc = _sqlite3CorruptError(tls, i32(65062)) goto _freepage_out } - if _6_nLeaf >= (((_pBt.X16) / uint32(i32(4))) - uint32(i32(8))) { + if _6_nLeaf >= ((_pBt.X16 / uint32(i32(4))) - uint32(i32(8))) { goto _23 } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.X23)) if _rc != i32(0) { goto _24 } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4)))), _6_nLeaf+uint32(i32(1))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(uint32(i32(8))+(_6_nLeaf*uint32(i32(4)))))), _iPage) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(i32(4)))), _6_nLeaf+uint32(i32(1))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrunk.X19))+1*uintptr(uint32(i32(8))+(_6_nLeaf*uint32(i32(4)))))), _iPage) if (_pPage != nil) && ((int32(_pBt.X10) & i32(4)) == i32(0)) { _sqlite3PagerDontWrite(tls, (*XPgHdr)(_pPage.X23)) } @@ -61473,11 +64154,11 @@ _18: goto _freepage_out } _sqlite3Put4byte(tls, _pPage.X19, _iTrunk) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(i32(4)))), uint32(i32(0))) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))), _iPage) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(i32(4)))), uint32(i32(0))) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage1.X19))+1*uintptr(i32(32)))), _iPage) _freepage_out: if _pPage != nil { - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = uint8(i32(0)) } _releasePage(tls, _pPage) _releasePage(tls, _pTrunk) @@ -61490,12 +64171,18 @@ func init() { crt.Xstrncpy(nil, &_freePage2Ø00__func__Ø000[0], str(81684), 10) } -// Increment the reference count for page pPg. +// C comment +// /* +// ** Increment the reference count for page pPg. +// */ func _sqlite3PagerRef(tls *crt.TLS, _pPg *XPgHdr) { _sqlite3PcacheRef(tls, _pPg) } -// Increase the reference count of a supplied page by 1. +// C comment +// /* +// ** Increase the reference count of a supplied page by 1. +// */ func _sqlite3PcacheRef(tls *crt.TLS, _p *XPgHdr) { func() { if int32(_p.X7) <= i32(0) { @@ -61509,7 +64196,7 @@ func _sqlite3PcacheRef(tls *crt.TLS, _p *XPgHdr) { crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_p.X7))) += 1 + *(*int16)(unsafe.Pointer(&_p.X7)) += 1 *(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) += 1 } @@ -61519,88 +64206,94 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheRefØ00__func__Ø000[0], str(81694), 17) } -// A call to this routine tells the pager that it is not necessary to -// write the information on page pPg back to the disk, even though -// that page might be marked as dirty. This happens, for example, when -// the page has been added as a leaf of the freelist and so its -// content no longer matters. -// -// The overlying software layer calls this routine when all of the data -// on the given page is unused. The pager marks the page as clean so -// that it does not get written to disk. -// -// Tests show that this optimization can quadruple the speed of large -// DELETE operations. -// -// This optimization cannot be used with a temp-file, as the page may -// have been dirty at the start of the transaction. In that case, if -// memory pressure forces page pPg out of the cache, the data does need -// to be written out to disk so that it may be read back in if the -// current transaction is rolled back. +// C comment +// /* +// ** A call to this routine tells the pager that it is not necessary to +// ** write the information on page pPg back to the disk, even though +// ** that page might be marked as dirty. This happens, for example, when +// ** the page has been added as a leaf of the freelist and so its +// ** content no longer matters. +// ** +// ** The overlying software layer calls this routine when all of the data +// ** on the given page is unused. The pager marks the page as clean so +// ** that it does not get written to disk. +// ** +// ** Tests show that this optimization can quadruple the speed of large +// ** DELETE operations. +// ** +// ** This optimization cannot be used with a temp-file, as the page may +// ** have been dirty at the start of the transaction. In that case, if +// ** memory pressure forces page pPg out of the cache, the data does need +// ** to be written out to disk so that it may be read back in if the +// ** current transaction is rolled back. +// */ func _sqlite3PagerDontWrite(tls *crt.TLS, _pPg *XPgHdr) { var _pPager *XPager _pPager = (*XPager)(_pPg.X4) - if (((_pPager.X10) == 0) && (int32(_pPg.X6)&i32(2)) != 0) && ((_pPager.X38) == i32(0)) { + if ((_pPager.X10 == 0) && (int32(_pPg.X6)&i32(2)) != 0) && (_pPager.X38 == i32(0)) { { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } { - p := (*uint16)(unsafe.Pointer(&(_pPg.X6))) + p := (*uint16)(unsafe.Pointer(&_pPg.X6)) *p = uint16(int32(*p) & i32(-5)) sink14(*p) } } } -// Set bit pgno of the BtShared.pHasContent bitvec. This is called -// when a page that previously contained data becomes a free-list leaf -// page. -// -// The BtShared.pHasContent bitvec exists to work around an obscure -// bug caused by the interaction of two useful IO optimizations surrounding -// free-list leaf pages: -// -// 1) When all data is deleted from a page and the page becomes -// a free-list leaf page, the page is not written to the database -// (as free-list leaf pages contain no meaningful data). Sometimes -// such a page is not even journalled (as it will not be modified, -// why bother journalling it?). -// -// 2) When a free-list leaf page is reused, its content is not read -// from the database or written to the journal file (why should it -// be, if it is not at all meaningful?). -// -// By themselves, these optimizations work fine and provide a handy -// performance boost to bulk delete or insert operations. However, if -// a page is moved to the free-list and then reused within the same -// transaction, a problem comes up. If the page is not journalled when -// it is moved to the free-list and it is also not journalled when it -// is extracted from the free-list and reused, then the original data -// may be lost. In the event of a rollback, it may not be possible -// to restore the database to its original configuration. -// -// The solution is the BtShared.pHasContent bitvec. Whenever a page is -// moved to become a free-list leaf page, the corresponding bit is -// set in the bitvec. Whenever a leaf page is extracted from the free-list, -// optimization 2 above is omitted if the corresponding bit is already -// set in BtShared.pHasContent. The contents of the bitvec are cleared -// at the end of every transaction. +// C comment +// /* +// ** Set bit pgno of the BtShared.pHasContent bitvec. This is called +// ** when a page that previously contained data becomes a free-list leaf +// ** page. +// ** +// ** The BtShared.pHasContent bitvec exists to work around an obscure +// ** bug caused by the interaction of two useful IO optimizations surrounding +// ** free-list leaf pages: +// ** +// ** 1) When all data is deleted from a page and the page becomes +// ** a free-list leaf page, the page is not written to the database +// ** (as free-list leaf pages contain no meaningful data). Sometimes +// ** such a page is not even journalled (as it will not be modified, +// ** why bother journalling it?). +// ** +// ** 2) When a free-list leaf page is reused, its content is not read +// ** from the database or written to the journal file (why should it +// ** be, if it is not at all meaningful?). +// ** +// ** By themselves, these optimizations work fine and provide a handy +// ** performance boost to bulk delete or insert operations. However, if +// ** a page is moved to the free-list and then reused within the same +// ** transaction, a problem comes up. If the page is not journalled when +// ** it is moved to the free-list and it is also not journalled when it +// ** is extracted from the free-list and reused, then the original data +// ** may be lost. In the event of a rollback, it may not be possible +// ** to restore the database to its original configuration. +// ** +// ** The solution is the BtShared.pHasContent bitvec. Whenever a page is +// ** moved to become a free-list leaf page, the corresponding bit is +// ** set in the bitvec. Whenever a leaf page is extracted from the free-list, +// ** optimization 2 above is omitted if the corresponding bit is already +// ** set in BtShared.pHasContent. The contents of the bitvec are cleared +// ** at the end of every transaction. +// */ func _btreeSetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) { var _rc int32 _rc = i32(0) - if (*XBitvec)(_pBt.X22) != nil { + if _pBt.X22 != nil { goto _0 } func() { - if _pgno > (_pBt.X18) { + if _pgno > _pBt.X18 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59597), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeSetHasContentØ00__func__Ø000))), unsafe.Pointer(str(81711))) crt.X__builtin_abort(tls) } }() - *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X22))))) = _sqlite3BitvecCreate(tls, _pBt.X18) - if (*XBitvec)(_pBt.X22) == nil { + *(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X22)))) = _sqlite3BitvecCreate(tls, _pBt.X18) + if _pBt.X22 == nil { _rc = _sqlite3NomemError(tls, i32(59600)) } _0: @@ -61616,12 +64309,15 @@ func init() { crt.Xstrncpy(nil, &_btreeSetHasContentØ00__func__Ø000[0], str(81728), 19) } -// Remove the i-th cell from pPage. This routine effects pPage only. -// The cell content is not freed or deallocated. It is assumed that -// the cell content has been copied someplace else. This routine just -// removes the reference to the cell from pPage. -// -// "sz" must be the number of bytes in the cell. +// C comment +// /* +// ** Remove the i-th cell from pPage. This routine effects pPage only. +// ** The cell content is not freed or deallocated. It is assumed that +// ** the cell content has been copied someplace else. This routine just +// ** removes the reference to the cell from pPage. +// ** +// ** "sz" must be the number of bytes in the cell. +// */ func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int32) { var _rc, _hdr int32 var _pc uint32 @@ -61636,7 +64332,7 @@ func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int3 } }() func() { - if (_sqlite3Config.X6) != i32(0) && _sz != int32(_cellSize(tls, _pPage, _idx)) { + if _sqlite3Config.X6 != i32(0) && _sz != int32(_cellSize(tls, _pPage, _idx)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65401), unsafe.Pointer((*int8)(unsafe.Pointer(&_dropCellØ00__func__Ø000))), unsafe.Pointer(str(81774))) crt.X__builtin_abort(tls) } @@ -61654,10 +64350,10 @@ func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int3 } }() _data = _pPage.X19 - _ptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21)) + 1*uintptr(i32(2)*_idx))) - _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_ptr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_ptr)) + 1*uintptr(i32(1)))))) + _ptr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21)) + 1*uintptr(i32(2)*_idx))) + _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr)) + 1*uintptr(i32(1)))))) _hdr = int32(_pPage.X6) - if (_pc < uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))))) || ((_pc + uint32(_sz)) > ((*XBtShared)(_pPage.X18).X16)) { + if (_pc < uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))))) || ((_pc + uint32(_sz)) > ((*XBtShared)(_pPage.X18).X16)) { *_pRC = _sqlite3CorruptError(tls, i32(65411)) return } @@ -61666,24 +64362,24 @@ func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int3 *_pRC = _rc return } - *(*uint16)(unsafe.Pointer(&(_pPage.X14))) -= 1 + *(*uint16)(unsafe.Pointer(&_pPage.X14)) -= 1 if int32(_pPage.X14) == i32(0) { - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1))))), i32(0), uint64(i32(4))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(((*XBtShared)(_pPage.X18).X16) >> uint(i32(8))) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(1))))), i32(0), uint64(i32(4))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(((*XBtShared)(_pPage.X18).X16) >> uint(i32(8))) return _data }()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8((*XBtShared)(_pPage.X18).X16) - *(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16(((((*XBtShared)(_pPage.X18).X16) - uint32(_pPage.X6)) - uint32(_pPage.X7)) - uint32(i32(8))) + *(*uint16)(unsafe.Pointer(&_pPage.X13)) = uint16(((((*XBtShared)(_pPage.X18).X16) - uint32(_pPage.X6)) - uint32(_pPage.X7)) - uint32(i32(8))) goto _15 } - crt.Xmemmove(tls, (unsafe.Pointer)(_ptr), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr))+uintptr(i32(2))))), uint64(i32(2)*(int32(_pPage.X14)-_idx))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPage.X14) >> uint(i32(8))) + crt.Xmemmove(tls, unsafe.Pointer(_ptr), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr))+uintptr(i32(2))))), uint64(i32(2)*(int32(_pPage.X14)-_idx))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPage.X14) >> uint(i32(8))) return _data }()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPage.X14) { - p := (*uint16)(unsafe.Pointer(&(_pPage.X13))) + p := (*uint16)(unsafe.Pointer(&_pPage.X13)) *p = uint16(int32(*p) + i32(2)) sink14(*p) } @@ -61696,25 +64392,30 @@ func init() { crt.Xstrncpy(nil, &_dropCellØ00__func__Ø000[0], str(81813), 9) } -// This variation on cellSizePtr() is used inside of assert() statements -// only. +// C comment +// /* This variation on cellSizePtr() is used inside of assert() statements +// ** only. */ func _cellSize(tls *crt.TLS, _pPage *XMemPage, _iCell int32) (r0 uint16) { - return (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(1)))))))))) -} - -// Return a section of the pPage->aData to the freelist. -// The first byte of the new free block is pPage->aData[iStart] -// and the size of the block is iSize bytes. -// -// Adjacent freeblocks are coalesced. -// -// Note that even though the freeblock list was checked by btreeInitPage(), -// that routine will not detect overlap between cells or freeblocks. Nor -// does it detect cells or freeblocks that encrouch into the reserved bytes -// at the end of the page. So do additional corruption checks inside this -// routine and return SQLITE_CORRUPT if any problems are found. + return func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(1)))))))))) +} + +// C comment +// /* +// ** Return a section of the pPage->aData to the freelist. +// ** The first byte of the new free block is pPage->aData[iStart] +// ** and the size of the block is iSize bytes. +// ** +// ** Adjacent freeblocks are coalesced. +// ** +// ** Note that even though the freeblock list was checked by btreeInitPage(), +// ** that routine will not detect overlap between cells or freeblocks. Nor +// ** does it detect cells or freeblocks that encrouch into the reserved bytes +// ** at the end of the page. So do additional corruption checks inside this +// ** routine and return SQLITE_CORRUPT if any problems are found. +// */ func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) (r0 int32) { var _7_iPtrEnd int32 var _iLast, _iEnd uint32 @@ -61739,13 +64440,13 @@ func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) ( } }() func() { - if (_sqlite3Config.X6) != i32(0) && int32(_iStart) < ((int32(_pPage.X6)+i32(6))+int32(_pPage.X7)) { + if _sqlite3Config.X6 != i32(0) && int32(_iStart) < ((int32(_pPage.X6)+i32(6))+int32(_pPage.X7)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60669), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81822))) crt.X__builtin_abort(tls) } }() func() { - if (_sqlite3Config.X6) != i32(0) && _iEnd > ((*XBtShared)(_pPage.X18).X16) { + if _sqlite3Config.X6 != i32(0) && _iEnd > ((*XBtShared)(_pPage.X18).X16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60670), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81883))) crt.X__builtin_abort(tls) } @@ -61769,16 +64470,16 @@ func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) ( } }() if (int32((*XBtShared)(_pPage.X18).X10) & i32(4)) != 0 { - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iStart)))), i32(0), uint64(_iSize)) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iStart)))), i32(0), uint64(_iSize)) } _hdr = _pPage.X6 _iPtr = uint16(int32(_hdr) + i32(1)) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_iPtr)+i32(1))))) == i32(0)) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_iPtr)))) == i32(0)) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(int32(_iPtr)+i32(1))))) == i32(0)) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_iPtr)))) == i32(0)) { _iFreeBlk = uint16(i32(0)) goto _19 } _20: - if int32(store14(&_iFreeBlk, uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(1)))))))) >= int32(_iStart) { + if int32(store14(&_iFreeBlk, uint16((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(1)))))))) >= int32(_iStart) { goto _21 } if int32(_iFreeBlk) >= (int32(_iPtr) + i32(4)) { @@ -61809,17 +64510,17 @@ _21: if _iEnd > uint32(_iFreeBlk) { return _sqlite3CorruptError(tls, i32(60707)) } - _iEnd = uint32(int32(_iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(1))))))) + _iEnd = uint32(int32(_iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(1))))))) if _iEnd > ((*XBtShared)(_pPage.X18).X16) { return _sqlite3CorruptError(tls, i32(60709)) } _iSize = uint16(_iEnd - uint32(_iStart)) - _iFreeBlk = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(1)))))) + _iFreeBlk = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(1)))))) _29: if int32(_iPtr) <= (int32(_hdr) + i32(1)) { goto _32 } - _7_iPtrEnd = int32(_iPtr) + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(1)))))) + _7_iPtrEnd = int32(_iPtr) + ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(1)))))) if (_7_iPtrEnd + i32(3)) < int32(_iStart) { goto _33 } @@ -61835,46 +64536,46 @@ _29: _iStart = _iPtr _33: _32: - if int32(_nFrag) > int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7))))) { + if int32(_nFrag) > int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(int32(_hdr)+i32(7))))) { return _sqlite3CorruptError(tls, i32(60727)) } { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7)))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(int32(_hdr)+i32(7)))) *p = uint8(int32(*p) - int32(_nFrag)) sink2(*p) } _19: - if int32(_iStart) != ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) { + if int32(_iStart) != ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) { goto _36 } if int32(_iPtr) != (int32(_hdr) + i32(1)) { return _sqlite3CorruptError(tls, i32(60734)) } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(1)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(1)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8))) return _data }()))+1*uintptr(int32(_hdr)+i32(1)))))) + 1*uintptr(i32(1)))) = uint8(_iFreeBlk) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_iEnd >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_iEnd >> uint(i32(8))) return _data }()))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_iEnd) goto _38 _36: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))) = uint8(int32(_iStart) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))) = uint8(int32(_iStart) >> uint(i32(8))) return _data }()))+1*uintptr(_iPtr))))) + 1*uintptr(i32(1)))) = uint8(_iStart) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iStart))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iStart))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8))) return _data }()))+1*uintptr(_iStart))))) + 1*uintptr(i32(1)))) = uint8(_iFreeBlk) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iStart)+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iSize) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_iStart)+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iSize) >> uint(i32(8))) return _data }()))+1*uintptr(int32(_iStart)+i32(2)))))) + 1*uintptr(i32(1)))) = uint8(_iSize) _38: { - p := (*uint16)(unsafe.Pointer(&(_pPage.X13))) + p := (*uint16)(unsafe.Pointer(&_pPage.X13)) *p = uint16(int32(*p) + int32(_iOrigSize)) sink14(*p) } @@ -61887,18 +64588,21 @@ func init() { crt.Xstrncpy(nil, &_freeSpaceØ00__func__Ø000[0], str(81980), 10) } -// Insert a new cell on pPage at cell index "i". pCell points to the -// content of the cell. -// -// If the cell content will fit on the page, then put it there. If it -// will not fit, then make a copy of the cell content into pTemp if -// pTemp is not null. Regardless of pTemp, allocate a new entry -// in pPage->apOvfl[] and make it point to the cell content (either -// in pTemp or the original pCell) and also record its index. -// Allocating a new entry in pPage->aCell[] implies that -// pPage->nOverflow is incremented. -// -// *pRC must be SQLITE_OK when this routine is called. +// C comment +// /* +// ** Insert a new cell on pPage at cell index "i". pCell points to the +// ** content of the cell. +// ** +// ** If the cell content will fit on the page, then put it there. If it +// ** will not fit, then make a copy of the cell content into pTemp if +// ** pTemp is not null. Regardless of pTemp, allocate a new entry +// ** in pPage->apOvfl[] and make it point to the cell content (either +// ** in pTemp or the original pCell) and also record its index. +// ** Allocating a new entry in pPage->aCell[] implies that +// ** pPage->nOverflow is incremented. +// ** +// ** *pRC must be SQLITE_OK when this routine is called. +// */ func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz int32, _pTemp *uint8, _iChild uint32, _pRC *int32) { var _idx, _j, _4_rc int32 var _data, _pIns *uint8 @@ -61922,7 +64626,7 @@ func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz in } }() func() { - if uint32(_pPage.X14) > ((((*XBtShared)(_pPage.X18).X15)-uint32(i32(8)))/uint32(i32(6))) && (_sqlite3Config.X6) != i32(0) { + if uint32(_pPage.X14) > ((((*XBtShared)(_pPage.X18).X15)-uint32(i32(8)))/uint32(i32(6))) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65464), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82074))) crt.X__builtin_abort(tls) } @@ -61941,40 +64645,41 @@ func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz in } }() func() { - if _sz != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, _pCell)) && (_sz != i32(8) || _iChild <= uint32(i32(0))) { + if _sz != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell)) && (_sz != i32(8) || _iChild <= uint32(i32(0))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65473), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82165))) crt.X__builtin_abort(tls) } }() - if (_pPage.X9) == 0 && (_sz+i32(2)) <= int32(_pPage.X13) { + if _pPage.X9 == 0 && (_sz+i32(2)) <= int32(_pPage.X13) { goto _19 } if _pTemp != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTemp), (unsafe.Pointer)(_pCell), uint64(_sz)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTemp), unsafe.Pointer(_pCell), uint64(_sz)) _pCell = _pTemp } if _iChild != 0 { _sqlite3Put4byte(tls, _pCell, _iChild) } - _j = int32(postInc2((*uint8)(unsafe.Pointer(&(_pPage.X9))), uint8(1))) + _j = int32(postInc2((*uint8)(unsafe.Pointer(&_pPage.X9)), byte(1))) func() { if _j >= i32(3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65486), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82223))) crt.X__builtin_abort(tls) } }() - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pPage.X17))))) + 8*uintptr(_j))) = _pCell - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j))) = uint16(_i) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_pPage.X17)))) + 8*uintptr(_j))) = _pCell + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pPage.X16)))) + 2*uintptr(_j))) = uint16(_i) func() { - if _j != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j-i32(1))))) >= int32(uint16(_i)) { + if _j != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pPage.X16)))) + 2*uintptr(_j-i32(1))))) >= int32(uint16(_i)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65495), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82254))) crt.X__builtin_abort(tls) } }() func() { - if _j != i32(0) && _i != (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j-i32(1)))))+i32(1)) { + if _j != i32(0) && _i != (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pPage.X16)))) + 2*uintptr(_j-i32(1)))))+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65496), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82288))) crt.X__builtin_abort(tls) } @@ -61994,7 +64699,7 @@ _19: }() _data = _pPage.X19 func() { - if (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_pPage.X12))) != (_pPage.X21) { + if (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_pPage.X12))) != _pPage.X21 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65505), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82320))) crt.X__builtin_abort(tls) } @@ -62011,7 +64716,7 @@ _19: } }() func() { - if _idx < ((int32(_pPage.X12)+(i32(2)*int32(_pPage.X14)))+i32(2)) && (_sqlite3Config.X6) != i32(0) { + if _idx < ((int32(_pPage.X12)+(i32(2)*int32(_pPage.X14)))+i32(2)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65511), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82371))) crt.X__builtin_abort(tls) } @@ -62023,26 +64728,26 @@ _19: } }() { - p := (*uint16)(unsafe.Pointer(&(_pPage.X13))) + p := (*uint16)(unsafe.Pointer(&_pPage.X13)) *p = uint16(int32(*p) - int32(uint16(i32(2)+_sz))) sink14(*p) } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_idx)))), (unsafe.Pointer)(_pCell), uint64(_sz)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_idx)))), unsafe.Pointer(_pCell), uint64(_sz)) if _iChild != 0 { - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_idx))), _iChild) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_idx))), _iChild) } _pIns = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21)) + uintptr(_i*i32(2)))) - crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns))+uintptr(i32(2))))), (unsafe.Pointer)(_pIns), uint64(i32(2)*(int32(_pPage.X14)-_i))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIns)) + 1*uintptr(i32(0)))) = uint8(_idx >> uint(i32(8))) + crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns))+uintptr(i32(2))))), unsafe.Pointer(_pIns), uint64(i32(2)*(int32(_pPage.X14)-_i))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns)) + 1*uintptr(i32(0)))) = uint8(_idx >> uint(i32(8))) return _pIns }())) + 1*uintptr(i32(1)))) = uint8(_idx) - *(*uint16)(unsafe.Pointer(&(_pPage.X14))) += 1 - if int32(preInc2((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(4)))), byte(1))) == i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_pPage.X6)+i32(3)))) += 1 + *(*uint16)(unsafe.Pointer(&_pPage.X14)) += 1 + if int32(preInc2((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_pPage.X6)+i32(4)))), byte(1))) == i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(int32(_pPage.X6)+i32(3)))) += 1 } func() { - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(1)))))) != int32(_pPage.X14) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(1)))))) != int32(_pPage.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65524), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82465))) crt.X__builtin_abort(tls) } @@ -62059,17 +64764,20 @@ func init() { crt.Xstrncpy(nil, &_insertCellØ00__func__Ø000[0], str(82515), 11) } -// Allocate nByte bytes of space from within the B-Tree page passed -// as the first argument. Write into *pIdx the index into pPage->aData[] -// of the first byte of allocated space. Return either SQLITE_OK or -// an error code (usually SQLITE_CORRUPT). -// -// The caller guarantees that there is sufficient space to make the -// allocation. This routine might need to defragment in order to bring -// all the space together, however. This routine will avoid using -// the first two bytes past the cell pointer area since presumably this -// allocation is being made in order to insert a new cell, so we will -// also end up needing a new cell pointer. +// C comment +// /* +// ** Allocate nByte bytes of space from within the B-Tree page passed +// ** as the first argument. Write into *pIdx the index into pPage->aData[] +// ** of the first byte of allocated space. Return either SQLITE_OK or +// ** an error code (usually SQLITE_CORRUPT). +// ** +// ** The caller guarantees that there is sufficient space to make the +// ** allocation. This routine might need to defragment in order to bring +// ** all the space together, however. This routine will avoid using +// ** the first two bytes past the cell pointer area since presumably this +// ** allocation is being made in order to insert a new cell, so we will +// ** also end up needing a new cell pointer. +// */ func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) (r0 int32) { var _hdr, _top, _rc, _gap int32 var _data, _4_pSpace *uint8 @@ -62083,7 +64791,7 @@ func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) } }() func() { - if (*XBtShared)(_pPage.X18) == nil { + if _pPage.X18 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60575), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(20307))) crt.X__builtin_abort(tls) } @@ -62131,7 +64839,7 @@ func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) crt.X__builtin_abort(tls) } }() - _top = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) + _top = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) func() { if _top > int32((*XBtShared)(_pPage.X18).X16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60591), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82672))) @@ -62149,7 +64857,7 @@ func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) _23: _20: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(2))))) == 0 && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(1))))) == 0 || (_gap+i32(2)) > _top { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(2))))) == 0 && (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(1))))) == 0 || (_gap+i32(2)) > _top { goto _26 } _4_pSpace = _pageFindSlot(tls, _pPage, _nByte, &_rc) @@ -62171,7 +64879,7 @@ _26: goto _33 } func() { - if int32(_pPage.X14) <= i32(0) && (_sqlite3Config.X6) != i32(0) { + if int32(_pPage.X14) <= i32(0) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60623), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82743))) crt.X__builtin_abort(tls) } @@ -62185,7 +64893,7 @@ _26: if _rc != 0 { return _rc } - _top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1) + _top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1) func() { if ((_gap + i32(2)) + _nByte) > _top { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60627), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82772))) @@ -62198,8 +64906,8 @@ _33: *p = (*p) - _nByte sink1(*p) } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_top >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_top >> uint(i32(8))) return _data }()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_top) func() { @@ -62218,25 +64926,28 @@ func init() { crt.Xstrncpy(nil, &_allocateSpaceØ00__func__Ø000[0], str(82830), 14) } -// Search the free-list on page pPg for space to store a cell nByte bytes in -// size. If one can be found, return a pointer to the space and remove it -// from the free-list. -// -// If no suitable space can be found on the free-list, return NULL. -// -// This function may detect corruption within pPg. If corruption is -// detected then *pRc is set to SQLITE_CORRUPT and NULL is returned. -// -// Slots on the free list that are between 1 and 3 bytes larger than nByte -// will be ignored if adding the extra space to the fragmentation count -// causes the fragmentation count to exceed 60. +// C comment +// /* +// ** Search the free-list on page pPg for space to store a cell nByte bytes in +// ** size. If one can be found, return a pointer to the space and remove it +// ** from the free-list. +// ** +// ** If no suitable space can be found on the free-list, return NULL. +// ** +// ** This function may detect corruption within pPg. If corruption is +// ** detected then *pRc is set to SQLITE_CORRUPT and NULL is returned. +// ** +// ** Slots on the free list that are between 1 and 3 bytes larger than nByte +// ** will be ignored if adding the extra space to the fragmentation count +// ** causes the fragmentation count to exceed 60. +// */ func _pageFindSlot(tls *crt.TLS, _pPg *XMemPage, _nByte int32, _pRc *int32) (r0 *uint8) { var _hdr, _iAddr, _pc, _x, _usableSize, _1_size int32 var _aData *uint8 _hdr = int32(_pPg.X6) _aData = _pPg.X19 _iAddr = _hdr + i32(1) - _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(1))))) + _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(1))))) _usableSize = int32((*XBtShared)(_pPg.X18).X16) func() { if _pc <= i32(0) { @@ -62249,7 +64960,7 @@ _2: *_pRc = _sqlite3CorruptError(tls, i32(60518)) return nil } - _1_size = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(1))))) + _1_size = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(1))))) if store1(&_x, _1_size-_nByte) < i32(0) { goto _5 } @@ -62260,27 +64971,27 @@ _2: if _x >= i32(4) { goto _9 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7))))) > i32(57) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_hdr+i32(7))))) > i32(57) { return nil } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc)))), uint64(i32(2))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_iAddr)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc)))), uint64(i32(2))) { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7)))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_hdr+i32(7)))) *p = uint8(int32(*p) + int32(uint8(_x))) sink2(*p) } goto _11 _9: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(_x >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(_x >> uint(i32(8))) return _aData }()))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(1)))) = uint8(_x) _11: - return (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_pc+_x))) + return (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_pc+_x))) _5: _iAddr = _pc - _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(1))))) + _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(1))))) if _pc != 0 { goto _2 } @@ -62293,16 +65004,19 @@ func init() { crt.Xstrncpy(nil, &_pageFindSlotØ00__func__Ø000[0], str(82849), 13) } -// Defragment the page given. This routine reorganizes cells within the -// page so that there are no free-blocks on the free-block list. -// -// Parameter nMaxFrag is the maximum amount of fragmented space that may be -// present in the page after this routine returns. -// -// EVIDENCE-OF: R-44582-60138 SQLite may from time to time reorganize a -// b-tree page so that there are no freeblocks or fragment bytes, all -// unused bytes are contained in the unallocated space region, and all -// cells are packed tightly at the end of the page. +// C comment +// /* +// ** Defragment the page given. This routine reorganizes cells within the +// ** page so that there are no free-blocks on the free-block list. +// ** +// ** Parameter nMaxFrag is the maximum amount of fragmented space that may be +// ** present in the page after this routine returns. +// ** +// ** EVIDENCE-OF: R-44582-60138 SQLite may from time to time reorganize a +// ** b-tree page so that there are no freeblocks or fragment bytes, all +// ** unused bytes are contained in the unallocated space region, and all +// ** cells are packed tightly at the end of the page. +// */ func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) { var _i, _pc, _hdr, _size, _usableSize, _cellOffset, _cbrk, _nCell, _iCellFirst, _iCellLast, _1_iFree, _2_iFree2, _3_sz2, _3_sz, _3_top, _11_x int32 var _data, _temp, _src, _3_pEnd, _3_pAddr, _8_pAddr *uint8 @@ -62342,21 +65056,21 @@ func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) _cellOffset = int32(_pPage.X12) _nCell = int32(_pPage.X14) func() { - if _nCell != ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))))) { + if _nCell != ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60391), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82909))) crt.X__builtin_abort(tls) } }() _iCellFirst = _cellOffset + (i32(2) * _nCell) _usableSize = int32((*XBtShared)(_pPage.X18).X16) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))) > _nMaxFrag { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7))))) > _nMaxFrag { goto _12 } - _1_iFree = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1))))) + _1_iFree = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1))))) if _1_iFree == 0 { goto _13 } - _2_iFree2 = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(1))))) + _2_iFree2 = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(1))))) func() { if _2_iFree2 != i32(0) && _2_iFree2 <= _1_iFree { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60411), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82939))) @@ -62364,38 +65078,38 @@ func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) } }() func() { - if (_1_iFree + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1))))))) > _usableSize { + if (_1_iFree + ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1))))))) > _usableSize { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60412), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82965))) crt.X__builtin_abort(tls) } }() func() { - if _2_iFree2 != i32(0) && (_2_iFree2+((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(1))))))) > _usableSize { + if _2_iFree2 != i32(0) && (_2_iFree2+((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(1))))))) > _usableSize { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60413), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83010))) crt.X__builtin_abort(tls) } }() - if i32(0) != _2_iFree2 && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_2_iFree2)))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_2_iFree2+i32(1))))) != i32(0)) { + if i32(0) != _2_iFree2 && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_2_iFree2)))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_2_iFree2+i32(1))))) != i32(0)) { goto _24 } - _3_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset+(_nCell*i32(2))))) + _3_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_cellOffset+(_nCell*i32(2))))) _3_sz2 = i32(0) - _3_sz = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1))))) - _3_top = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) + _3_sz = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1))))) + _3_top = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) if _2_iFree2 == 0 { goto _25 } if (_1_iFree + _3_sz) > _2_iFree2 { return _sqlite3CorruptError(tls, i32(60422)) } - _3_sz2 = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(1))))) + _3_sz2 = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(1))))) func() { if ((((_1_iFree + _3_sz) + _3_sz2) + _2_iFree2) - (_1_iFree + _3_sz)) > _usableSize { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60424), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83070))) crt.X__builtin_abort(tls) } }() - crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr((_1_iFree+_3_sz)+_3_sz2)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+_3_sz)))), uint64(_2_iFree2-(_1_iFree+_3_sz))) + crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr((_1_iFree+_3_sz)+_3_sz2)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_1_iFree+_3_sz)))), uint64(_2_iFree2-(_1_iFree+_3_sz))) { p := &_3_sz *p = (*p) + _3_sz2 @@ -62409,30 +65123,30 @@ _25: crt.X__builtin_abort(tls) } }() - crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cbrk)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_3_top)))), uint64(_1_iFree-_3_top)) - _3_pAddr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset))) + crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cbrk)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_3_top)))), uint64(_1_iFree-_3_top)) + _3_pAddr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_cellOffset))) _31: if crt.P2U(unsafe.Pointer(_3_pAddr)) >= crt.P2U(unsafe.Pointer(_3_pEnd)) { goto _34 } - _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(1))))) + _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pAddr)) + 1*uintptr(i32(1))))) if _pc < _1_iFree { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz) >> uint(i32(8))) return _3_pAddr }())) + 1*uintptr(i32(1)))) = uint8(_pc + _3_sz) goto _37 } if _pc < _2_iFree2 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz2) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz2) >> uint(i32(8))) return _3_pAddr }())) + 1*uintptr(i32(1)))) = uint8(_pc + _3_sz2) } _37: { p := &_3_pAddr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink13(*p) } goto _31 @@ -62448,8 +65162,8 @@ _38: if _i >= _nCell { goto _41 } - _8_pAddr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset+(_i*i32(2))))) - _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(1))))) + _8_pAddr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_cellOffset+(_i*i32(2))))) + _pc = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pAddr)) + 1*uintptr(i32(1))))) if (_pc < _iCellFirst) || (_pc > _iCellLast) { return _sqlite3CorruptError(tls, i32(60453)) } @@ -62459,9 +65173,10 @@ _38: crt.X__builtin_abort(tls) } }() - _size = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_src))+1*uintptr(_pc))))) + _size = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_src))+1*uintptr(_pc))))) { p := &_cbrk *p = (*p) - _size @@ -62476,8 +65191,8 @@ _38: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_pAddr)) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8))) return _8_pAddr }())) + 1*uintptr(i32(1)))) = uint8(_cbrk) if _temp != nil { @@ -62487,18 +65202,18 @@ _38: goto _39 } _temp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPage.X18).X0))) - _11_x = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_temp))+1*uintptr(_11_x)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_11_x)))), uint64((_cbrk+_size)-_11_x)) + _11_x = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_temp))+1*uintptr(_11_x)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_11_x)))), uint64((_cbrk+_size)-_11_x)) _src = _temp _52: - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cbrk)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_src))+1*uintptr(_pc)))), uint64(_size)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cbrk)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_src))+1*uintptr(_pc)))), uint64(_size)) _39: _i += 1 goto _38 _41: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) _defragment_out: - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))) + _cbrk) - _iCellFirst) != int32(_pPage.X13) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7))))) + _cbrk) - _iCellFirst) != int32(_pPage.X13) { return _sqlite3CorruptError(tls, i32(60479)) } func() { @@ -62507,13 +65222,13 @@ _defragment_out: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8))) return _data }()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_cbrk) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(1)))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(2)))) = uint8(i32(0)) - crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iCellFirst)))), i32(0), uint64(_cbrk-_iCellFirst)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(1)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(2)))) = uint8(i32(0)) + crt.Xmemset(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_iCellFirst)))), i32(0), uint64(_cbrk-_iCellFirst)) func() { if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60486), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(53334))) @@ -62529,24 +65244,30 @@ func init() { crt.Xstrncpy(nil, &_defragmentPageØ00__func__Ø000[0], str(83237), 15) } -// Return a pointer to the "temporary page" buffer held internally -// by the pager. This is a buffer that is big enough to hold the -// entire content of a database page. This buffer is used internally -// during rollback and will be overwritten whenever a rollback -// occurs. But other modules are free to use it too, as long as -// no rollbacks are happening. +// C comment +// /* +// ** Return a pointer to the "temporary page" buffer held internally +// ** by the pager. This is a buffer that is big enough to hold the +// ** entire content of a database page. This buffer is used internally +// ** during rollback and will be overwritten whenever a rollback +// ** occurs. But other modules are free to use it too, as long as +// ** no rollbacks are happening. +// */ func _sqlite3PagerTempSpace(tls *crt.TLS, _pPager *XPager) (r0 unsafe.Pointer) { - return (unsafe.Pointer)(_pPager.X58) -} - -// The page that pCur currently points to has just been modified in -// some way. This function figures out if this modification means the -// tree needs to be balanced, and if so calls the appropriate balancing -// routine. Balancing routines are: -// -// balance_quick() -// balance_deeper() -// balance_nonroot() + return unsafe.Pointer(_pPager.X58) +} + +// C comment +// /* +// ** The page that pCur currently points to has just been modified in +// ** some way. This function figures out if this modification means the +// ** tree needs to be balanced, and if so calls the appropriate balancing +// ** routine. Balancing routines are: +// ** +// ** balance_quick() +// ** balance_deeper() +// ** balance_nonroot() +// */ func _balance(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { var _rc, _nMin, _balance_quick_called, _balance_deeper_called, _1_iPage, _7_iIdx int32 var _pFree, _10_pSpace *uint8 @@ -62559,11 +65280,11 @@ func _balance(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { _balance_deeper_called = i32(0) _0: _1_iPage = int32(_pCur.X14) - _1_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_1_iPage))) + _1_pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_1_iPage))) if _1_iPage != i32(0) { goto _1 } - if (_1_pPage.X9) == 0 { + if _1_pPage.X9 == 0 { goto _2 } func() { @@ -62573,13 +65294,13 @@ _0: } }() _balance_deeper_called += 1 - _rc = _balance_deeper(tls, _1_pPage, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+8*uintptr(i32(1))))) + _rc = _balance_deeper(tls, _1_pPage, (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19))))+8*uintptr(i32(1))))) if _rc == i32(0) { - *(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(1)) - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(i32(0)))) = uint16(i32(0)) + *(*int8)(unsafe.Pointer(&_pCur.X14)) = int8(i32(1)) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(i32(0)))) = uint16(i32(0)) func() { - if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(i32(1))))).X9) == 0 { + if ((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(i32(1))))).X9) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66973), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(83277))) crt.X__builtin_abort(tls) } @@ -62594,13 +65315,13 @@ _1: if (int32(_1_pPage.X9) == i32(0)) && (int32(_1_pPage.X13) <= _nMin) { goto _9 } - _7_pParent = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_1_iPage-i32(1)))) - _7_iIdx = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(_1_iPage-i32(1))))) + _7_pParent = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_1_iPage-i32(1)))) + _7_iIdx = int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[19]uint16)(unsafe.Pointer(&_pCur.X17)))) + 2*uintptr(_1_iPage-i32(1))))) _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pParent.X23)) if _rc != i32(0) { goto _14 } - if (((((_1_pPage.X3) != 0) && (int32(_1_pPage.X9) == i32(1))) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_1_pPage.X16))))) + 2*uintptr(i32(0))))) == int32(_1_pPage.X14))) && ((_7_pParent.X4) != uint32(i32(1)))) && (int32(_7_pParent.X14) == _7_iIdx) { + if ((((_1_pPage.X3 != 0) && (int32(_1_pPage.X9) == i32(1))) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_1_pPage.X16)))) + 2*uintptr(i32(0))))) == int32(_1_pPage.X14))) && (_7_pParent.X4 != uint32(i32(1)))) && (int32(_7_pParent.X14) == _7_iIdx) { func() { if _balance_quick_called != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67006), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(83304))) @@ -62614,14 +65335,14 @@ _1: _10_pSpace = (*uint8)(_sqlite3PageMalloc(tls, int32((*XBtShared)(_pCur.X1).X15))) _rc = _balance_nonroot(tls, _7_pParent, _7_iIdx, _10_pSpace, bool2int(_1_iPage == i32(1)), int32(_pCur.X13)&i32(1)) if _pFree != nil { - _sqlite3PageFree(tls, (unsafe.Pointer)(_pFree)) + _sqlite3PageFree(tls, unsafe.Pointer(_pFree)) } _pFree = _10_pSpace _22: _14: - *(*uint8)(unsafe.Pointer(&(_1_pPage.X9))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_1_pPage.X9)) = uint8(i32(0)) _releasePage(tls, _1_pPage) - *(*int8)(unsafe.Pointer(&(_pCur.X14))) -= 1 + *(*int8)(unsafe.Pointer(&_pCur.X14)) -= 1 func() { if int32(_pCur.X14) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67052), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(75282))) @@ -62634,7 +65355,7 @@ _13: } _9: if _pFree != nil { - _sqlite3PageFree(tls, (unsafe.Pointer)(_pFree)) + _sqlite3PageFree(tls, unsafe.Pointer(_pFree)) } return _rc @@ -62648,23 +65369,26 @@ func init() { crt.Xstrncpy(nil, &_balanceØ00__func__Ø000[0], str(83328), 8) } -// This function is called when the root page of a b-tree structure is -// overfull (has one or more overflow pages). -// -// A new child page is allocated and the contents of the current root -// page, including overflow cells, are copied into the child. The root -// page is then overwritten to make it an empty page with the right-child -// pointer pointing to the new page. -// -// Before returning, all pointer-map entries corresponding to pages -// that the new child-page now contains pointers to are updated. The -// entry corresponding to the new right-child pointer of the root -// page is also updated. -// -// If successful, *ppChild is set to contain a reference to the child -// page and SQLITE_OK is returned. In this case the caller is required -// to call releasePage() on *ppChild exactly once. If an error occurs, -// an error code is returned and *ppChild is set to 0. +// C comment +// /* +// ** This function is called when the root page of a b-tree structure is +// ** overfull (has one or more overflow pages). +// ** +// ** A new child page is allocated and the contents of the current root +// ** page, including overflow cells, are copied into the child. The root +// ** page is then overwritten to make it an empty page with the right-child +// ** pointer pointing to the new page. +// ** +// ** Before returning, all pointer-map entries corresponding to pages +// ** that the new child-page now contains pointers to are updated. The +// ** entry corresponding to the new right-child pointer of the root +// ** page is also updated. +// ** +// ** If successful, *ppChild is set to contain a reference to the child +// ** page and SQLITE_OK is returned. In this case the caller is required +// ** to call releasePage() on *ppChild exactly once. If an error occurs, +// ** an error code is returned and *ppChild is set to 0. +// */ func _balance_deeper(tls *crt.TLS, _pRoot *XMemPage, _ppChild **XMemPage) (r0 int32) { var _rc int32 var _pgnoChild uint32 @@ -62691,7 +65415,7 @@ func _balance_deeper(tls *crt.TLS, _pRoot *XMemPage, _ppChild **XMemPage) (r0 in } _rc = _allocateBtreePage(tls, _pBt, &_pChild, &_pgnoChild, _pRoot.X4, uint8(i32(0))) _copyNodeContent(tls, _pRoot, _pChild, &_rc) - if (_pBt.X5) != 0 { + if _pBt.X5 != 0 { _ptrmapPut(tls, _pBt, _pgnoChild, uint8(i32(5)), _pRoot.X4, &_rc) } _4: @@ -62718,11 +65442,11 @@ _4: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pChild.X16)))), (unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pRoot.X16)))), uint64(_pRoot.X9)*u64(2)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pChild.X17)))), (unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pRoot.X17)))), uint64(_pRoot.X9)*u64(8)) - *(*uint8)(unsafe.Pointer(&(_pChild.X9))) = _pRoot.X9 - _zeroPage(tls, _pRoot, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pChild.X19)) + 1*uintptr(i32(0)))))&i32(-9)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8)))), _pgnoChild) + crt.Xmemcpy(tls, unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pChild.X16))), unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pRoot.X16))), uint64(_pRoot.X9)*u64(2)) + crt.Xmemcpy(tls, unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_pChild.X17))), unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_pRoot.X17))), uint64(_pRoot.X9)*u64(8)) + *(*uint8)(unsafe.Pointer(&_pChild.X9)) = _pRoot.X9 + _zeroPage(tls, _pRoot, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pChild.X19)) + 1*uintptr(i32(0)))))&i32(-9)) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8)))), _pgnoChild) *_ppChild = _pChild return i32(0) } @@ -62733,21 +65457,24 @@ func init() { crt.Xstrncpy(nil, &_balance_deeperØ00__func__Ø000[0], str(83424), 15) } -// This function is used to copy the contents of the b-tree node stored -// on page pFrom to page pTo. If page pFrom was not a leaf page, then -// the pointer-map entries for each child page are updated so that the -// parent page stored in the pointer map is page pTo. If pFrom contained -// any cells with overflow page pointers, then the corresponding pointer -// map entries are also updated so that the parent page is page pTo. -// -// If pFrom is currently carrying any overflow cells (entries in the -// MemPage.apOvfl[] array), they are not copied to pTo. -// -// Before returning, page pTo is reinitialized using btreeInitPage(). -// -// The performance of this function is not critical. It is only used by -// the balance_shallower() and balance_deeper() procedures, neither of -// which are called often under normal circumstances. +// C comment +// /* +// ** This function is used to copy the contents of the b-tree node stored +// ** on page pFrom to page pTo. If page pFrom was not a leaf page, then +// ** the pointer-map entries for each child page are updated so that the +// ** parent page stored in the pointer map is page pTo. If pFrom contained +// ** any cells with overflow page pointers, then the corresponding pointer +// ** map entries are also updated so that the parent page is page pTo. +// ** +// ** If pFrom is currently carrying any overflow cells (entries in the +// ** MemPage.apOvfl[] array), they are not copied to pTo. +// ** +// ** Before returning, page pTo is reinitialized using btreeInitPage(). +// ** +// ** The performance of this function is not critical. It is only used by +// ** the balance_shallower() and balance_deeper() procedures, neither of +// ** which are called often under normal circumstances. +// */ func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int32) { var _1_iFromHdr, _1_iToHdr, _1_rc, _1_iData int32 var _1_aFrom, _1_aTo *uint8 @@ -62760,13 +65487,13 @@ func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int3 _1_aTo = _pTo.X19 _1_iFromHdr = int32(_pFrom.X6) _1_iToHdr = func() int32 { - if (_pTo.X4) == uint32(i32(1)) { + if _pTo.X4 == uint32(i32(1)) { return i32(100) } return i32(0) }() func() { - if (_pFrom.X0) == 0 { + if _pFrom.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66056), unsafe.Pointer((*int8)(unsafe.Pointer(&_copyNodeContentØ00__func__Ø000))), unsafe.Pointer(str(83439))) crt.X__builtin_abort(tls) } @@ -62778,21 +65505,21 @@ func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int3 } }() func() { - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1)))))) > int32(_1_pBt.X16) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1)))))) > int32(_1_pBt.X16) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66058), unsafe.Pointer((*int8)(unsafe.Pointer(&_copyNodeContentØ00__func__Ø000))), unsafe.Pointer(str(83474))) crt.X__builtin_abort(tls) } }() - _1_iData = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aTo))+1*uintptr(_1_iData)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iData)))), uint64((_1_pBt.X16)-uint32(_1_iData))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aTo))+1*uintptr(_1_iToHdr)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr)))), uint64(int32(_pFrom.X12)+(i32(2)*int32(_pFrom.X14)))) - *(*uint8)(unsafe.Pointer(&(_pTo.X0))) = uint8(i32(0)) + _1_iData = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1))))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aTo))+1*uintptr(_1_iData)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iData)))), uint64(_1_pBt.X16-uint32(_1_iData))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aTo))+1*uintptr(_1_iToHdr)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aFrom))+1*uintptr(_1_iFromHdr)))), uint64(int32(_pFrom.X12)+(i32(2)*int32(_pFrom.X14)))) + *(*uint8)(unsafe.Pointer(&_pTo.X0)) = uint8(i32(0)) _1_rc = _btreeInitPage(tls, _pTo) if _1_rc != i32(0) { *_pRC = _1_rc return } - if (_1_pBt.X5) != 0 { + if _1_pBt.X5 != 0 { *_pRC = _setChildPtrmaps(tls, _pTo) } _0: @@ -62804,27 +65531,30 @@ func init() { crt.Xstrncpy(nil, &_copyNodeContentØ00__func__Ø000[0], str(83527), 16) } -// This version of balance() handles the common special case where -// a new entry is being inserted on the extreme right-end of the -// tree, in other words, when the new entry will become the largest -// entry in the tree. -// -// Instead of trying to balance the 3 right-most leaf pages, just add -// a new page to the right-hand side and put the one new entry in -// that page. This leaves the right side of the tree somewhat -// unbalanced. But odds are that we will be inserting new entries -// at the end soon afterwards so the nearly empty page will quickly -// fill up. On average. -// -// pPage is the leaf page which is the right-most page in the tree. -// pParent is its parent. pPage must have a single overflow entry -// which is also the right-most entry on the page. -// -// The pSpace buffer is used to store a temporary copy of the divider -// cell that will be inserted into pParent. Such a cell consists of a 4 -// byte page number followed by a variable length integer. In other -// words, at most 13 bytes. Hence the pSpace buffer must be at -// least 13 bytes in size. +// C comment +// /* +// ** This version of balance() handles the common special case where +// ** a new entry is being inserted on the extreme right-end of the +// ** tree, in other words, when the new entry will become the largest +// ** entry in the tree. +// ** +// ** Instead of trying to balance the 3 right-most leaf pages, just add +// ** a new page to the right-hand side and put the one new entry in +// ** that page. This leaves the right side of the tree somewhat +// ** unbalanced. But odds are that we will be inserting new entries +// ** at the end soon afterwards so the nearly empty page will quickly +// ** fill up. On average. +// ** +// ** pPage is the leaf page which is the right-most page in the tree. +// ** pParent is its parent. pPage must have a single overflow entry +// ** which is also the right-most entry on the page. +// ** +// ** The pSpace buffer is used to store a temporary copy of the divider +// ** cell that will be inserted into pParent. Such a cell consists of a 4 +// ** byte page number followed by a variable length integer. In other +// ** words, at most 13 bytes. Hence the pSpace buffer must be at +// ** least 13 bytes in size. +// */ func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace *uint8) (r0 int32) { var _rc int32 var _pgnoNew uint32 @@ -62867,11 +65597,12 @@ func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace if _rc != i32(0) { goto _9 } - _1_pOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace)) + 1*uintptr(i32(4)))) - _1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pPage.X17))))) + 8*uintptr(i32(0)))) - _1_szCell = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, _1_pCell) + _1_pOut = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSpace)) + 1*uintptr(i32(4)))) + _1_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_pPage.X17)))) + 8*uintptr(i32(0)))) + _1_szCell = func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, _1_pCell) func() { if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pNew.X23)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65927), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83605))) @@ -62879,7 +65610,7 @@ func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace } }() func() { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19)) + 1*uintptr(i32(0))))) != i32(13) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + 1*uintptr(i32(0))))) != i32(13) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65928), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83644))) crt.X__builtin_abort(tls) } @@ -62898,8 +65629,8 @@ func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace }() != 0 { return _rc } - *(*uint16)(unsafe.Pointer(&(_pNew.X13))) = uint16((((_pBt.X16) - uint32(_pNew.X12)) - uint32(i32(2))) - uint32(_1_szCell)) - if (_pBt.X5) == 0 { + *(*uint16)(unsafe.Pointer(&_pNew.X13)) = uint16(((_pBt.X16 - uint32(_pNew.X12)) - uint32(i32(2))) - uint32(_1_szCell)) + if _pBt.X5 == 0 { goto _17 } _ptrmapPut(tls, _pBt, _pgnoNew, uint8(i32(5)), _pParent.X4, &_rc) @@ -62907,13 +65638,13 @@ func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace _ptrmapPutOvflPtr(tls, _pNew, _1_pCell, &_rc) } _17: - _1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*(int32(_pPage.X14)-i32(1))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*(int32(_pPage.X14)-i32(1))))))) + 1*uintptr(i32(1))))))))) - _1_pStop = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pCell)) + 1*uintptr(i32(9)))) + _1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*(int32(_pPage.X14)-i32(1))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*(int32(_pPage.X14)-i32(1))))))) + 1*uintptr(i32(1))))))))) + _1_pStop = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pCell)) + 1*uintptr(i32(9)))) _19: if (int32(*postInc13(&_1_pCell, 1))&i32(128)) != 0 && (crt.P2U(unsafe.Pointer(_1_pCell)) < crt.P2U(unsafe.Pointer(_1_pStop))) { goto _19 } - _1_pStop = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pCell)) + 1*uintptr(i32(9)))) + _1_pStop = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pCell)) + 1*uintptr(i32(9)))) _22: if (int32(store2(postInc13(&_1_pOut, 1), *postInc13(&_1_pCell, 1)))&i32(128)) != 0 && (crt.P2U(unsafe.Pointer(_1_pCell)) < crt.P2U(unsafe.Pointer(_1_pStop))) { goto _22 @@ -62921,7 +65652,7 @@ _22: if _rc == i32(0) { _insertCell(tls, _pParent, int32(_pParent.X14), _pSpace, int32(int64((uintptr(unsafe.Pointer(_1_pOut))-uintptr(unsafe.Pointer(_pSpace)))/1)), nil, _pPage.X4, &_rc) } - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X19))+1*uintptr(int32(_pParent.X6)+i32(8)))), _pgnoNew) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19))+1*uintptr(int32(_pParent.X6)+i32(8)))), _pgnoNew) _releasePage(tls, _pNew) _9: return _rc @@ -62933,60 +65664,64 @@ func init() { crt.Xstrncpy(nil, &_balance_quickØ00__func__Ø000[0], str(83696), 14) } -// Array apCell[] contains pointers to nCell b-tree page cells. The -// szCell[] array contains the size in bytes of each cell. This function -// replaces the current contents of page pPg with the contents of the cell -// array. -// -// Some of the cells in apCell[] may currently be stored in pPg. This -// function works around problems caused by this by making a copy of any -// such cells before overwriting the page data. -// -// The MemPage.nFree field is invalidated by this function. It is the -// responsibility of the caller to set it correctly. +// C comment +// /* +// ** Array apCell[] contains pointers to nCell b-tree page cells. The +// ** szCell[] array contains the size in bytes of each cell. This function +// ** replaces the current contents of page pPg with the contents of the cell +// ** array. +// ** +// ** Some of the cells in apCell[] may currently be stored in pPg. This +// ** function works around problems caused by this by making a copy of any +// ** such cells before overwriting the page data. +// ** +// ** The MemPage.nFree field is invalidated by this function. It is the +// ** responsibility of the caller to set it correctly. +// */ func _rebuildPage(tls *crt.TLS, _pPg *XMemPage, _nCell int32, _apCell **uint8, _szCell *uint16) (r0 int32) { var _hdr, _usableSize, _i int32 var _aData, _pEnd, _pCellptr, _pTmp, _pData, _1_pCell *uint8 _hdr = int32(_pPg.X6) _aData = _pPg.X19 _usableSize = int32((*XBtShared)(_pPg.X18).X16) - _pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_usableSize))) + _pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_usableSize))) _pCellptr = _pPg.X21 _pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.X18).X0))) - _i = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTmp))+1*uintptr(_i)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_i)))), uint64(_usableSize-_i)) + _i = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTmp))+1*uintptr(_i)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_i)))), uint64(_usableSize-_i)) _pData = _pEnd _i = i32(0) _0: if _i >= _nCell { goto _3 } - _1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apCell)) + 8*uintptr(_i))) + _1_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_apCell)) + 8*uintptr(_i))) if (uint64(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_aData)))) && (uint64(crt.P2U(unsafe.Pointer(_1_pCell))) < uint64(crt.P2U(unsafe.Pointer(_pEnd)))) { - _1_pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTmp)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_1_pCell))-uintptr(unsafe.Pointer(_aData)))/1)))) + _1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTmp)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_1_pCell))-uintptr(unsafe.Pointer(_aData)))/1)))) } { p := &_pData - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i)))))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_szCell)) + 2*uintptr(_i)))))) sink13(*p) } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) return _pCellptr }())) + 1*uintptr(i32(1)))) = uint8(int64((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1)) { p := &_pCellptr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink13(*p) } if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pCellptr)) { return _sqlite3CorruptError(tls, i32(65622)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pData), (unsafe.Pointer)(_1_pCell), uint64(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i))))) + crt.Xmemcpy(tls, unsafe.Pointer(_pData), unsafe.Pointer(_1_pCell), uint64(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_szCell)) + 2*uintptr(_i))))) func() { - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i)))) != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPg.X24)})))(tls, _pPg, _1_pCell)) && (_sqlite3Config.X6) != i32(0) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_szCell)) + 2*uintptr(_i)))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPg.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPg, _1_pCell)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65624), unsafe.Pointer((*int8)(unsafe.Pointer(&_rebuildPageØ00__func__Ø000))), unsafe.Pointer(str(83710))) crt.X__builtin_abort(tls) } @@ -62994,21 +65729,21 @@ _0: _i += 1 goto _0 _3: - *(*uint16)(unsafe.Pointer(&(_pPg.X14))) = uint16(_nCell) - *(*uint8)(unsafe.Pointer(&(_pPg.X9))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0)))) = u8(0) + *(*uint16)(unsafe.Pointer(&_pPg.X14)) = uint16(_nCell) + *(*uint8)(unsafe.Pointer(&_pPg.X9)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0)))) = u8(0) return _aData }()))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1)))) = u8(0) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8))) return _aData }()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPg.X14) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) return _aData }()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(int64((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0)) return i32(0) } @@ -63018,44 +65753,47 @@ func init() { crt.Xstrncpy(nil, &_rebuildPageØ00__func__Ø000[0], str(83762), 12) } -// This routine redistributes cells on the iParentIdx'th child of pParent -// (hereafter "the page") and up to 2 siblings so that all pages have about the -// same amount of free space. Usually a single sibling on either side of the -// page are used in the balancing, though both siblings might come from one -// side if the page is the first or last child of its parent. If the page -// has fewer than 2 siblings (something which can only happen if the page -// is a root page or a child of a root page) then all available siblings -// participate in the balancing. -// -// The number of siblings of the page might be increased or decreased by -// one or two in an effort to keep pages nearly full but not over full. -// -// Note that when this routine is called, some of the cells on the page -// might not actually be stored in MemPage.aData[]. This can happen -// if the page is overfull. This routine ensures that all cells allocated -// to the page and its siblings fit into MemPage.aData[] before returning. -// -// In the course of balancing the page and its siblings, cells may be -// inserted into or removed from the parent page (pParent). Doing so -// may cause the parent page to become overfull or underfull. If this -// happens, it is the responsibility of the caller to invoke the correct -// balancing routine to fix this problem (see the balance() routine). -// -// If this routine fails for any reason, it might leave the database -// in a corrupted state. So if this routine fails, the database should -// be rolled back. -// -// The third argument to this function, aOvflSpace, is a pointer to a -// buffer big enough to hold one page. If while inserting cells into the parent -// page (pParent) the parent page becomes overfull, this buffer is -// used to store the parent's overflow cells. Because this function inserts -// a maximum of four divider cells into the parent page, and the maximum -// size of a cell stored within an internal node is always less than 1/4 -// of the page-size, the aOvflSpace[] buffer is guaranteed to be large -// enough for all overflow cells. -// -// If aOvflSpace is set to a null pointer, this function returns -// SQLITE_NOMEM. +// C comment +// /* +// ** This routine redistributes cells on the iParentIdx'th child of pParent +// ** (hereafter "the page") and up to 2 siblings so that all pages have about the +// ** same amount of free space. Usually a single sibling on either side of the +// ** page are used in the balancing, though both siblings might come from one +// ** side if the page is the first or last child of its parent. If the page +// ** has fewer than 2 siblings (something which can only happen if the page +// ** is a root page or a child of a root page) then all available siblings +// ** participate in the balancing. +// ** +// ** The number of siblings of the page might be increased or decreased by +// ** one or two in an effort to keep pages nearly full but not over full. +// ** +// ** Note that when this routine is called, some of the cells on the page +// ** might not actually be stored in MemPage.aData[]. This can happen +// ** if the page is overfull. This routine ensures that all cells allocated +// ** to the page and its siblings fit into MemPage.aData[] before returning. +// ** +// ** In the course of balancing the page and its siblings, cells may be +// ** inserted into or removed from the parent page (pParent). Doing so +// ** may cause the parent page to become overfull or underfull. If this +// ** happens, it is the responsibility of the caller to invoke the correct +// ** balancing routine to fix this problem (see the balance() routine). +// ** +// ** If this routine fails for any reason, it might leave the database +// ** in a corrupted state. So if this routine fails, the database should +// ** be rolled back. +// ** +// ** The third argument to this function, aOvflSpace, is a pointer to a +// ** buffer big enough to hold one page. If while inserting cells into the parent +// ** page (pParent) the parent page becomes overfull, this buffer is +// ** used to store the parent's overflow cells. Because this function inserts +// ** a maximum of four divider cells into the parent page, and the maximum +// ** size of a cell stored within an internal node is always less than 1/4 +// ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large +// ** enough for all overflow cells. +// ** +// ** If aOvflSpace is set to a null pointer, this function returns +// ** SQLITE_NOMEM. +// */ func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvflSpace *uint8, _isRoot int32, _bBulk int32) (r0 int32) { var _nMaxCells, _nNew, _nOld, _i, _j, _k, _nxDiv, _rc, _leafData, _usableSpace, _pageFlags, _iSpace1, _iOvflSpace, _szScratch, _13_iOff, _17_limit, _29_sz, _42_szRight, _42_szLeft, _42_r, _42_d, _54_iBest, _59_cntOldNext, _59_usableSize, _59_iNew, _59_iOld, _66_sz, _71_iPg, _72_iNew, _72_iOld, _72_nNewCell int32 var _pgno, _77_key uint32 @@ -63077,9 +65815,9 @@ func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvf _rc = i32(0) _iSpace1 = i32(0) _iOvflSpace = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_abDone), i32(0), u64(5)) - *(*int32)(unsafe.Pointer(&(_b.X0))) = i32(0) - *(***uint8)(unsafe.Pointer(&(_b.X2))) = nil + crt.Xmemset(tls, unsafe.Pointer(&_abDone), i32(0), u64(5)) + *(*int32)(unsafe.Pointer(&_b.X0)) = i32(0) + *(***uint8)(unsafe.Pointer(&_b.X2)) = nil _pBt = (*XBtShared)(_pParent.X18) func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 { @@ -63100,7 +65838,7 @@ func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvf } }() func() { - if int32(_pParent.X9) != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pParent.X16))))) + 2*uintptr(i32(0))))) != _iParentIdx { + if int32(_pParent.X9) != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pParent.X16)))) + 2*uintptr(i32(0))))) != _iParentIdx { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66179), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83821))) crt.X__builtin_abort(tls) } @@ -63133,53 +65871,55 @@ _19: _12: _nOld = _i + i32(1) if ((_i + _nxDiv) - int32(_pParent.X9)) == int32(_pParent.X14) { - _pRight = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X19)) + 1*uintptr(int32(_pParent.X6)+i32(8)))) + _pRight = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + 1*uintptr(int32(_pParent.X6)+i32(8)))) goto _21 } - _pRight = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(1))))))))) + _pRight = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(1))))))))) _21: _pgno = _sqlite3Get4byte(tls, _pRight) _22: - _rc = _getAndInitPage(tls, _pBt, _pgno, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld))+8*uintptr(_i))), nil, i32(0)) + _rc = _getAndInitPage(tls, _pBt, _pgno, (**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld))+8*uintptr(_i))), nil, i32(0)) if _rc != 0 { - crt.Xmemset(tls, (unsafe.Pointer)(&_apOld), i32(0), uint64(_i+i32(1))*u64(8)) + crt.Xmemset(tls, unsafe.Pointer(&_apOld), i32(0), uint64(_i+i32(1))*u64(8)) goto _balance_cleanup } { p := &_nMaxCells - *p = (*p) + ((i32(1) + int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i)))).X14)) + int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i)))).X9)) + *p = (*p) + ((i32(1) + int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i)))).X14)) + int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i)))).X9)) sink1(*p) } - if postInc1(&_i, int32(-1)) == i32(0) { + if postInc1(&_i, -1) == i32(0) { goto _23 } - if ((_pParent.X9) != 0) && ((_i + _nxDiv) == int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pParent.X16))))) + 2*uintptr(i32(0)))))) { - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))) = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pParent.X17))))) + 8*uintptr(i32(0)))) - _pgno = _sqlite3Get4byte(tls, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i)))) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pParent.X24)})))(tls, _pParent, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))))) - *(*uint8)(unsafe.Pointer(&(_pParent.X9))) = uint8(i32(0)) + if (_pParent.X9 != 0) && ((_i + _nxDiv) == int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pParent.X16)))) + 2*uintptr(i32(0)))))) { + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))) = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_pParent.X17)))) + 8*uintptr(i32(0)))) + _pgno = _sqlite3Get4byte(tls, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i)))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pParent.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pParent, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))))) + *(*uint8)(unsafe.Pointer(&_pParent.X9)) = uint8(i32(0)) goto _28 } - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(1))))))))) - _pgno = _sqlite3Get4byte(tls, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i)))) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pParent.X24)})))(tls, _pParent, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))))) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(1))))))))) + _pgno = _sqlite3Get4byte(tls, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i)))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pParent.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pParent, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))))) if (int32(_pBt.X10) & i32(4)) == 0 { goto _29 } - _13_iOff = int32(int64(crt.P2U(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))))))) - int32(int64(crt.P2U(unsafe.Pointer(_pParent.X19)))) - if (_13_iOff + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))))) > int32(_pBt.X16) { + _13_iOff = int32(int64(crt.P2U(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))))))) - int32(int64(crt.P2U(unsafe.Pointer(_pParent.X19)))) + if (_13_iOff + (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))))) > int32(_pBt.X16) { _rc = _sqlite3CorruptError(tls, i32(66253)) - crt.Xmemset(tls, (unsafe.Pointer)(&_apOld), i32(0), uint64(_i+i32(1))*u64(8)) + crt.Xmemset(tls, unsafe.Pointer(&_apOld), i32(0), uint64(_i+i32(1))*u64(8)) goto _balance_cleanup } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace))+1*uintptr(_13_iOff)))), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i)))), uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))))) - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace)) + 1*uintptr(int64((uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i)))))-uintptr(unsafe.Pointer(_pParent.X19)))/1)))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOvflSpace))+1*uintptr(_13_iOff)))), unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i)))), uint64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))))) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOvflSpace)) + 1*uintptr(int64((uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i)))))-uintptr(unsafe.Pointer(_pParent.X19)))/1)))) _29: - _dropCell(tls, _pParent, (_i+_nxDiv)-int32(_pParent.X9), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))), &_rc) + _dropCell(tls, _pParent, (_i+_nxDiv)-int32(_pParent.X9), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))), &_rc) _28: goto _22 _23: @@ -63191,20 +65931,20 @@ _23: crt.X__builtin_abort(tls) } }() - *(***uint8)(unsafe.Pointer(&(_b.X2))) = (**uint8)(_sqlite3ScratchMalloc(tls, _szScratch)) - if (_b.X2) == nil { + *(***uint8)(unsafe.Pointer(&_b.X2)) = (**uint8)(_sqlite3ScratchMalloc(tls, _szScratch)) + if _b.X2 == nil { _rc = _sqlite3NomemError(tls, i32(66282)) goto _balance_cleanup } - *(**uint16)(unsafe.Pointer(&(_b.X3))) = (*uint16)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_nMaxCells))))) - _aSpace1 = (*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_nMaxCells))))) + *(**uint16)(unsafe.Pointer(&_b.X3)) = (*uint16)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_nMaxCells))))) + _aSpace1 = (*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_nMaxCells))))) func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_aSpace1))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66287), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83930))) crt.X__builtin_abort(tls) } }() - *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X1))))) = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(i32(0)))) + *(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_b.X1)))) = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(i32(0)))) _leafCorrection = uint16(int32((*XMemPage)(_b.X1).X5) * i32(4)) _leafData = int32((*XMemPage)(_b.X1).X3) _i = i32(0) @@ -63212,32 +65952,32 @@ _37: if _i >= _nOld { goto _40 } - _17_pOld = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i))) + _17_pOld = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i))) _17_limit = int32(_17_pOld.X14) _17_aData = _17_pOld.X19 _17_maskPage = _17_pOld.X15 _17_piCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(_17_pOld.X12))) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_pOld.X19)) + 1*uintptr(i32(0))))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0))))) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_pOld.X19)) + 1*uintptr(i32(0))))) != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0))))) { _rc = _sqlite3CorruptError(tls, i32(66320)) goto _balance_cleanup } - crt.Xmemset(tls, (unsafe.Pointer)((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3))+2*uintptr(_b.X0)))), i32(0), u64(2)*uint64(_17_limit+int32(_17_pOld.X9))) + crt.Xmemset(tls, unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3))+2*uintptr(_b.X0)))), i32(0), u64(2)*uint64(_17_limit+int32(_17_pOld.X9))) if int32(_17_pOld.X9) <= i32(0) { goto _42 } - _17_limit = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(i32(0))))) + _17_limit = int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_17_pOld.X16)))) + 2*uintptr(i32(0))))) _j = i32(0) _43: if _j >= _17_limit { goto _46 } - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(1))))))))) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_piCell)) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_piCell)) + 1*uintptr(i32(1))))))))) { p := &_17_piCell - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink13(*p) } - *(*int32)(unsafe.Pointer(&(_b.X0))) += 1 + *(*int32)(unsafe.Pointer(&_b.X0)) += 1 _j += 1 goto _43 _46: @@ -63247,13 +65987,13 @@ _47: goto _50 } func() { - if _k != i32(0) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(_k-i32(1)))))+i32(1)) != int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(_k)))) { + if _k != i32(0) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_17_pOld.X16)))) + 2*uintptr(_k-i32(1)))))+i32(1)) != int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_17_pOld.X16)))) + 2*uintptr(_k)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66350), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83960))) crt.X__builtin_abort(tls) } }() - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0))) = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_17_pOld.X17))))) + 8*uintptr(_k))) - *(*int32)(unsafe.Pointer(&(_b.X0))) += 1 + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0))) = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_17_pOld.X17)))) + 8*uintptr(_k))) + *(*int32)(unsafe.Pointer(&_b.X0)) += 1 _k += 1 goto _47 _50: @@ -63262,33 +66002,33 @@ _42: _54: if crt.P2U(unsafe.Pointer(_17_piCell)) < crt.P2U(unsafe.Pointer(_17_piEnd)) { func() { - if (_b.X0) >= _nMaxCells { + if _b.X0 >= _nMaxCells { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66357), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84005))) crt.X__builtin_abort(tls) } }() - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(1))))))))) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_piCell)) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_piCell)) + 1*uintptr(i32(1))))))))) { p := &_17_piCell - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink13(*p) } - *(*int32)(unsafe.Pointer(&(_b.X0))) += 1 + *(*int32)(unsafe.Pointer(&_b.X0)) += 1 goto _54 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_i))) = _b.X0 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_i))) = _b.X0 if _i >= (_nOld-i32(1)) || _leafData != 0 { goto _59 } - _23_sz = uint16(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))) + _23_sz = uint16(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i)))) func() { - if (_b.X0) >= _nMaxCells { + if _b.X0 >= _nMaxCells { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66367), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84005))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) = _23_sz - _23_pTemp = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1)) + 1*uintptr(_iSpace1))) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0))) = _23_sz + _23_pTemp = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSpace1)) + 1*uintptr(_iSpace1))) { p := &_iSpace1 *p = (*p) + int32(_23_sz) @@ -63306,16 +66046,16 @@ _54: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_23_pTemp), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 8*uintptr(_i)))), uint64(_23_sz)) - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pTemp)) + uintptr(_leafCorrection))) + crt.Xmemcpy(tls, unsafe.Pointer(_23_pTemp), unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apDiv)) + 8*uintptr(_i)))), uint64(_23_sz)) + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pTemp)) + uintptr(_leafCorrection))) func() { if int32(_leafCorrection) != i32(0) && int32(_leafCorrection) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66375), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84074))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) = uint16(int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) - int32(_leafCorrection)) - if (_17_pOld.X5) == 0 { + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0))) = uint16(int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0)))) - int32(_leafCorrection)) + if _17_pOld.X5 == 0 { func() { if int32(_leafCorrection) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66378), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84113))) @@ -63328,7 +66068,7 @@ _54: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_pOld.X19))+1*uintptr(i32(8))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_pOld.X19))+1*uintptr(i32(8))))), uint64(i32(4))) goto _74 } func() { @@ -63338,53 +66078,54 @@ _54: } }() _77: - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) < i32(4) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0)))) < i32(4) { func() { - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) != i32(3) && (_sqlite3Config.X6) != i32(0) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0)))) != i32(3) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66388), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84168))) crt.X__builtin_abort(tls) } }() func() { - if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_b.X0)))) != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1))+1*uintptr(_iSpace1-i32(3)))) && (_sqlite3Config.X6) != i32(0) { + if (*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_b.X0)))) != (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSpace1))+1*uintptr(_iSpace1-i32(3)))) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66389), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84203))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1)) + 1*uintptr(postInc1(&_iSpace1, int32(1))))) = uint8(i32(0)) - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) += 1 + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSpace1)) + 1*uintptr(postInc1(&_iSpace1, 1)))) = uint8(i32(0)) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_b.X0))) += 1 goto _77 } _74: - *(*int32)(unsafe.Pointer(&(_b.X0))) += 1 + *(*int32)(unsafe.Pointer(&_b.X0)) += 1 _59: _i += 1 goto _37 _40: - _usableSpace = int32(((_pBt.X16) - uint32(i32(12))) + uint32(_leafCorrection)) + _usableSpace = int32((_pBt.X16 - uint32(i32(12))) + uint32(_leafCorrection)) _i = i32(0) _85: if _i >= _nOld { goto _88 } - _27_p = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i))) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = _usableSpace - int32(_27_p.X13) + _27_p = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) = _usableSpace - int32(_27_p.X13) _j = i32(0) _89: if _j >= int32(_27_p.X9) { goto _92 } { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) - *p = (*p) + (i32(2) + int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_27_p.X24)})))(tls, _27_p, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_27_p.X17))))) + 8*uintptr(_j)))))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) + *p = (*p) + (i32(2) + int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _27_p.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _27_p, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]*uint8)(unsafe.Pointer(&_27_p.X17)))) + 8*uintptr(_j)))))) sink1(*p) } _j += 1 goto _89 _92: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_i))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_i))) _i += 1 goto _85 _88: @@ -63395,7 +66136,7 @@ _93: goto _96 } _97: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))) <= _usableSpace { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i)))) <= _usableSpace { goto _98 } if (_i + i32(1)) < _k { @@ -63406,70 +66147,70 @@ _97: _rc = _sqlite3CorruptError(tls, i32(66429)) goto _balance_cleanup } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_k-i32(1)))) = i32(0) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_k-i32(1)))) = _b.X0 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_k-i32(1)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_k-i32(1)))) = _b.X0 _99: - _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))))-i32(1))) + _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))))-i32(1))) { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) *p = (*p) - _29_sz sink1(*p) } if _leafData != 0 { goto _101 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) < (_b.X0) { - _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))))) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i)))) < _b.X0 { + _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))))) goto _103 } _29_sz = i32(0) _103: _101: { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i+i32(1)))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i+i32(1)))) *p = (*p) + _29_sz sink1(*p) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) -= 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))) -= 1 goto _97 _98: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) >= (_b.X0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i)))) >= _b.X0 { goto _105 } - _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))))) - if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))) + _29_sz) > _usableSpace { + _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))))) + if ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i)))) + _29_sz) > _usableSpace { goto _105 } { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) *p = (*p) + _29_sz sink1(*p) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))) += 1 if _leafData != 0 { goto _107 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) < (_b.X0) { - _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))))) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i)))) < _b.X0 { + _29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))))) goto _109 } _29_sz = i32(0) _109: _107: { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i+i32(1)))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i+i32(1)))) *p = (*p) - _29_sz sink1(*p) } goto _98 _105: - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) >= (_b.X0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i)))) >= _b.X0 { _k = _i + i32(1) goto _114 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) <= func() int32 { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i)))) <= func() int32 { if _i > i32(0) { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1))))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i-i32(1))))) } return i32(0) }() { @@ -63485,9 +66226,9 @@ _115: if _i <= i32(0) { goto _118 } - _42_szRight = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) - _42_szLeft = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i-i32(1)))) - _42_r = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1))))) - i32(1) + _42_szRight = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) + _42_szLeft = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i-i32(1)))) + _42_r = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i-i32(1))))) - i32(1) _42_d = (_42_r + i32(1)) - _leafData _cachedCellSize(tls, &_b, _42_d) _119: @@ -63504,7 +66245,7 @@ _119: } }() _cachedCellSize(tls, &_b, _42_r) - if (_42_szRight != i32(0)) && (_bBulk != 0 || (((_42_szRight + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_d))))) + i32(2)) > (_42_szLeft - (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_r)))) + func() int32 { + if (_42_szRight != i32(0)) && (_bBulk != 0 || (((_42_szRight + int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_42_d))))) + i32(2)) > (_42_szLeft - (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_42_r)))) + func() int32 { if _i == (_k - i32(1)) { return i32(0) } @@ -63514,26 +66255,26 @@ _119: } { p := &_42_szRight - *p = (*p) + (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_d)))) + i32(2)) + *p = (*p) + (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_42_d)))) + i32(2)) sink1(*p) } { p := &_42_szLeft - *p = (*p) - (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_r)))) + i32(2)) + *p = (*p) - (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_42_r)))) + i32(2)) sink1(*p) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1)))) = _42_r + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i-i32(1)))) = _42_r _42_r -= 1 _42_d -= 1 if _42_r >= i32(0) { goto _119 } _129: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = _42_szRight - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i-i32(1)))) = _42_szLeft - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1))))) <= func() int32 { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i))) = _42_szRight + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_i-i32(1)))) = _42_szLeft + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i-i32(1))))) <= func() int32 { if _i > i32(1) { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(2))))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i-i32(2))))) } return i32(0) }() { @@ -63544,12 +66285,12 @@ _129: goto _115 _118: func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(i32(0))))) <= i32(0) && ((_pParent.X4) != uint32(i32(1)) || int32(_pParent.X14) != i32(0)) && (_sqlite3Config.X6) != i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(i32(0))))) <= i32(0) && (_pParent.X4 != uint32(i32(1)) || int32(_pParent.X14) != i32(0)) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66516), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84280))) crt.X__builtin_abort(tls) } }() - _pageFlags = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0))))) + _pageFlags = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0))))) _i = i32(0) _138: if _i >= _k { @@ -63558,8 +66299,8 @@ _138: if _i >= _nOld { goto _142 } - _46_pNew = store52((**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew))+8*uintptr(_i))), *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i)))) - *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i))) = nil + _46_pNew = store52((**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew))+8*uintptr(_i))), *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i)))) + *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i))) = nil _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_46_pNew.X23)) _nNew += 1 if _rc != 0 { @@ -63583,10 +66324,10 @@ _142: goto _balance_cleanup } _zeroPage(tls, _46_pNew, _pageFlags) - *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i))) = _46_pNew + *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i))) = _46_pNew _nNew += 1 - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_i))) = _b.X0 - if (_pBt.X5) == 0 { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_i))) = _b.X0 + if _pBt.X5 == 0 { goto _150 } _ptrmapPut(tls, _pBt, _46_pNew.X4, uint8(i32(5)), _pParent.X4, &_rc) @@ -63603,16 +66344,16 @@ _152: if _i >= _nNew { goto _155 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_i))) = store5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno))+4*uintptr(_i))), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X4) - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgFlags)) + 2*uintptr(_i))) = (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X23).X6 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgOrder)) + 4*uintptr(_i))) = store5((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgno))+4*uintptr(_i))), (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X4) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgFlags)) + 2*uintptr(_i))) = (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X23).X6 _j = i32(0) _156: if _j >= _i { goto _159 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_j)))) == (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_i)))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgno)) + 4*uintptr(_j)))) == (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgno)) + 4*uintptr(_i)))) { func() { - if (_sqlite3Config.X6) != i32(0) { + if _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66577), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84349))) crt.X__builtin_abort(tls) } @@ -63637,22 +66378,22 @@ _167: if _j >= _nNew { goto _170 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_j)))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest)))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgOrder)) + 4*uintptr(_j)))) < (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgOrder)) + 4*uintptr(_54_iBest)))) { _54_iBest = _j } _j += 1 goto _167 _170: - _pgno = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest))) = u32(4294967295) + _pgno = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgOrder)) + 4*uintptr(_54_iBest))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgOrder)) + 4*uintptr(_54_iBest))) = u32(4294967295) if _54_iBest == _i { goto _172 } if _54_iBest > _i { - _sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_54_iBest)))).X23), ((_pBt.X18)+uint32(_54_iBest))+uint32(i32(1)), uint16(i32(0))) + _sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_54_iBest)))).X23), (_pBt.X18+uint32(_54_iBest))+uint32(i32(1)), uint16(i32(0))) } - _sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X23), _pgno, *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgFlags)) + 2*uintptr(_54_iBest)))) - *(*uint32)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X4))) = _pgno + _sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X23), _pgno, *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgFlags)) + 2*uintptr(_54_iBest)))) + *(*uint32)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X4))) = _pgno _172: _i += 1 goto _163 @@ -63663,20 +66404,20 @@ _166: crt.X__builtin_abort(tls) } }() - _sqlite3Put4byte(tls, _pRight, (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_nNew-i32(1))))).X4) + _sqlite3Put4byte(tls, _pRight, (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_nNew-i32(1))))).X4) if ((_pageFlags & i32(8)) == i32(0)) && (_nOld != _nNew) { - _58_pOld = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() **XMemPage { + _58_pOld = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(func() **XMemPage { if _nNew > _nOld { return (**XMemPage)(unsafe.Pointer(&_apNew)) } return (**XMemPage)(unsafe.Pointer(&_apOld)) }())) + 8*uintptr(_nOld-i32(1)))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_nNew-i32(1))))).X19))+1*uintptr(i32(8))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_58_pOld.X19))+1*uintptr(i32(8))))), uint64(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_nNew-i32(1))))).X19))+1*uintptr(i32(8))))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_58_pOld.X19))+1*uintptr(i32(8))))), uint64(i32(4))) } - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _180 } - _59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0)))) + _59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0)))) _59_aOld = _59_pNew.X19 _59_cntOldNext = int32(_59_pNew.X14) + int32(_59_pNew.X9) _59_usableSize = int32(_pBt.X16) @@ -63684,16 +66425,16 @@ _166: _59_iOld = i32(0) _i = i32(0) _181: - if _i >= (_b.X0) { + if _i >= _b.X0 { goto _184 } - _60_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_i))) + _60_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_i))) if _i == _59_cntOldNext { _61_pOld = func() *XMemPage { if preInc1(&_59_iOld, 1) < _nNew { - return (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_59_iOld)))) + return (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_59_iOld)))) } - return (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_59_iOld)))) + return (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_59_iOld)))) }() { p := &_59_cntOldNext @@ -63702,15 +66443,15 @@ _181: } _59_aOld = _61_pOld.X19 } - if _i != (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_59_iNew)))) { + if _i != (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_59_iNew)))) { goto _188 } - _59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(preInc1(&_59_iNew, 1)))) + _59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(preInc1(&_59_iNew, 1)))) if _leafData == 0 { goto _182 } _188: - if _59_iOld < _nNew && (_59_pNew.X4) == (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_59_iOld)))) && (uint64(crt.P2U(unsafe.Pointer(_60_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_59_aOld))) && uint64(crt.P2U(unsafe.Pointer(_60_pCell))) < uint64(crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_59_aOld))+1*uintptr(_59_usableSize))))))) { + if _59_iOld < _nNew && _59_pNew.X4 == (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aPgno)) + 4*uintptr(_59_iOld)))) && (uint64(crt.P2U(unsafe.Pointer(_60_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_59_aOld))) && uint64(crt.P2U(unsafe.Pointer(_60_pCell))) < uint64(crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_59_aOld))+1*uintptr(_59_usableSize))))))) { goto _193 } if _leafCorrection == 0 { @@ -63733,8 +66474,8 @@ _197: if _i >= (_nNew - i32(1)) { goto _200 } - _66_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i))) - _j = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) + _66_pNew = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i))) + _j = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_i))) func() { if _j >= _nMaxCells { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66688), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84360))) @@ -63742,43 +66483,45 @@ _197: } }() func() { - if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_j)))) == nil { + if (*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_j)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66689), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84372))) crt.X__builtin_abort(tls) } }() - _66_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_j))) - _66_sz = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_j)))) + int32(_leafCorrection) - _66_pTemp = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace)) + 1*uintptr(_iOvflSpace))) - if (_66_pNew.X5) == 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_pNew.X19))+1*uintptr(i32(8))))), (unsafe.Pointer)(_66_pCell), uint64(i32(4))) + _66_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_j))) + _66_sz = int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_j)))) + int32(_leafCorrection) + _66_pTemp = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOvflSpace)) + 1*uintptr(_iOvflSpace))) + if _66_pNew.X5 == 0 { + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_66_pNew.X19))+1*uintptr(i32(8))))), unsafe.Pointer(_66_pCell), uint64(i32(4))) goto _208 } if _leafData != 0 { _j -= 1 - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_66_pNew.X25)})))(tls, _66_pNew, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 8*uintptr(_j))), &_68_info) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _66_pNew.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _66_pNew, *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X2)) + 8*uintptr(_j))), &_68_info) _66_pCell = _66_pTemp - _66_sz = i32(4) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_pCell))+1*uintptr(i32(4)))), uint64(_68_info.X0)) + _66_sz = i32(4) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_66_pCell))+1*uintptr(i32(4)))), uint64(_68_info.X0)) _66_pTemp = nil goto _208 } { p := &_66_pCell - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(4)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(i32(4)))) sink13(*p) } - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_j)))) == i32(4) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_b.X3)) + 2*uintptr(_j)))) == i32(4) { func() { if int32(_leafCorrection) != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66721), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84150))) crt.X__builtin_abort(tls) } }() - _66_sz = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pParent.X24)})))(tls, _pParent, _66_pCell)) + _66_sz = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pParent.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pParent, _66_pCell)) } _208: { @@ -63828,52 +66571,52 @@ _219: crt.X__builtin_abort(tls) } }() - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg)))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_abDone)) + 1*uintptr(_71_iPg)))) != 0 { goto _220 } - if _i < i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) { + if _i < i32(0) && (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) { goto _230 } func() { - if _71_iPg != i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg-i32(1))))) == 0 { + if _71_iPg != i32(0) && (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) && (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_abDone)) + 1*uintptr(_71_iPg-i32(1))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66768), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84439))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg)))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg)))) && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg+i32(1))))) == 0 { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_71_iPg)))) < (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_71_iPg)))) && (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_abDone)) + 1*uintptr(_71_iPg+i32(1))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66772), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84495))) crt.X__builtin_abort(tls) } }() if _71_iPg == i32(0) { _72_iNew = store1(&_72_iOld, i32(0)) - _72_nNewCell = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(i32(0)))) + _72_nNewCell = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(i32(0)))) goto _239 } _72_iOld = func() int32 { if _71_iPg < _nOld { - return ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0)) + return ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0)) } - return (_b.X0) + return _b.X0 }() - _72_iNew = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0) - _72_nNewCell = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg)))) - _72_iNew + _72_iNew = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0) + _72_nNewCell = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cntNew)) + 4*uintptr(_71_iPg)))) - _72_iNew _239: - _rc = _editPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_71_iPg))), _72_iOld, _72_iNew, _72_nNewCell, &_b) + _rc = _editPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_71_iPg))), _72_iOld, _72_iNew, _72_nNewCell, &_b) if _rc != 0 { goto _balance_cleanup } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg))) += 1 - *(*uint16)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_71_iPg)))).X13))) = uint16(_usableSpace - (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_71_iPg))))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_abDone)) + 1*uintptr(_71_iPg))) += 1 + *(*uint16)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_71_iPg)))).X13))) = uint16(_usableSpace - (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_szNew)) + 4*uintptr(_71_iPg))))) func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_71_iPg)))).X9) != i32(0) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_71_iPg)))).X9) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66787), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84537))) crt.X__builtin_abort(tls) } }() func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_71_iPg)))).X14) != _72_nNewCell { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_71_iPg)))).X14) != _72_nNewCell { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66788), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84562))) crt.X__builtin_abort(tls) } @@ -63884,7 +66627,7 @@ _220: goto _219 _222: func() { - if crt.Xmemcmp(tls, (unsafe.Pointer)(&_abDone), (unsafe.Pointer)(str(84590)), uint64(_nNew)) != i32(0) { + if crt.Xmemcmp(tls, unsafe.Pointer(&_abDone), unsafe.Pointer(str(84590)), uint64(_nNew)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66793), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84596))) crt.X__builtin_abort(tls) } @@ -63901,25 +66644,25 @@ _222: crt.X__builtin_abort(tls) } }() - if (_isRoot != 0 && (int32(_pParent.X14) == i32(0))) && (int32(_pParent.X6) <= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X13)) { + if (_isRoot != 0 && (int32(_pParent.X14) == i32(0))) && (int32(_pParent.X6) <= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X13)) { func() { - if _nNew != i32(1) && (_sqlite3Config.X6) != i32(0) { + if _nNew != i32(1) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66814), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84653))) crt.X__builtin_abort(tls) } }() - _rc = _defragmentPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0)))), i32(-1)) + _rc = _defragmentPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0)))), i32(-1)) func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X13) != ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X19))+1*uintptr(i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X19))+1*uintptr(i32(5)))))) + 1*uintptr(i32(1))))))-int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X12))-(int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0))))).X14)*i32(2))) && _rc == i32(0) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X13) != ((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X19))+1*uintptr(i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X19))+1*uintptr(i32(5)))))) + 1*uintptr(i32(1))))))-int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X12))-(int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0))))).X14)*i32(2))) && _rc == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66817), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84675))) crt.X__builtin_abort(tls) } }() - _copyNodeContent(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0)))), _pParent, &_rc) - _freePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(i32(0)))), &_rc) + _copyNodeContent(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0)))), _pParent, &_rc) + _freePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(i32(0)))), &_rc) goto _264 } - if (_pBt.X5) == 0 || _leafCorrection != 0 { + if _pBt.X5 == 0 || _leafCorrection != 0 { goto _264 } _i = i32(0) @@ -63927,14 +66670,14 @@ _265: if _i >= _nNew { goto _268 } - _77_key = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X19))+1*uintptr(i32(8))))) - _ptrmapPut(tls, _pBt, _77_key, uint8(i32(5)), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))).X4, &_rc) + _77_key = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X19))+1*uintptr(i32(8))))) + _ptrmapPut(tls, _pBt, _77_key, uint8(i32(5)), (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))).X4, &_rc) _i += 1 goto _265 _268: _264: func() { - if (_pParent.X0) == 0 { + if _pParent.X0 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66833), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84782))) crt.X__builtin_abort(tls) } @@ -63944,17 +66687,17 @@ _271: if _i >= _nOld { goto _balance_cleanup } - _freePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i))), &_rc) + _freePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i))), &_rc) _i += 1 goto _271 _balance_cleanup: - _sqlite3ScratchFree(tls, (unsafe.Pointer)(_b.X2)) + _sqlite3ScratchFree(tls, unsafe.Pointer(_b.X2)) _i = i32(0) _275: if _i >= _nOld { goto _278 } - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 8*uintptr(_i)))) + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apOld)) + 8*uintptr(_i)))) _i += 1 goto _275 _278: @@ -63963,7 +66706,7 @@ _279: if _i >= _nNew { goto _282 } - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 8*uintptr(_i)))) + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apNew)) + 8*uintptr(_i)))) _i += 1 goto _279 _282: @@ -63990,12 +66733,15 @@ func init() { crt.Xstrncpy(nil, &_balance_nonrootØ00__func__Ø000[0], str(84798), 16) } -// Allocate memory that is to be used and released right away. -// This routine is similar to alloca() in that it is not intended -// for situations where the memory might be held long-term. This -// routine is intended to get memory to old large transient data -// structures that would not normally fit on the stack of an -// embedded processor. +// C comment +// /* +// ** Allocate memory that is to be used and released right away. +// ** This routine is similar to alloca() in that it is not intended +// ** for situations where the memory might be held long-term. This +// ** routine is intended to get memory to old large transient data +// ** structures that would not normally fit on the stack of an +// ** embedded processor. +// */ func _sqlite3ScratchMalloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) { var _p unsafe.Pointer func() { @@ -64006,17 +66752,17 @@ func _sqlite3ScratchMalloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) { }() Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _sqlite3StatusHighwater(tls, i32(8), _n) - if ((_mem0.X4) != 0) && ((_sqlite3Config.X20) >= _n) { + if (_mem0.X4 != 0) && (_sqlite3Config.X20 >= _n) { _p = _mem0.X3 - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = (*Xsqlite3_file)((*Xsqlite3_file)(_mem0.X3).X0) - *(*uint32)(unsafe.Pointer(&(_mem0.X4))) -= 1 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem0.X3)))) = (*Xsqlite3_file)((*Xsqlite3_file)(_mem0.X3).X0) + *(*uint32)(unsafe.Pointer(&_mem0.X4)) -= 1 _sqlite3StatusUp(tls, i32(3), i32(1)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) goto _4 } Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) _p = _sqlite3Malloc(tls, uint64(_n)) - if (_sqlite3Config.X0) != 0 && (_p != nil) { + if _sqlite3Config.X0 != 0 && (_p != nil) { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _sqlite3StatusUp(tls, i32(4), _sqlite3MallocSize(tls, _p)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) @@ -64039,13 +66785,13 @@ func init() { func _cachedCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) { func() { - if _N < i32(0) || _N >= (_p.X0) { + if _N < i32(0) || _N >= _p.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65577), unsafe.Pointer((*int8)(unsafe.Pointer(&_cachedCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84869))) crt.X__builtin_abort(tls) } }() - if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))) != 0 { - return *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N))) + if (*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_N)))) != 0 { + return *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_N))) } return _computeCellSize(tls, _p, _N) } @@ -64056,24 +66802,28 @@ func init() { crt.Xstrncpy(nil, &_cachedCellSizeØ00__func__Ø000[0], str(84888), 15) } -// Return the size of the Nth element of the cell array +// C comment +// /* +// ** Return the size of the Nth element of the cell array +// */ func _computeCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) { func() { - if _N < i32(0) || _N >= (_p.X0) { + if _N < i32(0) || _N >= _p.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65571), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84869))) crt.X__builtin_abort(tls) } }() func() { - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))) != i32(0) { + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_N)))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65572), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84903))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N))) = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(_N)))) - return *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N))) + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_N))) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := (*XMemPage)(_p.X1).X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(_N)))) + return *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_N))) } var _computeCellSizeØ00__func__Ø000 [16]int8 @@ -64082,18 +66832,21 @@ func init() { crt.Xstrncpy(nil, &_computeCellSizeØ00__func__Ø000[0], str(84919), 16) } -// The page handle passed as the first argument refers to a dirty page -// with a page number other than iNew. This function changes the page's -// page number to iNew and sets the value of the PgHdr.flags field to -// the value passed as the third parameter. +// C comment +// /* +// ** The page handle passed as the first argument refers to a dirty page +// ** with a page number other than iNew. This function changes the page's +// ** page number to iNew and sets the value of the PgHdr.flags field to +// ** the value passed as the third parameter. +// */ func _sqlite3PagerRekey(tls *crt.TLS, _pPg *XPgHdr, _iNew uint32, _flags uint16) { func() { - if (_pPg.X5) == _iNew { + if _pPg.X5 == _iNew { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54015), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerRekeyØ00__func__Ø000))), unsafe.Pointer(str(84935))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pPg.X6))) = _flags + *(*uint16)(unsafe.Pointer(&_pPg.X6)) = _flags _sqlite3PcacheMove(tls, _pPg, _iNew) } @@ -64103,30 +66856,33 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerRekeyØ00__func__Ø000[0], str(84951), 18) } -// apCell[] and szCell[] contains pointers to and sizes of all cells in the -// pages being balanced. The current page, pPg, has pPg->nCell cells starting -// with apCell[iOld]. After balancing, this page should hold nNew cells -// starting at apCell[iNew]. -// -// This routine makes the necessary adjustments to pPg so that it contains -// the correct cells after being balanced. -// -// The pPg->nFree field is invalid when this function returns. It is the -// responsibility of the caller to set it correctly. +// C comment +// /* +// ** apCell[] and szCell[] contains pointers to and sizes of all cells in the +// ** pages being balanced. The current page, pPg, has pPg->nCell cells starting +// ** with apCell[iOld]. After balancing, this page should hold nNew cells +// ** starting at apCell[iNew]. +// ** +// ** This routine makes the necessary adjustments to pPg so that it contains +// ** the correct cells after being balanced. +// ** +// ** The pPg->nFree field is invalid when this function returns. It is the +// ** responsibility of the caller to set it correctly. +// */ func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int32, _pCArray *XCellArray) (r0 int32) { var _hdr, _nCell, _i, _iOldEnd, _iNewEnd, _1_nShift, _3_nAdd, _4_iCell, _6_iOff int32 var _aData, _pBegin, _pData, _pCellptr, _pTmp, _6_pCell *uint8 _aData = _pPg.X19 _hdr = int32(_pPg.X6) - _pBegin = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_nNew*i32(2)))) + _pBegin = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21)) + 1*uintptr(_nNew*i32(2)))) _nCell = int32(_pPg.X14) _iOldEnd = (_iOld + int32(_pPg.X14)) + int32(_pPg.X9) _iNewEnd = _iNew + _nNew _pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.X18).X0))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTmp), (unsafe.Pointer)(_aData), uint64((*XBtShared)(_pPg.X18).X16)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTmp), unsafe.Pointer(_aData), uint64((*XBtShared)(_pPg.X18).X16)) if _iOld < _iNew { _1_nShift = _pageFreeArray(tls, _pPg, _iOld, _iNew-_iOld, _pCArray) - crt.Xmemmove(tls, (unsafe.Pointer)(_pPg.X21), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_1_nShift*i32(2))))), uint64(_nCell*i32(2))) + crt.Xmemmove(tls, unsafe.Pointer(_pPg.X21), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21))+1*uintptr(_1_nShift*i32(2))))), uint64(_nCell*i32(2))) { p := &_nCell *p = (*p) - _1_nShift @@ -64140,7 +66896,7 @@ func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int sink1(*p) } } - _pData = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))))-i32(1))&i32(65535))+i32(1)))) + _pData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1))))))-i32(1))&i32(65535))+i32(1)))) if crt.P2U(unsafe.Pointer(_pData)) < crt.P2U(unsafe.Pointer(_pBegin)) { goto _editpage_fail } @@ -64154,13 +66910,13 @@ func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int return (_iOld - _iNew) }() func() { - if (_iOld-_iNew) >= _nNew && _nCell != i32(0) && (_sqlite3Config.X6) != i32(0) { + if (_iOld-_iNew) >= _nNew && _nCell != i32(0) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65805), unsafe.Pointer((*int8)(unsafe.Pointer(&_editPageØ00__func__Ø000))), unsafe.Pointer(str(84969))) crt.X__builtin_abort(tls) } }() _pCellptr = _pPg.X21 - crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr))+1*uintptr(_3_nAdd*i32(2))))), (unsafe.Pointer)(_pCellptr), uint64(_nCell*i32(2))) + crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellptr))+1*uintptr(_3_nAdd*i32(2))))), unsafe.Pointer(_pCellptr), uint64(_nCell*i32(2))) if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew, _3_nAdd, _pCArray) != 0 { goto _editpage_fail } @@ -64175,12 +66931,12 @@ _11: if _i >= int32(_pPg.X9) { goto _14 } - _4_iCell = (_iOld + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPg.X16))))) + 2*uintptr(_i))))) - _iNew + _4_iCell = (_iOld + int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint16)(unsafe.Pointer(&_pPg.X16)))) + 2*uintptr(_i))))) - _iNew if _4_iCell < i32(0) || _4_iCell >= _nNew { goto _16 } - _pCellptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_4_iCell*i32(2)))) - crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr))+1*uintptr(i32(2))))), (unsafe.Pointer)(_pCellptr), uint64((_nCell-_4_iCell)*i32(2))) + _pCellptr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21)) + 1*uintptr(_4_iCell*i32(2)))) + crt.Xmemmove(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellptr))+1*uintptr(i32(2))))), unsafe.Pointer(_pCellptr), uint64((_nCell-_4_iCell)*i32(2))) _nCell += 1 if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _4_iCell+_iNew, i32(1), _pCArray) != 0 { goto _editpage_fail @@ -64189,34 +66945,35 @@ _16: _i += 1 goto _11 _14: - _pCellptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_nCell*i32(2)))) + _pCellptr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21)) + 1*uintptr(_nCell*i32(2)))) if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew+_nCell, _nNew-_nCell, _pCArray) != 0 { goto _editpage_fail } - *(*uint16)(unsafe.Pointer(&(_pPg.X14))) = uint16(_nNew) - *(*uint8)(unsafe.Pointer(&(_pPg.X9))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8))) + *(*uint16)(unsafe.Pointer(&_pPg.X14)) = uint16(_nNew) + *(*uint8)(unsafe.Pointer(&_pPg.X9)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8))) return _aData }()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPg.X14) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) return _aData }()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(int64((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1)) _i = i32(0) _19: - if _i >= _nNew || (_sqlite3Config.X6) == i32(0) { + if _i >= _nNew || _sqlite3Config.X6 == i32(0) { goto _23 } - _6_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i+_iNew))) - _6_iOff = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(1))))) - if (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_aData)))) && (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) < uint64(crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr((*XBtShared)(_pPg.X18).X16))))))) { - _6_pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTmp)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_6_pCell))-uintptr(unsafe.Pointer(_aData)))/1)))) + _6_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i+_iNew))) + _6_iOff = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(1))))) + if (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_aData)))) && (uint64(crt.P2U(unsafe.Pointer(_6_pCell))) < uint64(crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr((*XBtShared)(_pPg.X18).X16))))))) { + _6_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTmp)) + 1*uintptr(int64((uintptr(unsafe.Pointer(_6_pCell))-uintptr(unsafe.Pointer(_aData)))/1)))) } func() { - if i32(0) != crt.Xmemcmp(tls, (unsafe.Pointer)(_6_pCell), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_6_iOff)))), uint64((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{((*XMemPage)(_pCArray.X1).X24)})))(tls, (*XMemPage)(_pCArray.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i+_iNew)))))) { + if i32(0) != crt.Xmemcmp(tls, unsafe.Pointer(_6_pCell), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData))+1*uintptr(_6_iOff)))), uint64(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := (*XMemPage)(_pCArray.X1).X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, (*XMemPage)(_pCArray.X1), *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i+_iNew)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65849), unsafe.Pointer((*int8)(unsafe.Pointer(&_editPageØ00__func__Ø000))), unsafe.Pointer(str(85012))) crt.X__builtin_abort(tls) } @@ -64228,22 +66985,25 @@ _23: _editpage_fail: _populateCellCache(tls, _pCArray, _iNew, _nNew) - return _rebuildPage(tls, _pPg, _nNew, (**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2))+8*uintptr(_iNew))), (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X3))+2*uintptr(_iNew)))) -} - -// Array apCell[] contains nCell pointers to b-tree cells. Array szCell -// contains the size in bytes of each such cell. This function adds the -// space associated with each cell in the array that is currently stored -// within the body of pPg to the pPg free-list. The cell-pointers and other -// fields of the page are not updated. -// -// This function returns the total number of cells added to the free-list. + return _rebuildPage(tls, _pPg, _nNew, (**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2))+8*uintptr(_iNew))), (*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X3))+2*uintptr(_iNew)))) +} + +// C comment +// /* +// ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell +// ** contains the size in bytes of each such cell. This function adds the +// ** space associated with each cell in the array that is currently stored +// ** within the body of pPg to the pPg free-list. The cell-pointers and other +// ** fields of the page are not updated. +// ** +// ** This function returns the total number of cells added to the free-list. +// */ func _pageFreeArray(tls *crt.TLS, _pPg *XMemPage, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) { var _nRet, _i, _iEnd, _szFree, _2_sz int32 var _aData, _pEnd, _pStart, _pFree, _1_pCell *uint8 _aData = _pPg.X19 - _pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr((*XBtShared)(_pPg.X18).X16))) - _pStart = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr((int32(_pPg.X6)+i32(8))+int32(_pPg.X7)))) + _pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr((*XBtShared)(_pPg.X18).X16))) + _pStart = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr((int32(_pPg.X6)+i32(8))+int32(_pPg.X7)))) _nRet = i32(0) _iEnd = _iFirst + _nCell _pFree = nil @@ -64253,11 +67013,11 @@ _0: if _i >= _iEnd { goto _3 } - _1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i))) + _1_pCell = *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i))) if uint64(crt.P2U(unsafe.Pointer(_1_pCell))) < uint64(crt.P2U(unsafe.Pointer(_pStart))) || uint64(crt.P2U(unsafe.Pointer(_1_pCell))) >= uint64(crt.P2U(unsafe.Pointer(_pEnd))) { goto _5 } - _2_sz = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X3)) + 2*uintptr(_i)))) + _2_sz = int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X3)) + 2*uintptr(_i)))) func() { if _2_sz <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65732), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000))), unsafe.Pointer(str(85109))) @@ -64319,29 +67079,32 @@ func init() { crt.Xstrncpy(nil, &_editPageØ00__func__Ø000[0], str(85165), 9) } -// Array apCell[] contains nCell pointers to b-tree cells. Array szCell -// contains the size in bytes of each such cell. This function attempts to -// add the cells stored in the array to page pPg. If it cannot (because -// the page needs to be defragmented before the cells will fit), non-zero -// is returned. Otherwise, if the cells are added successfully, zero is -// returned. -// -// Argument pCellptr points to the first entry in the cell-pointer array -// (part of page pPg) to populate. After cell apCell[0] is written to the -// page body, a 16-bit offset is written to pCellptr. And so on, for each -// cell in the array. It is the responsibility of the caller to ensure -// that it is safe to overwrite this part of the cell-pointer array. -// -// When this function is called, *ppData points to the start of the -// content area on page pPg. If the size of the content area is extended, -// *ppData is updated to point to the new start of the content area -// before returning. -// -// Finally, argument pBegin points to the byte immediately following the -// end of the space required by this page for the cell-pointer area (for -// all cells - not just those inserted by the current call). If the content -// area must be extended to before this point in order to accomodate all -// cells in apCell[], then the cells do not fit and non-zero is returned. +// C comment +// /* +// ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell +// ** contains the size in bytes of each such cell. This function attempts to +// ** add the cells stored in the array to page pPg. If it cannot (because +// ** the page needs to be defragmented before the cells will fit), non-zero +// ** is returned. Otherwise, if the cells are added successfully, zero is +// ** returned. +// ** +// ** Argument pCellptr points to the first entry in the cell-pointer array +// ** (part of page pPg) to populate. After cell apCell[0] is written to the +// ** page body, a 16-bit offset is written to pCellptr. And so on, for each +// ** cell in the array. It is the responsibility of the caller to ensure +// ** that it is safe to overwrite this part of the cell-pointer array. +// ** +// ** When this function is called, *ppData points to the start of the +// ** content area on page pPg. If the size of the content area is extended, +// ** *ppData is updated to point to the new start of the content area +// ** before returning. +// ** +// ** Finally, argument pBegin points to the byte immediately following the +// ** end of the space required by this page for the cell-pointer area (for +// ** all cells - not just those inserted by the current call). If the content +// ** area must be extended to before this point in order to accomodate all +// ** cells in apCell[], then the cells do not fit and non-zero is returned. +// */ func _pageInsertArray(tls *crt.TLS, _pPg *XMemPage, _pBegin *uint8, _ppData **uint8, _pCellptr *uint8, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) { var _i, _iEnd, _1_sz, _1_rc int32 var _aData, _pData, _1_pSlot *uint8 @@ -64349,7 +67112,7 @@ func _pageInsertArray(tls *crt.TLS, _pPg *XMemPage, _pBegin *uint8, _ppData **ui _pData = *_ppData _iEnd = _iFirst + _nCell func() { - if (_sqlite3Config.X6) != i32(0) && int32(_pPg.X6) != i32(0) { + if _sqlite3Config.X6 != i32(0) && int32(_pPg.X6) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65677), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000))), unsafe.Pointer(str(85174))) crt.X__builtin_abort(tls) } @@ -64360,7 +67123,7 @@ _3: goto _6 } _1_sz = int32(_cachedCellSize(tls, _pCArray, _i)) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(1))))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(2))))) != i32(0)) && store13(&_1_pSlot, _pageFindSlot(tls, _pPg, _1_sz, &_1_rc)) != nil { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(i32(1))))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aData)) + 1*uintptr(i32(2))))) != i32(0)) && store13(&_1_pSlot, _pageFindSlot(tls, _pPg, _1_sz, &_1_rc)) != nil { goto _9 } if int64((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_pBegin)))/1) < int64(_1_sz) { @@ -64368,25 +67131,25 @@ _3: } { p := &_pData - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_1_sz))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(_1_sz))) sink13(*p) } _1_pSlot = _pData _9: func() { - if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSlot))+uintptr(_1_sz))))) > crt.P2U(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i))))) && crt.P2U(unsafe.Pointer(_1_pSlot)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i)))))+uintptr(_1_sz))))) && (_sqlite3Config.X6) != i32(0) { + if crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSlot))+uintptr(_1_sz))))) > crt.P2U(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i))))) && crt.P2U(unsafe.Pointer(_1_pSlot)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i)))))+uintptr(_1_sz))))) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65690), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000))), unsafe.Pointer(str(85206))) crt.X__builtin_abort(tls) } }() - crt.Xmemmove(tls, (unsafe.Pointer)(_1_pSlot), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 8*uintptr(_i)))), uint64(_1_sz)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_1_pSlot))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) + crt.Xmemmove(tls, unsafe.Pointer(_1_pSlot), unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCArray.X2)) + 8*uintptr(_i)))), uint64(_1_sz)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(func() *uint8 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int64((uintptr(unsafe.Pointer(_1_pSlot))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8))) return _pCellptr }())) + 1*uintptr(i32(1)))) = uint8(int64((uintptr(unsafe.Pointer(_1_pSlot)) - uintptr(unsafe.Pointer(_aData))) / 1)) { p := &_pCellptr - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(2)))) sink13(*p) } _i += 1 @@ -64405,11 +67168,14 @@ func init() { crt.Xstrncpy(nil, &_pageInsertArrayØ00__func__Ø000[0], str(85285), 16) } -// Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been -// computed. +// C comment +// /* +// ** Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been +// ** computed. +// */ func _populateCellCache(tls *crt.TLS, _p *XCellArray, _idx int32, _N int32) { func() { - if _idx < i32(0) || (_idx+_N) > (_p.X0) { + if _idx < i32(0) || (_idx+_N) > _p.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65553), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85301))) crt.X__builtin_abort(tls) } @@ -64419,21 +67185,23 @@ _3: goto _4 } func() { - if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(_idx)))) == nil { + if (*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(_idx)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65555), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85327))) crt.X__builtin_abort(tls) } }() - if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx)))) == i32(0) { - *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx))) = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(_idx)))) + if int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_idx)))) == i32(0) { + *(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_idx))) = func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := (*XMemPage)(_p.X1).X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(_idx)))) goto _8 } func() { - if (_sqlite3Config.X6) != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx)))) != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(_idx))))) { + if _sqlite3Config.X6 != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X3)) + 2*uintptr(_idx)))) != int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := (*XMemPage)(_p.X1).X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(_idx))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65559), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85345))) crt.X__builtin_abort(tls) } @@ -64466,11 +67234,11 @@ func _sqlite3ScratchFree(tls *crt.TLS, _p unsafe.Pointer) { if (uint64(crt.P2U(_p)) >= uint64(crt.P2U(_sqlite3Config.X19))) && (uint64(crt.P2U(_p)) < uint64(crt.P2U(_mem0.X2))) { _2_pSlot = (*Xsqlite3_file)(_p) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = (*Xsqlite3_file)(_mem0.X3) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = _2_pSlot - *(*uint32)(unsafe.Pointer(&(_mem0.X4))) += 1 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pSlot.X0)))) = (*Xsqlite3_file)(_mem0.X3) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_mem0.X3)))) = _2_pSlot + *(*uint32)(unsafe.Pointer(&_mem0.X4)) += 1 func() { - if (_mem0.X4) > uint32(_sqlite3Config.X21) { + if _mem0.X4 > uint32(_sqlite3Config.X21) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ScratchFreeØ00__func__Ø000))), unsafe.Pointer(str(85437))) crt.X__builtin_abort(tls) } @@ -64481,17 +67249,17 @@ func _sqlite3ScratchFree(tls *crt.TLS, _p unsafe.Pointer) { } i32(0) i32(0) - if (_sqlite3Config.X0) != 0 { + if _sqlite3Config.X0 != 0 { _4_iSize = _sqlite3MallocSize(tls, _p) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0)) _sqlite3StatusDown(tls, i32(4), _4_iSize) _sqlite3StatusDown(tls, i32(0), _4_iSize) _sqlite3StatusDown(tls, i32(9), i32(1)) - ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p) + ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X1)(tls, _p) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) goto _7 } - ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p) + ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X1)(tls, _p) _7: _5: _0: @@ -64503,21 +67271,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ScratchFreeØ00__func__Ø000[0], str(85492), 19) } -// Delete the entry that the cursor is pointing to. -// -// If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then -// the cursor is left pointing at an arbitrary location after the delete. -// But if that bit is set, then the cursor is left in a state such that -// the next call to BtreeNext() or BtreePrev() moves it to the same row -// as it would have been on if the call to BtreeDelete() had been omitted. -// -// The BTREE_AUXDELETE bit of flags indicates that is one of several deletes -// associated with a single table entry and its indexes. Only one of those -// deletes is considered the "primary" delete. The primary delete occurs -// on a cursor that is not a BTREE_FORDELETE cursor. All but one delete -// operation on non-FORDELETE cursors is tagged with the AUXDELETE flag. -// The BTREE_AUXDELETE bit is a hint that is not used by this implementation, -// but which might be used by alternative storage engines. +// C comment +// /* +// ** Delete the entry that the cursor is pointing to. +// ** +// ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then +// ** the cursor is left pointing at an arbitrary location after the delete. +// ** But if that bit is set, then the cursor is left in a state such that +// ** the next call to BtreeNext() or BtreePrev() moves it to the same row +// ** as it would have been on if the call to BtreeDelete() had been omitted. +// ** +// ** The BTREE_AUXDELETE bit of flags indicates that is one of several deletes +// ** associated with a single table entry and its indexes. Only one of those +// ** deletes is considered the "primary" delete. The primary delete occurs +// ** on a cursor that is not a BTREE_FORDELETE cursor. All but one delete +// ** operation on non-FORDELETE cursors is tagged with the AUXDELETE flag. +// ** The BTREE_AUXDELETE bit is a hint that is not used by this implementation, +// ** but which might be used by alternative storage engines. +// */ func _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32) { var _rc, _iCellIdx, _iCellDepth, _bSkipnext, _4_notUsed, _7_nCell int32 var _7_n uint32 @@ -64568,7 +67339,7 @@ func _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32 } }() func() { - if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) { + if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67329), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(10597))) crt.X__builtin_abort(tls) } @@ -64587,12 +67358,12 @@ func _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32 }() _iCellDepth = int32(_pCur.X14) _iCellIdx = int32(_pCur.X16) - _pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_iCellDepth))) - _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCellIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCellIdx))))) + 1*uintptr(i32(1))))))))) + _pPage = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_iCellDepth))) + _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCellIdx))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_iCellIdx))))) + 1*uintptr(i32(1))))))))) if _bPreserve == 0 { goto _18 } - if (_pPage.X5) != 0 && ((int32(_pPage.X13)+int32(_cellSizePtr(tls, _pPage, _pCell)))+i32(2)) <= int32(((_pBt.X16)*uint32(i32(2)))/uint32(i32(3))) { + if _pPage.X5 != 0 && ((int32(_pPage.X13)+int32(_cellSizePtr(tls, _pPage, _pCell)))+i32(2)) <= int32((_pBt.X16*uint32(i32(2)))/uint32(i32(3))) { goto _20 } _rc = _saveCursorKey(tls, _pCur) @@ -64604,7 +67375,7 @@ _20: _bSkipnext = i32(1) _22: _18: - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _23 } _4_notUsed = i32(0) @@ -64622,7 +67393,7 @@ _23: } _25: if (*XKeyInfo)(_pCur.X18) == nil { - _invalidateIncrblobCursors(tls, _p, _pCur.X7, (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0, i32(0)) + _invalidateIncrblobCursors(tls, _p, _pCur.X7, (*XCellInfo)(unsafe.Pointer(&_pCur.X4)).X0, i32(0)) } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23)) if _rc != 0 { @@ -64633,20 +67404,21 @@ _25: if _rc != 0 { return _rc } - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _30 } - _7_pLeaf = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14))) - _7_n = (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_iCellDepth+i32(1))))).X4 - _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.X19)) + uintptr(int32(_7_pLeaf.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_7_pLeaf.X21))+1*uintptr(i32(2)*(int32(_7_pLeaf.X14)-i32(1))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_7_pLeaf.X21))+1*uintptr(i32(2)*(int32(_7_pLeaf.X14)-i32(1))))))) + 1*uintptr(i32(1))))))))) - if crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_7_pLeaf.X19))+1*uintptr(i32(4)))))) { + _7_pLeaf = *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14))) + _7_n = (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_iCellDepth+i32(1))))).X4 + _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.X19)) + uintptr(int32(_7_pLeaf.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.X21))+1*uintptr(i32(2)*(int32(_7_pLeaf.X14)-i32(1))))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.X21))+1*uintptr(i32(2)*(int32(_7_pLeaf.X14)-i32(1))))))) + 1*uintptr(i32(1))))))))) + if crt.P2U(unsafe.Pointer(_pCell)) < crt.P2U(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_7_pLeaf.X19))+1*uintptr(i32(4)))))) { return _sqlite3CorruptError(tls, i32(67407)) } - _7_nCell = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_7_pLeaf.X24)})))(tls, _7_pLeaf, _pCell)) + _7_nCell = int32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _7_pLeaf.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _7_pLeaf, _pCell)) func() { - if int32((_pBt.X15)-uint32(i32(8))) < _7_nCell { + if int32(_pBt.X15-uint32(i32(8))) < _7_nCell { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67409), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85633))) crt.X__builtin_abort(tls) } @@ -64673,7 +67445,7 @@ _30: } _40: if int32(_pCur.X14) > _iCellDepth { - _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1)))))) + _releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(postInc3((*int8)(unsafe.Pointer(&_pCur.X14)), -1))))) goto _40 } _rc = _balance(tls, _pCur) @@ -64685,36 +67457,36 @@ _39: goto _43 } func() { - if _bPreserve == 0 || int32(_pCur.X14) != _iCellDepth && (_sqlite3Config.X6) != i32(0) { + if _bPreserve == 0 || int32(_pCur.X14) != _iCellDepth && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67445), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85668))) crt.X__builtin_abort(tls) } }() func() { - if _pPage != (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))) && (_sqlite3Config.X6) != i32(0) { + if _pPage != (*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))) && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67446), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85721))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pPage.X14) <= i32(0) && (_sqlite3Config.X6) != i32(0) || _iCellIdx > int32(_pPage.X14) { + if int32(_pPage.X14) <= i32(0) && _sqlite3Config.X6 != i32(0) || _iCellIdx > int32(_pPage.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85768))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(2)) if _iCellIdx >= int32(_pPage.X14) { - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(-1) - *(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(int32(_pPage.X14) - i32(1)) + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(-1) + *(*uint16)(unsafe.Pointer(&_pCur.X16)) = uint16(int32(_pPage.X14) - i32(1)) goto _56 } - *(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(1) + *(*int32)(unsafe.Pointer(&_pCur.X9)) = i32(1) _56: goto _57 _43: _rc = _moveToRoot(tls, _pCur) if _bPreserve != 0 { - *(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pCur.X12)) = uint8(i32(3)) } _57: _42: @@ -64731,20 +67503,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeDeleteØ00__func__Ø000[0], str(85825), 19) } -// Compare the key in memory cell pVal with the key that the sorter cursor -// passed as the first argument currently points to. For the purposes of -// the comparison, ignore the rowid field at the end of each record. -// -// If the sorter cursor key contains any NULL values, consider it to be -// less than pVal. Even if pVal also contains NULL values. -// -// If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM). -// Otherwise, set *pRes to a negative, zero or positive value if the -// key in pVal is smaller than, equal to or larger than the current sorter -// key. -// -// This routine forms the core of the OP_SorterCompare opcode, which in -// turn is used to verify uniqueness when constructing a UNIQUE INDEX. +// C comment +// /* +// ** Compare the key in memory cell pVal with the key that the sorter cursor +// ** passed as the first argument currently points to. For the purposes of +// ** the comparison, ignore the rowid field at the end of each record. +// ** +// ** If the sorter cursor key contains any NULL values, consider it to be +// ** less than pVal. Even if pVal also contains NULL values. +// ** +// ** If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM). +// ** Otherwise, set *pRes to a negative, zero or positive value if the +// ** key in pVal is smaller than, equal to or larger than the current sorter +// ** key. +// ** +// ** This routine forms the core of the OP_SorterCompare opcode, which in +// ** turn is used to verify uniqueness when constructing a UNIQUE INDEX. +// */ func _sqlite3VdbeSorterCompare(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem, _nKeyCol int32, _pRes *int32) (r0 int32) { var _i, _nKey int32 var _pKey unsafe.Pointer @@ -64757,17 +67532,17 @@ func _sqlite3VdbeSorterCompare(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem, _n crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) _r2 = (*XUnpackedRecord)(_pSorter.X8) _pKeyInfo = (*XKeyInfo)(_pCsr.X15) if _r2 != nil { goto _2 } - _r2 = store51((**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X8))))), _sqlite3VdbeAllocUnpackedRecord(tls, _pKeyInfo)) + _r2 = store51((**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X8)))), _sqlite3VdbeAllocUnpackedRecord(tls, _pKeyInfo)) if _r2 == nil { return _sqlite3NomemError(tls, i32(88746)) } - *(*uint16)(unsafe.Pointer(&(_r2.X2))) = uint16(_nKeyCol) + *(*uint16)(unsafe.Pointer(&_r2.X2)) = uint16(_nKeyCol) _2: func() { if int32(_r2.X2) != _nKeyCol { @@ -64789,7 +67564,7 @@ _6: _i += 1 goto _6 _9: - *_pRes = _sqlite3VdbeRecordCompare(tls, _pVal.X4, (unsafe.Pointer)(_pVal.X5), _r2) + *_pRes = _sqlite3VdbeRecordCompare(tls, _pVal.X4, unsafe.Pointer(_pVal.X5), _r2) return i32(0) } @@ -64799,31 +67574,37 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterCompareØ00__func__Ø000[0], str(85864), 25) } -// Return a pointer to a buffer owned by the sorter that contains the -// current key. +// C comment +// /* +// ** Return a pointer to a buffer owned by the sorter that contains the +// ** current key. +// */ func _vdbeSorterRowkey(tls *crt.TLS, _pSorter *XVdbeSorter, _pnKey *int32) (r0 unsafe.Pointer) { var _pKey unsafe.Pointer var _1_pReader *XPmaReader - if (_pSorter.X12) == 0 { + if _pSorter.X12 == 0 { goto _0 } - if (_pSorter.X13) != 0 { + if _pSorter.X13 != 0 { _1_pReader = (*XPmaReader)(_pSorter.X4) goto _2 } - _1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr((*XMergeEngine)(_pSorter.X5).X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMergeEngine)(_pSorter.X5).X2)) + 4*uintptr(i32(1))))))) + _1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr((*XMergeEngine)(_pSorter.X5).X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMergeEngine)(_pSorter.X5).X2)) + 4*uintptr(i32(1))))))) _2: *_pnKey = _1_pReader.X3 - _pKey = (unsafe.Pointer)(_1_pReader.X6) + _pKey = unsafe.Pointer(_1_pReader.X6) goto _3 _0: - *_pnKey = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0).X0 - _pKey = (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))) + uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))) + *_pnKey = (*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0).X0 + _pKey = unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))) + uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))) _3: return _pKey } -// Copy the current sorter key into the memory cell pOut. +// C comment +// /* +// ** Copy the current sorter key into the memory cell pOut. +// */ func _sqlite3VdbeSorterRowkey(tls *crt.TLS, _pCsr *XVdbeCursor, _pOut *XMem) (r0 int32) { var _nKey int32 var _pKey unsafe.Pointer @@ -64834,14 +67615,14 @@ func _sqlite3VdbeSorterRowkey(tls *crt.TLS, _pCsr *XVdbeCursor, _pOut *XMem) (r0 crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) _pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey) if _sqlite3VdbeMemClearAndResize(tls, _pOut, _nKey) != 0 { return _sqlite3NomemError(tls, i32(88703)) } - *(*int32)(unsafe.Pointer(&(_pOut.X4))) = _nKey - *(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(16)) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut.X5), _pKey, uint64(_nKey)) + *(*int32)(unsafe.Pointer(&_pOut.X4)) = _nKey + *(*uint16)(unsafe.Pointer(&_pOut.X1)) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(16)) + crt.Xmemcpy(tls, unsafe.Pointer(_pOut.X5), _pKey, uint64(_nKey)) return i32(0) } @@ -64851,8 +67632,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterRowkeyØ00__func__Ø000[0], str(85889), 24) } -// Check to ensure that the cursor is valid. Restore the cursor -// if need be. Return any I/O error from the restore operation. +// C comment +// /* +// ** Check to ensure that the cursor is valid. Restore the cursor +// ** if need be. Return any I/O error from the restore operation. +// */ func _sqlite3VdbeCursorRestore(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { func() { if int32(_p.X0) != i32(0) { @@ -64860,7 +67644,7 @@ func _sqlite3VdbeCursorRestore(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) { crt.X__builtin_abort(tls) } }() - if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) != 0 { + if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_p.X14)))))) != 0 { return _handleMovedCursor(tls, _p) } return i32(0) @@ -64872,7 +67656,8 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeCursorRestoreØ00__func__Ø000[0], str(85913), 25) } -// NDEBUG +// C comment +// /* NDEBUG */ func _sqlite3BtreeCursorIsValidNN(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { func() { if _pCur == nil { @@ -64889,9 +67674,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCursorIsValidNNØ00__func__Ø000[0], str(85938), 28) } -// Move the cursor to the first entry in the table. Return SQLITE_OK -// on success. Set *pRes to 0 if the cursor actually points to something -// or set *pRes to 1 if the table is empty. +// C comment +// /* Move the cursor to the first entry in the table. Return SQLITE_OK +// ** on success. Set *pRes to 0 if the cursor actually points to something +// ** or set *pRes to 1 if the table is empty. +// */ func _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) { var _rc int32 func() { @@ -64912,7 +67699,7 @@ func _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) } if int32(_pCur.X12) == i32(0) { func() { - if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { + if _pCur.X7 != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64084), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(74242))) crt.X__builtin_abort(tls) } @@ -64921,7 +67708,7 @@ func _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) goto _9 } func() { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X14) <= i32(0) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X14) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64087), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(85966))) crt.X__builtin_abort(tls) } @@ -64939,9 +67726,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeFirstØ00__func__Ø000[0], str(86001), 18) } -// Return an estimate for the number of rows in the table that pCur is -// pointing to. Return a negative number if no estimate is currently -// available. +// C comment +// /* +// ** Return an estimate for the number of rows in the table that pCur is +// ** pointing to. Return a negative number if no estimate is currently +// ** available. +// */ func _sqlite3BtreeRowCountEst(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) { var _n int64 var _i uint8 @@ -64970,7 +67760,7 @@ func _sqlite3BtreeRowCountEst(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) { return int64(i32(-1)) } if func() int32 { - if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_pCur.X14)))).X5) == i32(0) { + if int32((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_pCur.X14)))).X5) == i32(0) { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -64988,7 +67778,7 @@ _10: } { p := &_n - *p = (*p) * int64((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 8*uintptr(_i)))).X14) + *p = (*p) * int64((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCur.X19)))) + 8*uintptr(_i)))).X14) sink6(*p) } _i += 1 @@ -65003,9 +67793,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeRowCountEstØ00__func__Ø000[0], str(86019), 24) } -// Once the sorter has been populated by calls to sqlite3VdbeSorterWrite, -// this function is called to prepare for iterating through the records -// in sorted order. +// C comment +// /* +// ** Once the sorter has been populated by calls to sqlite3VdbeSorterWrite, +// ** this function is called to prepare for iterating through the records +// ** in sorted order. +// */ func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) { var _rc int32 var _pSorter *XVdbeSorter @@ -65016,7 +67809,7 @@ func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) ( crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) func() { if _pSorter == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88589), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(86043))) @@ -65026,9 +67819,9 @@ func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) ( if int32(_pSorter.X12) != i32(0) { goto _4 } - if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil { + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) != nil { *_pbEof = i32(0) - _rc = _vdbeSorterSort(tls, (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+104*uintptr(i32(0)))), (*t47)(unsafe.Pointer(&(_pSorter.X9)))) + _rc = _vdbeSorterSort(tls, (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17))))+104*uintptr(i32(0)))), (*t47)(unsafe.Pointer(&_pSorter.X9))) goto _6 } *_pbEof = i32(1) @@ -65037,7 +67830,7 @@ _6: _4: func() { - if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) == nil { + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88608), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(86051))) crt.X__builtin_abort(tls) } @@ -65063,9 +67856,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterRewindØ00__func__Ø000[0], str(86091), 24) } -// Sort the linked list of records headed at pTask->pList. Return -// SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if -// an error occurs. +// C comment +// /* +// ** Sort the linked list of records headed at pTask->pList. Return +// ** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if +// ** an error occurs. +// */ func _vdbeSorterSort(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 int32) { var _i, _rc int32 var _p, _2_pNext *XSorterRecord @@ -65075,7 +67871,7 @@ func _vdbeSorterSort(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 int32) return _rc } _p = (*XSorterRecord)(_pList.X0) - *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pTask.X6))))) = _vdbeSorterGetCompare(tls, (*XVdbeSorter)(_pTask.X2)) + *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&_pTask.X6)))) = _vdbeSorterGetCompare(tls, (*XVdbeSorter)(_pTask.X2)) _aSlot = (**XSorterRecord)(_sqlite3MallocZero(tls, u64(512))) if _aSlot == nil { return _sqlite3NomemError(tls, i32(87425)) @@ -65084,37 +67880,37 @@ _1: if _p == nil { goto _3 } - if (_pList.X1) == nil { + if _pList.X1 == nil { goto _4 } - if (*uint8)(unsafe.Pointer(_p)) == (_pList.X1) { + if (*uint8)(unsafe.Pointer(_p)) == _pList.X1 { _2_pNext = nil goto _6 } func() { - if (*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1)))))) >= _sqlite3MallocSize(tls, (unsafe.Pointer)(_pList.X1)) { + if (*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p.X1))))) >= _sqlite3MallocSize(tls, unsafe.Pointer(_pList.X1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87434), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000))), unsafe.Pointer(str(86115))) crt.X__builtin_abort(tls) } }() - _2_pNext = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pList.X1)) + 1*uintptr(*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1)))))))))) + _2_pNext = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pList.X1)) + 1*uintptr(*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p.X1))))))))) _6: goto _9 _4: - _2_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1)))))) + _2_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p.X1))))) _9: - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1))))))) = nil + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p.X1)))))) = nil _i = i32(0) _10: - if (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i)))) == nil { + if (*(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i)))) == nil { goto _13 } - _p = _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i)))) - *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i))) = nil + _p = _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i)))) + *(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i))) = nil _i += 1 goto _10 _13: - *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i))) = _p + *(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i))) = _p _p = _2_pNext goto _1 _3: @@ -65124,21 +67920,21 @@ _14: if _i >= i32(64) { goto _17 } - if (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i)))) == nil { + if (*(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i)))) == nil { goto _15 } _p = func() *XSorterRecord { if _p != nil { - return _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i)))) + return _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i)))) } - return (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 8*uintptr(_i)))) + return (*(**XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSlot)) + 8*uintptr(_i)))) }() _15: _i += 1 goto _14 _17: - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = _p - Xsqlite3_free(tls, (unsafe.Pointer)(_aSlot)) + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pList.X0)))) = _p + Xsqlite3_free(tls, unsafe.Pointer(_aSlot)) func() { if int32((*XUnpackedRecord)(_pTask.X3).X4) != i32(0) && int32((*XUnpackedRecord)(_pTask.X3).X4) != i32(7) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87458), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000))), unsafe.Pointer(str(86160))) @@ -65148,14 +67944,17 @@ _17: return int32((*XUnpackedRecord)(_pTask.X3).X4) } -// If it has not already been allocated, allocate the UnpackedRecord -// structure at pTask->pUnpacked. Return SQLITE_OK if successful (or -// if no allocation was required), or SQLITE_NOMEM otherwise. +// C comment +// /* +// ** If it has not already been allocated, allocate the UnpackedRecord +// ** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or +// ** if no allocation was required), or SQLITE_NOMEM otherwise. +// */ func _vdbeSortAllocUnpacked(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) { if (*XUnpackedRecord)(_pTask.X3) != nil { goto _0 } - *(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X3))))) = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7)) + *(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTask.X3)))) = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7)) if (*XUnpackedRecord)(_pTask.X3) == nil { return _sqlite3NomemError(tls, i32(87344)) } @@ -65165,8 +67964,11 @@ _0: return i32(0) } -// Return the SorterCompare function to compare values collected by the -// sorter object passed as the only argument. +// C comment +// /* +// ** Return the SorterCompare function to compare values collected by the +// ** sorter object passed as the only argument. +// */ func _vdbeSorterGetCompare(tls *crt.TLS, _p *XVdbeSorter) (r0 func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32) { if int32(_p.X16) == i32(1) { return _vdbeSorterCompareInt @@ -65177,18 +67979,21 @@ func _vdbeSorterGetCompare(tls *crt.TLS, _p *XVdbeSorter) (r0 func(*crt.TLS, *XS return _vdbeSorterCompare } -// A specially optimized version of vdbeSorterCompare() that assumes that -// the first field of each key is an INTEGER value. +// C comment +// /* +// ** A specially optimized version of vdbeSorterCompare() that assumes that +// ** the first field of each key is an INTEGER value. +// */ func _vdbeSorterCompareInt(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) { var _s1, _s2, _res, _1_i int32 var _1_n uint8 var _p1, _p2, _v1, _v2 *uint8 _p1 = (*uint8)(_pKey1) _p2 = (*uint8)(_pKey2) - _s1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(1))))) - _s2 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(1))))) - _v1 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(0))))))) - _v2 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(0))))))) + _s1 = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(i32(1))))) + _s2 = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(i32(1))))) + _v1 = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(i32(0))))))) + _v2 = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(i32(0))))))) func() { if (_s1 <= i32(0) || _s1 >= i32(7)) && _s1 != i32(8) && _s1 != i32(9) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86872), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000))), unsafe.Pointer(str(86240))) @@ -65204,19 +68009,19 @@ func _vdbeSorterCompareInt(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *in if _s1 != _s2 { goto _10 } - _1_n = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_vdbeSorterCompareIntØ00aLenØ001)) + 1*uintptr(_s1))) + _1_n = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vdbeSorterCompareIntØ00aLenØ001)) + 1*uintptr(_s1))) _res = i32(0) _1_i = i32(0) _11: if _1_i >= int32(_1_n) { goto _14 } - if store1(&_res, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(_1_i))))-int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v2)) + 1*uintptr(_1_i))))) == i32(0) { + if store1(&_res, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_v1)) + 1*uintptr(_1_i))))-int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_v2)) + 1*uintptr(_1_i))))) == i32(0) { goto _15 } - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(i32(0))))) ^ int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v2)) + 1*uintptr(i32(0)))))) & i32(128)) != i32(0) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_v1)) + 1*uintptr(i32(0))))) ^ int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_v2)) + 1*uintptr(i32(0)))))) & i32(128)) != i32(0) { _res = func() int32 { - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(i32(0))))) & i32(128)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_v1)) + 1*uintptr(i32(0))))) & i32(128)) != 0 { return i32(-1) } return i32(1) @@ -65270,7 +68075,7 @@ _22: } goto _36 _33: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 { _res = _res * i32(-1) } _36: @@ -65289,9 +68094,12 @@ func init() { _vdbeSorterCompareIntØ00aLenØ001 = [10]uint8{0, 1, 2, 3, 4, 6, 8, 0, 0, 0} } -// A version of vdbeSorterCompare() that assumes that it has already been -// determined that the first field of key1 is equal to the first field of -// key2. +// C comment +// /* +// ** A version of vdbeSorterCompare() that assumes that it has already been +// ** determined that the first field of key1 is equal to the first field of +// ** key2. +// */ func _vdbeSorterCompareTail(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) { var _r2 *XUnpackedRecord _r2 = (*XUnpackedRecord)(_pTask.X3) @@ -65302,37 +68110,40 @@ func _vdbeSorterCompareTail(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *i return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _r2, i32(1)) } -// A specially optimized version of vdbeSorterCompare() that assumes that -// the first field of each key is a TEXT value and that the collation -// sequence to compare them with is BINARY. +// C comment +// /* +// ** A specially optimized version of vdbeSorterCompare() that assumes that +// ** the first field of each key is a TEXT value and that the collation +// ** sequence to compare them with is BINARY. +// */ func _vdbeSorterCompareText(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) { var _n1, _n2, _res int32 var _p1, _p2, _v1, _v2 *uint8 _p1 = (*uint8)(_pKey1) _p2 = (*uint8)(_pKey2) - _v1 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(0))))))) - _v2 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(0))))))) + _v1 = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(i32(0))))))) + _v2 = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(i32(0))))))) func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(i32(1))))) < int32(u8(128)) { return func() int32 { - _n1 = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(1)))))) + _n1 = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1)) + 1*uintptr(i32(1)))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n1)))) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n1)))) }() _n1 = (_n1 - i32(13)) / i32(2) func() int32 { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(1))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(i32(1))))) < int32(u8(128)) { return func() int32 { - _n2 = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(1)))))) + _n2 = int32(uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2)) + 1*uintptr(i32(1)))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n2)))) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n2)))) }() _n2 = (_n2 - i32(13)) / i32(2) - _res = crt.Xmemcmp(tls, (unsafe.Pointer)(_v1), (unsafe.Pointer)(_v2), uint64(func() int32 { + _res = crt.Xmemcmp(tls, unsafe.Pointer(_v1), unsafe.Pointer(_v2), uint64(func() int32 { if _n1 < _n2 { return _n1 } @@ -65349,24 +68160,27 @@ func _vdbeSorterCompareText(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *i } goto _9 _7: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 { _res = _res * i32(-1) } _9: return _res } -// Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, -// size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences -// used by the comparison. Return the result of the comparison. -// -// If IN/OUT parameter *pbKey2Cached is true when this function is called, -// it is assumed that (pTask->pUnpacked) contains the unpacked version -// of key2. If it is false, (pTask->pUnpacked) is populated with the unpacked -// version of key2 and *pbKey2Cached set to true before returning. -// -// If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set -// to SQLITE_NOMEM. +// C comment +// /* +// ** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, +// ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences +// ** used by the comparison. Return the result of the comparison. +// ** +// ** If IN/OUT parameter *pbKey2Cached is true when this function is called, +// ** it is assumed that (pTask->pUnpacked) contains the unpacked version +// ** of key2. If it is false, (pTask->pUnpacked) is populated with the unpacked +// ** version of key2 and *pbKey2Cached set to true before returning. +// ** +// ** If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set +// ** to SQLITE_NOMEM. +// */ func _vdbeSorterCompare(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) { var _r2 *XUnpackedRecord _r2 = (*XUnpackedRecord)(_pTask.X3) @@ -65383,7 +68197,10 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterSortØ00__func__Ø000[0], str(86327), 15) } -// Merge the two sorted lists p1 and p2 into a single list. +// C comment +// /* +// ** Merge the two sorted lists p1 and p2 into a single list. +// */ func _vdbeSorterMerge(tls *crt.TLS, _pTask *XSortSubtask, _p1 *XSorterRecord, _p2 *XSorterRecord) (r0 *XSorterRecord) { var _bCached, _1_res int32 var _pFinal *XSorterRecord @@ -65398,15 +68215,16 @@ func _vdbeSorterMerge(tls *crt.TLS, _pTask *XSortSubtask, _p1 *XSorterRecord, _p } }() _3: - _1_res = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 - }{(_pTask.X6)})))(tls, _pTask, &_bCached, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p1.X0, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p2.X0) + _1_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 { + v := _pTask.X6 + return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pTask, &_bCached, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p1.X0, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), _p2.X0) if _1_res > i32(0) { goto _6 } *_pp = _p1 - _pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p1.X1))))))) - _p1 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p1.X1)))))) + _pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p1.X1)))))) + _p1 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p1.X1))))) if _p1 == nil { *_pp = _p2 goto _5 @@ -65414,8 +68232,8 @@ _3: goto _8 _6: *_pp = _p2 - _pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p2.X1))))))) - _p2 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p2.X1)))))) + _pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p2.X1)))))) + _p2 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_p2.X1))))) _bCached = i32(0) if _p2 == nil { *_pp = _p1 @@ -65436,8 +68254,11 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterMergeØ00__func__Ø000[0], str(86357), 16) } -// Flush the current contents of VdbeSorter.list to a new PMA, possibly -// using a background thread. +// C comment +// /* +// ** Flush the current contents of VdbeSorter.list to a new PMA, possibly +// ** using a background thread. +// */ func _vdbeSorterFlushPMA(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) { var _rc, _i, _nWorker, _1_iTest int32 var _5_pCtx unsafe.Pointer @@ -65446,15 +68267,15 @@ func _vdbeSorterFlushPMA(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) { _rc = i32(0) _pTask = nil _nWorker = int32(_pSorter.X15) - i32(1) - *(*uint8)(unsafe.Pointer(&(_pSorter.X12))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pSorter.X12)) = uint8(i32(1)) _i = i32(0) _0: if _i >= _nWorker { goto _3 } _1_iTest = ((int32(_pSorter.X14) + _i) + i32(1)) % _nWorker - _pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_1_iTest))) - if (_pTask.X1) != 0 { + _pTask = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_1_iTest))) + if _pTask.X1 != 0 { _rc = _vdbeSorterJoinThread(tls, _pTask) } if (_rc != i32(0)) || ((*XSQLiteThread)(_pTask.X0) == nil) { @@ -65467,43 +68288,43 @@ _3: goto _7 } if _i == _nWorker { - _rc = _vdbeSorterListToPMA(tls, (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+104*uintptr(_nWorker))), (*t47)(unsafe.Pointer(&(_pSorter.X9)))) + _rc = _vdbeSorterListToPMA(tls, (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17))))+104*uintptr(_nWorker))), (*t47)(unsafe.Pointer(&_pSorter.X9))) goto _9 } - _5_aMem = (*t47)(unsafe.Pointer(&(_pTask.X4))).X1 - _5_pCtx = (unsafe.Pointer)(_pTask) + _5_aMem = (*t47)(unsafe.Pointer(&_pTask.X4)).X1 + _5_pCtx = unsafe.Pointer(_pTask) func() { - if (*XSQLiteThread)(_pTask.X0) != nil || (_pTask.X1) != i32(0) { + if (*XSQLiteThread)(_pTask.X0) != nil || _pTask.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87751), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86373))) crt.X__builtin_abort(tls) } }() func() { - if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pTask.X4))).X0) != nil { + if (*XSorterRecord)((*t47)(unsafe.Pointer(&_pTask.X4)).X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87752), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86410))) crt.X__builtin_abort(tls) } }() func() { - if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil && ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + if ((*t47)(unsafe.Pointer(&_pTask.X4)).X1) != nil && ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87753), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86431))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pSorter.X14))) = uint8(int64((uintptr(unsafe.Pointer(_pTask)) - uintptr(unsafe.Pointer((*XSortSubtask)(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))))) / 104)) - *(*t47)(unsafe.Pointer(&(_pTask.X4))) = _pSorter.X9 - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = nil - *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pSorter.X14)) = uint8(int64((uintptr(unsafe.Pointer(_pTask)) - uintptr(unsafe.Pointer((*XSortSubtask)(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17))))))) / 104)) + *(*t47)(unsafe.Pointer(&_pTask.X4)) = _pSorter.X9 + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) = nil + *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X2))) = i32(0) if _5_aMem != nil { - *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = _5_aMem - *(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _sqlite3MallocSize(tls, (unsafe.Pointer)(_5_aMem)) + *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) = _5_aMem + *(*int32)(unsafe.Pointer(&_pSorter.X11)) = _sqlite3MallocSize(tls, unsafe.Pointer(_5_aMem)) goto _20 } - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { goto _20 } - *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pSorter.X11))) - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pSorter.X11))) + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { return _sqlite3NomemError(tls, i32(87764)) } _20: @@ -65513,18 +68334,21 @@ _7: return _rc } -// Write the current contents of in-memory linked-list pList to a level-0 -// PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if -// successful, or an SQLite error code otherwise. -// -// The format of a PMA is: -// -// * A varint. This varint contains the total number of bytes of content -// in the PMA (not including the varint itself). -// -// * One or more records packed end-to-end in order of ascending keys. -// Each record consists of a varint followed by a blob of data (the -// key). The varint is the number of bytes in the blob of data. +// C comment +// /* +// ** Write the current contents of in-memory linked-list pList to a level-0 +// ** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if +// ** successful, or an SQLite error code otherwise. +// ** +// ** The format of a PMA is: +// ** +// ** * A varint. This varint contains the total number of bytes of content +// ** in the PMA (not including the varint itself). +// ** +// ** * One or more records packed end-to-end in order of ascending keys. +// ** Each record consists of a varint followed by a blob of data (the +// ** key). The varint is the number of bytes in the blob of data. +// */ func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 int32) { var _rc int32 var _iSz int64 @@ -65533,37 +68357,37 @@ func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 i var _writer XPmaWriter _db = (*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6) _rc = i32(0) - _iSz = int64((_pList.X2)+_sqlite3VarintLen(tls, uint64(_pList.X2))) + ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) - crt.Xmemset(tls, (unsafe.Pointer)(&_writer), i32(0), u64(48)) + _iSz = int64(_pList.X2+_sqlite3VarintLen(tls, uint64(_pList.X2))) + ((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1) + crt.Xmemset(tls, unsafe.Pointer(&_writer), i32(0), u64(48)) func() { - if (_pList.X2) <= i32(0) { + if _pList.X2 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87575), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86482))) crt.X__builtin_abort(tls) } }() - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) == nil { - _rc = _vdbeSorterOpenTempFile(tls, _db, int64(i32(0)), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0)))))) + if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0) == nil { + _rc = _vdbeSorterOpenTempFile(tls, _db, int64(i32(0)), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0)))))) func() { - if _rc == i32(0) && (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) == nil { + if _rc == i32(0) && ((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87580), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86497))) crt.X__builtin_abort(tls) } }() func() { - if ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) != int64(i32(0)) { + if ((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87581), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86530))) crt.X__builtin_abort(tls) } }() func() { - if (_pTask.X5) != i32(0) { + if _pTask.X5 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87582), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86550))) crt.X__builtin_abort(tls) } }() } if _rc == i32(0) { - _vdbeSorterExtendFile(tls, _db, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0), (((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1)+int64(_pList.X2))+int64(i32(9))) + _vdbeSorterExtendFile(tls, _db, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0), (((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1)+int64(_pList.X2))+int64(i32(9))) } if _rc == i32(0) { _rc = _vdbeSorterSort(tls, _pTask, _pList) @@ -65572,25 +68396,25 @@ func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 i goto _12 } _4_pNext = nil - _vdbePmaWriterInit(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0), &_writer, (*XVdbeSorter)(_pTask.X2).X3, (*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) - *(*int32)(unsafe.Pointer(&(_pTask.X5))) += 1 + _vdbePmaWriterInit(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X0), &_writer, (*XVdbeSorter)(_pTask.X2).X3, (*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1) + *(*int32)(unsafe.Pointer(&_pTask.X5)) += 1 _vdbePmaWriteVarint(tls, &_writer, uint64(_pList.X2)) _4_p = (*XSorterRecord)(_pList.X0) _13: if _4_p == nil { goto _16 } - _4_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_p.X1)))))) + _4_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_4_p.X1))))) _vdbePmaWriteVarint(tls, &_writer, uint64(_4_p.X0)) - _vdbePmaWriteBlob(tls, &_writer, (*uint8)((unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_p))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16))))))))))))), _4_p.X0) - if (_pList.X1) == nil { - Xsqlite3_free(tls, (unsafe.Pointer)(_4_p)) + _vdbePmaWriteBlob(tls, &_writer, (*uint8)(unsafe.Pointer(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_p))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))))), _4_p.X0) + if _pList.X1 == nil { + Xsqlite3_free(tls, unsafe.Pointer(_4_p)) } _4_p = _4_pNext goto _13 _16: - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = _4_p - _rc = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1)))) + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pList.X0)))) = _4_p + _rc = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1)))) _12: func() { if _rc == i32(0) && (*XSorterRecord)(_pList.X0) != nil { @@ -65599,7 +68423,7 @@ _12: } }() func() { - if _rc == i32(0) && ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) != _iSz { + if _rc == i32(0) && ((*XSorterFile)(unsafe.Pointer(&_pTask.X7)).X1) != _iSz { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87615), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86598))) crt.X__builtin_abort(tls) } @@ -65616,9 +68440,12 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterListToPMAØ00__func__Ø000[0], str(86637), 20) } -// Allocate space for a file-handle and open a temporary file. If successful, -// set *ppFd to point to the malloc'd file-handle and return SQLITE_OK. -// Otherwise, set *ppFd to 0 and return an SQLite error code. +// C comment +// /* +// ** Allocate space for a file-handle and open a temporary file. If successful, +// ** set *ppFd to point to the malloc'd file-handle and return SQLITE_OK. +// ** Otherwise, set *ppFd to 0 and return an SQLite error code. +// */ func _vdbeSorterOpenTempFile(tls *crt.TLS, _db *Xsqlite3, _nExtend int64, _ppFd **Xsqlite3_file) (r0 int32) { var _rc int32 var _1_max int64 @@ -65630,7 +68457,7 @@ func _vdbeSorterOpenTempFile(tls *crt.TLS, _db *Xsqlite3, _nExtend int64, _ppFd goto _1 } _1_max = i64(2147418112) - _sqlite3OsFileControlHint(tls, *_ppFd, i32(18), (unsafe.Pointer)(&_1_max)) + _sqlite3OsFileControlHint(tls, *_ppFd, i32(18), unsafe.Pointer(&_1_max)) if _nExtend > int64(i32(0)) { _vdbeSorterExtendFile(tls, _db, *_ppFd, _nExtend) } @@ -65641,44 +68468,53 @@ _1: panic(0) } -// The first argument is a file-handle open on a temporary file. The file -// is guaranteed to be nByte bytes or smaller in size. This function -// attempts to extend the file to nByte bytes in size and to ensure that -// the VFS has memory mapped it. -// -// Whether or not the file does end up memory mapped of course depends on -// the specific VFS implementation. +// C comment +// /* +// ** The first argument is a file-handle open on a temporary file. The file +// ** is guaranteed to be nByte bytes or smaller in size. This function +// ** attempts to extend the file to nByte bytes in size and to ensure that +// ** the VFS has memory mapped it. +// ** +// ** Whether or not the file does end up memory mapped of course depends on +// ** the specific VFS implementation. +// */ func _vdbeSorterExtendFile(tls *crt.TLS, _db *Xsqlite3, _pFd *Xsqlite3_file, _nByte int64) { var _1_chunksize int32 var _1_p unsafe.Pointer if (_nByte <= int64(_db.X32)) && (((*Xsqlite3_io_methods)(_pFd.X0).X0) >= i32(3)) { _1_p = nil _1_chunksize = i32(4096) - _sqlite3OsFileControlHint(tls, _pFd, i32(6), (unsafe.Pointer)(&_1_chunksize)) - _sqlite3OsFileControlHint(tls, _pFd, i32(5), (unsafe.Pointer)(&_nByte)) + _sqlite3OsFileControlHint(tls, _pFd, i32(6), unsafe.Pointer(&_1_chunksize)) + _sqlite3OsFileControlHint(tls, _pFd, i32(5), unsafe.Pointer(&_nByte)) _sqlite3OsFetch(tls, _pFd, int64(i32(0)), int32(_nByte), &_1_p) _sqlite3OsUnfetch(tls, _pFd, int64(i32(0)), _1_p) } _ = _1_chunksize } -// Initialize a PMA-writer object. +// C comment +// /* +// ** Initialize a PMA-writer object. +// */ func _vdbePmaWriterInit(tls *crt.TLS, _pFd *Xsqlite3_file, _p *XPmaWriter, _nBuf int32, _iStart int64) { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(48)) - *(**uint8)(unsafe.Pointer(&(_p.X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_nBuf))) - if (_p.X1) == nil { - *(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3NomemError(tls, i32(87476)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(48)) + *(**uint8)(unsafe.Pointer(&_p.X1)) = (*uint8)(_sqlite3Malloc(tls, uint64(_nBuf))) + if _p.X1 == nil { + *(*int32)(unsafe.Pointer(&_p.X0)) = _sqlite3NomemError(tls, i32(87476)) goto _1 } - *(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X3))), int32(_iStart%int64(_nBuf))) - *(*int64)(unsafe.Pointer(&(_p.X5))) = _iStart - int64(_p.X3) - *(*int32)(unsafe.Pointer(&(_p.X2))) = _nBuf - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = _pFd + *(*int32)(unsafe.Pointer(&_p.X4)) = store1((*int32)(unsafe.Pointer(&_p.X3)), int32(_iStart%int64(_nBuf))) + *(*int64)(unsafe.Pointer(&_p.X5)) = _iStart - int64(_p.X3) + *(*int32)(unsafe.Pointer(&_p.X2)) = _nBuf + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X6)))) = _pFd _1: } -// Write value iVal encoded as a varint to the PMA. Return -// SQLITE_OK if successful, or an SQLite error code if an error occurs. +// C comment +// /* +// ** Write value iVal encoded as a varint to the PMA. Return +// ** SQLITE_OK if successful, or an SQLite error code if an error occurs. +// */ func _vdbePmaWriteVarint(tls *crt.TLS, _p *XPmaWriter, _iVal uint64) { var _nByte int32 var _aByte [10]uint8 @@ -65687,36 +68523,39 @@ func _vdbePmaWriteVarint(tls *crt.TLS, _p *XPmaWriter, _iVal uint64) { _ = _aByte } -// Write nData bytes of data to the PMA. Return SQLITE_OK -// if successful, or an SQLite error code if an error occurs. +// C comment +// /* +// ** Write nData bytes of data to the PMA. Return SQLITE_OK +// ** if successful, or an SQLite error code if an error occurs. +// */ func _vdbePmaWriteBlob(tls *crt.TLS, _p *XPmaWriter, _pData *uint8, _nData int32) { var _nRem, _1_nCopy int32 _nRem = _nData _0: - if _nRem <= i32(0) || (_p.X0) != i32(0) { + if _nRem <= i32(0) || _p.X0 != i32(0) { goto _1 } _1_nCopy = _nRem - if _1_nCopy > ((_p.X2) - (_p.X4)) { - _1_nCopy = (_p.X2) - (_p.X4) + if _1_nCopy > (_p.X2 - _p.X4) { + _1_nCopy = _p.X2 - _p.X4 } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X4)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pData))+1*uintptr(_nData-_nRem)))), uint64(_1_nCopy)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1))+1*uintptr(_p.X4)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pData))+1*uintptr(_nData-_nRem)))), uint64(_1_nCopy)) { - p := (*int32)(unsafe.Pointer(&(_p.X4))) + p := (*int32)(unsafe.Pointer(&_p.X4)) *p = (*p) + _1_nCopy sink1(*p) } - if (_p.X4) == (_p.X2) { - *(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X3)))), (_p.X4)-(_p.X3), (_p.X5)+int64(_p.X3)) - *(*int32)(unsafe.Pointer(&(_p.X3))) = store1((*int32)(unsafe.Pointer(&(_p.X4))), i32(0)) + if _p.X4 == _p.X2 { + *(*int32)(unsafe.Pointer(&_p.X0)) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1))+1*uintptr(_p.X3)))), _p.X4-_p.X3, _p.X5+int64(_p.X3)) + *(*int32)(unsafe.Pointer(&_p.X3)) = store1((*int32)(unsafe.Pointer(&_p.X4)), i32(0)) { - p := (*int64)(unsafe.Pointer(&(_p.X5))) + p := (*int64)(unsafe.Pointer(&_p.X5)) *p = (*p) + int64(_p.X2) sink6(*p) } } func() { - if (_p.X4) >= (_p.X2) { + if _p.X4 >= _p.X2 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87507), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaWriteBlobØ00__func__Ø000))), unsafe.Pointer(str(86657))) crt.X__builtin_abort(tls) } @@ -65736,17 +68575,20 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaWriteBlobØ00__func__Ø000[0], str(86679), 17) } -// Flush any buffered data to disk and clean up the PMA-writer object. -// The results of using the PMA-writer after this call are undefined. -// Return SQLITE_OK if flushing the buffered data succeeds or is not -// required. Otherwise, return an SQLite error code. -// -// Before returning, set *piEof to the offset immediately following the -// last byte written to the file. +// C comment +// /* +// ** Flush any buffered data to disk and clean up the PMA-writer object. +// ** The results of using the PMA-writer after this call are undefined. +// ** Return SQLITE_OK if flushing the buffered data succeeds or is not +// ** required. Otherwise, return an SQLite error code. +// ** +// ** Before returning, set *piEof to the offset immediately following the +// ** last byte written to the file. +// */ func _vdbePmaWriterFinish(tls *crt.TLS, _p *XPmaWriter, _piEof *int64) (r0 int32) { var _rc int32 - if (((_p.X0) == i32(0)) && func() int32 { - if (_p.X1) != nil { + if ((_p.X0 == i32(0)) && func() int32 { + if _p.X1 != nil { return i32(1) } return func() int32 { @@ -65754,13 +68596,13 @@ func _vdbePmaWriterFinish(tls *crt.TLS, _p *XPmaWriter, _piEof *int64) (r0 int32 crt.X__builtin_abort(tls) return i32(0) }() - }() != 0) && ((_p.X4) > (_p.X3)) { - *(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X3)))), (_p.X4)-(_p.X3), (_p.X5)+int64(_p.X3)) + }() != 0) && (_p.X4 > _p.X3) { + *(*int32)(unsafe.Pointer(&_p.X0)) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X1))+1*uintptr(_p.X3)))), _p.X4-_p.X3, _p.X5+int64(_p.X3)) } - *_piEof = (_p.X5) + int64(_p.X4) - Xsqlite3_free(tls, (unsafe.Pointer)(_p.X1)) + *_piEof = _p.X5 + int64(_p.X4) + Xsqlite3_free(tls, unsafe.Pointer(_p.X1)) _rc = _p.X0 - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(48)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(48)) return _rc } @@ -65776,15 +68618,18 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterFlushPMAØ00__func__Ø000[0], str(86716), 19) } -// Launch a background thread to run xTask(pIn). +// C comment +// /* +// ** Launch a background thread to run xTask(pIn). +// */ func _vdbeSorterCreateThread(tls *crt.TLS, _pTask *XSortSubtask, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) { func() { - if (*XSQLiteThread)(_pTask.X0) != nil || (_pTask.X1) != i32(0) { + if (*XSQLiteThread)(_pTask.X0) != nil || _pTask.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87148), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCreateThreadØ00__func__Ø000))), unsafe.Pointer(str(86373))) crt.X__builtin_abort(tls) } }() - return _sqlite3ThreadCreate(tls, (**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X0))))), _xTask, _pIn) + return _sqlite3ThreadCreate(tls, (**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTask.X0)))), _xTask, _pIn) } var _vdbeSorterCreateThreadØ00__func__Ø000 [23]int8 @@ -65793,7 +68638,8 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterCreateThreadØ00__func__Ø000[0], str(86735), 23) } -// Create a new thread +// C comment +// /* Create a new thread */ func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) { var _rc int32 var _p *XSQLiteThread @@ -65814,7 +68660,7 @@ func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(* } }() func() { - if (_sqlite3Config.X1) == i32(0) { + if _sqlite3Config.X1 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26908), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000))), unsafe.Pointer(str(86779))) crt.X__builtin_abort(tls) } @@ -65824,18 +68670,18 @@ func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(* if _p == nil { return _sqlite3NomemError(tls, i32(26912)) } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(40)) - *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&(_p.X3))) = _xTask - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = _pIn + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(40)) + *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&_p.X3)) = _xTask + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = _pIn if _sqlite3FaultSim(tls, i32(200)) != 0 { _rc = i32(1) goto _8 } - _rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&(_p.X0))), nil, _xTask, _pIn) + _rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&_p.X0)), nil, _xTask, _pIn) _8: if _rc != 0 { - *(*int32)(unsafe.Pointer(&(_p.X1))) = i32(1) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = _xTask(tls, _pIn) + *(*int32)(unsafe.Pointer(&_p.X1)) = i32(1) + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X2)) = _xTask(tls, _pIn) } *_ppThread = _p return i32(0) @@ -65847,19 +68693,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ThreadCreateØ00__func__Ø000[0], str(86813), 20) } -// The main routine for background threads that write level-0 PMAs. +// C comment +// /* +// ** The main routine for background threads that write level-0 PMAs. +// */ func _vdbeSorterFlushThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) { var _rc int32 var _pTask *XSortSubtask _pTask = (*XSortSubtask)(_pCtx) func() { - if (_pTask.X1) != i32(0) { + if _pTask.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87700), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushThreadØ00__func__Ø000))), unsafe.Pointer(str(86833))) crt.X__builtin_abort(tls) } }() - _rc = _vdbeSorterListToPMA(tls, _pTask, (*t47)(unsafe.Pointer(&(_pTask.X4)))) - *(*int32)(unsafe.Pointer(&(_pTask.X1))) = i32(1) + _rc = _vdbeSorterListToPMA(tls, _pTask, (*t47)(unsafe.Pointer(&_pTask.X4))) + *(*int32)(unsafe.Pointer(&_pTask.X1)) = i32(1) return crt.U2P(uintptr(int64(_rc))) } @@ -65869,13 +68718,16 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterFlushThreadØ00__func__Ø000[0], str(86849), 22) } -// This function is called as part of an sqlite3VdbeSorterRewind() operation -// on a sorter that has written two or more PMAs to temporary files. It sets -// up either VdbeSorter.pMerger (for single threaded sorters) or pReader -// (for multi-threaded sorters) so that it can be used to iterate through -// all records stored in the sorter. -// -// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** This function is called as part of an sqlite3VdbeSorterRewind() operation +// ** on a sorter that has written two or more PMAs to temporary files. It sets +// ** up either VdbeSorter.pMerger (for single threaded sorters) or pReader +// ** (for multi-threaded sorters) so that it can be used to iterate through +// ** all records stored in the sorter. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// */ func _vdbeSorterSetupMerge(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) { var _rc, _i, _3_iTask int32 var _db *Xsqlite3 @@ -65884,7 +68736,7 @@ func _vdbeSorterSetupMerge(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) { var _pTask0, _3_pLast *XSortSubtask var _xCompare func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 var _pMain *XMergeEngine - _pTask0 = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(i32(0)))) + _pTask0 = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(i32(0)))) _pMain = nil _db = (*Xsqlite3)((*XVdbeSorter)(_pTask0.X2).X6) _xCompare = _vdbeSorterGetCompare(tls, _pSorter) @@ -65893,7 +68745,7 @@ _0: if _i >= int32(_pSorter.X15) { goto _3 } - *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_i))).X6))))) = _xCompare + *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_i))).X6))))) = _xCompare _i += 1 goto _0 _3: @@ -65907,17 +68759,17 @@ _3: crt.X__builtin_abort(tls) } }() - if (_pSorter.X13) == 0 { + if _pSorter.X13 == 0 { goto _8 } _3_pReadr = nil - _3_pLast = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(int32(_pSorter.X15)-i32(1)))) + _3_pLast = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(int32(_pSorter.X15)-i32(1)))) _rc = _vdbeSortAllocUnpacked(tls, _3_pLast) if _rc != i32(0) { goto _9 } _3_pReadr = (*XPmaReader)(_sqlite3DbMallocZero(tls, _db, u64(80))) - *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X4))))) = _3_pReadr + *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X4)))) = _3_pReadr if _3_pReadr == nil { _rc = _sqlite3NomemError(tls, i32(88526)) } @@ -65925,7 +68777,7 @@ _9: if _rc != i32(0) { goto _11 } - _rc = _vdbeIncrMergerNew(tls, _3_pLast, _pMain, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pReadr.X10)))))) + _rc = _vdbeIncrMergerNew(tls, _3_pLast, _pMain, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pReadr.X10))))) if _rc != i32(0) { goto _12 } @@ -65954,7 +68806,7 @@ _20: } _9_p = (*XPmaReader)(unsafe.Pointer(uintptr(_pMain.X3) + 80*uintptr(_3_iTask))) func() { - if (*XIncrMerger)(_9_p.X10) != nil && ((*XSortSubtask)((*XIncrMerger)(_9_p.X10).X0) != (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+104*uintptr(_3_iTask))) || _3_iTask == (int32(_pSorter.X15)-i32(1)) && ((*XIncrMerger)(_9_p.X10).X5) != i32(0)) { + if (*XIncrMerger)(_9_p.X10) != nil && ((*XSortSubtask)((*XIncrMerger)(_9_p.X10).X0) != (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17))))+104*uintptr(_3_iTask))) || _3_iTask == (int32(_pSorter.X15)-i32(1)) && ((*XIncrMerger)(_9_p.X10).X5) != i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88550), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000))), unsafe.Pointer(str(86935))) crt.X__builtin_abort(tls) } @@ -65972,7 +68824,7 @@ _11: goto _31 _8: _rc = _vdbeMergeEngineInit(tls, _pTask0, _pMain, i32(0)) - *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X5))))) = _pMain + *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSorter.X5)))) = _pMain _pMain = nil _31: _4: @@ -65982,15 +68834,18 @@ _4: return _rc } -// This function is called as part of a SorterRewind() operation on a sorter -// that has already written two or more level-0 PMAs to one or more temp -// files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that -// can be used to incrementally merge all PMAs on disk. -// -// If successful, SQLITE_OK is returned and *ppOut set to point to the -// MergeEngine object at the root of the tree before returning. Or, if an -// error occurs, an SQLite error code is returned and the final value -// of *ppOut is undefined. +// C comment +// /* +// ** This function is called as part of a SorterRewind() operation on a sorter +// ** that has already written two or more level-0 PMAs to one or more temp +// ** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that +// ** can be used to incrementally merge all PMAs on disk. +// ** +// ** If successful, SQLITE_OK is returned and *ppOut set to point to the +// ** MergeEngine object at the root of the tree before returning. Or, if an +// ** error occurs, an SQLite error code is returned and the final value +// ** of *ppOut is undefined. +// */ func _vdbeSorterMergeTreeBuild(tls *crt.TLS, _pSorter *XVdbeSorter, _ppOut **XMergeEngine) (r0 int32) { var _rc, _iTask, _3_nDepth, _5_i, _5_iSeq, _6_nReader int32 var _3_iReadOff int64 @@ -65999,7 +68854,7 @@ func _vdbeSorterMergeTreeBuild(tls *crt.TLS, _pSorter *XVdbeSorter, _ppOut **XMe _pMain = nil _rc = i32(0) func() { - if (_pSorter.X13) == 0 && int32(_pSorter.X15) != i32(1) { + if _pSorter.X13 == 0 && int32(_pSorter.X15) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88434), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000))), unsafe.Pointer(str(87052))) crt.X__builtin_abort(tls) } @@ -66017,20 +68872,20 @@ _5: if _rc != i32(0) || _iTask >= int32(_pSorter.X15) { goto _9 } - _2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 104*uintptr(_iTask))) + _2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17)))) + 104*uintptr(_iTask))) func() { - if (_2_pTask.X5) <= i32(0) && i32(1) == 0 { + if _2_pTask.X5 <= i32(0) && i32(1) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88443), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000))), unsafe.Pointer(str(87094))) crt.X__builtin_abort(tls) } }() - if i32(0) == 0 && (_2_pTask.X5) == 0 { + if i32(0) == 0 && _2_pTask.X5 == 0 { goto _14 } _3_pRoot = nil _3_nDepth = _vdbeSorterTreeDepth(tls, _2_pTask.X5) _3_iReadOff = int64(i32(0)) - if (_2_pTask.X5) <= i32(16) { + if _2_pTask.X5 <= i32(16) { _rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _2_pTask.X5, &_3_iReadOff, &_3_pRoot) goto _16 } @@ -66041,19 +68896,19 @@ _5: } _5_i = i32(0) _18: - if _5_i >= (_2_pTask.X5) || _rc != i32(0) { + if _5_i >= _2_pTask.X5 || _rc != i32(0) { goto _22 } _6_pMerger = nil _6_nReader = func() int32 { - if ((_2_pTask.X5) - _5_i) < i32(16) { - return ((_2_pTask.X5) - _5_i) + if (_2_pTask.X5 - _5_i) < i32(16) { + return (_2_pTask.X5 - _5_i) } return i32(16) }() _rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _6_nReader, &_3_iReadOff, &_6_pMerger) if _rc == i32(0) { - _rc = _vdbeSorterAddToTree(tls, _2_pTask, _3_nDepth, postInc1(&_5_iSeq, int32(1)), _3_pRoot, _6_pMerger) + _rc = _vdbeSorterAddToTree(tls, _2_pTask, _3_nDepth, postInc1(&_5_iSeq, 1), _3_pRoot, _6_pMerger) } { p := &_5_i @@ -66104,11 +68959,14 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterMergeTreeBuildØ00__func__Ø000[0], str(87148), 25) } -// Allocate a new MergeEngine object capable of handling up to -// nReader PmaReader inputs. -// -// nReader is automatically rounded up to the next power of two. -// nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. +// C comment +// /* +// ** Allocate a new MergeEngine object capable of handling up to +// ** nReader PmaReader inputs. +// ** +// ** nReader is automatically rounded up to the next power of two. +// ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. +// */ func _vdbeMergeEngineNew(tls *crt.TLS, _nReader int32) (r0 *XMergeEngine) { var _N, _nByte int32 var _pNew *XMergeEngine @@ -66136,10 +68994,10 @@ _2: return (*XMergeEngine)(_sqlite3MallocZero(tls, uint64(_nByte))) }() if _pNew != nil { - *(*int32)(unsafe.Pointer(&(_pNew.X0))) = _N - *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = nil - *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X3))))) = (*XPmaReader)(unsafe.Pointer((*XMergeEngine)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 32*uintptr(i32(1)))))) - *(**int32)(unsafe.Pointer(&(_pNew.X2))) = (*int32)(unsafe.Pointer((*XPmaReader)(unsafe.Pointer(uintptr(_pNew.X3) + 80*uintptr(_N))))) + *(*int32)(unsafe.Pointer(&_pNew.X0)) = _N + *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X1)))) = nil + *(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X3)))) = (*XPmaReader)(unsafe.Pointer((*XMergeEngine)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew)) + 32*uintptr(i32(1)))))) + *(**int32)(unsafe.Pointer(&_pNew.X2)) = (*int32)(unsafe.Pointer((*XPmaReader)(unsafe.Pointer(uintptr(_pNew.X3) + 80*uintptr(_N))))) } return _pNew } @@ -66150,14 +69008,17 @@ func init() { crt.Xstrncpy(nil, &_vdbeMergeEngineNewØ00__func__Ø000[0], str(87205), 19) } -// Return the depth of a tree comprising nPMA PMAs, assuming a fanout of -// SORTER_MAX_MERGE_COUNT. The returned value does not include leaf nodes. -// -// i.e. -// -// nPMA<=16 -> TreeDepth() == 0 -// nPMA<=256 -> TreeDepth() == 1 -// nPMA<=65536 -> TreeDepth() == 2 +// C comment +// /* +// ** Return the depth of a tree comprising nPMA PMAs, assuming a fanout of +// ** SORTER_MAX_MERGE_COUNT. The returned value does not include leaf nodes. +// ** +// ** i.e. +// ** +// ** nPMA<=16 -> TreeDepth() == 0 +// ** nPMA<=256 -> TreeDepth() == 1 +// ** nPMA<=65536 -> TreeDepth() == 2 +// */ func _vdbeSorterTreeDepth(tls *crt.TLS, _nPMA int32) (r0 int32) { var _nDepth int32 var _nDiv int64 @@ -66172,16 +69033,19 @@ _0: return _nDepth } -// Allocate a new MergeEngine object to merge the contents of nPMA level-0 -// PMAs from pTask->file. If no error occurs, set *ppOut to point to -// the new object and return SQLITE_OK. Or, if an error does occur, set *ppOut -// to NULL and return an SQLite error code. -// -// When this function is called, *piOffset is set to the offset of the -// first PMA to read from pTask->file. Assuming no error occurs, it is -// set to the offset immediately following the last byte of the last -// PMA before returning. If an error does occur, then the final value of -// *piOffset is undefined. +// C comment +// /* +// ** Allocate a new MergeEngine object to merge the contents of nPMA level-0 +// ** PMAs from pTask->file. If no error occurs, set *ppOut to point to +// ** the new object and return SQLITE_OK. Or, if an error does occur, set *ppOut +// ** to NULL and return an SQLite error code. +// ** +// ** When this function is called, *piOffset is set to the offset of the +// ** first PMA to read from pTask->file. Assuming no error occurs, it is +// ** set to the offset immediately following the last byte of the last +// ** PMA before returning. If an error does occur, then the final value of +// ** *piOffset is undefined. +// */ func _vdbeMergeEngineLevel0(tls *crt.TLS, _pTask *XSortSubtask, _nPMA int32, _piOffset *int64, _ppOut **XMergeEngine) (r0 int32) { var _i, _rc int32 var _iOff, _1_nDummy int64 @@ -66200,7 +69064,7 @@ _1: } _1_nDummy = int64(i32(0)) _1_pReadr = (*XPmaReader)(unsafe.Pointer(uintptr(_pNew.X3) + 80*uintptr(_i))) - _rc = _vdbePmaReaderInit(tls, _pTask, (*XSorterFile)(unsafe.Pointer(&(_pTask.X7))), _iOff, _1_pReadr, &_1_nDummy) + _rc = _vdbePmaReaderInit(tls, _pTask, (*XSorterFile)(unsafe.Pointer(&_pTask.X7)), _iOff, _1_pReadr, &_1_nDummy) _iOff = _1_pReadr.X1 _i += 1 goto _1 @@ -66216,36 +69080,39 @@ _5: panic(0) } -// Initialize PmaReader pReadr to scan through the PMA stored in file pFile -// starting at offset iStart and ending at offset iEof-1. This function -// leaves the PmaReader pointing to the first key in the PMA (or EOF if the -// PMA is empty). -// -// If the pnByte parameter is NULL, then it is assumed that the file -// contains a single PMA, and that that PMA omits the initial length varint. +// C comment +// /* +// ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile +// ** starting at offset iStart and ending at offset iEof-1. This function +// ** leaves the PmaReader pointing to the first key in the PMA (or EOF if the +// ** PMA is empty). +// ** +// ** If the pnByte parameter is NULL, then it is assumed that the file +// ** contains a single PMA, and that that PMA omits the initial length varint. +// */ func _vdbePmaReaderInit(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _iStart int64, _pReadr *XPmaReader, _pnByte *int64) (r0 int32) { var _rc int32 var _1_nByte uint64 func() { - if (_pFile.X1) <= _iStart { + if _pFile.X1 <= _iStart { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86747), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87224))) crt.X__builtin_abort(tls) } }() func() { - if (_pReadr.X5) != nil || (_pReadr.X2) != i32(0) { + if _pReadr.X5 != nil || _pReadr.X2 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86748), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87243))) crt.X__builtin_abort(tls) } }() func() { - if (_pReadr.X7) != nil { + if _pReadr.X7 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86749), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87282))) crt.X__builtin_abort(tls) } }() func() { - if (_pReadr.X9) != nil { + if _pReadr.X9 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86750), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87301))) crt.X__builtin_abort(tls) } @@ -66254,7 +69121,7 @@ func _vdbePmaReaderInit(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, if _rc == i32(0) { _1_nByte = u64(0) _rc = _vdbePmaReadVarint(tls, _pReadr, &_1_nByte) - *(*int64)(unsafe.Pointer(&(_pReadr.X1))) = int64(uint64(_pReadr.X0) + _1_nByte) + *(*int64)(unsafe.Pointer(&_pReadr.X1)) = int64(uint64(_pReadr.X0) + _1_nByte) { p := _pnByte *p = int64(uint64(*p) + _1_nByte) @@ -66273,9 +69140,12 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaReaderInitØ00__func__Ø000[0], str(87317), 18) } -// Attach PmaReader pReadr to file pFile (if it is not already attached to -// that file) and seek it to offset iOff within the file. Return SQLITE_OK -// if successful, or an SQLite error code if an error occurs. +// C comment +// /* +// ** Attach PmaReader pReadr to file pFile (if it is not already attached to +// ** that file) and seek it to offset iOff within the file. Return SQLITE_OK +// ** if successful, or an SQLite error code if an error occurs. +// */ func _vdbePmaReaderSeek(tls *crt.TLS, _pTask *XSortSubtask, _pReadr *XPmaReader, _pFile *XSorterFile, _iOff int64) (r0 int32) { var _rc, _2_pgsz, _2_iBuf, _4_nRead int32 _rc = i32(0) @@ -66288,36 +69158,36 @@ func _vdbePmaReaderSeek(tls *crt.TLS, _pTask *XSortSubtask, _pReadr *XPmaReader, if _sqlite3FaultSim(tls, i32(201)) != 0 { return i32(266) } - if (_pReadr.X9) != nil { - _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), (unsafe.Pointer)(_pReadr.X9)) - *(**uint8)(unsafe.Pointer(&(_pReadr.X9))) = nil + if _pReadr.X9 != nil { + _sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), unsafe.Pointer(_pReadr.X9)) + *(**uint8)(unsafe.Pointer(&_pReadr.X9)) = nil } - *(*int64)(unsafe.Pointer(&(_pReadr.X0))) = _iOff - *(*int64)(unsafe.Pointer(&(_pReadr.X1))) = _pFile.X1 - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pReadr.X4))))) = (*Xsqlite3_file)(_pFile.X0) - _rc = _vdbeSorterMapFile(tls, _pTask, _pFile, (**uint8)(unsafe.Pointer(&(_pReadr.X9)))) - if _rc != i32(0) || (_pReadr.X9) != nil { + *(*int64)(unsafe.Pointer(&_pReadr.X0)) = _iOff + *(*int64)(unsafe.Pointer(&_pReadr.X1)) = _pFile.X1 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pReadr.X4)))) = (*Xsqlite3_file)(_pFile.X0) + _rc = _vdbeSorterMapFile(tls, _pTask, _pFile, (**uint8)(unsafe.Pointer(&_pReadr.X9))) + if _rc != i32(0) || _pReadr.X9 != nil { goto _6 } _2_pgsz = (*XVdbeSorter)(_pTask.X2).X3 - _2_iBuf = int32((_pReadr.X0) % int64(_2_pgsz)) - if (_pReadr.X7) != nil { + _2_iBuf = int32(_pReadr.X0 % int64(_2_pgsz)) + if _pReadr.X7 != nil { goto _7 } - *(**uint8)(unsafe.Pointer(&(_pReadr.X7))) = (*uint8)(_sqlite3Malloc(tls, uint64(_2_pgsz))) - if (_pReadr.X7) == nil { + *(**uint8)(unsafe.Pointer(&_pReadr.X7)) = (*uint8)(_sqlite3Malloc(tls, uint64(_2_pgsz))) + if _pReadr.X7 == nil { _rc = _sqlite3NomemError(tls, i32(86669)) } - *(*int32)(unsafe.Pointer(&(_pReadr.X8))) = _2_pgsz + *(*int32)(unsafe.Pointer(&_pReadr.X8)) = _2_pgsz _7: if _rc != i32(0) || _2_iBuf == 0 { goto _10 } _4_nRead = _2_pgsz - _2_iBuf - if ((_pReadr.X0) + int64(_4_nRead)) > (_pReadr.X1) { - _4_nRead = int32((_pReadr.X1) - (_pReadr.X0)) + if (_pReadr.X0 + int64(_4_nRead)) > _pReadr.X1 { + _4_nRead = int32(_pReadr.X1 - _pReadr.X0) } - _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pReadr.X4), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pReadr.X7))+1*uintptr(_2_iBuf)))), _4_nRead, _pReadr.X0) + _rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pReadr.X4), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pReadr.X7))+1*uintptr(_2_iBuf)))), _4_nRead, _pReadr.X0) _10: _6: return _rc @@ -66329,18 +69199,21 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaReaderSeekØ00__func__Ø000[0], str(87378), 18) } -// Attempt to memory map file pFile. If successful, set *pp to point to the -// new mapping and return SQLITE_OK. If the mapping is not attempted -// (because the file is too large or the VFS layer is configured not to use -// mmap), return SQLITE_OK and set *pp to NULL. -// -// Or, if an error occurs, return an SQLite error code. The final value of -// *pp is undefined in this case. +// C comment +// /* +// ** Attempt to memory map file pFile. If successful, set *pp to point to the +// ** new mapping and return SQLITE_OK. If the mapping is not attempted +// ** (because the file is too large or the VFS layer is configured not to use +// ** mmap), return SQLITE_OK and set *pp to NULL. +// ** +// ** Or, if an error occurs, return an SQLite error code. The final value of +// ** *pp is undefined in this case. +// */ func _vdbeSorterMapFile(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _pp **uint8) (r0 int32) { var _rc int32 var _1_pFd *Xsqlite3_file _rc = i32(0) - if (_pFile.X1) > int64((*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6).X32) { + if _pFile.X1 > int64((*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6).X32) { goto _0 } _1_pFd = (*Xsqlite3_file)(_pFile.X0) @@ -66351,25 +69224,28 @@ _0: return _rc } -// Read a varint from the stream of data accessed by p. Set *pnOut to -// the value read. +// C comment +// /* +// ** Read a varint from the stream of data accessed by p. Set *pnOut to +// ** the value read. +// */ func _vdbePmaReadVarint(tls *crt.TLS, _p *XPmaReader, _pnOut *uint64) (r0 int32) { var _iBuf, _4_i, _4_rc int32 var _4_a *uint8 var _4_aVarint [16]uint8 - if (_p.X9) != nil { + if _p.X9 != nil { { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X9))+1*uintptr(_p.X0))), _pnOut)) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X9))+1*uintptr(_p.X0))), _pnOut)) sink6(*p) } goto _1 } - _iBuf = int32((_p.X0) % int64(_p.X8)) - if _iBuf != 0 && (((_p.X8) - _iBuf) >= i32(9)) { + _iBuf = int32(_p.X0 % int64(_p.X8)) + if _iBuf != 0 && ((_p.X8 - _iBuf) >= i32(9)) { { - p := (*int64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7))+1*uintptr(_iBuf))), _pnOut)) + p := (*int64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X7))+1*uintptr(_iBuf))), _pnOut)) sink6(*p) } goto _4 @@ -66380,8 +69256,8 @@ _5: if _4_rc != 0 { return _4_rc } - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_4_aVarint)) + 1*uintptr(postInc1(&_4_i, int32(1))&i32(15)))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_a)) + 1*uintptr(i32(0)))) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_a)) + 1*uintptr(i32(0))))) & i32(128)) != i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_4_aVarint)) + 1*uintptr(postInc1(&_4_i, 1)&i32(15)))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_a)) + 1*uintptr(i32(0)))) + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_a)) + 1*uintptr(i32(0))))) & i32(128)) != i32(0) { goto _5 } _sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(&_4_aVarint)), _pnOut) @@ -66394,40 +69270,43 @@ _1: panic(0) } -// Read the next nByte bytes of data from the PMA p. -// If successful, set *ppOut to point to a buffer containing the data -// and return SQLITE_OK. Otherwise, if an error occurs, return an SQLite -// error code. -// -// The buffer returned in *ppOut is only valid until the -// next call to this function. +// C comment +// /* +// ** Read the next nByte bytes of data from the PMA p. +// ** If successful, set *ppOut to point to a buffer containing the data +// ** and return SQLITE_OK. Otherwise, if an error occurs, return an SQLite +// ** error code. +// ** +// ** The buffer returned in *ppOut is only valid until the +// ** next call to this function. +// */ func _vdbePmaReadBlob(tls *crt.TLS, _p *XPmaReader, _nByte int32, _ppOut **uint8) (r0 int32) { var _iBuf, _nAvail, _2_nRead, _2_rc, _6_nRem, _7_nNew, _8_rc, _8_nCopy int32 var _7_aNew, _8_aNext *uint8 - if (_p.X9) != nil { - *_ppOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X9)) + 1*uintptr(_p.X0))) + if _p.X9 != nil { + *_ppOut = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X9)) + 1*uintptr(_p.X0))) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + int64(_nByte) sink6(*p) } return i32(0) } func() { - if (_p.X7) == nil { + if _p.X7 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86514), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87396))) crt.X__builtin_abort(tls) } }() - _iBuf = int32((_p.X0) % int64(_p.X8)) + _iBuf = int32(_p.X0 % int64(_p.X8)) if _iBuf != i32(0) { goto _3 } - if ((_p.X1) - (_p.X0)) > int64(_p.X8) { + if (_p.X1 - _p.X0) > int64(_p.X8) { _2_nRead = _p.X8 goto _5 } - _2_nRead = int32((_p.X1) - (_p.X0)) + _2_nRead = int32(_p.X1 - _p.X0) _5: func() { if _2_nRead <= i32(0) { @@ -66435,7 +69314,7 @@ _5: crt.X__builtin_abort(tls) } }() - _2_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_p.X4), (unsafe.Pointer)(_p.X7), _2_nRead, _p.X0) + _2_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_p.X4), unsafe.Pointer(_p.X7), _2_nRead, _p.X0) func() { if _2_rc == i32(522) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86534), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87415))) @@ -66446,40 +69325,40 @@ _5: return _2_rc } _3: - _nAvail = (_p.X8) - _iBuf + _nAvail = _p.X8 - _iBuf if _nByte <= _nAvail { - *_ppOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 1*uintptr(_iBuf))) + *_ppOut = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X7)) + 1*uintptr(_iBuf))) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + int64(_nByte) sink6(*p) } goto _12 } - if (_p.X2) >= _nByte { + if _p.X2 >= _nByte { goto _13 } _7_nNew = func() int32 { - if i32(128) > ((_p.X2) * i32(2)) { + if i32(128) > (_p.X2 * i32(2)) { return i32(128) } - return ((_p.X2) * i32(2)) + return (_p.X2 * i32(2)) }() _16: if _nByte > _7_nNew { _7_nNew = _7_nNew * i32(2) goto _16 } - _7_aNew = (*uint8)(_sqlite3Realloc(tls, (unsafe.Pointer)(_p.X5), uint64(_7_nNew))) + _7_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer(_p.X5), uint64(_7_nNew))) if _7_aNew == nil { return _sqlite3NomemError(tls, i32(86557)) } - *(*int32)(unsafe.Pointer(&(_p.X2))) = _7_nNew - *(**uint8)(unsafe.Pointer(&(_p.X5))) = _7_aNew + *(*int32)(unsafe.Pointer(&_p.X2)) = _7_nNew + *(**uint8)(unsafe.Pointer(&_p.X5)) = _7_aNew _13: - crt.Xmemcpy(tls, (unsafe.Pointer)(_p.X5), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7))+1*uintptr(_iBuf)))), uint64(_nAvail)) + crt.Xmemcpy(tls, unsafe.Pointer(_p.X5), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X7))+1*uintptr(_iBuf)))), uint64(_nAvail)) { - p := (*int64)(unsafe.Pointer(&(_p.X0))) + p := (*int64)(unsafe.Pointer(&_p.X0)) *p = (*p) + int64(_nAvail) sink6(*p) } @@ -66489,7 +69368,7 @@ _19: goto _20 } _8_nCopy = _6_nRem - if _6_nRem > (_p.X8) { + if _6_nRem > _p.X8 { _8_nCopy = _p.X8 } _8_rc = _vdbePmaReadBlob(tls, _p, _8_nCopy, &_8_aNext) @@ -66497,12 +69376,12 @@ _19: return _8_rc } func() { - if _8_aNext == (_p.X5) { + if _8_aNext == _p.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86579), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87443))) crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X5))+1*uintptr(_nByte-_6_nRem)))), (unsafe.Pointer)(_8_aNext), uint64(_8_nCopy)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X5))+1*uintptr(_nByte-_6_nRem)))), unsafe.Pointer(_8_aNext), uint64(_8_nCopy)) { p := &_6_nRem *p = (*p) - _8_nCopy @@ -66521,15 +69400,18 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaReadBlobØ00__func__Ø000[0], str(87460), 16) } -// Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if -// no error occurs, or an SQLite error code if one does. +// C comment +// /* +// ** Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if +// ** no error occurs, or an SQLite error code if one does. +// */ func _vdbePmaReaderNext(tls *crt.TLS, _pReadr *XPmaReader) (r0 int32) { var _rc, _1_bEof int32 var _nRec uint64 var _1_pIncr *XIncrMerger _rc = i32(0) _nRec = u64(0) - if (_pReadr.X0) < (_pReadr.X1) { + if _pReadr.X0 < _pReadr.X1 { goto _0 } _1_pIncr = (*XIncrMerger)(_pReadr.X10) @@ -66538,8 +69420,8 @@ func _vdbePmaReaderNext(tls *crt.TLS, _pReadr *XPmaReader) (r0 int32) { goto _1 } _rc = _vdbeIncrSwap(tls, _1_pIncr) - if (_rc == i32(0)) && ((_1_pIncr.X4) == i32(0)) { - _rc = _vdbePmaReaderSeek(tls, (*XSortSubtask)(_1_pIncr.X0), _pReadr, (*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_1_pIncr.X6)))))+16*uintptr(i32(0)))), _1_pIncr.X2) + if (_rc == i32(0)) && (_1_pIncr.X4 == i32(0)) { + _rc = _vdbePmaReaderSeek(tls, (*XSortSubtask)(_1_pIncr.X0), _pReadr, (*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_1_pIncr.X6))))+16*uintptr(i32(0)))), _1_pIncr.X2) _1_bEof = i32(0) } _1: @@ -66552,45 +69434,48 @@ _0: _rc = _vdbePmaReadVarint(tls, _pReadr, &_nRec) } if _rc == i32(0) { - *(*int32)(unsafe.Pointer(&(_pReadr.X3))) = int32(_nRec) - _rc = _vdbePmaReadBlob(tls, _pReadr, int32(_nRec), (**uint8)(unsafe.Pointer(&(_pReadr.X6)))) + *(*int32)(unsafe.Pointer(&_pReadr.X3)) = int32(_nRec) + _rc = _vdbePmaReadBlob(tls, _pReadr, int32(_nRec), (**uint8)(unsafe.Pointer(&_pReadr.X6))) } return _rc } -// This function is called when the PmaReader corresponding to pIncr has -// finished reading the contents of aFile[0]. Its purpose is to "refill" -// aFile[0] such that the PmaReader should start rereading it from the -// beginning. -// -// For single-threaded objects, this is accomplished by literally reading -// keys from pIncr->pMerger and repopulating aFile[0]. -// -// For multi-threaded objects, all that is required is to wait until the -// background thread is finished (if it is not already) and then swap -// aFile[0] and aFile[1] in place. If the contents of pMerger have not -// been exhausted, this function also launches a new background thread -// to populate the new aFile[1]. -// -// SQLITE_OK is returned on success, or an SQLite error code otherwise. +// C comment +// /* +// ** This function is called when the PmaReader corresponding to pIncr has +// ** finished reading the contents of aFile[0]. Its purpose is to "refill" +// ** aFile[0] such that the PmaReader should start rereading it from the +// ** beginning. +// ** +// ** For single-threaded objects, this is accomplished by literally reading +// ** keys from pIncr->pMerger and repopulating aFile[0]. +// ** +// ** For multi-threaded objects, all that is required is to wait until the +// ** background thread is finished (if it is not already) and then swap +// ** aFile[0] and aFile[1] in place. If the contents of pMerger have not +// ** been exhausted, this function also launches a new background thread +// ** to populate the new aFile[1]. +// ** +// ** SQLITE_OK is returned on success, or an SQLite error code otherwise. +// */ func _vdbeIncrSwap(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) { var _rc int32 var _2_f0 XSorterFile _rc = i32(0) - if (_pIncr.X5) == 0 { + if _pIncr.X5 == 0 { goto _0 } _rc = _vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.X0)) if _rc == i32(0) { - _2_f0 = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))) - *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))) - *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))) = _2_f0 + _2_f0 = *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))) + *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))) + *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))) = _2_f0 } if _rc != i32(0) { goto _2 } - if ((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))).X1) == (_pIncr.X2) { - *(*int32)(unsafe.Pointer(&(_pIncr.X4))) = i32(1) + if ((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))).X1) == _pIncr.X2 { + *(*int32)(unsafe.Pointer(&_pIncr.X4)) = i32(1) goto _4 } _rc = _vdbeIncrBgPopulate(tls, _pIncr) @@ -66599,20 +69484,23 @@ _2: goto _5 _0: _rc = _vdbeIncrPopulate(tls, _pIncr) - *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))) - if ((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))).X1) == (_pIncr.X2) { - *(*int32)(unsafe.Pointer(&(_pIncr.X4))) = i32(1) + *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))) + if ((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))).X1) == _pIncr.X2 { + *(*int32)(unsafe.Pointer(&_pIncr.X4)) = i32(1) } _5: return _rc } -// Launch a background thread to populate aFile[1] of pIncr. +// C comment +// /* +// ** Launch a background thread to populate aFile[1] of pIncr. +// */ func _vdbeIncrBgPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) { var _p unsafe.Pointer - _p = (unsafe.Pointer)(_pIncr) + _p = unsafe.Pointer(_pIncr) func() { - if (_pIncr.X5) == 0 { + if _pIncr.X5 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87940), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeIncrBgPopulateØ00__func__Ø000))), unsafe.Pointer(str(87476))) crt.X__builtin_abort(tls) } @@ -66626,8 +69514,11 @@ func init() { crt.Xstrncpy(nil, &_vdbeIncrBgPopulateØ00__func__Ø000[0], str(87494), 19) } -// The main routine for background threads that populate aFile[1] of -// multi-threaded IncrMerger objects. +// C comment +// /* +// ** The main routine for background threads that populate aFile[1] of +// ** multi-threaded IncrMerger objects. +// */ func _vdbeIncrPopulateThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) { var _pRet unsafe.Pointer var _pIncr *XIncrMerger @@ -66637,9 +69528,12 @@ func _vdbeIncrPopulateThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Poin return _pRet } -// Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format -// of the data stored in aFile[1] is the same as that used by regular PMAs, -// except that the number-of-bytes varint is omitted from the start. +// C comment +// /* +// ** Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format +// ** of the data stored in aFile[1] is the same as that used by regular PMAs, +// ** except that the number-of-bytes varint is omitted from the start. +// */ func _vdbeIncrPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) { var _rc, _rc2, _1_dummy, _1_nKey int32 var _iStart, _1_iEof int64 @@ -66650,11 +69544,11 @@ func _vdbeIncrPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) { var _writer XPmaWriter _rc = i32(0) _iStart = _pIncr.X2 - _pOut = (*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))) + _pOut = (*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))) _pTask = (*XSortSubtask)(_pIncr.X0) _pMerger = (*XMergeEngine)(_pIncr.X1) func() { - if (_pIncr.X4) != i32(0) { + if _pIncr.X4 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87894), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000))), unsafe.Pointer(str(87513))) crt.X__builtin_abort(tls) } @@ -66664,9 +69558,9 @@ _2: if _rc != i32(0) { goto _3 } - _1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1))))))) + _1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(i32(1))))))) _1_nKey = _1_pReader.X3 - _1_iEof = (_writer.X5) + int64(_writer.X4) + _1_iEof = _writer.X5 + int64(_writer.X4) if (*Xsqlite3_file)(_1_pReader.X4) == nil { goto _3 } @@ -66684,7 +69578,7 @@ _2: _rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pIncr.X1), &_1_dummy) goto _2 _3: - _rc2 = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&(_pOut.X1)))) + _rc2 = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&_pOut.X1))) if _rc == i32(0) { _rc = _rc2 } @@ -66701,16 +69595,19 @@ func init() { crt.Xstrncpy(nil, &_vdbeIncrPopulateØ00__func__Ø000[0], str(87557), 17) } -// Advance the MergeEngine to its next entry. -// Set *pbEof to true there is no next entry because -// the MergeEngine has reached the end of all its inputs. -// -// Return SQLITE_OK if successful or an error code if an error occurs. +// C comment +// /* +// ** Advance the MergeEngine to its next entry. +// ** Set *pbEof to true there is no next entry because +// ** the MergeEngine has reached the end of all its inputs. +// ** +// ** Return SQLITE_OK if successful or an error code if an error occurs. +// */ func _vdbeMergeEngineStep(tls *crt.TLS, _pMerger *XMergeEngine, _pbEof *int32) (r0 int32) { var _rc, _iPrev, _1_i, _1_bCached, _2_iRes int32 var _1_pReadr1, _1_pReadr2 *XPmaReader var _pTask *XSortSubtask - _iPrev = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1)))) + _iPrev = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(i32(1)))) _pTask = (*XSortSubtask)(_pMerger.X1) _rc = _vdbePmaReaderNext(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+80*uintptr(_iPrev)))) if _rc != i32(0) { @@ -66719,7 +69616,7 @@ func _vdbeMergeEngineStep(tls *crt.TLS, _pMerger *XMergeEngine, _pbEof *int32) ( _1_bCached = i32(0) _1_pReadr1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(_iPrev&i32(65534)))) _1_pReadr2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(_iPrev|i32(1)))) - _1_i = ((_pMerger.X0) + _iPrev) / i32(2) + _1_i = (_pMerger.X0 + _iPrev) / i32(2) _1: if _1_i <= i32(0) { goto _4 @@ -66732,26 +69629,27 @@ _1: _2_iRes = i32(-1) goto _8 } - _2_iRes = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 - }{(_pTask.X6)})))(tls, _pTask, &_1_bCached, (unsafe.Pointer)(_1_pReadr1.X6), _1_pReadr1.X3, (unsafe.Pointer)(_1_pReadr2.X6), _1_pReadr2.X3) + _2_iRes = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 { + v := _pTask.X6 + return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pTask, &_1_bCached, unsafe.Pointer(_1_pReadr1.X6), _1_pReadr1.X3, unsafe.Pointer(_1_pReadr2.X6), _1_pReadr2.X3) _8: if (_2_iRes < i32(0)) || ((_2_iRes == i32(0)) && (crt.P2U(unsafe.Pointer(_1_pReadr1)) < crt.P2U(unsafe.Pointer(_1_pReadr2)))) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i))) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr1)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 80)) - _1_pReadr2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i^i32(1))))))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_1_i))) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr1)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 80)) + _1_pReadr2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_1_i^i32(1))))))) _1_bCached = i32(0) goto _12 } - if (*Xsqlite3_file)(_1_pReadr1.X4) != nil { + if _1_pReadr1.X4 != nil { _1_bCached = i32(0) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i))) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr2)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 80)) - _1_pReadr1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i^i32(1))))))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_1_i))) = int32(int64((uintptr(unsafe.Pointer(_1_pReadr2)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 80)) + _1_pReadr1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_1_i^i32(1))))))) _12: _1_i = _1_i / i32(2) goto _1 _4: - *_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+80*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1))))))).X4) == nil) + *_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+80*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(i32(1))))))).X4) == nil) _0: return func() int32 { if _rc == i32(0) { @@ -66764,12 +69662,15 @@ _0: panic(0) } -// pRoot is the root of an incremental merge-tree with depth nDepth (according -// to vdbeSorterTreeDepth()). pLeaf is the iSeq'th leaf to be added to the -// tree, counting from zero. This function adds pLeaf to the tree. -// -// If successful, SQLITE_OK is returned. If an error occurs, an SQLite error -// code is returned and pLeaf is freed. +// C comment +// /* +// ** pRoot is the root of an incremental merge-tree with depth nDepth (according +// ** to vdbeSorterTreeDepth()). pLeaf is the iSeq'th leaf to be added to the +// ** tree, counting from zero. This function adds pLeaf to the tree. +// ** +// ** If successful, SQLITE_OK is returned. If an error occurs, an SQLite error +// ** code is returned and pLeaf is freed. +// */ func _vdbeSorterAddToTree(tls *crt.TLS, _pTask *XSortSubtask, _nDepth int32, _iSeq int32, _pRoot *XMergeEngine, _pLeaf *XMergeEngine) (r0 int32) { var _rc, _nDiv, _i, _2_iIter int32 var _2_pReadr *XPmaReader @@ -66803,7 +69704,7 @@ _4: _rc = _sqlite3NomemError(tls, i32(88392)) goto _11 } - _rc = _vdbeIncrMergerNew(tls, _pTask, _3_pNew, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pReadr.X10)))))) + _rc = _vdbeIncrMergerNew(tls, _pTask, _3_pNew, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pReadr.X10))))) _11: _9: if _rc == i32(0) { @@ -66822,10 +69723,13 @@ _14: return _rc } -// Allocate and return a new IncrMerger object to read data from pMerger. -// -// If an OOM condition is encountered, return NULL. In this case free the -// pMerger argument before returning. +// C comment +// /* +// ** Allocate and return a new IncrMerger object to read data from pMerger. +// ** +// ** If an OOM condition is encountered, return NULL. In this case free the +// ** pMerger argument before returning. +// */ func _vdbeIncrMergerNew(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _ppOut **XIncrMerger) (r0 int32) { var _rc int32 var _pIncr *XIncrMerger @@ -66837,16 +69741,16 @@ func _vdbeIncrMergerNew(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngi return _sqlite3MallocZero(tls, u64(72)) }())) if _pIncr != nil { - *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIncr.X1))))) = _pMerger - *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIncr.X0))))) = _pTask - *(*int32)(unsafe.Pointer(&(_pIncr.X3))) = func() int32 { + *(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIncr.X1)))) = _pMerger + *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIncr.X0)))) = _pTask + *(*int32)(unsafe.Pointer(&_pIncr.X3)) = func() int32 { if (((*XVdbeSorter)(_pTask.X2).X2) + i32(9)) > (((*XVdbeSorter)(_pTask.X2).X1) / i32(2)) { return (((*XVdbeSorter)(_pTask.X2).X2) + i32(9)) } return (((*XVdbeSorter)(_pTask.X2).X1) / i32(2)) }() { - p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1))) + p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1))) *p = (*p) + int64(_pIncr.X3) sink6(*p) } @@ -66864,9 +69768,12 @@ func init() { crt.Xstrncpy(nil, &_vdbeSorterSetupMergeØ00__func__Ø000[0], str(87574), 21) } -// Set the "use-threads" flag on object pIncr. +// C comment +// /* +// ** Set the "use-threads" flag on object pIncr. +// */ func _vdbeIncrMergerSetThreads(tls *crt.TLS, _pIncr *XIncrMerger) { - *(*int32)(unsafe.Pointer(&(_pIncr.X5))) = i32(1) + *(*int32)(unsafe.Pointer(&_pIncr.X5)) = i32(1) { p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&((*XSortSubtask)(_pIncr.X0).X8))).X1))) *p = (*p) - int64(_pIncr.X3) @@ -66874,15 +69781,18 @@ func _vdbeIncrMergerSetThreads(tls *crt.TLS, _pIncr *XIncrMerger) { } } -// If the PmaReader passed as the first argument is not an incremental-reader -// (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes -// the vdbePmaReaderIncrMergeInit() function with the parameters passed to -// this routine to initialize the incremental merge. -// -// If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), -// then a background thread is launched to call vdbePmaReaderIncrMergeInit(). -// Or, if the IncrMerger is single threaded, the same function is called -// using the current thread. +// C comment +// /* +// ** If the PmaReader passed as the first argument is not an incremental-reader +// ** (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes +// ** the vdbePmaReaderIncrMergeInit() function with the parameters passed to +// ** this routine to initialize the incremental merge. +// ** +// ** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), +// ** then a background thread is launched to call vdbePmaReaderIncrMergeInit(). +// ** Or, if the IncrMerger is single threaded, the same function is called +// ** using the current thread. +// */ func _vdbePmaReaderIncrInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) { var _rc int32 var _2_pCtx unsafe.Pointer @@ -66893,13 +69803,13 @@ func _vdbePmaReaderIncrInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 goto _0 } func() { - if (_pIncr.X5) != i32(0) && _eMode != i32(1) { + if _pIncr.X5 != i32(0) && _eMode != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88284), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrInitØ00__func__Ø000))), unsafe.Pointer(str(87595))) crt.X__builtin_abort(tls) } }() - if (_pIncr.X5) != 0 { - _2_pCtx = (unsafe.Pointer)(_pReadr) + if _pIncr.X5 != 0 { + _2_pCtx = unsafe.Pointer(_pReadr) _rc = _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.X0), _vdbePmaReaderBgIncrInit, _2_pCtx) goto _5 } @@ -66915,8 +69825,11 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaReaderIncrInitØ00__func__Ø000[0], str(87640), 22) } -// The main routine for vdbePmaReaderIncrMergeInit() operations run in -// background threads. +// C comment +// /* +// ** The main routine for vdbePmaReaderIncrMergeInit() operations run in +// ** background threads. +// */ func _vdbePmaReaderBgIncrInit(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) { var _pRet unsafe.Pointer var _pReader *XPmaReader @@ -66926,37 +69839,40 @@ func _vdbePmaReaderBgIncrInit(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Poi return _pRet } -// The PmaReader passed as the first argument is guaranteed to be an -// incremental-reader (pReadr->pIncr!=0). This function serves to open -// and/or initialize the temp file related fields of the IncrMerge -// object at (pReadr->pIncr). -// -// If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders -// in the sub-tree headed by pReadr are also initialized. Data is then -// loaded into the buffers belonging to pReadr and it is set to point to -// the first key in its range. -// -// If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed -// to be a multi-threaded PmaReader and this function is being called in a -// background thread. In this case all PmaReaders in the sub-tree are -// initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to -// pReadr is populated. However, pReadr itself is not set up to point -// to its first key. A call to vdbePmaReaderNext() is still required to do -// that. -// -// The reason this function does not call vdbePmaReaderNext() immediately -// in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has -// to block on thread (pTask->thread) before accessing aFile[1]. But, since -// this entire function is being run by thread (pTask->thread), that will -// lead to the current background thread attempting to join itself. -// -// Finally, if argument eMode is set to INCRINIT_ROOT, it may be assumed -// that pReadr->pIncr is a multi-threaded IncrMerge objects, and that all -// child-trees have already been initialized using IncrInit(INCRINIT_TASK). -// In this case vdbePmaReaderNext() is called on all child PmaReaders and -// the current PmaReader set to point to the first key in its range. -// -// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** The PmaReader passed as the first argument is guaranteed to be an +// ** incremental-reader (pReadr->pIncr!=0). This function serves to open +// ** and/or initialize the temp file related fields of the IncrMerge +// ** object at (pReadr->pIncr). +// ** +// ** If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders +// ** in the sub-tree headed by pReadr are also initialized. Data is then +// ** loaded into the buffers belonging to pReadr and it is set to point to +// ** the first key in its range. +// ** +// ** If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed +// ** to be a multi-threaded PmaReader and this function is being called in a +// ** background thread. In this case all PmaReaders in the sub-tree are +// ** initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to +// ** pReadr is populated. However, pReadr itself is not set up to point +// ** to its first key. A call to vdbePmaReaderNext() is still required to do +// ** that. +// ** +// ** The reason this function does not call vdbePmaReaderNext() immediately +// ** in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has +// ** to block on thread (pTask->thread) before accessing aFile[1]. But, since +// ** this entire function is being run by thread (pTask->thread), that will +// ** lead to the current background thread attempting to join itself. +// ** +// ** Finally, if argument eMode is set to INCRINIT_ROOT, it may be assumed +// ** that pReadr->pIncr is a multi-threaded IncrMerge objects, and that all +// ** child-trees have already been initialized using IncrInit(INCRINIT_TASK). +// ** In this case vdbePmaReaderNext() is called on all child PmaReaders and +// ** the current PmaReader set to point to the first key in its range. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// */ func _vdbePmaReaderIncrMergeInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) { var _rc, _1_mxSz int32 var _db *Xsqlite3 @@ -66972,37 +69888,37 @@ func _vdbePmaReaderIncrMergeInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32 goto _0 } _1_mxSz = _pIncr.X3 - if (_pIncr.X5) == 0 { + if _pIncr.X5 == 0 { goto _1 } - _rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(0)))).X0)))))) + _rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(0)))).X0)))))) if _rc == i32(0) { - _rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))).X0)))))) + _rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))).X0)))))) } goto _3 _1: - if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0) == nil { + if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X0) == nil { func() { - if ((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1) <= int64(i32(0)) { + if ((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1) <= int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88217), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000))), unsafe.Pointer(str(87662))) crt.X__builtin_abort(tls) } }() - _rc = _vdbeSorterOpenTempFile(tls, _db, (*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1, (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0)))))) - *(*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1))) = int64(i32(0)) + _rc = _vdbeSorterOpenTempFile(tls, _db, (*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1, (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X0)))))) + *(*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1))) = int64(i32(0)) } if _rc == i32(0) { - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 16*uintptr(i32(1)))).X0))))) = (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0) - *(*int64)(unsafe.Pointer(&(_pIncr.X2))) = (*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1 + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]XSorterFile)(unsafe.Pointer(&_pIncr.X6)))) + 16*uintptr(i32(1)))).X0))))) = (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X0) + *(*int64)(unsafe.Pointer(&_pIncr.X2)) = (*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1 { - p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1))) + p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&_pTask.X8)).X1))) *p = (*p) + int64(_1_mxSz) sink6(*p) } } _3: _0: - if (_rc == i32(0)) && (_pIncr.X5) != 0 { + if (_rc == i32(0)) && _pIncr.X5 != 0 { func() { if _eMode != i32(2) && _eMode != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88241), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000))), unsafe.Pointer(str(87682))) @@ -67017,22 +69933,25 @@ _0: return _rc } -// Initialize the MergeEngine object passed as the second argument. Once this -// function returns, the first key of merged data may be read from the -// MergeEngine object in the usual fashion. -// -// If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge -// objects attached to the PmaReader objects that the merger reads from have -// already been populated, but that they have not yet populated aFile[0] and -// set the PmaReader objects up to read from it. In this case all that is -// required is to call vdbePmaReaderNext() on each PmaReader to point it at -// its first key. -// -// Otherwise, if eMode is any value other than INCRINIT_ROOT, then use -// vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data -// to pMerger. -// -// SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** Initialize the MergeEngine object passed as the second argument. Once this +// ** function returns, the first key of merged data may be read from the +// ** MergeEngine object in the usual fashion. +// ** +// ** If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge +// ** objects attached to the PmaReader objects that the merger reads from have +// ** already been populated, but that they have not yet populated aFile[0] and +// ** set the PmaReader objects up to read from it. In this case all that is +// ** required is to call vdbePmaReaderNext() on each PmaReader to point it at +// ** its first key. +// ** +// ** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use +// ** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data +// ** to pMerger. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// */ func _vdbeMergeEngineInit(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _eMode int32) (r0 int32) { var _rc, _i, _nTree int32 _rc = i32(0) @@ -67044,7 +69963,7 @@ func _vdbeMergeEngineInit(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEn crt.X__builtin_abort(tls) } }() - *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMerger.X1))))) = _pTask + *(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMerger.X1)))) = _pTask _i = i32(0) _2: if _i >= _nTree { @@ -67062,7 +69981,7 @@ _8: _i += 1 goto _2 _5: - _i = (_pMerger.X0) - i32(1) + _i = _pMerger.X0 - i32(1) _10: if _i <= i32(0) { goto _13 @@ -67080,26 +69999,29 @@ func init() { crt.Xstrncpy(nil, &_vdbeMergeEngineInitØ00__func__Ø000[0], str(87745), 20) } -// Recompute pMerger->aTree[iOut] by comparing the next keys on the -// two PmaReaders that feed that entry. Neither of the PmaReaders -// are advanced. This routine merely does the comparison. +// C comment +// /* +// ** Recompute pMerger->aTree[iOut] by comparing the next keys on the +// ** two PmaReaders that feed that entry. Neither of the PmaReaders +// ** are advanced. This routine merely does the comparison. +// */ func _vdbeMergeEngineCompare(tls *crt.TLS, _pMerger *XMergeEngine, _iOut int32) { var _i1, _i2, _iRes, _5_bCached, _5_res int32 var _p1, _p2 *XPmaReader var _5_pTask *XSortSubtask func() { - if _iOut >= (_pMerger.X0) || _iOut <= i32(0) { + if _iOut >= _pMerger.X0 || _iOut <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88048), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000))), unsafe.Pointer(str(87765))) crt.X__builtin_abort(tls) } }() - if _iOut >= ((_pMerger.X0) / i32(2)) { - _i1 = (_iOut - ((_pMerger.X0) / i32(2))) * i32(2) + if _iOut >= (_pMerger.X0 / i32(2)) { + _i1 = (_iOut - (_pMerger.X0 / i32(2))) * i32(2) _i2 = _i1 + i32(1) goto _4 } - _i1 = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_iOut*i32(2)))) - _i2 = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr((_iOut*i32(2))+i32(1)))) + _i1 = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_iOut*i32(2)))) + _i2 = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr((_iOut*i32(2))+i32(1)))) _4: _p1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(_i1))) _p2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 80*uintptr(_i2))) @@ -67119,9 +70041,10 @@ _4: crt.X__builtin_abort(tls) } }() - _5_res = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 - }{(_5_pTask.X6)})))(tls, _5_pTask, &_5_bCached, (unsafe.Pointer)(_p1.X6), _p1.X3, (unsafe.Pointer)(_p2.X6), _p2.X3) + _5_res = func() func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32 { + v := _5_pTask.X6 + return *(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _5_pTask, &_5_bCached, unsafe.Pointer(_p1.X6), _p1.X3, unsafe.Pointer(_p2.X6), _p2.X3) if _5_res <= i32(0) { _iRes = _i1 goto _12 @@ -67129,7 +70052,7 @@ _4: _iRes = _i2 _12: _8: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_iOut))) = _iRes + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pMerger.X2)) + 4*uintptr(_iOut))) = _iRes _ = _5_bCached } @@ -67145,7 +70068,10 @@ func init() { crt.Xstrncpy(nil, &_vdbePmaReaderIncrMergeInitØ00__func__Ø000[0], str(87838), 27) } -// Advance to the next element in the sorter. +// C comment +// /* +// ** Advance to the next element in the sorter. +// */ func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) { var _rc int32 var _pSorter *XVdbeSorter @@ -67156,14 +70082,14 @@ func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pb crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) func() { - if (_pSorter.X12) == 0 && ((*XPmaReader)(_pSorter.X4) != nil || (*XMergeEngine)(_pSorter.X5) != nil) { + if _pSorter.X12 == 0 && ((*XPmaReader)(_pSorter.X4) != nil || (*XMergeEngine)(_pSorter.X5) != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(87865))) crt.X__builtin_abort(tls) } }() - if (_pSorter.X12) == 0 { + if _pSorter.X12 == 0 { goto _6 } func() { @@ -67173,18 +70099,18 @@ func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pb } }() func() { - if int32(_pSorter.X13) != i32(0) && (*XPmaReader)(_pSorter.X4) == nil { + if int32(_pSorter.X13) != i32(0) && _pSorter.X4 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(87973))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pSorter.X13) != i32(1) && (*XMergeEngine)(_pSorter.X5) == nil { + if int32(_pSorter.X13) != i32(1) && _pSorter.X5 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88641), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(88017))) crt.X__builtin_abort(tls) } }() - if (_pSorter.X13) != 0 { + if _pSorter.X13 != 0 { _rc = _vdbePmaReaderNext(tls, (*XPmaReader)(_pSorter.X4)) *_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(_pSorter.X4).X4) == nil) goto _17 @@ -67196,7 +70122,7 @@ func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pb } }() func() { - if (*XSortSubtask)((*XMergeEngine)(_pSorter.X5).X1) != (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+104*uintptr(i32(0)))) { + if (*XSortSubtask)((*XMergeEngine)(_pSorter.X5).X1) != (*XSortSubtask)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&_pSorter.X17))))+104*uintptr(i32(0)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88650), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(88081))) crt.X__builtin_abort(tls) } @@ -67205,13 +70131,13 @@ func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pb _17: goto _22 _6: - _4_pFree = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_pFree.X1)))))) - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_pFree.X1))))))) = nil - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + _4_pFree = (*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_4_pFree.X1))))) + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_4_pFree.X1)))))) = nil + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { _vdbeSorterRecordFree(tls, _db, _4_pFree) } - *_pbEof = bool2int((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) == nil) + *_pbEof = bool2int(((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) == nil) _rc = i32(0) _22: return _rc @@ -67223,7 +70149,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterNextØ00__func__Ø000[0], str(88127), 22) } -// Add a record to the sorter. +// C comment +// /* +// ** Add a record to the sorter. +// */ func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 int32) { var _rc, _bFlush, _nReq, _nPMA, _t, _9_nMin, _10_iListOff, _10_nNew int32 var _10_aNew *uint8 @@ -67236,19 +70165,19 @@ func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 crt.X__builtin_abort(tls) } }() - _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14)))))) + _pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pCsr.X14))))) func() int32 { - if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVal.X5)) + 1*uintptr(i32(1))))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pVal.X5)) + 1*uintptr(i32(1))))))) < int32(u8(128)) { return func() int32 { - _t = int32(uint32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVal.X5)) + 1*uintptr(i32(1)))))))) + _t = int32(uint32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pVal.X5)) + 1*uintptr(i32(1)))))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVal.X5))+1*uintptr(i32(1)))))), (*uint32)(unsafe.Pointer(&_t)))) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pVal.X5))+1*uintptr(i32(1)))))), (*uint32)(unsafe.Pointer(&_t)))) }() if ((_t > i32(0)) && (_t < i32(10))) && (_t != i32(7)) { { - p := (*uint8)(unsafe.Pointer(&(_pSorter.X16))) + p := (*uint8)(unsafe.Pointer(&_pSorter.X16)) *p = uint8(int32(*p) & i32(1)) sink2(*p) } @@ -67256,13 +70185,13 @@ func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 } if (_t > i32(10)) && (_t&i32(1)) != 0 { { - p := (*uint8)(unsafe.Pointer(&(_pSorter.X16))) + p := (*uint8)(unsafe.Pointer(&_pSorter.X16)) *p = uint8(int32(*p) & i32(2)) sink2(*p) } goto _10 } - *(*uint8)(unsafe.Pointer(&(_pSorter.X16))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pSorter.X16)) = uint8(i32(0)) _10: func() { if _pSorter == nil { @@ -67271,22 +70200,22 @@ _10: } }() _nReq = int32(uint64(_pVal.X4) + u64(16)) - _nPMA = (_pVal.X4) + _sqlite3VarintLen(tls, uint64(_pVal.X4)) - if (_pSorter.X1) == 0 { + _nPMA = _pVal.X4 + _sqlite3VarintLen(tls, uint64(_pVal.X4)) + if _pSorter.X1 == 0 { goto _13 } - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) != nil { - _bFlush = bool2int((_pSorter.X10) != 0 && (((_pSorter.X10) + _nReq) > (_pSorter.X1))) + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) != nil { + _bFlush = bool2int(_pSorter.X10 != 0 && ((_pSorter.X10 + _nReq) > _pSorter.X1)) goto _16 } - _bFlush = bool2int((((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2) > (_pSorter.X1)) || ((((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2) > (_pSorter.X0)) && _sqlite3HeapNearlyFull(tls) != 0)) + _bFlush = bool2int((((*t47)(unsafe.Pointer(&_pSorter.X9)).X2) > _pSorter.X1) || ((((*t47)(unsafe.Pointer(&_pSorter.X9)).X2) > _pSorter.X0) && _sqlite3HeapNearlyFull(tls) != 0)) _16: if _bFlush != 0 { _rc = _vdbeSorterFlushPMA(tls, _pSorter) - *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pSorter.X10))) = i32(0) + *(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X2))) = i32(0) + *(*int32)(unsafe.Pointer(&_pSorter.X10)) = i32(0) func() { - if _rc == i32(0) && (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil { + if _rc == i32(0) && (*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87834), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000))), unsafe.Pointer(str(88149))) crt.X__builtin_abort(tls) } @@ -67294,49 +70223,49 @@ _16: } _13: { - p := (*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) + p := (*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X2))) *p = (*p) + _nPMA sink1(*p) } - if _nPMA > (_pSorter.X2) { - *(*int32)(unsafe.Pointer(&(_pSorter.X2))) = _nPMA + if _nPMA > _pSorter.X2 { + *(*int32)(unsafe.Pointer(&_pSorter.X2)) = _nPMA } - if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil { + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X1) == nil { goto _24 } - _9_nMin = (_pSorter.X10) + _nReq - if _9_nMin <= (_pSorter.X11) { + _9_nMin = _pSorter.X10 + _nReq + if _9_nMin <= _pSorter.X11 { goto _25 } - _10_iListOff = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) / 1)) - _10_nNew = (_pSorter.X11) * i32(2) + _10_iListOff = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) / 1)) + _10_nNew = _pSorter.X11 * i32(2) _26: if _10_nNew < _9_nMin { _10_nNew = _10_nNew * i32(2) goto _26 } - if _10_nNew > (_pSorter.X1) { + if _10_nNew > _pSorter.X1 { _10_nNew = _pSorter.X1 } if _10_nNew < _9_nMin { _10_nNew = _9_nMin } - _10_aNew = (*uint8)(_sqlite3Realloc(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1), uint64(_10_nNew))) + _10_aNew = (*uint8)(_sqlite3Realloc(tls, unsafe.Pointer((*t47)(unsafe.Pointer(&_pSorter.X9)).X1), uint64(_10_nNew))) if _10_aNew == nil { return _sqlite3NomemError(tls, i32(87855)) } - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_10_aNew)) + 1*uintptr(_10_iListOff))))) - *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = _10_aNew - *(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _10_nNew + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_10_aNew)) + 1*uintptr(_10_iListOff))))) + *(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) = _10_aNew + *(*int32)(unsafe.Pointer(&_pSorter.X11)) = _10_nNew _25: - _pNew = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1)) + 1*uintptr(_pSorter.X10))))) + _pNew = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&_pSorter.X9)).X1)) + 1*uintptr(_pSorter.X10))))) { - p := (*int32)(unsafe.Pointer(&(_pSorter.X10))) + p := (*int32)(unsafe.Pointer(&_pSorter.X10)) *p = (*p) + ((_nReq + i32(7)) & i32(-8)) sink1(*p) } - if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil { - *(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_pNew.X1))))) = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) / 1)) + if ((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) != nil { + *(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&_pNew.X1)))) = int32(int64((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&_pSorter.X9)).X1))) / 1)) } goto _32 _24: @@ -67344,11 +70273,11 @@ _24: if _pNew == nil { return _sqlite3NomemError(tls, i32(87869)) } - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_pNew.X1))))))) = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&_pNew.X1)))))) = (*XSorterRecord)((*t47)(unsafe.Pointer(&_pSorter.X9)).X0) _32: - crt.Xmemcpy(tls, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), (unsafe.Pointer)(_pVal.X5), uint64(_pVal.X4)) - *(*int32)(unsafe.Pointer(&(_pNew.X0))) = _pVal.X4 - *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = _pNew + crt.Xmemcpy(tls, unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(16)))))))))))), unsafe.Pointer(_pVal.X5), uint64(_pVal.X4)) + *(*int32)(unsafe.Pointer(&_pNew.X0)) = _pVal.X4 + *(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&_pSorter.X9)).X0))))) = _pNew return _rc } @@ -67358,12 +70287,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSorterWriteØ00__func__Ø000[0], str(88189), 23) } -// pCur points at an index entry created using the OP_MakeRecord opcode. -// Read the rowid (the last field in the record) and store it in *rowid. -// Return SQLITE_OK if everything works, or an error code otherwise. -// -// pCur might be pointing to text obtained from a corrupt database file. -// So the content cannot be trusted. Do appropriate checks on the content. +// C comment +// /* +// ** pCur points at an index entry created using the OP_MakeRecord opcode. +// ** Read the rowid (the last field in the record) and store it in *rowid. +// ** Return SQLITE_OK if everything works, or an error code otherwise. +// ** +// ** pCur might be pointing to text obtained from a corrupt database file. +// ** So the content cannot be trusted. Do appropriate checks on the content. +// */ func _sqlite3VdbeIdxRowid(tls *crt.TLS, _db *Xsqlite3, _pCur *XBtCursor, _rowid *int64) (r0 int32) { var _rc int32 var _nCellKey int64 @@ -67394,27 +70326,27 @@ func _sqlite3VdbeIdxRowid(tls *crt.TLS, _db *Xsqlite3, _pCur *XBtCursor, _rowid } return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(_m.X5)), &_szHdr)) }() - if (_szHdr < uint32(i32(3))) || (int32(_szHdr) > (_m.X4)) { + if (_szHdr < uint32(i32(3))) || (int32(_szHdr) > _m.X4) { goto _idx_rowid_corruption } func() int32 { - if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5)) + 1*uintptr(_szHdr-uint32(i32(1)))))))) < int32(u8(128)) { + if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_m.X5)) + 1*uintptr(_szHdr-uint32(i32(1)))))))) < int32(u8(128)) { return func() int32 { - _typeRowid = uint32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5)) + 1*uintptr(_szHdr-uint32(i32(1)))))))) + _typeRowid = uint32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_m.X5)) + 1*uintptr(_szHdr-uint32(i32(1)))))))) return i32(1) }() } - return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5))+1*uintptr(_szHdr-uint32(i32(1))))))), &_typeRowid)) + return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_m.X5))+1*uintptr(_szHdr-uint32(i32(1))))))), &_typeRowid)) }() if ((_typeRowid < uint32(i32(1))) || (_typeRowid > uint32(i32(9)))) || (_typeRowid == uint32(i32(7))) { goto _idx_rowid_corruption } - _lenRowid = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_typeRowid)))) + _lenRowid = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SmallTypeSizes)) + 1*uintptr(_typeRowid)))) if uint32(_m.X4) < (_szHdr + _lenRowid) { goto _idx_rowid_corruption } - _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5))+1*uintptr(uint32(_m.X4)-_lenRowid))))), _typeRowid, &_v) - *_rowid = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_v.X0))))) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_m.X5))+1*uintptr(uint32(_m.X4)-_lenRowid))))), _typeRowid, &_v) + *_rowid = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_v.X0)))) _sqlite3VdbeMemRelease(tls, &_m) return i32(0) @@ -67433,15 +70365,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeIdxRowidØ00__func__Ø000[0], str(88255), 20) } -// Compare the key of the index entry that cursor pC is pointing to against -// the key string in pUnpacked. Write into *pRes a number -// that is negative, zero, or positive if pC is less than, equal to, -// or greater than pUnpacked. Return SQLITE_OK on success. -// -// pUnpacked is either created without a rowid or is truncated so that it -// omits the rowid at the end. The rowid at the end of the index entry -// is ignored as well. Hence, this routine only compares the prefixes -// of the keys prior to the final rowid, not the entire key. +// C comment +// /* +// ** Compare the key of the index entry that cursor pC is pointing to against +// ** the key string in pUnpacked. Write into *pRes a number +// ** that is negative, zero, or positive if pC is less than, equal to, +// ** or greater than pUnpacked. Return SQLITE_OK on success. +// ** +// ** pUnpacked is either created without a rowid or is truncated so that it +// ** omits the rowid at the end. The rowid at the end of the index entry +// ** is ignored as well. Hence, this routine only compares the prefixes +// ** of the keys prior to the final rowid, not the entire key. +// */ func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _pUnpacked *XUnpackedRecord, _res *int32) (r0 int32) { var _rc int32 var _nCellKey int64 @@ -67454,7 +70389,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _p crt.X__builtin_abort(tls) } }() - _pCur = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pC.X14)))))) + _pCur = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_pC.X14))))) func() { if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000))), unsafe.Pointer(str(77407))) @@ -67471,7 +70406,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _p if _rc != 0 { return _rc } - *_res = _sqlite3VdbeRecordCompare(tls, _m.X4, (unsafe.Pointer)(_m.X5), _pUnpacked) + *_res = _sqlite3VdbeRecordCompare(tls, _m.X4, unsafe.Pointer(_m.X5), _pUnpacked) _sqlite3VdbeMemRelease(tls, &_m) return i32(0) @@ -67493,24 +70428,27 @@ func _sqlite3BtreeDropTable(tls *crt.TLS, _p *XBtree, _iTable int32, _piMoved *i return _rc } -// Erase all information in a table and add the root of the table to -// the freelist. Except, the root of the principle table (the one on -// page 1) is never added to the freelist. -// -// This routine will fail with SQLITE_LOCKED if there are any open -// cursors on the table. -// -// If AUTOVACUUM is enabled and the page at iTable is not the last -// root page in the database file, then the last root page -// in the database file is moved into the slot formerly occupied by -// iTable and that last slot formerly occupied by the last root page -// is added to the freelist instead of iTable. In this say, all -// root pages are kept at the beginning of the database file, which -// is necessary for AUTOVACUUM to work right. *piMoved is set to the -// page number that used to be the last root page in the file before -// the move. If no page gets moved, *piMoved is set to 0. -// The last root page is recorded in meta[3] and the value of -// meta[3] is updated by this procedure. +// C comment +// /* +// ** Erase all information in a table and add the root of the table to +// ** the freelist. Except, the root of the principle table (the one on +// ** page 1) is never added to the freelist. +// ** +// ** This routine will fail with SQLITE_LOCKED if there are any open +// ** cursors on the table. +// ** +// ** If AUTOVACUUM is enabled and the page at iTable is not the last +// ** root page in the database file, then the last root page +// ** in the database file is moved into the slot formerly occupied by +// ** iTable and that last slot formerly occupied by the last root page +// ** is added to the freelist instead of iTable. In this say, all +// ** root pages are kept at the beginning of the database file, which +// ** is necessary for AUTOVACUUM to work right. *piMoved is set to the +// ** page number that used to be the last root page in the file before +// ** the move. If no page gets moved, *piMoved is set to 0. +// ** The last root page is recorded in meta[3] and the value of +// ** meta[3] is updated by this procedure. +// */ func _btreeDropTable(tls *crt.TLS, _p *XBtree, _iTable uint32, _piMoved *int32) (r0 int32) { var _rc int32 var _2_maxRootPgno uint32 @@ -67546,7 +70484,7 @@ func _btreeDropTable(tls *crt.TLS, _p *XBtree, _iTable uint32, _piMoved *int32) return _rc } *_piMoved = i32(0) - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { goto _8 } _sqlite3BtreeGetMeta(tls, _p, i32(4), &_2_maxRootPgno) @@ -67581,12 +70519,12 @@ _9: _11: _2_maxRootPgno -= 1 _15: - if (_2_maxRootPgno == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _2_maxRootPgno) == _2_maxRootPgno) { + if (_2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _2_maxRootPgno) == _2_maxRootPgno) { _2_maxRootPgno -= 1 goto _15 } func() { - if _2_maxRootPgno == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) { + if _2_maxRootPgno == ((uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67818), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeDropTableØ00__func__Ø000))), unsafe.Pointer(str(88310))) crt.X__builtin_abort(tls) } @@ -67606,17 +70544,20 @@ func init() { crt.Xstrncpy(nil, &_btreeDropTableØ00__func__Ø000[0], str(88346), 15) } -// Delete all information from a single table in the database. iTable is -// the page number of the root of the table. After this routine returns, -// the root page is empty, but still exists. -// -// This routine will fail with SQLITE_LOCKED if there are any open -// read cursors on the table. Open write cursors are moved to the -// root of the table. -// -// If pnChange is not NULL, then table iTable must be an intkey table. The -// integer value pointed to by pnChange is incremented by the number of -// entries in the table. +// C comment +// /* +// ** Delete all information from a single table in the database. iTable is +// ** the page number of the root of the table. After this routine returns, +// ** the root page is empty, but still exists. +// ** +// ** This routine will fail with SQLITE_LOCKED if there are any open +// ** read cursors on the table. Open write cursors are moved to the +// ** root of the table. +// ** +// ** If pnChange is not NULL, then table iTable must be an intkey table. The +// ** integer value pointed to by pnChange is incremented by the number of +// ** entries in the table. +// */ func _sqlite3BtreeClearTable(tls *crt.TLS, _p *XBtree, _iTable int32, _pnChange *int32) (r0 int32) { var _rc int32 var _pBt *XBtShared @@ -67643,8 +70584,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeClearTableØ00__func__Ø000[0], str(88361), 23) } -// Erase the given database page and all its children. Return -// the page to the freelist. +// C comment +// /* +// ** Erase the given database page and all its children. Return +// ** the page to the freelist. +// */ func _clearDatabasePage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _freePageFlag int32, _pnChange *int32) (r0 int32) { var _rc, _i, _hdr int32 var _pCell *uint8 @@ -67663,19 +70607,19 @@ func _clearDatabasePage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _freePageFl if _rc != 0 { return _rc } - if (_pPage.X1) != 0 { + if _pPage.X1 != 0 { _rc = _sqlite3CorruptError(tls, i32(67651)) goto _cleardatabasepage_out } - *(*uint8)(unsafe.Pointer(&(_pPage.X1))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPage.X1)) = uint8(i32(1)) _hdr = int32(_pPage.X6) _i = i32(0) _5: if _i >= int32(_pPage.X14) { goto _8 } - _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(1))))))))) - if (_pPage.X5) != 0 { + _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))<<uint(i32(8)))|int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(1))))))))) + if _pPage.X5 != 0 { goto _9 } _rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, _pCell), i32(1), _pnChange) @@ -67690,10 +70634,10 @@ _9: _i += 1 goto _5 _8: - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _12 } - _rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_hdr+i32(8))))), i32(1), _pnChange) + _rc = _clearDatabasePage(tls, _pBt, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+1*uintptr(_hdr+i32(8))))), i32(1), _pnChange) if _rc != 0 { goto _cleardatabasepage_out } @@ -67701,7 +70645,7 @@ _8: _12: if _pnChange != nil { func() { - if (_pPage.X2) == 0 && (_sqlite3Config.X6) != i32(0) { + if _pPage.X2 == 0 && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67669), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000))), unsafe.Pointer(str(88384))) crt.X__builtin_abort(tls) } @@ -67718,10 +70662,10 @@ _15: goto _cleardatabasepage_out } if store1(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))) == i32(0) { - _zeroPage(tls, _pPage, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19)) + 1*uintptr(_hdr))))|i32(8)) + _zeroPage(tls, _pPage, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + 1*uintptr(_hdr))))|i32(8)) } _cleardatabasepage_out: - *(*uint8)(unsafe.Pointer(&(_pPage.X1))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X1)) = uint8(i32(0)) _releasePage(tls, _pPage) return _rc @@ -67755,8 +70699,8 @@ _2: goto _5 } _1_pTab = (*XTable)(_pElem.X2) - if (_1_pTab.X7) == _iFrom { - *(*int32)(unsafe.Pointer(&(_1_pTab.X7))) = _iTo + if _1_pTab.X7 == _iFrom { + *(*int32)(unsafe.Pointer(&_1_pTab.X7)) = _iTo } _pElem = (*XHashElem)(_pElem.X0) goto _2 @@ -67768,8 +70712,8 @@ _7: goto _10 } _3_pIdx = (*XIndex)(_pElem.X2) - if (_3_pIdx.X11) == _iFrom { - *(*int32)(unsafe.Pointer(&(_3_pIdx.X11))) = _iTo + if _3_pIdx.X11 == _iFrom { + *(*int32)(unsafe.Pointer(&_3_pIdx.X11)) = _iTo } _pElem = (*XHashElem)(_pElem.X0) goto _7 @@ -67782,15 +70726,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RootPageMovedØ00__func__Ø000[0], str(88430), 21) } -// Delete all information from the single table that pCur is open on. -// -// This routine only work for pCur on an ephemeral table. +// C comment +// /* +// ** Delete all information from the single table that pCur is open on. +// ** +// ** This routine only work for pCur on an ephemeral table. +// */ func _sqlite3BtreeClearTableOfCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) { return _sqlite3BtreeClearTable(tls, (*XBtree)(_pCur.X0), int32(_pCur.X7), nil) } -// Unlink the given table from the hash tables and the delete the -// table structure with all its indices and foreign keys. +// C comment +// /* +// ** Unlink the given table from the hash tables and the delete the +// ** table structure with all its indices and foreign keys. +// */ func _sqlite3UnlinkAndDeleteTable(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTabName *int8) { var _pDb *XDb var _p *XTable @@ -67801,7 +70751,7 @@ func _sqlite3UnlinkAndDeleteTable(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab } }() func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100357), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -67822,7 +70772,7 @@ func _sqlite3UnlinkAndDeleteTable(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab _p = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X2))), _zTabName, nil)) _sqlite3DeleteTable(tls, _db, _p) { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } @@ -67834,10 +70784,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTableØ00__func__Ø000[0], str(88460), 28) } -// For the index called zIdxName which is found in the database iDb, -// unlike that index from its Table then remove the index from -// the index hash table and free all memory structures associated -// with the index. +// C comment +// /* +// ** For the index called zIdxName which is found in the database iDb, +// ** unlike that index from its Table then remove the index from +// ** the index hash table and free all memory structures associated +// ** with the index. +// */ func _sqlite3UnlinkAndDeleteIndex(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zIdxName *int8) { var _pHash *XHash var _pIndex, _3_p *XIndex @@ -67890,13 +70843,13 @@ _7: return i32(0) }() }() != 0 { - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_p.X5))))) = (*XIndex)(_pIndex.X5) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_p.X5)))) = (*XIndex)(_pIndex.X5) } _6: _freeIndex(tls, _db, _pIndex) _4: { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } @@ -67908,7 +70861,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000[0], str(88488), 28) } -// Remove a trigger from the hash tables of the sqlite* pointer. +// C comment +// /* +// ** Remove a trigger from the hash tables of the sqlite* pointer. +// */ func _sqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zName *int8) { var _pHash *XHash var _pTrigger *XTrigger @@ -67938,7 +70894,7 @@ func _sqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zN goto _5 } _2_pTab = _tableOfTrigger(tls, _pTrigger) - _2_pp = (**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pTab.X19))))) + _2_pp = (**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pTab.X19)))) _6: if (*_2_pp) == _pTrigger { goto _9 @@ -67950,7 +70906,7 @@ _9: _5: _sqlite3DeleteTrigger(tls, _db, _pTrigger) { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } @@ -67963,23 +70919,29 @@ func init() { crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000[0], str(88516), 30) } -// Return a pointer to the Table structure for the table that a trigger -// is set on. +// C comment +// /* +// ** Return a pointer to the Table structure for the table that a trigger +// ** is set on. +// */ func _tableOfTrigger(tls *crt.TLS, _pTrigger *XTrigger) (r0 *XTable) { return (*XTable)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTrigger.X7).X2))), _pTrigger.X1)) } -// This routine does a complete check of the given BTree file. aRoot[] is -// an array of pages numbers were each page number is the root page of -// a table. nRoot is the number of entries in aRoot. -// -// A read-only or read-write transaction must be opened before calling -// this function. -// -// Write the number of error seen in *pnErr. Except for some memory -// allocation errors, an error message held in memory obtained from -// malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is -// returned. If a memory allocation error occurs, NULL is returned. +// C comment +// /* +// ** This routine does a complete check of the given BTree file. aRoot[] is +// ** an array of pages numbers were each page number is the root page of +// ** a table. nRoot is the number of entries in aRoot. +// ** +// ** A read-only or read-write transaction must be opened before calling +// ** this function. +// ** +// ** Write the number of error seen in *pnErr. Except for some memory +// ** allocation errors, an error message held in memory obtained from +// ** malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is +// ** returned. If a memory allocation error occurs, NULL is returned. +// */ func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot int32, _mxErr int32, _pnErr *int32) (r0 *int8) { var _savedDbFlags, _nRef int32 var _4_notUsed int64 @@ -68003,39 +70965,39 @@ func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot crt.X__builtin_abort(tls) } }() - *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCheck.X0))))) = _pBt - *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCheck.X1))))) = (*XPager)(_pBt.X0) - *(*uint32)(unsafe.Pointer(&(_sCheck.X3))) = _btreePagecount(tls, (*XBtShared)(_sCheck.X0)) - *(*int32)(unsafe.Pointer(&(_sCheck.X4))) = _mxErr - *(*int32)(unsafe.Pointer(&(_sCheck.X5))) = i32(0) - *(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(0) - *(**int8)(unsafe.Pointer(&(_sCheck.X7))) = nil - *(*int32)(unsafe.Pointer(&(_sCheck.X8))) = i32(0) - *(*int32)(unsafe.Pointer(&(_sCheck.X9))) = i32(0) - *(**uint8)(unsafe.Pointer(&(_sCheck.X2))) = nil - *(**uint32)(unsafe.Pointer(&(_sCheck.X11))) = nil - _sqlite3StrAccumInit(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))), nil, (*int8)(unsafe.Pointer(&_zErr)), int32(u64(100)), i32(1000000000)) - *(*uint8)(unsafe.Pointer(&((*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))).X7))) = uint8(i32(1)) - if (_sCheck.X3) == uint32(i32(0)) { + *(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCheck.X0)))) = _pBt + *(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCheck.X1)))) = (*XPager)(_pBt.X0) + *(*uint32)(unsafe.Pointer(&_sCheck.X3)) = _btreePagecount(tls, (*XBtShared)(_sCheck.X0)) + *(*int32)(unsafe.Pointer(&_sCheck.X4)) = _mxErr + *(*int32)(unsafe.Pointer(&_sCheck.X5)) = i32(0) + *(*int32)(unsafe.Pointer(&_sCheck.X6)) = i32(0) + *(**int8)(unsafe.Pointer(&_sCheck.X7)) = nil + *(*int32)(unsafe.Pointer(&_sCheck.X8)) = i32(0) + *(*int32)(unsafe.Pointer(&_sCheck.X9)) = i32(0) + *(**uint8)(unsafe.Pointer(&_sCheck.X2)) = nil + *(**uint32)(unsafe.Pointer(&_sCheck.X11)) = nil + _sqlite3StrAccumInit(tls, (*XStrAccum)(unsafe.Pointer(&_sCheck.X10)), nil, (*int8)(unsafe.Pointer(&_zErr)), int32(u64(100)), i32(1000000000)) + *(*uint8)(unsafe.Pointer(&((*XStrAccum)(unsafe.Pointer(&_sCheck.X10)).X7))) = uint8(i32(1)) + if _sCheck.X3 == uint32(i32(0)) { goto _integrity_ck_cleanup } - *(**uint8)(unsafe.Pointer(&(_sCheck.X2))) = (*uint8)(_sqlite3MallocZero(tls, uint64(((_sCheck.X3)/uint32(i32(8)))+uint32(i32(1))))) - if (_sCheck.X2) == nil { - *(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(1) + *(**uint8)(unsafe.Pointer(&_sCheck.X2)) = (*uint8)(_sqlite3MallocZero(tls, uint64((_sCheck.X3/uint32(i32(8)))+uint32(i32(1))))) + if _sCheck.X2 == nil { + *(*int32)(unsafe.Pointer(&_sCheck.X6)) = i32(1) goto _integrity_ck_cleanup } - *(**uint32)(unsafe.Pointer(&(_sCheck.X11))) = (*uint32)(_sqlite3PageMalloc(tls, int32(_pBt.X15))) - if (_sCheck.X11) == nil { - *(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(1) + *(**uint32)(unsafe.Pointer(&_sCheck.X11)) = (*uint32)(_sqlite3PageMalloc(tls, int32(_pBt.X15))) + if _sCheck.X11 == nil { + *(*int32)(unsafe.Pointer(&_sCheck.X6)) = i32(1) goto _integrity_ck_cleanup } - _i = (uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)) - if _i <= (_sCheck.X3) { + _i = (uint32(_sqlite3PendingByte) / _pBt.X15) + uint32(i32(1)) + if _i <= _sCheck.X3 { _setPageReferenced(tls, &_sCheck, _i) } - *(**int8)(unsafe.Pointer(&(_sCheck.X7))) = str(88609) - _checkList(tls, &_sCheck, i32(1), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))))), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))))) - *(**int8)(unsafe.Pointer(&(_sCheck.X7))) = nil + *(**int8)(unsafe.Pointer(&_sCheck.X7)) = str(88609) + _checkList(tls, &_sCheck, i32(1), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))))), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))))) + *(**int8)(unsafe.Pointer(&_sCheck.X7)) = nil { p := (*int32)(unsafe.Pointer(&((*Xsqlite3)(_pBt.X1).X6))) *p = (*p) & i32(-536870913) @@ -68043,16 +71005,16 @@ func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot } _i = uint32(i32(0)) _9: - if int32(_i) >= _nRoot || (_sCheck.X4) == 0 { + if int32(_i) >= _nRoot || _sCheck.X4 == 0 { goto _13 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))) == i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRoot)) + 4*uintptr(_i)))) == i32(0) { goto _10 } - if ((_pBt.X5) != 0) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))) > i32(1)) { - _checkPtrmap(tls, &_sCheck, uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))), uint8(i32(1)), uint32(i32(0))) + if (_pBt.X5 != 0) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRoot)) + 4*uintptr(_i)))) > i32(1)) { + _checkPtrmap(tls, &_sCheck, uint32(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRoot)) + 4*uintptr(_i)))), uint8(i32(1)), uint32(i32(0))) } - _checkTreePage(tls, &_sCheck, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i))), &_4_notUsed, i64(9223372036854775807)) + _checkTreePage(tls, &_sCheck, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRoot)) + 4*uintptr(_i))), &_4_notUsed, i64(9223372036854775807)) _10: _i += 1 goto _9 @@ -68060,27 +71022,27 @@ _13: *(*int32)(unsafe.Pointer(&((*Xsqlite3)(_pBt.X1).X6))) = _savedDbFlags _i = uint32(i32(1)) _17: - if _i > (_sCheck.X3) || (_sCheck.X4) == 0 { + if _i > _sCheck.X3 || _sCheck.X4 == 0 { goto _integrity_ck_cleanup } - if (_getPageReferenced(tls, &_sCheck, _i) == i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) != _i) || ((_pBt.X5) == 0)) { + if (_getPageReferenced(tls, &_sCheck, _i) == i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) != _i) || (_pBt.X5 == 0)) { _checkAppendMsg(tls, &_sCheck, str(88625), _i) } - if (_getPageReferenced(tls, &_sCheck, _i) != i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) == _i) && ((_pBt.X5) != 0)) { + if (_getPageReferenced(tls, &_sCheck, _i) != i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) == _i) && (_pBt.X5 != 0)) { _checkAppendMsg(tls, &_sCheck, str(88647), _i) } _i += 1 goto _17 _integrity_ck_cleanup: - _sqlite3PageFree(tls, (unsafe.Pointer)(_sCheck.X11)) - Xsqlite3_free(tls, (unsafe.Pointer)(_sCheck.X2)) - if (_sCheck.X6) != 0 { - _sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10)))) - *(*int32)(unsafe.Pointer(&(_sCheck.X5))) += 1 + _sqlite3PageFree(tls, unsafe.Pointer(_sCheck.X11)) + Xsqlite3_free(tls, unsafe.Pointer(_sCheck.X2)) + if _sCheck.X6 != 0 { + _sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&_sCheck.X10))) + *(*int32)(unsafe.Pointer(&_sCheck.X5)) += 1 } *_pnErr = _sCheck.X5 - if (_sCheck.X5) == i32(0) { - _sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10)))) + if _sCheck.X5 == i32(0) { + _sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&_sCheck.X10))) } func() { if _nRef != _sqlite3PagerRefcount(tls, (*XPager)(_pBt.X0)) { @@ -68089,7 +71051,7 @@ _integrity_ck_cleanup: } }() _sqlite3BtreeLeave(tls, _p) - return _sqlite3StrAccumFinish(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10)))) + return _sqlite3StrAccumFinish(tls, (*XStrAccum)(unsafe.Pointer(&_sCheck.X10))) _ = _sCheck _ = _zErr @@ -68103,16 +71065,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeIntegrityCheckØ00__func__Ø000[0], str(88721), 27) } -// Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. +// C comment +// /* +// ** Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. +// */ func _setPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) { func() { - if _iPg > (_pCheck.X3) || i32(1) == 0 { + if _iPg > _pCheck.X3 || i32(1) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68037), unsafe.Pointer((*int8)(unsafe.Pointer(&_setPageReferencedØ00__func__Ø000))), unsafe.Pointer(str(88748))) crt.X__builtin_abort(tls) } }() { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8))))) *p = uint8(int32(*p) | (i32(1) << uint(int32(_iPg&uint32(i32(7)))))) sink2(*p) } @@ -68124,8 +71089,11 @@ func init() { crt.Xstrncpy(nil, &_setPageReferencedØ00__func__Ø000[0], str(88799), 18) } -// Check the integrity of the freelist or of an overflow page list. -// Verify that the number of pages on the list is N. +// C comment +// /* +// ** Check the integrity of the freelist or of an overflow page list. +// ** Verify that the number of pages on the list is N. +// */ func _checkList(tls *crt.TLS, _pCheck *XIntegrityCk, _isFreeList int32, _iPage int32, _N int32) { var _i, _expected, _iFirst, _4_n int32 var _8_iFreePage uint32 @@ -68134,7 +71102,7 @@ func _checkList(tls *crt.TLS, _pCheck *XIntegrityCk, _isFreeList int32, _iPage i _expected = _N _iFirst = _iPage _0: - if postInc1(&_N, int32(-1)) <= i32(0) || (_pCheck.X4) == 0 { + if postInc1(&_N, -1) <= i32(0) || _pCheck.X4 == 0 { goto _1 } if _iPage < i32(1) { @@ -68152,7 +71120,7 @@ _0: if _isFreeList == 0 { goto _6 } - _4_n = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOvflData))+1*uintptr(i32(4)))))) + _4_n = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pOvflData))+1*uintptr(i32(4)))))) if ((*XBtShared)(_pCheck.X0).X5) != 0 { _checkPtrmap(tls, _pCheck, uint32(_iPage), uint8(i32(2)), uint32(i32(0))) } @@ -68166,7 +71134,7 @@ _10: if _i >= _4_n { goto _13 } - _8_iFreePage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOvflData))+1*uintptr(i32(8)+(_i*i32(4)))))) + _8_iFreePage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pOvflData))+1*uintptr(i32(8)+(_i*i32(4)))))) if ((*XBtShared)(_pCheck.X0).X5) != 0 { _checkPtrmap(tls, _pCheck, _8_iFreePage, uint8(i32(2)), uint32(i32(0))) } @@ -68196,39 +71164,45 @@ _15: _1: } -// Append a message to the error message string. +// C comment +// /* +// ** Append a message to the error message string. +// */ func _checkAppendMsg(tls *crt.TLS, _pCheck *XIntegrityCk, _zFormat *int8, args ...interface{}) { var _ap []interface{} - if (_pCheck.X4) == 0 { + if _pCheck.X4 == 0 { return } - *(*int32)(unsafe.Pointer(&(_pCheck.X4))) -= 1 - *(*int32)(unsafe.Pointer(&(_pCheck.X5))) += 1 + *(*int32)(unsafe.Pointer(&_pCheck.X4)) -= 1 + *(*int32)(unsafe.Pointer(&_pCheck.X5)) += 1 _ap = args - if ((*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))).X3) != 0 { - _sqlite3StrAccumAppend(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), str(37700), i32(1)) + if ((*XStrAccum)(unsafe.Pointer(&_pCheck.X10)).X3) != 0 { + _sqlite3StrAccumAppend(tls, (*XStrAccum)(unsafe.Pointer(&_pCheck.X10)), str(37700), i32(1)) } - if (_pCheck.X7) != nil { - _sqlite3XPrintf(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), _pCheck.X7, _pCheck.X8, _pCheck.X9) + if _pCheck.X7 != nil { + _sqlite3XPrintf(tls, (*XStrAccum)(unsafe.Pointer(&_pCheck.X10)), _pCheck.X7, _pCheck.X8, _pCheck.X9) } - _sqlite3VXPrintf(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), _zFormat, _ap) + _sqlite3VXPrintf(tls, (*XStrAccum)(unsafe.Pointer(&_pCheck.X10)), _zFormat, _ap) _ap = nil - if int32((*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))).X6) == i32(1) { - *(*int32)(unsafe.Pointer(&(_pCheck.X6))) = i32(1) + if int32((*XStrAccum)(unsafe.Pointer(&_pCheck.X10)).X6) == i32(1) { + *(*int32)(unsafe.Pointer(&_pCheck.X6)) = i32(1) } } -// Add 1 to the reference count for page iPage. If this is the second -// reference to the page, add an error message to pCheck->zErrMsg. -// Return 1 if there are 2 or more references to the page and 0 if -// if this is the first reference to the page. -// -// Also check that the page number is in bounds. +// C comment +// /* +// ** Add 1 to the reference count for page iPage. If this is the second +// ** reference to the page, add an error message to pCheck->zErrMsg. +// ** Return 1 if there are 2 or more references to the page and 0 if +// ** if this is the first reference to the page. +// ** +// ** Also check that the page number is in bounds. +// */ func _checkRef(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage uint32) (r0 int32) { if _iPage == uint32(i32(0)) { return i32(1) } - if _iPage > (_pCheck.X3) { + if _iPage > _pCheck.X3 { _checkAppendMsg(tls, _pCheck, str(88974), _iPage) return i32(1) } @@ -68240,16 +71214,19 @@ func _checkRef(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage uint32) (r0 int32) { return i32(0) } -// Return non-zero if the bit in the IntegrityCk.aPgRef[] array that -// corresponds to page iPg is already set. +// C comment +// /* +// ** Return non-zero if the bit in the IntegrityCk.aPgRef[] array that +// ** corresponds to page iPg is already set. +// */ func _getPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) (r0 int32) { func() { - if _iPg > (_pCheck.X3) || i32(1) == 0 { + if _iPg > _pCheck.X3 || i32(1) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68029), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageReferencedØ00__func__Ø000))), unsafe.Pointer(str(88748))) crt.X__builtin_abort(tls) } }() - return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8)))))) & (i32(1) << uint(int32(_iPg&uint32(i32(7))))) + return int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8)))))) & (i32(1) << uint(int32(_iPg&uint32(i32(7))))) } var _getPageReferencedØ00__func__Ø000 [18]int8 @@ -68258,9 +71235,12 @@ func init() { crt.Xstrncpy(nil, &_getPageReferencedØ00__func__Ø000[0], str(89022), 18) } -// Check that the entry in the pointer-map for page iChild maps to -// page iParent, pointer type ptrType. If not, append an error message -// to pCheck. +// C comment +// /* +// ** Check that the entry in the pointer-map for page iChild maps to +// ** page iParent, pointer type ptrType. If not, append an error message +// ** to pCheck. +// */ func _checkPtrmap(tls *crt.TLS, _pCheck *XIntegrityCk, _iChild uint32, _eType uint8, _iParent uint32) { var _rc int32 var _iPtrmapParent uint32 @@ -68270,7 +71250,7 @@ func _checkPtrmap(tls *crt.TLS, _pCheck *XIntegrityCk, _iChild uint32, _eType ui goto _0 } if (_rc == i32(7)) || (_rc == i32(3082)) { - *(*int32)(unsafe.Pointer(&(_pCheck.X6))) = i32(1) + *(*int32)(unsafe.Pointer(&_pCheck.X6)) = i32(1) } _checkAppendMsg(tls, _pCheck, str(89040), _iChild) return @@ -68280,18 +71260,21 @@ _0: } } -// Do various sanity checks on a single page of a tree. Return -// the tree depth. Root pages return 0. Parents of root pages -// return 1, and so forth. -// -// These checks are done: -// -// 1. Make sure that cells and freeblocks do not overlap -// but combine to completely cover the page. -// 2. Make sure integer cell keys are in order. -// 3. Check the integrity of overflow pages. -// 4. Recursively call checkTreePage on all children. -// 5. Verify that the depth of all children is the same. +// C comment +// /* +// ** Do various sanity checks on a single page of a tree. Return +// ** the tree depth. Root pages return 0. Parents of root pages +// ** return 1, and so forth. +// ** +// ** These checks are done: +// ** +// ** 1. Make sure that cells and freeblocks do not overlap +// ** but combine to completely cover the page. +// ** 2. Make sure integer cell keys are in order. +// ** 3. Check the integrity of overflow pages. +// ** 4. Recursively call checkTreePage on all children. +// ** 5. Verify that the depth of all children is the same. +// */ func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey *int64, _maxKey int64) (r0 int32) { var _i, _rc, _depth, _d2, _pgno, _nFrag, _hdr, _cellStart, _nCell, _doCoverageCheck, _keyCanBeEqual, _saved_v1, _saved_v2, _11_nPage, _20_size, _20_j int32 var _pc, _usableSize, _contentOffset, _x, _prev, _11_pgnoOvfl, _19_size uint32 @@ -68320,14 +71303,14 @@ func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 { return i32(0) } - *(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89123) - *(*int32)(unsafe.Pointer(&(_pCheck.X8))) = _iPage + *(**int8)(unsafe.Pointer(&_pCheck.X7)) = str(89123) + *(*int32)(unsafe.Pointer(&_pCheck.X8)) = _iPage if store1(&_rc, _btreeGetPage(tls, _pBt, uint32(_iPage), &_pPage, i32(0))) != i32(0) { _checkAppendMsg(tls, _pCheck, str(89133), _rc) goto _end_of_check } _savedIsInit = _pPage.X0 - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = uint8(i32(0)) if store1(&_rc, _btreeInitPage(tls, _pPage)) != i32(0) { func() { if _rc != i32(11) { @@ -68340,15 +71323,15 @@ func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey } _data = _pPage.X19 _hdr = int32(_pPage.X6) - *(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89228) - _contentOffset = uint32(((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1)) + *(**int8)(unsafe.Pointer(&_pCheck.X7)) = str(89228) + _contentOffset = uint32(((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1)) func() { if _contentOffset > _usableSize { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68297), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89254))) crt.X__builtin_abort(tls) } }() - _nCell = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1))))) + _nCell = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1))))) func() { if int32(_pPage.X14) != _nCell { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68302), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89280))) @@ -68357,18 +71340,18 @@ func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey }() _cellStart = (_hdr + i32(12)) - (i32(4) * int32(_pPage.X5)) func() { - if (_pPage.X21) != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart))) { + if _pPage.X21 != (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cellStart))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68307), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89300))) crt.X__builtin_abort(tls) } }() - _pCellIdx = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellStart+(i32(2)*(_nCell-i32(1)))))) - if (_pPage.X5) != 0 { + _pCellIdx = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_cellStart+(i32(2)*(_nCell-i32(1)))))) + if _pPage.X5 != 0 { goto _12 } - _pgno = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(8)))))) - if (_pBt.X5) != 0 { - *(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89334) + _pgno = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(8)))))) + if _pBt.X5 != 0 { + *(**int8)(unsafe.Pointer(&_pCheck.X7)) = str(89334) _checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(i32(5)), uint32(_iPage)) } _depth = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey) @@ -68376,24 +71359,24 @@ func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey goto _14 _12: _heap = _pCheck.X11 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_heap)) + 4*uintptr(i32(0)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_heap)) + 4*uintptr(i32(0)))) = uint32(i32(0)) _14: _i = _nCell - i32(1) _15: - if _i < i32(0) || (_pCheck.X4) == 0 { + if _i < i32(0) || _pCheck.X4 == 0 { goto _19 } - *(*int32)(unsafe.Pointer(&(_pCheck.X9))) = _i + *(*int32)(unsafe.Pointer(&_pCheck.X9)) = _i func() { - if _pCellIdx != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart+(_i*i32(2))))) { + if _pCellIdx != (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cellStart+(_i*i32(2))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68335), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89362))) crt.X__builtin_abort(tls) } }() - _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellIdx)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellIdx)) + 1*uintptr(i32(1)))))) + _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellIdx)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCellIdx)) + 1*uintptr(i32(1)))))) { p := &_pCellIdx - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(2)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) - 1*uintptr(i32(2)))) sink13(*p) } if (_pc < _contentOffset) || (_pc > (_usableSize - uint32(i32(4)))) { @@ -68401,30 +71384,31 @@ _15: _doCoverageCheck = i32(0) goto _16 } - _pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pc))) - (*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer) - }{(_pPage.X25)})))(tls, _pPage, _pCell, &_6_info) + _pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_pc))) + func() func(*crt.TLS, *XMemPage, *uint8, *XCellInfo) { + v := _pPage.X25 + return *(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&v)) + }()(tls, _pPage, _pCell, &_6_info) if (_pc + uint32(_6_info.X4)) > _usableSize { _checkAppendMsg(tls, _pCheck, str(89425)) _doCoverageCheck = i32(0) goto _16 } - if (_pPage.X2) == 0 { + if _pPage.X2 == 0 { goto _25 } if func() int32 { if _keyCanBeEqual != 0 { - return bool2int((_6_info.X0) > _maxKey) + return bool2int(_6_info.X0 > _maxKey) } - return bool2int((_6_info.X0) >= _maxKey) + return bool2int(_6_info.X0 >= _maxKey) }() != 0 { _checkAppendMsg(tls, _pCheck, str(89449), _6_info.X0) } _maxKey = _6_info.X0 _keyCanBeEqual = i32(0) _25: - if (_6_info.X2) <= uint32(_6_info.X3) { + if _6_info.X2 <= uint32(_6_info.X3) { goto _29 } func() { @@ -68433,18 +71417,18 @@ _25: crt.X__builtin_abort(tls) } }() - _11_nPage = int32(((((_6_info.X2) - uint32(_6_info.X3)) + _usableSize) - uint32(i32(5))) / (_usableSize - uint32(i32(4)))) - _11_pgnoOvfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(int32(_6_info.X4)-i32(4))))) - if (_pBt.X5) != 0 { + _11_nPage = int32((((_6_info.X2 - uint32(_6_info.X3)) + _usableSize) - uint32(i32(5))) / (_usableSize - uint32(i32(4)))) + _11_pgnoOvfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+1*uintptr(int32(_6_info.X4)-i32(4))))) + if _pBt.X5 != 0 { _checkPtrmap(tls, _pCheck, _11_pgnoOvfl, uint8(i32(3)), uint32(_iPage)) } _checkList(tls, _pCheck, i32(0), int32(_11_pgnoOvfl), _11_nPage) _29: - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _33 } _pgno = int32(_sqlite3Get4byte(tls, _pCell)) - if (_pBt.X5) != 0 { + if _pBt.X5 != 0 { _checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(i32(5)), uint32(_iPage)) } _d2 = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey) @@ -68462,30 +71446,31 @@ _16: goto _15 _19: *_piMinKey = _maxKey - *(**int8)(unsafe.Pointer(&(_pCheck.X7))) = nil - if _doCoverageCheck == 0 || (_pCheck.X4) <= i32(0) { + *(**int8)(unsafe.Pointer(&_pCheck.X7)) = nil + if _doCoverageCheck == 0 || _pCheck.X4 <= i32(0) { goto _end_of_check } - if (_pPage.X5) != 0 { + if _pPage.X5 != 0 { goto _39 } _heap = _pCheck.X11 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_heap)) + 4*uintptr(i32(0)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_heap)) + 4*uintptr(i32(0)))) = uint32(i32(0)) _i = _nCell - i32(1) _40: if _i < i32(0) { goto _43 } - _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart+(_i*i32(2))))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart+(_i*i32(2))))))) + 1*uintptr(i32(1)))))) - _19_size = uint32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *uint8) uint16 - }{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_pc))))) + _pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cellStart+(_i*i32(2))))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_cellStart+(_i*i32(2))))))) + 1*uintptr(i32(1)))))) + _19_size = uint32(func() func(*crt.TLS, *XMemPage, *uint8) uint16 { + v := _pPage.X24 + return *(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&v)) + }()(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_pc))))) _btreeHeapInsert(tls, _heap, (_pc<<uint(i32(16)))|((_pc+_19_size)-uint32(i32(1)))) _i -= 1 goto _40 _43: _39: - _i = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1))))) + _i = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1))))) _44: if _i > i32(0) { func() { @@ -68494,7 +71479,7 @@ _44: crt.X__builtin_abort(tls) } }() - _20_size = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(1))))) + _20_size = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(1))))) func() { if uint32(_i+_20_size) > _usableSize { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68425), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89553))) @@ -68502,7 +71487,7 @@ _44: } }() _btreeHeapInsert(tls, _heap, (uint32(_i)<<uint(i32(16)))|uint32((_i+_20_size)-i32(1))) - _20_j = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i))))) + 1*uintptr(i32(1))))) + _20_j = (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_i))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data))+1*uintptr(_i))))) + 1*uintptr(i32(1))))) func() { if _20_j != i32(0) && _20_j <= (_i+_20_size) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68434), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89579))) @@ -68541,17 +71526,17 @@ _56: *p = int32(uint32(*p) + ((_usableSize - (_prev & uint32(i32(65535)))) - uint32(i32(1)))) sink1(*p) } - if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_heap)) + 4*uintptr(i32(0))))) == uint32(i32(0))) && (_nFrag != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))))) { - _checkAppendMsg(tls, _pCheck, str(89654), _nFrag, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))), _iPage) + if ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_heap)) + 4*uintptr(i32(0))))) == uint32(i32(0))) && (_nFrag != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7)))))) { + _checkAppendMsg(tls, _pCheck, str(89654), _nFrag, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_data)) + 1*uintptr(_hdr+i32(7))))), _iPage) } _end_of_check: if _doCoverageCheck == 0 { - *(*uint8)(unsafe.Pointer(&(_pPage.X0))) = _savedIsInit + *(*uint8)(unsafe.Pointer(&_pPage.X0)) = _savedIsInit } _releasePage(tls, _pPage) - *(**int8)(unsafe.Pointer(&(_pCheck.X7))) = _saved_zPfx - *(*int32)(unsafe.Pointer(&(_pCheck.X8))) = _saved_v1 - *(*int32)(unsafe.Pointer(&(_pCheck.X9))) = _saved_v2 + *(**int8)(unsafe.Pointer(&_pCheck.X7)) = _saved_zPfx + *(*int32)(unsafe.Pointer(&_pCheck.X8)) = _saved_v1 + *(*int32)(unsafe.Pointer(&_pCheck.X9)) = _saved_v2 return _depth + i32(1) _ = _6_info @@ -68564,35 +71549,38 @@ func init() { crt.Xstrncpy(nil, &_checkTreePageØ00__func__Ø000[0], str(89706), 14) } -// An implementation of a min-heap. -// -// aHeap[0] is the number of elements on the heap. aHeap[1] is the -// root element. The daughter nodes of aHeap[N] are aHeap[N*2] -// and aHeap[N*2+1]. -// -// The heap property is this: Every node is less than or equal to both -// of its daughter nodes. A consequence of the heap property is that the -// root node aHeap[1] is always the minimum value currently in the heap. -// -// The btreeHeapInsert() routine inserts an unsigned 32-bit number onto -// the heap, preserving the heap property. The btreeHeapPull() routine -// removes the root element from the heap (the minimum value in the heap) -// and then moves other nodes around as necessary to preserve the heap -// property. -// -// This heap is used for cell overlap and coverage testing. Each u32 -// entry represents the span of a cell or freeblock on a btree page. -// The upper 16 bits are the index of the first byte of a range and the -// lower 16 bits are the index of the last byte of that range. +// C comment +// /* +// ** An implementation of a min-heap. +// ** +// ** aHeap[0] is the number of elements on the heap. aHeap[1] is the +// ** root element. The daughter nodes of aHeap[N] are aHeap[N*2] +// ** and aHeap[N*2+1]. +// ** +// ** The heap property is this: Every node is less than or equal to both +// ** of its daughter nodes. A consequence of the heap property is that the +// ** root node aHeap[1] is always the minimum value currently in the heap. +// ** +// ** The btreeHeapInsert() routine inserts an unsigned 32-bit number onto +// ** the heap, preserving the heap property. The btreeHeapPull() routine +// ** removes the root element from the heap (the minimum value in the heap) +// ** and then moves other nodes around as necessary to preserve the heap +// ** property. +// ** +// ** This heap is used for cell overlap and coverage testing. Each u32 +// ** entry represents the span of a cell or freeblock on a btree page. +// ** The upper 16 bits are the index of the first byte of a range and the +// ** lower 16 bits are the index of the last byte of that range. +// */ func _btreeHeapInsert(tls *crt.TLS, _aHeap *uint32, _x uint32) { var _j, _i uint32 - _i = preInc5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap))+4*uintptr(i32(0)))), uint32(1)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = _x + _i = preInc5((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap))+4*uintptr(i32(0)))), uint32(1)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))) = _x _0: - if (store5(&_j, _i/uint32(i32(2))) > uint32(i32(0))) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))))) { - _x = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = _x + if (store5(&_j, _i/uint32(i32(2))) > uint32(i32(0))) && ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))))) { + _x = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))) = _x _i = _j goto _0 } @@ -68600,35 +71588,38 @@ _0: func _btreeHeapPull(tls *crt.TLS, _aHeap *uint32, _pOut *uint32) (r0 int32) { var _j, _i, _x uint32 - if store5(&_x, *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0))))) == uint32(i32(0)) { + if store5(&_x, *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(i32(0))))) == uint32(i32(0)) { return i32(0) } - *_pOut = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(1)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_x))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_x))) = u32(4294967295) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0)))) -= 1 + *_pOut = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(i32(1)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_x))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_x))) = u32(4294967295) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(i32(0)))) -= 1 _i = uint32(i32(1)) _1: - if store5(&_j, _i*uint32(i32(2))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0))))) { + if store5(&_j, _i*uint32(i32(2))) > (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(i32(0))))) { goto _2 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j+uint32(i32(1)))))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j+uint32(i32(1)))))) { _j += 1 } - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i)))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i)))) < (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j)))) { goto _2 } - _x = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) = _x + _x = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_i))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aHeap)) + 4*uintptr(_j))) = _x _i = _j goto _1 _2: return i32(1) } -// Delete any previous value and set the value of pMem to be an -// empty boolean index. +// C comment +// /* +// ** Delete any previous value and set the value of pMem to be an +// ** empty boolean index. +// */ func _sqlite3VdbeMemSetRowSet(tls *crt.TLS, _pMem *XMem) { var _db *Xsqlite3 _db = (*Xsqlite3)(_pMem.X9) @@ -68645,27 +71636,27 @@ func _sqlite3VdbeMemSetRowSet(tls *crt.TLS, _pMem *XMem) { } }() _sqlite3VdbeMemRelease(tls, _pMem) - *(**int8)(unsafe.Pointer(&(_pMem.X6))) = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(i32(64)))) - if (_db.X17) != 0 { - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1)) - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0) + *(**int8)(unsafe.Pointer(&_pMem.X6)) = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(i32(64)))) + if _db.X17 != 0 { + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(1)) + *(*int32)(unsafe.Pointer(&_pMem.X7)) = i32(0) goto _5 } func() { - if (_pMem.X6) == nil { + if _pMem.X6 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(89720))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, _db, (unsafe.Pointer)(_pMem.X6)) - *(**XRowSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))) = _sqlite3RowSetInit(tls, _db, (unsafe.Pointer)(_pMem.X6), uint32(_pMem.X7)) + *(*int32)(unsafe.Pointer(&_pMem.X7)) = _sqlite3DbMallocSize(tls, _db, unsafe.Pointer(_pMem.X6)) + *(**XRowSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0)))))) = _sqlite3RowSetInit(tls, _db, unsafe.Pointer(_pMem.X6), uint32(_pMem.X7)) func() { - if (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) == nil { + if (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pMem.X0))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70440), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(89734))) crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(32)) + *(*uint16)(unsafe.Pointer(&_pMem.X1)) = uint16(i32(32)) _5: } @@ -68675,16 +71666,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemSetRowSetØ00__func__Ø000[0], str(89753), 24) } -// Turn bulk memory into a RowSet object. N bytes of memory -// are available at pSpace. The db pointer is used as a memory context -// for any subsequent allocations that need to occur. -// Return a pointer to the new RowSet object. -// -// It must be the case that N is sufficient to make a Rowset. If not -// an assertion fault occurs. -// -// If N is larger than the minimum, use the surplus as an initial -// allocation of entries available to be filled. +// C comment +// /* +// ** Turn bulk memory into a RowSet object. N bytes of memory +// ** are available at pSpace. The db pointer is used as a memory context +// ** for any subsequent allocations that need to occur. +// ** Return a pointer to the new RowSet object. +// ** +// ** It must be the case that N is sufficient to make a Rowset. If not +// ** an assertion fault occurs. +// ** +// ** If N is larger than the minimum, use the surplus as an initial +// ** allocation of entries available to be filled. +// */ func _sqlite3RowSetInit(tls *crt.TLS, _db *Xsqlite3, _pSpace unsafe.Pointer, _N uint32) (r0 *XRowSet) { var _p *XRowSet func() { @@ -68694,15 +71688,15 @@ func _sqlite3RowSetInit(tls *crt.TLS, _db *Xsqlite3, _pSpace unsafe.Pointer, _N } }() _p = (*XRowSet)(_pSpace) - *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _db - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = (*TRowSetEntry)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u64(56)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))))))) - *(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16((uint64(_N) - u64(56)) / u64(24)) - *(*uint16)(unsafe.Pointer(&(_p.X7))) = uint16(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X8))) = i32(0) + *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = nil + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _db + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X5)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = (*TRowSetEntry)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u64(56)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))))))) + *(*uint16)(unsafe.Pointer(&_p.X6)) = uint16((uint64(_N) - u64(56)) / u64(24)) + *(*uint16)(unsafe.Pointer(&_p.X7)) = uint16(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X8)) = i32(0) return _p } @@ -68712,10 +71706,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RowSetInitØ00__func__Ø000[0], str(89801), 18) } -// Insert a new value into a RowSet. -// -// The mallocFailed flag of the database connection is set if a -// memory allocation fails. +// C comment +// /* +// ** Insert a new value into a RowSet. +// ** +// ** The mallocFailed flag of the database connection is set if a +// ** memory allocation fails. +// */ func _sqlite3RowSetInsert(tls *crt.TLS, _p *XRowSet, _rowid int64) { var _pEntry, _pLast *TRowSetEntry func() { @@ -68728,25 +71725,25 @@ func _sqlite3RowSetInsert(tls *crt.TLS, _p *XRowSet, _rowid int64) { if _pEntry == nil { return } - *(*int64)(unsafe.Pointer(&(_pEntry.X0))) = _rowid - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = nil + *(*int64)(unsafe.Pointer(&_pEntry.X0)) = _rowid + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pEntry.X1)))) = nil _pLast = (*TRowSetEntry)(_p.X3) if _pLast == nil { goto _4 } - if _rowid <= (_pLast.X0) { + if _rowid <= _pLast.X0 { { - p := (*uint16)(unsafe.Pointer(&(_p.X7))) + p := (*uint16)(unsafe.Pointer(&_p.X7)) *p = uint16(int32(*p) & i32(-2)) sink14(*p) } } - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLast.X1))))) = _pEntry + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLast.X1)))) = _pEntry goto _6 _4: - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pEntry + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = _pEntry _6: - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _pEntry + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = _pEntry } var _sqlite3RowSetInsertØ00__func__Ø000 [20]int8 @@ -68755,12 +71752,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RowSetInsertØ00__func__Ø000[0], str(89857), 20) } -// Allocate a new RowSetEntry object that is associated with the -// given RowSet. Return a pointer to the new and completely uninitialized -// objected. -// -// In an OOM situation, the RowSet.db->mallocFailed flag is set and this -// routine returns NULL. +// C comment +// /* +// ** Allocate a new RowSetEntry object that is associated with the +// ** given RowSet. Return a pointer to the new and completely uninitialized +// ** objected. +// ** +// ** In an OOM situation, the RowSet.db->mallocFailed flag is set and this +// ** routine returns NULL. +// */ func _rowSetEntryAlloc(tls *crt.TLS, _p *XRowSet) (r0 *TRowSetEntry) { var _1_pNew *TRowSetChunk func() { @@ -68776,13 +71776,13 @@ func _rowSetEntryAlloc(tls *crt.TLS, _p *XRowSet) (r0 *TRowSetEntry) { if _1_pNew == nil { return nil } - *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X0))))) = (*TRowSetChunk)(_p.X0) - *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _1_pNew - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = (*TRowSetEntry)(unsafe.Pointer((*[42]TRowSetEntry)(unsafe.Pointer(&(_1_pNew.X1))))) - *(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(u64(42)) + *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X0)))) = (*TRowSetChunk)(_p.X0) + *(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _1_pNew + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = (*TRowSetEntry)(unsafe.Pointer((*[42]TRowSetEntry)(unsafe.Pointer(&_1_pNew.X1)))) + *(*uint16)(unsafe.Pointer(&_p.X6)) = uint16(u64(42)) _2: - *(*uint16)(unsafe.Pointer(&(_p.X6))) -= 1 - return postInc57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))), 24) + *(*uint16)(unsafe.Pointer(&_p.X6)) -= 1 + return postInc57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))), 24) } var _rowSetEntryAllocØ00__func__Ø000 [17]int8 @@ -68791,17 +71791,20 @@ func init() { crt.Xstrncpy(nil, &_rowSetEntryAllocØ00__func__Ø000[0], str(89877), 17) } -// Extract the smallest element from the RowSet. -// Write the element into *pRowid. Return 1 on success. Return -// 0 if the RowSet is already empty. -// -// After this routine has been called, the sqlite3RowSetInsert() -// routine may not be called again. -// -// This routine may not be called after sqlite3RowSetTest() has -// been used. Older versions of RowSet allowed that, but as the -// capability was not used by the code generator, it was removed -// for code economy. +// C comment +// /* +// ** Extract the smallest element from the RowSet. +// ** Write the element into *pRowid. Return 1 on success. Return +// ** 0 if the RowSet is already empty. +// ** +// ** After this routine has been called, the sqlite3RowSetInsert() +// ** routine may not be called again. +// ** +// ** This routine may not be called after sqlite3RowSetTest() has +// ** been used. Older versions of RowSet allowed that, but as the +// ** capability was not used by the code generator, it was removed +// ** for code economy. +// */ func _sqlite3RowSetNext(tls *crt.TLS, _p *XRowSet, _pRowid *int64) (r0 int32) { func() { if _p == nil { @@ -68819,19 +71822,19 @@ func _sqlite3RowSetNext(tls *crt.TLS, _p *XRowSet, _pRowid *int64) (r0 int32) { goto _4 } if (int32(_p.X7) & i32(1)) == i32(0) { - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _rowSetEntrySort(tls, (*TRowSetEntry)(_p.X2)) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = _rowSetEntrySort(tls, (*TRowSetEntry)(_p.X2)) } { - p := (*uint16)(unsafe.Pointer(&(_p.X7))) + p := (*uint16)(unsafe.Pointer(&_p.X7)) *p = uint16(int32(*p) | i32(3)) sink14(*p) } _4: - if (*TRowSetEntry)(_p.X2) == nil { + if _p.X2 == nil { goto _6 } *_pRowid = (*TRowSetEntry)(_p.X2).X0 - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*TRowSetEntry)((*TRowSetEntry)(_p.X2).X1) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = (*TRowSetEntry)((*TRowSetEntry)(_p.X2).X1) if (*TRowSetEntry)(_p.X2) == nil { _sqlite3RowSetClear(tls, _p) } @@ -68851,41 +71854,41 @@ func _rowSetEntrySort(tls *crt.TLS, _pIn *TRowSetEntry) (r0 *TRowSetEntry) { var _i uint32 var _pNext *TRowSetEntry var _aBucket [40]*TRowSetEntry - crt.Xmemset(tls, (unsafe.Pointer)(&_aBucket), i32(0), u64(320)) + crt.Xmemset(tls, unsafe.Pointer(&_aBucket), i32(0), u64(320)) _0: if _pIn == nil { goto _1 } _pNext = (*TRowSetEntry)(_pIn.X1) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X1))))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIn.X1)))) = nil _i = uint32(i32(0)) _2: - if (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i)))) == nil { + if (*(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i)))) == nil { goto _5 } - _pIn = _rowSetEntryMerge(tls, *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i))), _pIn) - *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i))) = nil + _pIn = _rowSetEntryMerge(tls, *(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i))), _pIn) + *(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i))) = nil _i += 1 goto _2 _5: - *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i))) = _pIn + *(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i))) = _pIn _pIn = _pNext goto _0 _1: - _pIn = *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(i32(0)))) + _pIn = *(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(i32(0)))) _i = uint32(i32(1)) _6: if uint64(_i) >= u64(40) { goto _9 } - if (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i)))) == nil { + if (*(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i)))) == nil { goto _7 } _pIn = func() *TRowSetEntry { if _pIn != nil { - return _rowSetEntryMerge(tls, _pIn, *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i)))) + return _rowSetEntryMerge(tls, _pIn, *(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i)))) } - return (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 8*uintptr(_i)))) + return (*(**TRowSetEntry)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aBucket)) + 8*uintptr(_i)))) }() _7: _i += 1 @@ -68897,10 +71900,13 @@ _9: panic(0) } -// Merge two lists of RowSetEntry objects. Remove duplicates. -// -// The input lists are connected via pRight pointers and are -// assumed to each already be in sorted order. +// C comment +// /* +// ** Merge two lists of RowSetEntry objects. Remove duplicates. +// ** +// ** The input lists are connected via pRight pointers and are +// ** assumed to each already be in sorted order. +// */ func _rowSetEntryMerge(tls *crt.TLS, _pA *TRowSetEntry, _pB *TRowSetEntry) (r0 *TRowSetEntry) { var _head TRowSetEntry var _pTail *TRowSetEntry @@ -68913,34 +71919,34 @@ func _rowSetEntryMerge(tls *crt.TLS, _pA *TRowSetEntry, _pB *TRowSetEntry) (r0 * }() _3: func() { - if (*TRowSetEntry)(_pA.X1) != nil && (_pA.X0) > ((*TRowSetEntry)(_pA.X1).X0) { + if (*TRowSetEntry)(_pA.X1) != nil && _pA.X0 > ((*TRowSetEntry)(_pA.X1).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46511), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000))), unsafe.Pointer(str(89926))) crt.X__builtin_abort(tls) } }() func() { - if (*TRowSetEntry)(_pB.X1) != nil && (_pB.X0) > ((*TRowSetEntry)(_pB.X1).X0) { + if (*TRowSetEntry)(_pB.X1) != nil && _pB.X0 > ((*TRowSetEntry)(_pB.X1).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46512), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000))), unsafe.Pointer(str(89964))) crt.X__builtin_abort(tls) } }() - if (_pA.X0) > (_pB.X0) { + if _pA.X0 > _pB.X0 { goto _12 } - if (_pA.X0) < (_pB.X0) { - _pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))), _pA) + if _pA.X0 < _pB.X0 { + _pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X1)))), _pA) } _pA = (*TRowSetEntry)(_pA.X1) if _pA == nil { - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))) = _pB + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X1)))) = _pB goto _5 } goto _15 _12: - _pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))), _pB) + _pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X1)))), _pB) _pB = (*TRowSetEntry)(_pB.X1) if _pB == nil { - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))) = _pA + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTail.X1)))) = _pA goto _5 } _15: @@ -68958,12 +71964,15 @@ func init() { crt.Xstrncpy(nil, &_rowSetEntryMergeØ00__func__Ø000[0], str(90002), 17) } -// Check to see if element iRowid was inserted into the rowset as -// part of any insert batch prior to iBatch. Return 1 or 0. -// -// If this is the first test of a new batch and if there exist entries -// on pRowSet->pEntry, then sort those entries into the forest at -// pRowSet->pForest so that they can be tested. +// C comment +// /* +// ** Check to see if element iRowid was inserted into the rowset as +// ** part of any insert batch prior to iBatch. Return 1 or 0. +// ** +// ** If this is the first test of a new batch and if there exist entries +// ** on pRowSet->pEntry, then sort those entries into the forest at +// ** pRowSet->pForest so that they can be tested. +// */ func _sqlite3RowSetTest(tls *crt.TLS, _pRowSet *XRowSet, _iBatch int32, _iRowid int64) (r0 int32) { var _p, _pTree, _6_pAux, _6_pTail *TRowSetEntry var _2_ppPrevTree **TRowSetEntry @@ -68973,14 +71982,14 @@ func _sqlite3RowSetTest(tls *crt.TLS, _pRowSet *XRowSet, _iBatch int32, _iRowid crt.X__builtin_abort(tls) } }() - if _iBatch == (_pRowSet.X8) { + if _iBatch == _pRowSet.X8 { goto _3 } _p = (*TRowSetEntry)(_pRowSet.X2) if _p == nil { goto _4 } - _2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X5))))) + _2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRowSet.X5)))) if (int32(_pRowSet.X7) & i32(1)) == i32(0) { _p = _rowSetEntrySort(tls, _p) } @@ -68989,13 +71998,13 @@ _6: if _pTree == nil { goto _9 } - _2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X1))))) + _2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTree.X1)))) if (*TRowSetEntry)(_pTree.X2) == nil { - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = _rowSetListToTree(tls, _p) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTree.X2)))) = _rowSetListToTree(tls, _p) goto _9 } _rowSetTreeToList(tls, (*TRowSetEntry)(_pTree.X2), &_6_pAux, &_6_pTail) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTree.X2)))) = nil _p = _rowSetEntryMerge(tls, _6_pAux, _p) _pTree = (*TRowSetEntry)(_pTree.X1) goto _6 @@ -69005,20 +72014,20 @@ _9: } *_2_ppPrevTree = store57(&_pTree, _rowSetEntryAlloc(tls, _pRowSet)) if _pTree != nil { - *(*int64)(unsafe.Pointer(&(_pTree.X0))) = int64(i32(0)) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X1))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = _rowSetListToTree(tls, _p) + *(*int64)(unsafe.Pointer(&_pTree.X0)) = int64(i32(0)) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTree.X1)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTree.X2)))) = _rowSetListToTree(tls, _p) } _12: - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X2))))) = nil - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X3))))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRowSet.X2)))) = nil + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRowSet.X3)))) = nil { - p := (*uint16)(unsafe.Pointer(&(_pRowSet.X7))) + p := (*uint16)(unsafe.Pointer(&_pRowSet.X7)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } _4: - *(*int32)(unsafe.Pointer(&(_pRowSet.X8))) = _iBatch + *(*int32)(unsafe.Pointer(&_pRowSet.X8)) = _iBatch _3: _pTree = (*TRowSetEntry)(_pRowSet.X5) _14: @@ -69030,11 +72039,11 @@ _18: if _p == nil { goto _19 } - if (_p.X0) < _iRowid { + if _p.X0 < _iRowid { _p = (*TRowSetEntry)(_p.X1) goto _23 } - if (_p.X0) > _iRowid { + if _p.X0 > _iRowid { _p = (*TRowSetEntry)(_p.X2) goto _23 } @@ -69058,8 +72067,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RowSetTestØ00__func__Ø000[0], str(90069), 18) } -// Convert a sorted list of elements into a binary tree. Make the tree -// as deep as it needs to be in order to contain the entire list. +// C comment +// /* +// ** Convert a sorted list of elements into a binary tree. Make the tree +// ** as deep as it needs to be in order to contain the entire list. +// */ func _rowSetListToTree(tls *crt.TLS, _pList *TRowSetEntry) (r0 *TRowSetEntry) { var _iDepth int32 var _p, _pLeft *TRowSetEntry @@ -69071,7 +72083,7 @@ func _rowSetListToTree(tls *crt.TLS, _pList *TRowSetEntry) (r0 *TRowSetEntry) { }() _p = _pList _pList = (*TRowSetEntry)(_p.X1) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))), nil) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))), nil) _iDepth = i32(1) _2: if _pList == nil { @@ -69080,8 +72092,8 @@ _2: _pLeft = _p _p = _pList _pList = (*TRowSetEntry)(_p.X1) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pLeft - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _rowSetNDeepTree(tls, &_pList, _iDepth) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = _pLeft + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _rowSetNDeepTree(tls, &_pList, _iDepth) _iDepth += 1 goto _2 _5: @@ -69094,17 +72106,20 @@ func init() { crt.Xstrncpy(nil, &_rowSetListToTreeØ00__func__Ø000[0], str(90096), 17) } -// Convert a sorted list of elements (connected by pRight) into a binary -// tree with depth of iDepth. A depth of 1 means the tree contains a single -// node taken from the head of *ppList. A depth of 2 means a tree with -// three nodes. And so forth. -// -// Use as many entries from the input list as required and update the -// *ppList to point to the unused elements of the list. If the input -// list contains too few elements, then construct an incomplete tree -// and leave *ppList set to NULL. -// -// Return a pointer to the root of the constructed binary tree. +// C comment +// /* +// ** Convert a sorted list of elements (connected by pRight) into a binary +// ** tree with depth of iDepth. A depth of 1 means the tree contains a single +// ** node taken from the head of *ppList. A depth of 2 means a tree with +// ** three nodes. And so forth. +// ** +// ** Use as many entries from the input list as required and update the +// ** *ppList to point to the unused elements of the list. If the input +// ** list contains too few elements, then construct an incomplete tree +// ** and leave *ppList set to NULL. +// ** +// ** Return a pointer to the root of the constructed binary tree. +// */ func _rowSetNDeepTree(tls *crt.TLS, _ppList **TRowSetEntry, _iDepth int32) (r0 *TRowSetEntry) { var _p, _pLeft *TRowSetEntry if (*_ppList) == nil { @@ -69118,21 +72133,24 @@ func _rowSetNDeepTree(tls *crt.TLS, _ppList **TRowSetEntry, _iDepth int32) (r0 * if _p == nil { return _pLeft } - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pLeft + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = _pLeft *_ppList = (*TRowSetEntry)(_p.X1) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _rowSetNDeepTree(tls, _ppList, _iDepth-i32(1)) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _rowSetNDeepTree(tls, _ppList, _iDepth-i32(1)) goto _3 _1: _p = *_ppList *_ppList = (*TRowSetEntry)(_p.X1) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))), nil) + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))), nil) _3: return _p } -// The input, pIn, is a binary tree (or subtree) of RowSetEntry objects. -// Convert this tree into a linked list connected by the pRight pointers -// and return pointers to the first and last elements of the new list. +// C comment +// /* +// ** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects. +// ** Convert this tree into a linked list connected by the pRight pointers +// ** and return pointers to the first and last elements of the new list. +// */ func _rowSetTreeToList(tls *crt.TLS, _pIn *TRowSetEntry, _ppFirst **TRowSetEntry, _ppLast **TRowSetEntry) { var _1_p *TRowSetEntry func() { @@ -69141,15 +72159,15 @@ func _rowSetTreeToList(tls *crt.TLS, _pIn *TRowSetEntry, _ppFirst **TRowSetEntry crt.X__builtin_abort(tls) } }() - if (*TRowSetEntry)(_pIn.X2) != nil { + if _pIn.X2 != nil { _rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.X2), _ppFirst, &_1_p) - *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X1))))) = _pIn + *(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_p.X1)))) = _pIn goto _3 } *_ppFirst = _pIn _3: - if (*TRowSetEntry)(_pIn.X1) != nil { - _rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.X1), (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X1))))), _ppLast) + if _pIn.X1 != nil { + _rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.X1), (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIn.X1)))), _ppLast) goto _5 } *_ppLast = _pIn @@ -69168,23 +72186,26 @@ func init() { crt.Xstrncpy(nil, &_rowSetTreeToListØ00__func__Ø000[0], str(90141), 17) } -// Run a checkpoint on database iDb. This is a no-op if database iDb is -// not currently open in WAL mode. -// -// If a transaction is open on the database being checkpointed, this -// function returns SQLITE_LOCKED and a checkpoint is not attempted. If -// an error occurs while running the checkpoint, an SQLite error code is -// returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK. -// -// The mutex on database handle db should be held by the caller. The mutex -// associated with the specific b-tree being checkpointed is taken by -// this function while the checkpoint is running. -// -// If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are -// checkpointed. If an error is encountered it is returned immediately - -// no attempt is made to checkpoint any remaining databases. -// -// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// C comment +// /* +// ** Run a checkpoint on database iDb. This is a no-op if database iDb is +// ** not currently open in WAL mode. +// ** +// ** If a transaction is open on the database being checkpointed, this +// ** function returns SQLITE_LOCKED and a checkpoint is not attempted. If +// ** an error occurs while running the checkpoint, an SQLite error code is +// ** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK. +// ** +// ** The mutex on database handle db should be held by the caller. The mutex +// ** associated with the specific b-tree being checkpointed is taken by +// ** this function while the checkpoint is running. +// ** +// ** If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are +// ** checkpointed. If an error is encountered it is returned immediately - +// ** no attempt is made to checkpoint any remaining databases. +// ** +// ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// */ func _sqlite3Checkpoint(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) { var _rc, _i, _bBusy int32 _rc = i32(0) @@ -69209,7 +72230,7 @@ func _sqlite3Checkpoint(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _eMode int32, _ }() _i = i32(0) _8: - if _i >= (_db.X5) || _rc != i32(0) { + if _i >= _db.X5 || _rc != i32(0) { goto _12 } if _i != _iDb && _iDb != i32(10) { @@ -69240,12 +72261,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CheckpointØ00__func__Ø000[0], str(90202), 18) } -// Run a checkpoint on the Btree passed as the first argument. -// -// Return SQLITE_LOCKED if this or any other connection has an open -// transaction on the shared-cache the argument Btree is connected to. -// -// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// C comment +// /* +// ** Run a checkpoint on the Btree passed as the first argument. +// ** +// ** Return SQLITE_LOCKED if this or any other connection has an open +// ** transaction on the shared-cache the argument Btree is connected to. +// ** +// ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// */ func _sqlite3BtreeCheckpoint(tls *crt.TLS, _p *XBtree, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) { var _rc int32 var _1_pBt *XBtShared @@ -69266,28 +72290,34 @@ _0: return _rc } -// This function is called when the user invokes "PRAGMA wal_checkpoint", -// "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint() -// or wal_blocking_checkpoint() API functions. -// -// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// C comment +// /* +// ** This function is called when the user invokes "PRAGMA wal_checkpoint", +// ** "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint() +// ** or wal_blocking_checkpoint() API functions. +// ** +// ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. +// */ func _sqlite3PagerCheckpoint(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) { var _rc int32 _rc = i32(0) - if (*XWal)(_pPager.X60) != nil { + if _pPager.X60 != nil { _rc = _sqlite3WalCheckpoint(tls, (*XWal)(_pPager.X60), _db, _eMode, func() func(*crt.TLS, unsafe.Pointer) int32 { if _eMode == i32(0) { return nil } - return (_pPager.X53) + return _pPager.X53 }(), _pPager.X54, int32(_pPager.X7), _pPager.X48, (*uint8)(unsafe.Pointer(_pPager.X58)), _pnLog, _pnCkpt) } return _rc } -// Return TRUE if the pager is in a state where it is OK to change the -// journalmode. Journalmode changes can only happen when the database -// is unmodified. +// C comment +// /* +// ** Return TRUE if the pager is in a state where it is OK to change the +// ** journalmode. Journalmode changes can only happen when the database +// ** is unmodified. +// */ func _sqlite3PagerOkToChangeJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) { func() { if _assert_pager_state(tls, _pPager) == 0 { @@ -69299,7 +72329,7 @@ func _sqlite3PagerOkToChangeJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32 return i32(0) } if func() int32 { - if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && ((_pPager.X34) > int64(i32(0))) { + if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && (_pPager.X34 > int64(i32(0))) { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54189), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -69319,13 +72349,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000[0], str(90220), 34) } -// This function is called to close the connection to the log file prior -// to switching from WAL to rollback mode. -// -// Before closing the log file, this function attempts to take an -// EXCLUSIVE lock on the database file. If this cannot be obtained, an -// error (SQLITE_BUSY) is returned and the log connection is not closed. -// If successful, the EXCLUSIVE lock is not released before returning. +// C comment +// /* +// ** This function is called to close the connection to the log file prior +// ** to switching from WAL to rollback mode. +// ** +// ** Before closing the log file, this function attempts to take an +// ** EXCLUSIVE lock on the database file. If this cannot be obtained, an +// ** error (SQLITE_BUSY) is returned and the log connection is not closed. +// ** If successful, the EXCLUSIVE lock is not released before returning. +// */ func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) { var _rc, _1_logexists int32 _rc = i32(0) @@ -69335,7 +72368,7 @@ func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int crt.X__builtin_abort(tls) } }() - if (*XWal)(_pPager.X60) != nil { + if _pPager.X60 != nil { goto _2 } _1_logexists = i32(0) @@ -69347,7 +72380,7 @@ func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int _rc = _pagerOpenWal(tls, _pPager) } _2: - if _rc != i32(0) || (*XWal)(_pPager.X60) == nil { + if _rc != i32(0) || _pPager.X60 == nil { goto _7 } _rc = _pagerExclusiveLock(tls, _pPager) @@ -69355,9 +72388,9 @@ _2: goto _8 } _rc = _sqlite3WalClose(tls, (*XWal)(_pPager.X60), _db, int32(_pPager.X7), _pPager.X48, (*uint8)(unsafe.Pointer(_pPager.X58))) - *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60))))) = nil + *(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X60)))) = nil _pagerFixMaplimit(tls, _pPager) - if _rc != 0 && ((_pPager.X1) == 0) { + if _rc != 0 && (_pPager.X1 == 0) { _pagerUnlockDb(tls, _pPager, i32(1)) } _8: @@ -69371,24 +72404,27 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerCloseWalØ00__func__Ø000[0], str(90297), 21) } -// Set the journal-mode for this pager. Parameter eMode must be one of: -// -// PAGER_JOURNALMODE_DELETE -// PAGER_JOURNALMODE_TRUNCATE -// PAGER_JOURNALMODE_PERSIST -// PAGER_JOURNALMODE_OFF -// PAGER_JOURNALMODE_MEMORY -// PAGER_JOURNALMODE_WAL -// -// The journalmode is set to the value specified if the change is allowed. -// The change may be disallowed for the following reasons: -// -// * An in-memory database can only have its journal_mode set to _OFF -// or _MEMORY. -// -// * Temporary databases cannot have _WAL journalmode. -// -// The returned indicate the current (possibly updated) journal-mode. +// C comment +// /* +// ** Set the journal-mode for this pager. Parameter eMode must be one of: +// ** +// ** PAGER_JOURNALMODE_DELETE +// ** PAGER_JOURNALMODE_TRUNCATE +// ** PAGER_JOURNALMODE_PERSIST +// ** PAGER_JOURNALMODE_OFF +// ** PAGER_JOURNALMODE_MEMORY +// ** PAGER_JOURNALMODE_WAL +// ** +// ** The journalmode is set to the value specified if the change is allowed. +// ** The change may be disallowed for the following reasons: +// ** +// ** * An in-memory database can only have its journal_mode set to _OFF +// ** or _MEMORY. +// ** +// ** * Temporary databases cannot have _WAL journalmode. +// ** +// ** The returned indicate the current (possibly updated) journal-mode. +// */ func _sqlite3PagerSetJournalMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) { var _6_rc, _6_state int32 var _eOld uint8 @@ -69406,7 +72442,7 @@ func _sqlite3PagerSetJournalMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r crt.X__builtin_abort(tls) } }() - if (_pPager.X13) == 0 { + if _pPager.X13 == 0 { goto _10 } func() { @@ -69428,7 +72464,7 @@ _10: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(_eMode) + *(*uint8)(unsafe.Pointer(&_pPager.X2)) = uint8(_eMode) i32(0) i32(0) i32(0) @@ -69436,12 +72472,12 @@ _10: i32(0) i32(0) func() { - if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X1) == 0 { + if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _pPager.X1 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54130), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90636))) crt.X__builtin_abort(tls) } }() - if (_pPager.X1) != 0 || (int32(_eOld)&i32(5)) != i32(1) || (_eMode&i32(1)) != i32(0) { + if _pPager.X1 != 0 || (int32(_eOld)&i32(5)) != i32(1) || (_eMode&i32(1)) != i32(0) { goto _24 } _sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32)) @@ -69497,12 +72533,15 @@ _16: return int32(_pPager.X2) } -// Return a pointer to a human readable string in a static buffer -// containing the state of the Pager object passed as an argument. This -// is intended to be used within debuggers. For example, as an alternative -// to "print *pPager" in gdb: -// -// (gdb) printf "%s", print_pager_state(pPager) +// C comment +// /* +// ** Return a pointer to a human readable string in a static buffer +// ** containing the state of the Pager object passed as an argument. This +// ** is intended to be used within debuggers. For example, as an alternative +// ** to "print *pPager" in gdb: +// ** +// ** (gdb) printf "%s", print_pager_state(pPager) +// */ func _print_pager_state(tls *crt.TLS, _p *XPager) (r0 *int8) { Xsqlite3_snprintf(tls, i32(1024), (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001)), str(90743), unsafe.Pointer(_p.X51), unsafe.Pointer(func() *int8 { if int32(_p.X14) == i32(0) { @@ -69565,7 +72604,7 @@ func _print_pager_state(tls *crt.TLS, _p *XPager) (r0 *int8) { }() }() }()), unsafe.Pointer(func() *int8 { - if (_p.X1) != 0 { + if _p.X1 != 0 { return str(91138) } return str(91148) @@ -69611,9 +72650,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerSetJournalModeØ00__func__Ø000[0], str(91194), 27) } -// Set both the "read version" (single byte at byte offset 18) and -// "write version" (single byte at byte offset 19) fields in the database -// header to iVersion. +// C comment +// /* +// ** Set both the "read version" (single byte at byte offset 18) and +// ** "write version" (single byte at byte offset 19) fields in the database +// ** header to iVersion. +// */ func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 int32) { var _rc int32 var _1_aData *uint8 @@ -69626,13 +72668,13 @@ func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 } }() { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-17)) sink14(*p) } if _iVersion == i32(1) { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } @@ -69642,7 +72684,7 @@ func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 goto _4 } _1_aData = (*XMemPage)(_pBt.X3).X19 - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(18))))) == int32(uint8(_iVersion)) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(19))))) == int32(uint8(_iVersion)) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aData)) + 1*uintptr(i32(18))))) == int32(uint8(_iVersion)) && int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aData)) + 1*uintptr(i32(19))))) == int32(uint8(_iVersion)) { goto _6 } _rc = _sqlite3BtreeBeginTrans(tls, _pBtree, i32(2)) @@ -69651,14 +72693,14 @@ func _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 } _rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23)) if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(18)))) = uint8(_iVersion) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(19)))) = uint8(_iVersion) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aData)) + 1*uintptr(i32(18)))) = uint8(_iVersion) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aData)) + 1*uintptr(i32(19)))) = uint8(_iVersion) } _7: _6: _4: { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) & i32(-17)) sink14(*p) } @@ -69671,9 +72713,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSetVersionØ00__func__Ø000[0], str(91248), 23) } -// Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants -// defined in pager.h. This function returns the associated lowercase -// journal-mode name. +// C comment +// /* +// ** Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants +// ** defined in pager.h. This function returns the associated lowercase +// ** journal-mode name. +// */ func _sqlite3JournalModename(tls *crt.TLS, _eMode int32) (r0 *int8) { i32(0) i32(0) @@ -69690,7 +72735,7 @@ func _sqlite3JournalModename(tls *crt.TLS, _eMode int32) (r0 *int8) { if _eMode == i32(6) { return nil } - return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JournalModenameØ00azModeNameØ001)) + 8*uintptr(_eMode))) + return *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3JournalModenameØ00azModeNameØ001)) + 8*uintptr(_eMode))) } var _sqlite3JournalModenameØ00__func__Ø000 [23]int8 @@ -69705,7 +72750,10 @@ func init() { _sqlite3JournalModenameØ00azModeNameØ001 = [6]*int8{str(91166), str(91173), str(91162), str(91181), str(91155), str(91190)} } -// This routine implements the OP_Vacuum opcode of the VDBE. +// C comment +// /* +// ** This routine implements the OP_Vacuum opcode of the VDBE. +// */ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32) (r0 int32) { var _rc, _saved_flags, _saved_nChange, _saved_nTotalChange, _isMemDb, _nRes, _nDb, _5_i int32 var _5_meta uint32 @@ -69715,11 +72763,11 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 var _pDb *XDb _rc = i32(0) _pDb = nil - if (_db.X15) == 0 { + if _db.X15 == 0 { _sqlite3SetString(tls, _pzErrMsg, _db, str(91335)) return i32(1) } - if (_db.X34) > i32(1) { + if _db.X34 > i32(1) { _sqlite3SetString(tls, _pzErrMsg, _db, str(91375)) return i32(1) } @@ -69728,16 +72776,16 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 _saved_nTotalChange = _db.X30 _saved_mTrace = _db.X24 { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(270542848) sink1(*p) } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-655489) sink1(*p) } - *(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_db.X24)) = uint8(i32(0)) _zDbMain = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 _pMain = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X1) _isMemDb = _sqlite3PagerIsMemdb(tls, _sqlite3BtreePager(tls, _pMain)) @@ -69747,7 +72795,7 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 goto _end_of_vacuum } func() { - if ((_db.X5) - i32(1)) != _nDb { + if (_db.X5 - i32(1)) != _nDb { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91439))) crt.X__builtin_abort(tls) } @@ -69774,10 +72822,10 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 goto _end_of_vacuum } if _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, _pMain)) == i32(5) { - *(*int32)(unsafe.Pointer(&(_db.X27))) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X27)) = i32(0) } if (_sqlite3BtreeSetPageSize(tls, _pTemp, _sqlite3BtreeGetPageSize(tls, _pMain), _nRes, i32(0)) != 0 || ((_isMemDb == 0) && _sqlite3BtreeSetPageSize(tls, _pTemp, _db.X27, _nRes, i32(0)) != 0)) || func() int32 { - if (_db.X17) != 0 { + if _db.X17 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124846), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -69795,7 +72843,7 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 } return _sqlite3BtreeGetAutoVacuum(tls, _pMain) }()) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(_nDb) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X1))) = uint8(_nDb) _rc = _execSqlF(tls, _db, _pzErrMsg, str(91503), unsafe.Pointer(_zDbMain)) if _rc != i32(0) { goto _end_of_vacuum @@ -69804,16 +72852,16 @@ func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32 if _rc != i32(0) { goto _end_of_vacuum } - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X1))) = uint8(i32(0)) _rc = _execSqlF(tls, _db, _pzErrMsg, str(91684), unsafe.Pointer(_zDbMain)) func() { - if ((_db.X6) & i32(268435456)) == i32(0) { + if (_db.X6 & i32(268435456)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91835))) crt.X__builtin_abort(tls) } }() { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-268435457) sink1(*p) } @@ -69841,8 +72889,8 @@ _28: if _5_i >= i32(10) { goto _31 } - _sqlite3BtreeGetMeta(tls, _pMain, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), &_5_meta) - _rc = _sqlite3BtreeUpdateMeta(tls, _pTemp, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), _5_meta+uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i+i32(1)))))) + _sqlite3BtreeGetMeta(tls, _pMain, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), &_5_meta) + _rc = _sqlite3BtreeUpdateMeta(tls, _pTemp, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), _5_meta+uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i+i32(1)))))) if func() int32 { if _rc != i32(0) { return func() int32 { @@ -69879,30 +72927,33 @@ _31: }() _rc = _sqlite3BtreeSetPageSize(tls, _pMain, _sqlite3BtreeGetPageSize(tls, _pTemp), _nRes, i32(1)) _end_of_vacuum: - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_db.X6))) = _saved_flags - *(*int32)(unsafe.Pointer(&(_db.X29))) = _saved_nChange - *(*int32)(unsafe.Pointer(&(_db.X30))) = _saved_nTotalChange - *(*uint8)(unsafe.Pointer(&(_db.X24))) = _saved_mTrace + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X1))) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_db.X6)) = _saved_flags + *(*int32)(unsafe.Pointer(&_db.X29)) = _saved_nChange + *(*int32)(unsafe.Pointer(&_db.X30)) = _saved_nTotalChange + *(*uint8)(unsafe.Pointer(&_db.X24)) = _saved_mTrace _sqlite3BtreeSetPageSize(tls, _pMain, i32(-1), i32(-1), i32(1)) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) if _pDb != nil { _sqlite3BtreeClose(tls, (*XBtree)(_pDb.X1)) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X1))))) = nil - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X4))))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X1)))) = nil + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X4)))) = nil } _sqlite3ResetAllSchemasOfConnection(tls, _db) return _rc } -// Execute zSql on database db. -// -// If zSql returns rows, then each row will have exactly one -// column. (This will only happen if zSql begins with "SELECT".) -// Take each row of result and call execSql() again recursively. -// -// The execSqlF() routine does the same thing, except it accepts -// a format string as its third argument +// C comment +// /* +// ** Execute zSql on database db. +// ** +// ** If zSql returns rows, then each row will have exactly one +// ** column. (This will only happen if zSql begins with "SELECT".) +// ** Take each row of result and call execSql() again recursively. +// ** +// ** The execSqlF() routine does the same thing, except it accepts +// ** a format string as its third argument +// */ func _execSql(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8) (r0 int32) { var _rc int32 var _1_zSubSql *int8 @@ -69926,7 +72977,7 @@ _0: goto _5 } func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zSubSql)) + 1*uintptr(i32(0))))) == i32(83) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zSubSql)) + 1*uintptr(i32(0))))) == i32(83) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124659), unsafe.Pointer((*int8)(unsafe.Pointer(&_execSqlØ00__func__Ø000))), unsafe.Pointer(str(92097))) crt.X__builtin_abort(tls) } @@ -69966,13 +73017,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RunVacuumØ00__func__Ø000[0], str(92136), 17) } -// Return the number of bytes of space at the end of every page that -// are intentually left unused. This is the "reserved" space that is -// sometimes used by extensions. -// -// If SQLITE_HAS_MUTEX is defined then the number returned is the -// greater of the current reserved space and the maximum requested -// reserve space. +// C comment +// /* +// ** Return the number of bytes of space at the end of every page that +// ** are intentually left unused. This is the "reserved" space that is +// ** sometimes used by extensions. +// ** +// ** If SQLITE_HAS_MUTEX is defined then the number returned is the +// ** greater of the current reserved space and the maximum requested +// ** reserve space. +// */ func _sqlite3BtreeGetOptimalReserve(tls *crt.TLS, _p *XBtree) (r0 int32) { var _n int32 _sqlite3BtreeEnter(tls, _p) @@ -69981,14 +73035,17 @@ func _sqlite3BtreeGetOptimalReserve(tls *crt.TLS, _p *XBtree) (r0 int32) { return _n } -// Change the "spill" limit on the number of pages in the cache. -// If the number of pages exceeds this limit during a write transaction, -// the pager might attempt to "spill" pages to the journal early in -// order to free up memory. -// -// The value returned is the current spill size. If zero is passed -// as an argument, no changes are made to the spill size setting, so -// using mxPage of 0 is a way to query the current spill size. +// C comment +// /* +// ** Change the "spill" limit on the number of pages in the cache. +// ** If the number of pages exceeds this limit during a write transaction, +// ** the pager might attempt to "spill" pages to the journal early in +// ** order to free up memory. +// ** +// ** The value returned is the current spill size. If zero is passed +// ** as an argument, no changes are made to the spill size setting, so +// ** using mxPage of 0 is a way to query the current spill size. +// */ func _sqlite3BtreeSetSpillSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) { var _res int32 var _pBt *XBtShared @@ -70011,19 +73068,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSetSpillSizeØ00__func__Ø000[0], str(92153), 25) } -// Change the maximum number of in-memory pages that are allowed -// before attempting to spill pages to journal. +// C comment +// /* +// ** Change the maximum number of in-memory pages that are allowed +// ** before attempting to spill pages to journal. +// */ func _sqlite3PagerSetSpillsize(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) { return _sqlite3PcacheSetSpillsize(tls, (*XPCache)(_pPager.X59), _mxPage) } -// Set the suggested cache-spill value. Make no changes if if the -// argument is zero. Return the effective cache-spill size, which will -// be the larger of the szSpill and szCache. +// C comment +// /* +// ** Set the suggested cache-spill value. Make no changes if if the +// ** argument is zero. Return the effective cache-spill size, which will +// ** be the larger of the szSpill and szCache. +// */ func _sqlite3PcacheSetSpillsize(tls *crt.TLS, _p *XPCache, _mxPage int32) (r0 int32) { var _res int32 func() { - if (_p.X12) == nil { + if _p.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetSpillsizeØ00__func__Ø000))), unsafe.Pointer(str(92178))) crt.X__builtin_abort(tls) } @@ -70032,12 +73095,12 @@ func _sqlite3PcacheSetSpillsize(tls *crt.TLS, _p *XPCache, _mxPage int32) (r0 in goto _2 } if _mxPage < i32(0) { - _mxPage = int32((int64(i32(-1024)) * int64(_mxPage)) / int64((_p.X6)+(_p.X7))) + _mxPage = int32((int64(i32(-1024)) * int64(_mxPage)) / int64(_p.X6+_p.X7)) } - *(*int32)(unsafe.Pointer(&(_p.X5))) = _mxPage + *(*int32)(unsafe.Pointer(&_p.X5)) = _mxPage _2: _res = _numberOfCachePages(tls, _p) - if _res < (_p.X5) { + if _res < _p.X5 { _res = _p.X5 } return _res @@ -70073,91 +73136,94 @@ func init() { func _sqlite3PagerSetFlags(tls *crt.TLS, _pPager *XPager, _pgFlags uint32) { var _level uint32 _level = _pgFlags & uint32(i32(7)) - if (_pPager.X10) != 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X4))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(i32(0)) + if _pPager.X10 != 0 { + *(*uint8)(unsafe.Pointer(&_pPager.X4)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pPager.X5)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X6)) = uint8(i32(0)) goto _1 } - *(*uint8)(unsafe.Pointer(&(_pPager.X4))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pPager.X4)) = uint8(func() int32 { if _level == uint32(i32(1)) { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pPager.X5)) = uint8(func() int32 { if _level >= uint32(i32(3)) { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pPager.X6)) = uint8(func() int32 { if _level == uint32(i32(4)) { return i32(1) } return i32(0) }()) _1: - if (_pPager.X4) != 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(0)) + if _pPager.X4 != 0 { + *(*uint8)(unsafe.Pointer(&_pPager.X9)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pPager.X7)) = uint8(i32(0)) goto _13 } if (_pgFlags & uint32(i32(8))) != 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(3)) - *(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pPager.X9)) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pPager.X7)) = uint8(i32(3)) goto _13 } if (_pgFlags & uint32(i32(16))) != 0 { - *(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2)) - *(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pPager.X9)) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X7)) = uint8(i32(3)) goto _13 } - *(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2)) - *(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X9)) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pPager.X7)) = uint8(i32(2)) _13: - *(*uint8)(unsafe.Pointer(&(_pPager.X8))) = _pPager.X9 - if (_pPager.X5) != 0 { + *(*uint8)(unsafe.Pointer(&_pPager.X8)) = _pPager.X9 + if _pPager.X5 != 0 { { - p := (*uint8)(unsafe.Pointer(&(_pPager.X8))) + p := (*uint8)(unsafe.Pointer(&_pPager.X8)) *p = uint8(int32(*p) | i32(32)) sink2(*p) } } if (_pgFlags & uint32(i32(32))) != 0 { { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) & i32(-2)) sink2(*p) } goto _16 } { - p := (*uint8)(unsafe.Pointer(&(_pPager.X18))) + p := (*uint8)(unsafe.Pointer(&_pPager.X18)) *p = uint8(int32(*p) | i32(1)) sink2(*p) } _16: } -// Change the default pages size and the number of reserved bytes per page. -// Or, if the page size has already been fixed, return SQLITE_READONLY -// without changing anything. -// -// The page size must be a power of 2 between 512 and 65536. If the page -// size supplied does not meet this constraint then the page size is not -// changed. -// -// Page sizes are constrained to be a power of two so that the region -// of the database file used for locking (beginning at PENDING_BYTE, -// the first byte past the 1GB boundary, 0x40000000) needs to occur -// at the beginning of a page. -// -// If parameter nReserve is less than zero, then the number of reserved -// bytes per page is left unchanged. -// -// If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size -// and autovacuum mode can no longer be changed. +// C comment +// /* +// ** Change the default pages size and the number of reserved bytes per page. +// ** Or, if the page size has already been fixed, return SQLITE_READONLY +// ** without changing anything. +// ** +// ** The page size must be a power of 2 between 512 and 65536. If the page +// ** size supplied does not meet this constraint then the page size is not +// ** changed. +// ** +// ** Page sizes are constrained to be a power of two so that the region +// ** of the database file used for locking (beginning at PENDING_BYTE, +// ** the first byte past the 1GB boundary, 0x40000000) needs to occur +// ** at the beginning of a page. +// ** +// ** If parameter nReserve is less than zero, then the number of reserved +// ** bytes per page is left unchanged. +// ** +// ** If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size +// ** and autovacuum mode can no longer be changed. +// */ func _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReserve int32, _iFix int32) (r0 int32) { var _rc int32 var _pBt *XBtShared @@ -70175,7 +73241,7 @@ func _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReser return i32(8) } if _nReserve < i32(0) { - _nReserve = int32((_pBt.X15) - (_pBt.X16)) + _nReserve = int32(_pBt.X15 - _pBt.X16) } func() { if _nReserve < i32(0) || _nReserve > i32(255) { @@ -70191,19 +73257,19 @@ func _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReser } }() func() { - if (*XBtCursor)(_pBt.X2) != nil { + if _pBt.X2 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(22109))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32(_pageSize) + *(*uint32)(unsafe.Pointer(&_pBt.X15)) = uint32(_pageSize) _freeTempSpace(tls, _pBt) } - _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), _nReserve) - *(*uint32)(unsafe.Pointer(&(_pBt.X16))) = (_pBt.X15) - uint32(uint16(_nReserve)) + _rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&_pBt.X15)), _nReserve) + *(*uint32)(unsafe.Pointer(&_pBt.X16)) = _pBt.X15 - uint32(uint16(_nReserve)) if _iFix != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pBt.X10))) + p := (*uint16)(unsafe.Pointer(&_pBt.X10)) *p = uint16(int32(*p) | i32(2)) sink14(*p) } @@ -70218,10 +73284,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSetPageSizeØ00__func__Ø000[0], str(92302), 24) } -// Change the 'auto-vacuum' property of the database. If the 'autoVacuum' -// parameter is non-zero, then auto-vacuum mode is enabled. If zero, it -// is disabled. The default value for the auto-vacuum property is -// determined by the SQLITE_DEFAULT_AUTOVACUUM macro. +// C comment +// /* +// ** Change the 'auto-vacuum' property of the database. If the 'autoVacuum' +// ** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it +// ** is disabled. The default value for the auto-vacuum property is +// ** determined by the SQLITE_DEFAULT_AUTOVACUUM macro. +// */ func _sqlite3BtreeSetAutoVacuum(tls *crt.TLS, _p *XBtree, _autoVacuum int32) (r0 int32) { var _rc int32 var _av uint8 @@ -70239,13 +73308,13 @@ func _sqlite3BtreeSetAutoVacuum(tls *crt.TLS, _p *XBtree, _autoVacuum int32) (r0 _rc = i32(8) goto _4 } - *(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pBt.X5)) = uint8(func() int32 { if _av != 0 { return i32(1) } return i32(0) }()) - *(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pBt.X6)) = uint8(func() int32 { if int32(_av) == i32(2) { return i32(1) } @@ -70256,8 +73325,11 @@ _4: return _rc } -// Return the value of the 'auto-vacuum' property. If auto-vacuum is -// enabled 1 is returned. Otherwise 0. +// C comment +// /* +// ** Return the value of the 'auto-vacuum' property. If auto-vacuum is +// ** enabled 1 is returned. Otherwise 0. +// */ func _sqlite3BtreeGetAutoVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) { var _rc int32 _sqlite3BtreeEnter(tls, _p) @@ -70287,7 +73359,7 @@ func _execSqlF(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8, args return i32(7) } _rc = _execSql(tls, _db, _pzErrMsg, _z) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) return _rc } @@ -70297,12 +73369,15 @@ func init() { _sqlite3RunVacuumØ00aCopyØ001 = [10]uint8{1, 1, 3, 0, 5, 0, 6, 0, 8, 0} } -// Copy the complete content of pBtFrom into pBtTo. A transaction -// must be active for both files. -// -// The size of file pTo may be reduced by this operation. If anything -// goes wrong, the transaction on pTo is rolled back. If successful, the -// transaction is committed before returning. +// C comment +// /* +// ** Copy the complete content of pBtFrom into pBtTo. A transaction +// ** must be active for both files. +// ** +// ** The size of file pTo may be reduced by this operation. If anything +// ** goes wrong, the transaction on pTo is rolled back. If successful, the +// ** transaction is committed before returning. +// */ func _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32) { var _rc int32 var _1_nByte int64 @@ -70317,11 +73392,11 @@ func _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32 } }() _pFd = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, _pTo)) - if (*Xsqlite3_io_methods)(_pFd.X0) == nil { + if _pFd.X0 == nil { goto _2 } _1_nByte = int64(_sqlite3BtreeGetPageSize(tls, _pFrom)) * int64(_sqlite3BtreeLastPage(tls, _pFrom)) - _rc = _sqlite3OsFileControl(tls, _pFd, i32(11), (unsafe.Pointer)(&_1_nByte)) + _rc = _sqlite3OsFileControl(tls, _pFd, i32(11), unsafe.Pointer(&_1_nByte)) if _rc == i32(12) { _rc = i32(0) } @@ -70329,14 +73404,14 @@ func _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32 goto _copy_finished } _2: - crt.Xmemset(tls, (unsafe.Pointer)(&_b), i32(0), u64(72)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X5))))) = (*Xsqlite3)(_pFrom.X0) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X6))))) = _pFrom - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X1))))) = _pTo - *(*uint32)(unsafe.Pointer(&(_b.X4))) = uint32(i32(1)) + crt.Xmemset(tls, unsafe.Pointer(&_b), i32(0), u64(72)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_b.X5)))) = (*Xsqlite3)(_pFrom.X0) + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_b.X6)))) = _pFrom + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_b.X1)))) = _pTo + *(*uint32)(unsafe.Pointer(&_b.X4)) = uint32(i32(1)) Xsqlite3_backup_step(tls, &_b, i32(2147483647)) func() { - if (_b.X7) == i32(0) { + if _b.X7 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000))), unsafe.Pointer(str(92353))) crt.X__builtin_abort(tls) } @@ -70374,7 +73449,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeCopyFileØ00__func__Ø000[0], str(92399), 21) } -// Copy nPage pages from the source b-tree to the destination. +// C comment +// /* +// ** Copy nPage pages from the source b-tree to the destination. +// */ func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 int32) { var _rc, _destMode, _pgszSrc, _pgszDest, _2_ii, _2_nSrcPage, _2_bCloseTrans, _21_nDestTruncate, _22_ratio, _25_nDstPage, _36_rc2 int32 var _25_iSize, _25_iOff, _25_iEnd int64 @@ -70390,7 +73468,7 @@ func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 i } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X5).X3)) _sqlite3BtreeEnter(tls, (*XBtree)(_p.X6)) - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) } _rc = _p.X7 @@ -70401,7 +73479,7 @@ func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 i _2_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.X1)) _2_nSrcPage = i32(-1) _2_bCloseTrans = i32(0) - if ((*Xsqlite3)(_p.X0) != nil) && (int32((*XBtShared)((*XBtree)(_p.X6).X1).X8) == i32(2)) { + if (_p.X0 != nil) && (int32((*XBtShared)((*XBtree)(_p.X6).X1).X8) == i32(2)) { _rc = i32(5) goto _5 } @@ -70411,12 +73489,12 @@ _5: _rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.X6), i32(0)) _2_bCloseTrans = i32(1) } - if (((_p.X3) == i32(0)) && (_rc == i32(0))) && (_setDestPgsz(tls, _p) == i32(7)) { + if ((_p.X3 == i32(0)) && (_rc == i32(0))) && (_setDestPgsz(tls, _p) == i32(7)) { _rc = i32(7) } - if ((i32(0) == _rc) && ((_p.X3) == i32(0))) && (i32(0) == store1(&_rc, _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.X1), i32(2)))) { - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1) - _sqlite3BtreeGetMeta(tls, (*XBtree)(_p.X1), i32(1), (*uint32)(unsafe.Pointer(&(_p.X2)))) + if ((i32(0) == _rc) && (_p.X3 == i32(0))) && (i32(0) == store1(&_rc, _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.X1), i32(2)))) { + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(1) + _sqlite3BtreeGetMeta(tls, (*XBtree)(_p.X1), i32(1), (*uint32)(unsafe.Pointer(&_p.X2))) } _pgszSrc = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6)) _pgszDest = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X1)) @@ -70433,7 +73511,7 @@ _5: }() _2_ii = i32(0) _19: - if _nPage >= i32(0) && _2_ii >= _nPage || (_p.X4) > uint32(_2_nSrcPage) || _rc != 0 { + if _nPage >= i32(0) && _2_ii >= _nPage || _p.X4 > uint32(_2_nSrcPage) || _rc != 0 { goto _25 } _9_iSrcPg = _p.X4 @@ -70446,20 +73524,20 @@ _19: _sqlite3PagerUnref(tls, _10_pSrcPg) } _26: - *(*uint32)(unsafe.Pointer(&(_p.X4))) += 1 + *(*uint32)(unsafe.Pointer(&_p.X4)) += 1 _2_ii += 1 goto _19 _25: if _rc != i32(0) { goto _28 } - *(*uint32)(unsafe.Pointer(&(_p.X9))) = uint32(_2_nSrcPage) - *(*uint32)(unsafe.Pointer(&(_p.X8))) = uint32(_2_nSrcPage+i32(1)) - (_p.X4) - if (_p.X4) > uint32(_2_nSrcPage) { + *(*uint32)(unsafe.Pointer(&_p.X9)) = uint32(_2_nSrcPage) + *(*uint32)(unsafe.Pointer(&_p.X8)) = uint32(_2_nSrcPage+i32(1)) - _p.X4 + if _p.X4 > uint32(_2_nSrcPage) { _rc = i32(101) goto _31 } - if (_p.X10) == 0 { + if _p.X10 == 0 { _attachBackupObject(tls, _p) } _31: @@ -70472,12 +73550,12 @@ _28: _2_nSrcPage = i32(1) } if (_rc == i32(0)) || (_rc == i32(101)) { - _rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_p.X1), i32(1), (_p.X2)+uint32(i32(1))) + _rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_p.X1), i32(1), _p.X2+uint32(i32(1))) } if _rc != i32(0) { goto _36 } - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { _sqlite3ResetAllSchemasOfConnection(tls, (*Xsqlite3)(_p.X0)) } if _destMode == i32(5) { @@ -70571,7 +73649,7 @@ _68: _rc = _sqlite3PagerGet(tls, _2_pSrcPager, _30_iSrcPg, &_30_pSrcPg, i32(0)) if _rc == i32(0) { _31_zData = (*uint8)(_sqlite3PagerGetData(tls, _30_pSrcPg)) - _rc = _sqlite3OsWrite(tls, _25_pFile, (unsafe.Pointer)(_31_zData), _pgszSrc, _25_iOff) + _rc = _sqlite3OsWrite(tls, _25_pFile, unsafe.Pointer(_31_zData), _pgszSrc, _25_iOff) } _sqlite3PagerUnref(tls, _30_pSrcPg) { @@ -70614,9 +73692,9 @@ _32: if _rc == i32(3082) { _rc = _sqlite3NomemError(tls, i32(69485)) } - *(*int32)(unsafe.Pointer(&(_p.X7))) = _rc + *(*int32)(unsafe.Pointer(&_p.X7)) = _rc _2: - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) } _sqlite3BtreeLeave(tls, (*XBtree)(_p.X6)) @@ -70624,8 +73702,11 @@ _2: return _rc } -// Attempt to set the page size of the destination to match the page size -// of the source. +// C comment +// /* +// ** Attempt to set the page size of the destination to match the page size +// ** of the source. +// */ func _setDestPgsz(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { var _rc int32 _rc = _sqlite3BtreeSetPageSize(tls, (*XBtree)(_p.X1), _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6)), i32(-1), i32(0)) @@ -70638,8 +73719,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_backup_stepØ00__func__Ø000[0], str(92715), 20) } -// Register this backup object with the associated source pager for -// callbacks when pages are changed or the cache invalidated. +// C comment +// /* +// ** Register this backup object with the associated source pager for +// ** callbacks when pages are changed or the cache invalidated. +// */ func _attachBackupObject(tls *crt.TLS, _p *Xsqlite3_backup) { var _pp **Xsqlite3_backup func() { @@ -70649,9 +73733,9 @@ func _attachBackupObject(tls *crt.TLS, _p *Xsqlite3_backup) { } }() _pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.X6))) - *(**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = *_pp + *(**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X11)))) = *_pp *_pp = _p - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(1) } var _attachBackupObjectØ00__func__Ø000 [19]int8 @@ -70660,17 +73744,23 @@ func init() { crt.Xstrncpy(nil, &_attachBackupObjectØ00__func__Ø000[0], str(92767), 19) } -// Return a pointer to the pPager->pBackup variable. The backup module -// in backup.c maintains the content of this variable. This module -// uses it opaquely as an argument to sqlite3BackupRestart() and -// sqlite3BackupUpdate() only. +// C comment +// /* +// ** Return a pointer to the pPager->pBackup variable. The backup module +// ** in backup.c maintains the content of this variable. This module +// ** uses it opaquely as an argument to sqlite3BackupRestart() and +// ** sqlite3BackupUpdate() only. +// */ func _sqlite3PagerBackupPtr(tls *crt.TLS, _pPager *XPager) (r0 **Xsqlite3_backup) { - return (**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X36))))) + return (**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPager.X36)))) } -// Initialize the first page of the database file (creating a database -// consisting of a single page and no schema objects). Return SQLITE_OK -// if successful, or an SQLite error code otherwise. +// C comment +// /* +// ** Initialize the first page of the database file (creating a database +// ** consisting of a single page and no schema objects). Return SQLITE_OK +// ** if successful, or an SQLite error code otherwise. +// */ func _sqlite3BtreeNewDb(tls *crt.TLS, _p *XBtree) (r0 int32) { var _rc int32 _sqlite3BtreeEnter(tls, _p) @@ -70680,12 +73770,15 @@ func _sqlite3BtreeNewDb(tls *crt.TLS, _p *XBtree) (r0 int32) { return _rc } -// If pFile is currently larger than iSize bytes, then truncate it to -// exactly iSize bytes. If pFile is not larger than iSize bytes, then -// this function is a no-op. -// -// Return SQLITE_OK if everything is successful, or an SQLite error -// code if an error occurs. +// C comment +// /* +// ** If pFile is currently larger than iSize bytes, then truncate it to +// ** exactly iSize bytes. If pFile is not larger than iSize bytes, then +// ** this function is a no-op. +// ** +// ** Return SQLITE_OK if everything is successful, or an SQLite error +// ** code if an error occurs. +// */ func _backupTruncateFile(tls *crt.TLS, _pFile *Xsqlite3_file, _iSize int64) (r0 int32) { var _rc int32 var _iCurrent int64 @@ -70696,7 +73789,10 @@ func _backupTruncateFile(tls *crt.TLS, _pFile *Xsqlite3_file, _iSize int64) (r0 return _rc } -// Release all resources associated with an sqlite3_backup* handle. +// C comment +// /* +// ** Release all resources associated with an sqlite3_backup* handle. +// */ func Xsqlite3_backup_finish(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { var _rc int32 var _pSrcDb *Xsqlite3 @@ -70707,13 +73803,13 @@ func Xsqlite3_backup_finish(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { _pSrcDb = (*Xsqlite3)(_p.X5) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.X3)) _sqlite3BtreeEnter(tls, (*XBtree)(_p.X6)) - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) } - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { *(*int32)(unsafe.Pointer(&((*XBtree)(_p.X6).X7))) -= 1 } - if (_p.X10) == 0 { + if _p.X10 == 0 { goto _3 } _pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.X6))) @@ -70726,27 +73822,30 @@ _4: _3: _sqlite3BtreeRollback(tls, (*XBtree)(_p.X1), i32(0), i32(0)) _rc = func() int32 { - if (_p.X7) == i32(101) { + if _p.X7 == i32(101) { return i32(0) } - return (_p.X7) + return _p.X7 }() - if (*Xsqlite3)(_p.X0) != nil { + if _p.X0 != nil { _sqlite3Error(tls, (*Xsqlite3)(_p.X0), _rc) _sqlite3LeaveMutexAndCloseZombie(tls, (*Xsqlite3)(_p.X0)) } _sqlite3BtreeLeave(tls, (*XBtree)(_p.X6)) - if (*Xsqlite3)(_p.X0) != nil { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + if _p.X0 != nil { + Xsqlite3_free(tls, unsafe.Pointer(_p)) } _sqlite3LeaveMutexAndCloseZombie(tls, _pSrcDb) return _rc } -// Unless this is an in-memory or temporary database, clear the pager cache. +// C comment +// /* +// ** Unless this is an in-memory or temporary database, clear the pager cache. +// */ func _sqlite3PagerClearCache(tls *crt.TLS, _pPager *XPager) { func() { - if int32(_pPager.X13) != i32(0) && (_pPager.X10) == 0 { + if int32(_pPager.X13) != i32(0) && _pPager.X10 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerClearCacheØ00__func__Ø000))), unsafe.Pointer(str(55898))) crt.X__builtin_abort(tls) } @@ -70762,12 +73861,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerClearCacheØ00__func__Ø000[0], str(92786), 23) } -// A write-transaction must be opened before calling this function. -// It performs a single unit of work towards an incremental vacuum. -// -// If the incremental vacuum is finished after this function has run, -// SQLITE_DONE is returned. If it is not finished, but no error occurred, -// SQLITE_OK is returned. Otherwise an SQLite error code. +// C comment +// /* +// ** A write-transaction must be opened before calling this function. +// ** It performs a single unit of work towards an incremental vacuum. +// ** +// ** If the incremental vacuum is finished after this function has run, +// ** SQLITE_DONE is returned. If it is not finished, but no error occurred, +// ** SQLITE_OK is returned. Otherwise an SQLite error code. +// */ func _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) { var _rc int32 var _2_nOrig, _2_nFree, _2_nFin uint32 @@ -70780,12 +73882,12 @@ func _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pBt.X5) == 0 { + if _pBt.X5 == 0 { _rc = i32(101) goto _4 } _2_nOrig = _btreePagecount(tls, _pBt) - _2_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) + _2_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36))))) _2_nFin = _finalDbSize(tls, _pBt, _2_nOrig, _2_nFree) if _2_nOrig < _2_nFin { _rc = _sqlite3CorruptError(tls, i32(62724)) @@ -70801,7 +73903,7 @@ func _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) { } if _rc == i32(0) { _rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23)) - _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _pBt.X18) + _sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _pBt.X18) } goto _10 _7: @@ -70818,9 +73920,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeIncrVacuumØ00__func__Ø000[0], str(92868), 23) } -// Obtain a lock on the table whose root page is iTab. The -// lock is a write lock if isWritelock is true or a read lock -// if it is false. +// C comment +// /* +// ** Obtain a lock on the table whose root page is iTab. The +// ** lock is a write lock if isWritelock is true or a read lock +// ** if it is false. +// */ func _sqlite3BtreeLockTable(tls *crt.TLS, _p *XBtree, _iTab int32, _isWriteLock uint8) (r0 int32) { var _rc int32 var _1_lockType uint8 @@ -70831,7 +73936,7 @@ func _sqlite3BtreeLockTable(tls *crt.TLS, _p *XBtree, _iTab int32, _isWriteLock crt.X__builtin_abort(tls) } }() - if (_p.X3) == 0 { + if _p.X3 == 0 { goto _2 } _1_lockType = uint8(i32(1) + int32(_isWriteLock)) @@ -70858,21 +73963,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeLockTableØ00__func__Ø000[0], str(92914), 22) } -// Add a lock on the table with root-page iTable to the shared-btree used -// by Btree handle p. Parameter eLock must be either READ_LOCK or -// WRITE_LOCK. -// -// This function assumes the following: -// -// (a) The specified Btree object p is connected to a sharable -// database (one with the BtShared.sharable flag set), and -// -// (b) No other Btree objects hold a lock that conflicts -// with the requested lock (i.e. querySharedCacheTableLock() has -// already been called and returned SQLITE_OK). -// -// SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM -// is returned if a malloc attempt fails. +// C comment +// /* +// ** Add a lock on the table with root-page iTable to the shared-btree used +// ** by Btree handle p. Parameter eLock must be either READ_LOCK or +// ** WRITE_LOCK. +// ** +// ** This function assumes the following: +// ** +// ** (a) The specified Btree object p is connected to a sharable +// ** database (one with the BtShared.sharable flag set), and +// ** +// ** (b) No other Btree objects hold a lock that conflicts +// ** with the requested lock (i.e. querySharedCacheTableLock() has +// ** already been called and returned SQLITE_OK). +// ** +// ** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM +// ** is returned if a malloc attempt fails. +// */ func _setSharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTable uint32, _eLock uint8) (r0 int32) { var _pBt *XBtShared var _pLock, _pIter *XBtLock @@ -70903,7 +74011,7 @@ func _setSharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTable uint32, _eLock u } }() func() { - if (_p.X3) == 0 { + if _p.X3 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59370), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(92998))) crt.X__builtin_abort(tls) } @@ -70919,7 +74027,7 @@ _14: if _pIter == nil { goto _17 } - if ((_pIter.X1) == _iTable) && ((*XBtree)(_pIter.X0) == _p) { + if (_pIter.X1 == _iTable) && ((*XBtree)(_pIter.X0) == _p) { _pLock = _pIter goto _17 } @@ -70933,14 +74041,14 @@ _17: if _pLock == nil { return _sqlite3NomemError(tls, i32(59387)) } - *(*uint32)(unsafe.Pointer(&(_pLock.X1))) = _iTable - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLock.X0))))) = _p - *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLock.X3))))) = (*XBtLock)(_pBt.X25) - *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25))))) = _pLock + *(*uint32)(unsafe.Pointer(&_pLock.X1)) = _iTable + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLock.X0)))) = _p + *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLock.X3)))) = (*XBtLock)(_pBt.X25) + *(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBt.X25)))) = _pLock _20: i32(0) if int32(_eLock) > int32(_pLock.X2) { - *(*uint8)(unsafe.Pointer(&(_pLock.X2))) = _eLock + *(*uint8)(unsafe.Pointer(&_pLock.X2)) = _eLock } return i32(0) } @@ -70951,34 +74059,35 @@ func init() { crt.Xstrncpy(nil, &_setSharedCacheTableLockØ00__func__Ø000[0], str(93065), 24) } -// If the virtual table pVtab supports the transaction interface -// (xBegin/xRollback/xCommit and optionally xSync) and a transaction is -// not currently open, invoke the xBegin method now. -// -// If the xBegin call is successful, place the sqlite3_vtab pointer -// in the sqlite3.aVTrans array. +// C comment +// /* +// ** If the virtual table pVtab supports the transaction interface +// ** (xBegin/xRollback/xCommit and optionally xSync) and a transaction is +// ** not currently open, invoke the xBegin method now. +// ** +// ** If the xBegin call is successful, place the sqlite3_vtab pointer +// ** in the sqlite3.aVTrans array. +// */ func _sqlite3VtabBegin(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) (r0 int32) { var _rc, _3_i, _7_iSvpt int32 var _pModule *Xsqlite3_module _rc = i32(0) - if ((_db.X64) > i32(0)) && ((**XVTable)(unsafe.Pointer(_db.X67)) == nil) { + if (_db.X64 > i32(0)) && ((**XVTable)(unsafe.Pointer(_db.X67)) == nil) { return i32(6) } if _pVTab == nil { return i32(0) } _pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.X2).X0) - if (*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_pModule.X14)}))) == nil { + if _pModule.X14 == nil { goto _3 } _3_i = i32(0) _4: - if _3_i >= (_db.X64) { + if _3_i >= _db.X64 { goto _7 } - if (*(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 8*uintptr(_3_i)))) == _pVTab { + if (*(**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_db.X67)) + 8*uintptr(_3_i)))) == _pVTab { return i32(0) } _3_i += 1 @@ -70988,21 +74097,21 @@ _7: if _rc != i32(0) { goto _9 } - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{(_pModule.X14)})))(tls, (*Xsqlite3_vtab)(_pVTab.X2)) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab) int32 { + v := _pModule.X14 + return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_vtab)(_pVTab.X2)) if _rc != i32(0) { goto _10 } - _7_iSvpt = (_db.X76) + (_db.X75) + _7_iSvpt = _db.X76 + _db.X75 _addToVTrans(tls, _db, _pVTab) - if _7_iSvpt != 0 && ((*(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_pModule.X20)}))) != nil) { - *(*int32)(unsafe.Pointer(&(_pVTab.X5))) = _7_iSvpt - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{(_pModule.X20)})))(tls, (*Xsqlite3_vtab)(_pVTab.X2), _7_iSvpt-i32(1)) + if _7_iSvpt != 0 && (_pModule.X20 != nil) { + *(*int32)(unsafe.Pointer(&_pVTab.X5)) = _7_iSvpt + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32) int32 { + v := _pModule.X20 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*Xsqlite3_vtab)(_pVTab.X2), _7_iSvpt-i32(1)) } _10: _9: @@ -71010,35 +74119,44 @@ _3: return _rc } -// Grow the db->aVTrans[] array so that there is room for at least one -// more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise. +// C comment +// /* +// ** Grow the db->aVTrans[] array so that there is room for at least one +// ** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise. +// */ func _growVTrans(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _ARRAY_INCR, _1_nBytes int32 var _1_aVTrans **XVTable _ARRAY_INCR = i32(5) - if ((_db.X64) % _ARRAY_INCR) != i32(0) { + if (_db.X64 % _ARRAY_INCR) != i32(0) { goto _0 } - _1_nBytes = int32(u64(8) * uint64((_db.X64)+_ARRAY_INCR)) - _1_aVTrans = (**XVTable)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_db.X67), uint64(_1_nBytes))) + _1_nBytes = int32(u64(8) * uint64(_db.X64+_ARRAY_INCR)) + _1_aVTrans = (**XVTable)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_db.X67), uint64(_1_nBytes))) if _1_aVTrans == nil { return _sqlite3NomemError(tls, i32(125653)) } - crt.Xmemset(tls, (unsafe.Pointer)((**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aVTrans))+8*uintptr(_db.X64)))), i32(0), u64(8)*uint64(_ARRAY_INCR)) - *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = _1_aVTrans + crt.Xmemset(tls, unsafe.Pointer((**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aVTrans))+8*uintptr(_db.X64)))), i32(0), u64(8)*uint64(_ARRAY_INCR)) + *(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_db.X67)))) = _1_aVTrans _0: return i32(0) } -// Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should -// have already been reserved using growVTrans(). +// C comment +// /* +// ** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should +// ** have already been reserved using growVTrans(). +// */ func _addToVTrans(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) { - *(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_db.X64))), int32(1))))) = _pVTab + *(**XVTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_db.X67)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_db.X64)), 1)))) = _pVTab _sqlite3VtabLock(tls, _pVTab) } -// Make a full copy of pFrom into pTo. Prior contents of pTo are -// freed before the copy is made. +// C comment +// /* +// ** Make a full copy of pFrom into pTo. Prior contents of pTo are +// ** freed before the copy is made. +// */ func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) { var _rc int32 _rc = i32(0) @@ -71051,9 +74169,9 @@ func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) { if (int32(_pTo.X1) & i32(9312)) != i32(0) { _vdbeMemClearExternAndSetNull(tls, _pTo) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u64(24)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), u64(24)) { - p := (*uint16)(unsafe.Pointer(&(_pTo.X1))) + p := (*uint16)(unsafe.Pointer(&_pTo.X1)) *p = uint16(int32(*p) & i32(-1025)) sink14(*p) } @@ -71062,7 +74180,7 @@ func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) { } if i32(0) == (int32(_pFrom.X1) & i32(2048)) { { - p := (*uint16)(unsafe.Pointer(&(_pTo.X1))) + p := (*uint16)(unsafe.Pointer(&_pTo.X1)) *p = uint16(int32(*p) | i32(4096)) sink14(*p) } @@ -71078,12 +74196,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMemCopyØ00__func__Ø000[0], str(93089), 19) } -// This function is invoked by the vdbe to call the xCreate method -// of the virtual table named zTab in database iDb. -// -// If an error occurs, *pzErr is set to point to an English language -// description of the error and an SQLITE_XXX error code is returned. -// In this case the caller must call sqlite3DbFree(db, ) on *pzErr. +// C comment +// /* +// ** This function is invoked by the vdbe to call the xCreate method +// ** of the virtual table named zTab in database iDb. +// ** +// ** If an error occurs, *pzErr is set to point to an English language +// ** description of the error and an SQLITE_XXX error code is returned. +// ** In this case the caller must call sqlite3DbFree(db, ) on *pzErr. +// */ func _sqlite3VtabCallCreate(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8, _pzErr **int8) (r0 int32) { var _rc int32 var _zMod *int8 @@ -71092,33 +74213,36 @@ func _sqlite3VtabCallCreate(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8 _rc = i32(0) _pTab = _sqlite3FindTable(tls, _db, _zTab, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) func() { - if _pTab == nil || (_pTab.X16) == 0 || (*XVTable)(_pTab.X18) != nil { + if _pTab == nil || _pTab.X16 == 0 || _pTab.X18 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125687), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000))), unsafe.Pointer(str(93108))) crt.X__builtin_abort(tls) } }() - _zMod = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 8*uintptr(i32(0)))) - _pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zMod)) + _zMod = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTab.X17)) + 8*uintptr(i32(0)))) + _pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X65)), _zMod)) if ((_pMod == nil) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 - }{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{((*Xsqlite3_module)(_pMod.X0).X1)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := (*Xsqlite3_module)(_pMod.X0).X1 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 }{nil})))) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab) int32 - }{(*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_module)(_pMod.X0).X5)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_vtab) int32 { + v := (*Xsqlite3_module)(_pMod.X0).X5 + return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab) int32 }{nil}))) { *_pzErr = _sqlite3MPrintf(tls, _db, str(93150), unsafe.Pointer(_zMod)) _rc = i32(1) goto _7 } - _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{((*Xsqlite3_module)(_pMod.X0).X1)})), _pzErr) + _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := (*Xsqlite3_module)(_pMod.X0).X1 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }(), _pzErr) _7: if _rc != i32(0) || func() int32 { if _sqlite3GetVTable(tls, _db, _pTab) != nil { @@ -71146,9 +74270,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabCallCreateØ00__func__Ø000[0], str(93169), 22) } -// Invoke a virtual table constructor (either xCreate or xConnect). The -// pointer to the function to invoke is passed as the fourth parameter -// to this procedure. +// C comment +// /* +// ** Invoke a virtual table constructor (either xCreate or xConnect). The +// ** pointer to the function to invoke is passed as the fourth parameter +// ** to this procedure. +// */ func _vtabCallConstructor(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _pMod *XModule, _xConstruct func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32, _pzErr **int8) (r0 int32) { var _rc, _nArg, _iDb, _10_iCol, _11_nType, _11_i, _14_j, _14_nDel int32 var _zErr, _zModuleName, _9_zFormat, _11_zType *int8 @@ -71178,15 +74305,15 @@ _3: } _pVTable = (*XVTable)(_sqlite3DbMallocZero(tls, _db, u64(48))) if _pVTable == nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zModuleName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName)) return _sqlite3NomemError(tls, i32(125516)) } - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X0))))) = _db - *(**XModule)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X1))))) = _pMod + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVTable.X0)))) = _db + *(**XModule)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVTable.X1)))) = _pMod _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 8*uintptr(i32(1)))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTab.X17)) + 8*uintptr(i32(1)))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 func() { - if (**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) == nil { + if (*unsafe.Pointer)(unsafe.Pointer(&_db.X66)) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125525), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93233))) crt.X__builtin_abort(tls) } @@ -71197,13 +74324,13 @@ _3: crt.X__builtin_abort(tls) } }() - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X1))))) = _pTab - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X0))))) = _pVTable - *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X2))))) = (*XVtabCtx)(_db.X66) - *(*int32)(unsafe.Pointer(&(_sCtx.X3))) = i32(0) - *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) = &_sCtx - _rc = _xConstruct(tls, _db, _pMod.X2, _nArg, _azArg, (**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X2))))), &_zErr) - *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) = (*XVtabCtx)(_sCtx.X2) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCtx.X1)))) = _pTab + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCtx.X0)))) = _pVTable + *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCtx.X2)))) = (*XVtabCtx)(_db.X66) + *(*int32)(unsafe.Pointer(&_sCtx.X3)) = i32(0) + *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X66)))) = &_sCtx + _rc = _xConstruct(tls, _db, _pMod.X2, _nArg, _azArg, (**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVTable.X2)))), &_zErr) + *(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X66)))) = (*XVtabCtx)(_sCtx.X2) if _rc == i32(7) { _sqlite3OomFault(tls, _db) } @@ -71221,13 +74348,13 @@ _3: goto _16 } *_pzErr = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_zErr)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zErr)) + Xsqlite3_free(tls, unsafe.Pointer(_zErr)) _16: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pVTable)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pVTable)) goto _20 _14: if func() int32 { - if (*Xsqlite3_vtab)(_pVTable.X2) != nil { + if _pVTable.X2 != nil { return i32(1) } return func() int32 { @@ -71240,8 +74367,8 @@ _14: } crt.Xmemset(tls, _pVTable.X2, i32(0), u64(24)) *(**Xsqlite3_module)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_vtab)(_pVTable.X2).X0))))) = (*Xsqlite3_module)(_pMod.X0) - *(*int32)(unsafe.Pointer(&(_pVTable.X3))) = i32(1) - if (_sCtx.X3) == i32(0) { + *(*int32)(unsafe.Pointer(&_pVTable.X3)) = i32(1) + if _sCtx.X3 == i32(0) { _9_zFormat = str(93304) *_pzErr = _sqlite3MPrintf(tls, _db, _9_zFormat, unsafe.Pointer(_pTab.X0)) _sqlite3VtabUnlock(tls, _pVTable) @@ -71249,8 +74376,8 @@ _14: goto _22 } _10_oooHidden = u8(0) - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X6))))) = (*XVTable)(_pTab.X18) - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X18))))) = _pVTable + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVTable.X6)))) = (*XVTable)(_pTab.X18) + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X18)))) = _pVTable _10_iCol = i32(0) _23: if _10_iCol >= int32(_pTab.X11) { @@ -71264,7 +74391,7 @@ _27: if _11_i >= _11_nType { goto _30 } - if ((i32(0) == Xsqlite3_strnicmp(tls, str(93350), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType))+1*uintptr(_11_i))), i32(6))) && ((_11_i == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1))))) == i32(32)))) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(32))) { + if ((i32(0) == Xsqlite3_strnicmp(tls, str(93350), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType))+1*uintptr(_11_i))), i32(6))) && ((_11_i == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i-i32(1))))) == i32(32)))) && ((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(32))) { goto _30 } _11_i += 1 @@ -71274,7 +74401,7 @@ _30: goto _36 } _14_nDel = i32(6) + func() int32 { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i+i32(6))))) != 0 { return i32(1) } return i32(0) @@ -71284,18 +74411,18 @@ _39: if (_14_j + _14_nDel) > _11_nType { goto _42 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_14_j))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_14_j+_14_nDel))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_14_j))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_14_j+_14_nDel))) _14_j += 1 goto _39 _42: - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i)))) == i32(0)) && (_11_i > i32(0)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i)))) == i32(0)) && (_11_i > i32(0)) { func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1))))) != i32(32) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i-i32(1))))) != i32(32) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125587), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93357))) crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_zType)) + 1*uintptr(_11_i-i32(1)))) = int8(i32(0)) } { p := (*uint8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_10_iCol))).X6))) @@ -71306,7 +74433,7 @@ _42: goto _47 _36: { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) *p = (*p) | uint32(_10_oooHidden) sink5(*p) } @@ -71316,7 +74443,7 @@ _47: _26: _22: _20: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zModuleName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zModuleName)) return _rc _ = _sCtx @@ -71329,11 +74456,14 @@ func init() { crt.Xstrncpy(nil, &_vtabCallConstructorØ00__func__Ø000[0], str(93373), 20) } -// Return the declared type of a column. Or return zDflt if the column -// has no declared type. -// -// The column type is an extra string stored after the zero-terminator on -// the column name if and only if the COLFLAG_HASTYPE flag is set. +// C comment +// /* +// ** Return the declared type of a column. Or return zDflt if the column +// ** has no declared type. +// ** +// ** The column type is an extra string stored after the zero-terminator on +// ** the column name if and only if the COLFLAG_HASTYPE flag is set. +// */ func _sqlite3ColumnType(tls *crt.TLS, _pCol *XColumn, _zDflt *int8) (r0 *int8) { if (int32(_pCol.X6) & i32(4)) == i32(0) { return _zDflt @@ -71341,11 +74471,14 @@ func _sqlite3ColumnType(tls *crt.TLS, _pCol *XColumn, _zDflt *int8) (r0 *int8) { return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCol.X0))+uintptr(crt.Xstrlen(tls, _pCol.X0)))))) + uintptr(i32(1)))) } -// This function is invoked by the vdbe to call the xDestroy method -// of the virtual table named zTab in database iDb. This occurs -// when a DROP TABLE is mentioned. -// -// This call is a no-op if zTab is not a virtual table. +// C comment +// /* +// ** This function is invoked by the vdbe to call the xDestroy method +// ** of the virtual table named zTab in database iDb. This occurs +// ** when a DROP TABLE is mentioned. +// ** +// ** This call is a no-op if zTab is not a virtual table. +// */ func _sqlite3VtabCallDestroy(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8) (r0 int32) { var _rc int32 var _pTab *XTable @@ -71371,7 +74504,7 @@ _4: goto _7 } func() { - if (*Xsqlite3_vtab)(_1_p.X2) == nil { + if _1_p.X2 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000))), unsafe.Pointer(str(93393))) crt.X__builtin_abort(tls) } @@ -71383,9 +74516,10 @@ _4: goto _4 _7: _1_p = _vtabDisconnectAll(tls, _db, _pTab) - _1_xDestroy = *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_module)((*XModule)(_1_p.X1).X0).X5)})) + _1_xDestroy = func() func(*crt.TLS, *Xsqlite3_vtab) int32 { + v := (*Xsqlite3_module)((*XModule)(_1_p.X1).X0).X5 + return *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&v)) + }() func() { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab) int32 @@ -71404,8 +74538,8 @@ _7: crt.X__builtin_abort(tls) } }() - *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X2))))) = nil - *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X18))))) = nil + *(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_p.X2)))) = nil + *(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X18)))) = nil _sqlite3VtabUnlock(tls, _1_p) } _3: @@ -71418,9 +74552,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabCallDestroyØ00__func__Ø000[0], str(93446), 23) } -// Set the maximum page count for a database if mxPage is positive. -// No changes are made if mxPage is 0 or negative. -// Regardless of the value of mxPage, return the maximum page count. +// C comment +// /* +// ** Set the maximum page count for a database if mxPage is positive. +// ** No changes are made if mxPage is 0 or negative. +// ** Regardless of the value of mxPage, return the maximum page count. +// */ func _sqlite3BtreeMaxPageCount(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) { var _n int32 _sqlite3BtreeEnter(tls, _p) @@ -71429,14 +74566,17 @@ func _sqlite3BtreeMaxPageCount(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int3 return _n } -// Attempt to set the maximum database page count if mxPage is positive. -// Make no changes if mxPage is zero or negative. And never reduce the -// maximum page count below the current size of the database. -// -// Regardless of mxPage, return the current maximum page count. +// C comment +// /* +// ** Attempt to set the maximum database page count if mxPage is positive. +// ** Make no changes if mxPage is zero or negative. And never reduce the +// ** maximum page count below the current size of the database. +// ** +// ** Regardless of mxPage, return the current maximum page count. +// */ func _sqlite3PagerMaxPageCount(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) { if _mxPage > i32(0) { - *(*uint32)(unsafe.Pointer(&(_pPager.X49))) = uint32(_mxPage) + *(*uint32)(unsafe.Pointer(&_pPager.X49)) = uint32(_mxPage) } func() { if int32(_pPager.X14) == i32(0) { @@ -71445,7 +74585,7 @@ func _sqlite3PagerMaxPageCount(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 } }() func() { - if (_pPager.X49) < (_pPager.X22) { + if _pPager.X49 < _pPager.X22 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50720), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000))), unsafe.Pointer(str(93496))) crt.X__builtin_abort(tls) } @@ -71459,28 +74599,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerMaxPageCountØ00__func__Ø000[0], str(93527), 25) } -// This function returns a pointer to a nul-terminated string in memory -// obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the -// string contains a copy of zRawSql but with host parameters expanded to -// their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, -// then the returned string holds a copy of zRawSql with "-- " prepended -// to each line of text. -// -// If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then -// then long strings and blobs are truncated to that many bytes. This -// can be used to prevent unreasonably large trace strings when dealing -// with large (multi-megabyte) strings and blobs. -// -// The calling function is responsible for making sure the memory returned -// is eventually freed. -// -// ALGORITHM: Scan the input string looking for host parameters in any of -// these forms: ?, ?N, $A, @A, :A. Take care to avoid text within -// string literals, quoted identifier names, and comments. For text forms, -// the host parameter index is found by scanning the prepared -// statement for the corresponding OP_Variable opcode. Once the host -// parameter index is known, locate the value in p->aVar[]. Then render -// the value as a literal in place of the host parameter name. +// C comment +// /* +// ** This function returns a pointer to a nul-terminated string in memory +// ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the +// ** string contains a copy of zRawSql but with host parameters expanded to +// ** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, +// ** then the returned string holds a copy of zRawSql with "-- " prepended +// ** to each line of text. +// ** +// ** If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then +// ** then long strings and blobs are truncated to that many bytes. This +// ** can be used to prevent unreasonably large trace strings when dealing +// ** with large (multi-megabyte) strings and blobs. +// ** +// ** The calling function is responsible for making sure the memory returned +// ** is eventually freed. +// ** +// ** ALGORITHM: Scan the input string looking for host parameters in any of +// ** these forms: ?, ?N, $A, @A, :A. Take care to avoid text within +// ** string literals, quoted identifier names, and comments. For text forms, +// ** the host parameter index is found by scanning the prepared +// ** statement for the corresponding OP_Variable opcode. Once the host +// ** parameter index is known, locate the value in p->aVar[]. Then render +// ** the value as a literal in place of the host parameter name. +// */ func _sqlite3VdbeExpandSql(tls *crt.TLS, _p *TVdbe, _zRawSql *int8) (r0 *int8) { var _idx, _nextIndex, _n, _nToken, _i, _13_nOut, _17_nOut int32 var _2_zStart *int8 @@ -71493,8 +74636,8 @@ func _sqlite3VdbeExpandSql(tls *crt.TLS, _p *TVdbe, _zRawSql *int8) (r0 *int8) { _idx = i32(0) _nextIndex = i32(1) _db = (*Xsqlite3)(_p.X0) - _sqlite3StrAccumInit(tls, &_out, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(u64(100)), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) - if (_db.X37) <= i32(1) { + _sqlite3StrAccumInit(tls, &_out, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(u64(100)), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) + if _db.X37 <= i32(1) { goto _0 } _1: @@ -71523,7 +74666,7 @@ _0: goto _10 } _11: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) == 0 { goto _12 } _n = _findNextHostParameter(tls, _zRawSql, &_nToken) @@ -71536,11 +74679,11 @@ _11: _sqlite3StrAccumAppend(tls, &_out, _zRawSql, _n) { p := &_zRawSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink0(*p) } func() { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) == 0 && _nToken != i32(0) { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) == 0 && _nToken != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93575))) crt.X__builtin_abort(tls) } @@ -71548,17 +74691,17 @@ _11: if _nToken == i32(0) { goto _12 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(63) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) != i32(63) { goto _19 } if _nToken > i32(1) { func() { - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(1))))))))) & i32(4)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(1))))))))) & i32(4)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93599))) crt.X__builtin_abort(tls) } }() - _sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql))+1*uintptr(i32(1)))), &_idx) + _sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql))+1*uintptr(i32(1)))), &_idx) goto _23 } _idx = _nextIndex @@ -71566,7 +74709,7 @@ _23: goto _24 _19: func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(58) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(36) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(64) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(35) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) != i32(58) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) != i32(36) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) != i32(64) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRawSql)) + 1*uintptr(i32(0))))) != i32(35) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93626))) crt.X__builtin_abort(tls) } @@ -71581,7 +74724,7 @@ _19: _24: { p := &_zRawSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nToken))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_nToken))) sink0(*p) } _nextIndex = _idx + i32(1) @@ -71597,11 +74740,11 @@ _24: goto _47 } if (int32(_pVar.X1) & i32(4)) != 0 { - _sqlite3XPrintf(tls, &_out, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0)))))) + _sqlite3XPrintf(tls, &_out, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVar.X0))))) goto _47 } if (int32(_pVar.X1) & i32(8)) != 0 { - _sqlite3XPrintf(tls, &_out, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0)))))) + _sqlite3XPrintf(tls, &_out, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVar.X0))))) goto _47 } if (int32(_pVar.X1) & i32(2)) == 0 { @@ -71611,12 +74754,12 @@ _24: if int32(_13_enc) == i32(1) { goto _42 } - crt.Xmemset(tls, (unsafe.Pointer)(&_utf8), i32(0), u64(72)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_utf8.X9))))) = _db + crt.Xmemset(tls, unsafe.Pointer(&_utf8), i32(0), u64(72)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_utf8.X9)))) = _db _sqlite3VdbeMemSetStr(tls, &_utf8, _pVar.X5, _pVar.X4, _13_enc, nil) if i32(7) == _sqlite3VdbeChangeEncoding(tls, &_utf8, i32(1)) { - *(*uint8)(unsafe.Pointer(&(_out.X6))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&(_out.X4))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&_out.X6)) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_out.X4)) = uint32(i32(0)) } _pVar = &_utf8 _42: @@ -71628,7 +74771,7 @@ _42: goto _47 _41: if (int32(_pVar.X1) & i32(16384)) != 0 { - _sqlite3XPrintf(tls, &_out, str(93734), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0)))))) + _sqlite3XPrintf(tls, &_out, str(93734), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&_pVar.X0))))) goto _47 } func() { @@ -71644,7 +74787,7 @@ _50: if _i >= _17_nOut { goto _53 } - _sqlite3XPrintf(tls, &_out, str(93773), int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVar.X5)) + 1*uintptr(_i))))&i32(255)) + _sqlite3XPrintf(tls, &_out, str(93773), int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pVar.X5)) + 1*uintptr(_i))))&i32(255)) _i += 1 goto _50 _53: @@ -71653,7 +74796,7 @@ _47: goto _11 _12: _10: - if (_out.X6) != 0 { + if _out.X6 != 0 { _sqlite3StrAccumReset(tls, &_out) } return _sqlite3StrAccumFinish(tls, &_out) @@ -71670,16 +74813,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeExpandSqlØ00__func__Ø000[0], str(93780), 21) } -// zSql is a zero-terminated string of UTF-8 SQL text. Return the number of -// bytes in this text up to but excluding the first character in -// a host parameter. If the text contains no host parameters, return -// the total number of bytes in the text. +// C comment +// /* +// ** zSql is a zero-terminated string of UTF-8 SQL text. Return the number of +// ** bytes in this text up to but excluding the first character in +// ** a host parameter. If the text contains no host parameters, return +// ** the total number of bytes in the text. +// */ func _findNextHostParameter(tls *crt.TLS, _zSql *int8, _pnToken *int32) (r0 int32) { var _tokenType, _nTotal, _n int32 _nTotal = i32(0) *_pnToken = i32(0) _0: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSql)) + 1*uintptr(i32(0))))) == 0 { goto _1 } _n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType) @@ -71700,7 +74846,7 @@ _0: } { p := &_zSql - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n))) sink0(*p) } goto _0 @@ -71714,8 +74860,11 @@ func init() { crt.Xstrncpy(nil, &_findNextHostParameterØ00__func__Ø000[0], str(93830), 22) } -// The sqlite3_strlike() interface. Return 0 on a match and non-zero for -// a miss - like strcmp(). +// C comment +// /* +// ** The sqlite3_strlike() interface. Return 0 on a match and non-zero for +// ** a miss - like strcmp(). +// */ func Xsqlite3_strlike(tls *crt.TLS, _zPattern *int8, _zStr *int8, _esc uint32) (r0 int32) { return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zPattern)), (*uint8)(unsafe.Pointer(_zStr)), &_likeInfoNorm, _esc) } @@ -71726,15 +74875,18 @@ func init() { _likeInfoNorm = TcompareInfo{X0: u8(37), X1: u8(95), X2: u8(0), X3: u8(1)} } -// This function is called after a transaction has been committed. It -// invokes callbacks registered with sqlite3_wal_hook() as required. +// C comment +// /* +// ** This function is called after a transaction has been committed. It +// ** invokes callbacks registered with sqlite3_wal_hook() as required. +// */ func _doWalCallbacks(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _rc, _i, _2_nEntry int32 var _1_pBt *XBtree _rc = i32(0) _i = i32(0) _0: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _3 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -71744,12 +74896,11 @@ _0: _sqlite3BtreeEnter(tls, _1_pBt) _2_nEntry = _sqlite3PagerWalCallback(tls, _sqlite3BtreePager(tls, _1_pBt)) _sqlite3BtreeLeave(tls, _1_pBt) - if (((*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32 - }{(_db.X51)}))) != nil) && (_2_nEntry > i32(0))) && (_rc == i32(0)) { - _rc = (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32 - }{(_db.X51)})))(tls, _db.X52, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X0, _2_nEntry) + if ((_db.X51 != nil) && (_2_nEntry > i32(0))) && (_rc == i32(0)) { + _rc = func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 { + v := _db.X51 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _db.X52, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_i))).X0, _2_nEntry) } _4: _i += 1 @@ -71762,26 +74913,31 @@ func _sqlite3PagerWalCallback(tls *crt.TLS, _pPager *XPager) (r0 int32) { return _sqlite3WalCallback(tls, (*XWal)(_pPager.X60)) } -// Return the value to pass to a sqlite3_wal_hook callback, the -// number of frames in the WAL at the point of the last commit since -// sqlite3WalCallback() was called. If no commits have occurred since -// the last call, then return 0. +// C comment +// /* Return the value to pass to a sqlite3_wal_hook callback, the +// ** number of frames in the WAL at the point of the last commit since +// ** sqlite3WalCallback() was called. If no commits have occurred since +// ** the last call, then return 0. +// */ func _sqlite3WalCallback(tls *crt.TLS, _pWal *XWal) (r0 int32) { var _ret uint32 _ret = u32(0) if _pWal != nil { _ret = _pWal.X3 - *(*uint32)(unsafe.Pointer(&(_pWal.X3))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pWal.X3)) = uint32(i32(0)) } return int32(_ret) } -// Rerun the compilation of a statement after a schema change. -// -// If the statement is successfully recompiled, return SQLITE_OK. Otherwise, -// if the statement cannot be recompiled because another connection has -// locked the sqlite3_master table, return SQLITE_LOCKED. If any other error -// occurs, return SQLITE_SCHEMA. +// C comment +// /* +// ** Rerun the compilation of a statement after a schema change. +// ** +// ** If the statement is successfully recompiled, return SQLITE_OK. Otherwise, +// ** if the statement cannot be recompiled because another connection has +// ** locked the sqlite3_master table, return SQLITE_LOCKED. If any other error +// ** occurs, return SQLITE_SCHEMA. +// */ func _sqlite3Reprepare(tls *crt.TLS, _p *TVdbe) (r0 int32) { var _rc int32 var _zSql *int8 @@ -71793,7 +74949,7 @@ func _sqlite3Reprepare(tls *crt.TLS, _p *TVdbe) (r0 int32) { crt.X__builtin_abort(tls) } }() - _zSql = Xsqlite3_sql(tls, (unsafe.Pointer)(_p)) + _zSql = Xsqlite3_sql(tls, unsafe.Pointer(_p)) func() { if _zSql == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116376), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(24614))) @@ -71830,7 +74986,7 @@ _6: } }() _sqlite3VdbeSwap(tls, (*TVdbe)(_pNew), _p) - _sqlite3TransferBindings(tls, _pNew, (unsafe.Pointer)(_p)) + _sqlite3TransferBindings(tls, _pNew, unsafe.Pointer(_p)) _sqlite3VdbeResetStepResult(tls, (*TVdbe)(_pNew)) _sqlite3VdbeFinalize(tls, (*TVdbe)(_pNew)) return i32(0) @@ -71842,19 +74998,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ReprepareØ00__func__Ø000[0], str(93904), 17) } -// Return the SQL associated with a prepared statement +// C comment +// /* +// ** Return the SQL associated with a prepared statement +// */ func Xsqlite3_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) { var _p *TVdbe _p = (*TVdbe)(_pStmt) return func() *int8 { if _p != nil { - return (_p.X36) + return _p.X36 } return nil }() } -// Swap all content between two VDBE structures. +// C comment +// /* +// ** Swap all content between two VDBE structures. +// */ func _sqlite3VdbeSwap(tls *crt.TLS, _pA *TVdbe, _pB *TVdbe) { var _zTmp *int8 var _pTmp *TVdbe @@ -71869,16 +75031,16 @@ func _sqlite3VdbeSwap(tls *crt.TLS, _pA *TVdbe, _pB *TVdbe) { *_pA = *_pB *_pB = _tmp _pTmp = (*TVdbe)(_pA.X2) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X2))))) = (*TVdbe)(_pB.X2) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pB.X2))))) = _pTmp + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pA.X2)))) = (*TVdbe)(_pB.X2) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pB.X2)))) = _pTmp _pTmp = (*TVdbe)(_pA.X1) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X1))))) = (*TVdbe)(_pB.X1) - *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pB.X1))))) = _pTmp + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pA.X1)))) = (*TVdbe)(_pB.X1) + *(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pB.X1)))) = _pTmp _zTmp = _pA.X36 - *(**int8)(unsafe.Pointer(&(_pA.X36))) = _pB.X36 - *(**int8)(unsafe.Pointer(&(_pB.X36))) = _zTmp - storebits18((*int16)(unsafe.Pointer(&(_pB.X32))), int16((uint32((_pA.X32)>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))), 512, 9) - *(*uint32)(unsafe.Pointer(&(_pB.X41))) = _pA.X41 + *(**int8)(unsafe.Pointer(&_pA.X36)) = _pB.X36 + *(**int8)(unsafe.Pointer(&_pB.X36)) = _zTmp + storebits18((*int16)(unsafe.Pointer(&_pB.X32)), int16((uint32(_pA.X32>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))), 512, 9) + *(*uint32)(unsafe.Pointer(&_pB.X41)) = _pA.X41 } var _sqlite3VdbeSwapØ00__func__Ø000 [16]int8 @@ -71887,7 +75049,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeSwapØ00__func__Ø000[0], str(93936), 16) } -// Transfer all bindings from the first statement over to the second. +// C comment +// /* +// ** Transfer all bindings from the first statement over to the second. +// */ func _sqlite3TransferBindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) { var _i int32 var _pFrom, _pTo *TVdbe @@ -71925,10 +75090,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TransferBindingsØ00__func__Ø000[0], str(93975), 24) } -// Each VDBE holds the result of the most recent sqlite3_step() call -// in p->rc. This routine sets that result back to SQLITE_OK. +// C comment +// /* +// ** Each VDBE holds the result of the most recent sqlite3_step() call +// ** in p->rc. This routine sets that result back to SQLITE_OK. +// */ func _sqlite3VdbeResetStepResult(tls *crt.TLS, _p *TVdbe) { - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(0) } var _sqlite3_stepØ00__func__Ø000 [13]int8 @@ -71937,15 +75105,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_stepØ00__func__Ø000[0], str(93999), 13) } -// Pragma virtual table module xEof method. +// C comment +// /* +// ** Pragma virtual table module xEof method. +// */ func _pragmaVtabEof(tls *crt.TLS, _pVtabCursor *Xsqlite3_file) (r0 int32) { var _pCsr *XPragmaVtabCursor _pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor)) return bool2int(_pCsr.X1 == nil) } -// The xColumn method simply returns the corresponding column from -// the PRAGMA. +// C comment +// /* The xColumn method simply returns the corresponding column from +// ** the PRAGMA. +// */ func _pragmaVtabColumn(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _ctx *Xsqlite3_context, _i int32) (r0 int32) { var _pTab *XPragmaVtab var _pCsr *XPragmaVtabCursor @@ -71955,12 +75128,16 @@ func _pragmaVtabColumn(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _ctx *Xsqlite3 Xsqlite3_result_value(tls, _ctx, Xsqlite3_column_value(tls, _pCsr.X1, _i)) goto _1 } - Xsqlite3_result_text(tls, _ctx, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 8*uintptr(_i-int32(_pTab.X4)))), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _ctx, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]*int8)(unsafe.Pointer(&_pCsr.X3)))) + 8*uintptr(_i-int32(_pTab.X4)))), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _1: return i32(0) } -// SQLITE_OMIT_UTF16 +// C comment +// /* SQLITE_OMIT_UTF16 */ func Xsqlite3_result_value(tls *crt.TLS, _pCtx *Xsqlite3_context, _pValue *XMem) { func() { if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 { @@ -71977,7 +75154,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_valueØ00__func__Ø000[0], str(94012), 21) } -// Pragma virtual table module xRowid method. +// C comment +// /* +// ** Pragma virtual table module xRowid method. +// */ func _pragmaVtabRowid(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _p *int64) (r0 int32) { var _pCsr *XPragmaVtabCursor _pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor)) @@ -71985,18 +75165,21 @@ func _pragmaVtabRowid(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _p *int64) (r0 return i32(0) } -// Check to see if virtual table module pMod can be have an eponymous -// virtual table instance. If it can, create one if one does not already -// exist. Return non-zero if the eponymous virtual table instance exists -// when this routine returns, and return zero if it does not exist. -// -// An eponymous virtual table instance is one that is named after its -// module, and more importantly, does not require a CREATE VIRTUAL TABLE -// statement in order to come into existance. Eponymous virtual table -// instances always exist. They cannot be DROP-ed. -// -// Any virtual table module for which xConnect and xCreate are the same -// method can have an eponymous virtual table instance. +// C comment +// /* +// ** Check to see if virtual table module pMod can be have an eponymous +// ** virtual table instance. If it can, create one if one does not already +// ** exist. Return non-zero if the eponymous virtual table instance exists +// ** when this routine returns, and return zero if it does not exist. +// ** +// ** An eponymous virtual table instance is one that is named after its +// ** module, and more importantly, does not require a CREATE VIRTUAL TABLE +// ** statement in order to come into existance. Eponymous virtual table +// ** instances always exist. They cannot be DROP-ed. +// ** +// ** Any virtual table module for which xConnect and xCreate are the same +// ** method can have an eponymous virtual table instance. +// */ func _sqlite3VtabEponymousTableInit(tls *crt.TLS, _pParse *XParse, _pMod *XModule) (r0 int32) { var _rc int32 var _zErr *int8 @@ -72006,54 +75189,58 @@ func _sqlite3VtabEponymousTableInit(tls *crt.TLS, _pParse *XParse, _pMod *XModul _pModule = (*Xsqlite3_module)(_pMod.X0) _zErr = nil _db = (*Xsqlite3)(_pParse.X0) - if (*XTable)(_pMod.X4) != nil { + if _pMod.X4 != nil { return i32(1) } if (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 - }{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{(_pModule.X1)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := _pModule.X1 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 }{nil}))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 - }{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{(_pModule.X1)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := _pModule.X1 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 - }{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{(_pModule.X2)})))}))) { + }{func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := _pModule.X2 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }()}))) { return i32(0) } _pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128))) if _pTab == nil { return i32(0) } - *(**int8)(unsafe.Pointer(&(_pTab.X0))) = _sqlite3DbStrDup(tls, _db, _pMod.X1) - if (_pTab.X0) == nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTab)) + *(**int8)(unsafe.Pointer(&_pTab.X0)) = _sqlite3DbStrDup(tls, _db, _pMod.X1) + if _pTab.X0 == nil { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pTab)) return i32(0) } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = _pTab - *(*uint32)(unsafe.Pointer(&(_pTab.X8))) = uint32(i32(1)) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMod.X4)))) = _pTab + *(*uint32)(unsafe.Pointer(&_pTab.X8)) = uint32(i32(1)) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X20)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4) func() { - if (_pTab.X16) != i32(0) { + if _pTab.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126139), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabEponymousTableInitØ00__func__Ø000))), unsafe.Pointer(str(94033))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_pTab.X10)) = int16(i32(-1)) _addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.X0)) _addModuleArgument(tls, _db, _pTab, nil) _addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.X0)) - _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{(_pModule.X2)})), &_zErr) + _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := _pModule.X2 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }(), &_zErr) if _rc != 0 { _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_zErr)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _sqlite3VtabEponymousTableClear(tls, _db, _pMod) return i32(0) } @@ -72066,29 +75253,35 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabEponymousTableInitØ00__func__Ø000[0], str(94053), 30) } -// Add a new module argument to pTable->azModuleArg[]. -// The string is not copied - the pointer is stored. The -// string will be freed automatically when the table is -// deleted. +// C comment +// /* +// ** Add a new module argument to pTable->azModuleArg[]. +// ** The string is not copied - the pointer is stored. The +// ** string will be freed automatically when the table is +// ** deleted. +// */ func _addModuleArgument(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable, _zArg *int8) { var _nBytes, _2_i int32 var _azModuleArg **int8 - _nBytes = int32(u64(8) * uint64(i32(2)+(_pTable.X16))) - _azModuleArg = (**int8)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pTable.X17), uint64(_nBytes))) + _nBytes = int32(u64(8) * uint64(i32(2)+_pTable.X16)) + _azModuleArg = (**int8)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pTable.X17), uint64(_nBytes))) if _azModuleArg == nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zArg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zArg)) goto _1 } - _2_i = postInc1((*int32)(unsafe.Pointer(&(_pTable.X16))), int32(1)) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azModuleArg)) + 8*uintptr(_2_i))) = _zArg - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azModuleArg)) + 8*uintptr(_2_i+i32(1)))) = nil - *(***int8)(unsafe.Pointer(&(_pTable.X17))) = _azModuleArg + _2_i = postInc1((*int32)(unsafe.Pointer(&_pTable.X16)), 1) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azModuleArg)) + 8*uintptr(_2_i))) = _zArg + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azModuleArg)) + 8*uintptr(_2_i+i32(1)))) = nil + *(***int8)(unsafe.Pointer(&_pTable.X17)) = _azModuleArg _1: } -// The Table structure pTable is really a VIEW. Fill in the names of -// the columns of the view in the pTable structure. Return the number -// of errors. If an error is seen leave an error message in pParse->zErrMsg. +// C comment +// /* +// ** The Table structure pTable is really a VIEW. Fill in the names of +// ** the columns of the view in the pTable structure. Return the number +// ** of errors. If an error is seen leave an error message in pParse->zErrMsg. +// */ func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) (r0 int32) { var _nErr, _n int32 var _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32 @@ -72106,7 +75299,7 @@ func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) if _sqlite3VtabCallConnect(tls, _pParse, _pTable) != 0 { return i32(1) } - if (_pTable.X16) != 0 { + if _pTable.X16 != 0 { return i32(0) } if int32(_pTable.X11) > i32(0) { @@ -72123,7 +75316,7 @@ func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) } }() func() { - if (*XSelect)(_pTable.X3) == nil { + if _pTable.X3 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94136))) crt.X__builtin_abort(tls) } @@ -72134,18 +75327,18 @@ func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) } _n = _pParse.X17 _sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)(_pSel.X8)) - *(*int16)(unsafe.Pointer(&(_pTable.X11))) = int16(i32(-1)) - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1 + *(*int16)(unsafe.Pointer(&_pTable.X11)) = int16(i32(-1)) + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) += 1 _xAuth = _db.X59 - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = nil + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&_db.X59)) = nil _pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSel) - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _xAuth - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = _n - if (*XExprList)(_pTable.X6) == nil { + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&_db.X59)) = _xAuth + *(*int32)(unsafe.Pointer(&_pParse.X17)) = _n + if _pTable.X6 == nil { goto _11 } - _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pTable.X6), (*int16)(unsafe.Pointer(&(_pTable.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X1)))))) - if ((int32(_db.X17) == i32(0)) && ((_pParse.X16) == i32(0))) && (int32(_pTable.X11) == ((*XExprList)(_pSel.X0).X0)) { + _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pTable.X6), (*int16)(unsafe.Pointer(&_pTable.X11)), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTable.X1))))) + if ((int32(_db.X17) == i32(0)) && (_pParse.X16 == i32(0))) && (int32(_pTable.X11) == ((*XExprList)(_pSel.X0).X0)) { _sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTable, _pSel) } goto _21 @@ -72157,10 +75350,10 @@ _11: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_pTable.X11))) = _pSelTab.X11 - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X1))))) = (*XColumn)(_pSelTab.X1) - *(*int16)(unsafe.Pointer(&(_pSelTab.X11))) = int16(i32(0)) - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelTab.X1))))) = nil + *(*int16)(unsafe.Pointer(&_pTable.X11)) = _pSelTab.X11 + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTable.X1)))) = (*XColumn)(_pSelTab.X1) + *(*int16)(unsafe.Pointer(&_pSelTab.X11)) = int16(i32(0)) + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSelTab.X1)))) = nil func() { if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pTable.X20)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101936), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94168))) @@ -72169,12 +75362,12 @@ _11: }() goto _21 } - *(*int16)(unsafe.Pointer(&(_pTable.X11))) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_pTable.X11)) = int16(i32(0)) _nErr += 1 _21: _sqlite3DeleteTable(tls, _db, _pSelTab) _sqlite3SelectDelete(tls, _db, _pSel) - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1 + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) -= 1 goto _22 _10: _nErr += 1 @@ -72193,11 +75386,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ViewGetColumnNamesØ00__func__Ø000[0], str(94215), 26) } -// This function is invoked by the parser to call the xConnect() method -// of the virtual table pTab. If an error occurs, an error code is returned -// and an error left in pParse. -// -// This call is a no-op if table pTab is not a virtual table. +// C comment +// /* +// ** This function is invoked by the parser to call the xConnect() method +// ** of the virtual table pTab. If an error occurs, an error code is returned +// ** and an error left in pParse. +// ** +// ** This call is a no-op if table pTab is not a virtual table. +// */ func _sqlite3VtabCallConnect(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 int32) { var _rc int32 var _zMod, _2_zModule, _3_zErr *int8 @@ -72210,25 +75406,26 @@ func _sqlite3VtabCallConnect(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 i crt.X__builtin_abort(tls) } }() - if ((_pTab.X16) == 0) || (_sqlite3GetVTable(tls, _db, _pTab) != nil) { + if (_pTab.X16 == 0) || (_sqlite3GetVTable(tls, _db, _pTab) != nil) { return i32(0) } - _zMod = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 8*uintptr(i32(0)))) - _pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zMod)) + _zMod = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTab.X17)) + 8*uintptr(i32(0)))) + _pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&_db.X65)), _zMod)) if _pMod == nil { - _2_zModule = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 8*uintptr(i32(0)))) + _2_zModule = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTab.X17)) + 8*uintptr(i32(0)))) _sqlite3ErrorMsg(tls, _pParse, str(93150), unsafe.Pointer(_2_zModule)) _rc = i32(1) goto _5 } _3_zErr = nil - _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32 - }{((*Xsqlite3_module)(_pMod.X0).X2)})), &_3_zErr) + _rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, func() func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32 { + v := (*Xsqlite3_module)(_pMod.X0).X2 + return *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&v)) + }(), &_3_zErr) if _rc != i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_3_zErr)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zErr)) _5: return _rc } @@ -72239,8 +75436,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabCallConnectØ00__func__Ø000[0], str(94246), 23) } -// Given a SELECT statement, generate a Table structure that describes -// the result set of that SELECT. +// C comment +// /* +// ** Given a SELECT statement, generate a Table structure that describes +// ** the result set of that SELECT. +// */ func _sqlite3ResultSetOfSelect(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 *XTable) { var _savedFlags int32 var _db *Xsqlite3 @@ -72248,48 +75448,48 @@ func _sqlite3ResultSetOfSelect(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) _db = (*Xsqlite3)(_pParse.X0) _savedFlags = _db.X6 { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-5) sink1(*p) } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(64) sink1(*p) } _sqlite3SelectPrep(tls, _pParse, _pSelect, nil) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return nil } _0: - if (*XSelect)(_pSelect.X13) != nil { + if _pSelect.X13 != nil { _pSelect = (*XSelect)(_pSelect.X13) goto _0 } - *(*int32)(unsafe.Pointer(&(_db.X6))) = _savedFlags + *(*int32)(unsafe.Pointer(&_db.X6)) = _savedFlags _pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128))) if _pTab == nil { return nil } func() { - if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) == 0 { + if ((*t7)(unsafe.Pointer(&_db.X58)).X0) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118340), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000))), unsafe.Pointer(str(94269))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pTab.X8))) = uint32(i32(1)) - *(**int8)(unsafe.Pointer(&(_pTab.X0))) = nil - *(*int16)(unsafe.Pointer(&(_pTab.X12))) = int16(i32(200)) + *(*uint32)(unsafe.Pointer(&_pTab.X8)) = uint32(i32(1)) + *(**int8)(unsafe.Pointer(&_pTab.X0)) = nil + *(*int16)(unsafe.Pointer(&_pTab.X12)) = int16(i32(200)) func() { if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118343), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000))), unsafe.Pointer(str(48127))) crt.X__builtin_abort(tls) } }() - _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pSelect.X0), (*int16)(unsafe.Pointer(&(_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1)))))) + _sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pSelect.X0), (*int16)(unsafe.Pointer(&_pTab.X11)), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X1))))) _sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTab, _pSelect) - *(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1)) - if (_db.X17) != 0 { + *(*int16)(unsafe.Pointer(&_pTab.X10)) = int16(i32(-1)) + if _db.X17 != 0 { _sqlite3DeleteTable(tls, _db, _pTab) return nil } @@ -72302,15 +75502,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ResultSetOfSelectØ00__func__Ø000[0], str(94292), 25) } -// Add type and collation information to a column list based on -// a SELECT statement. -// -// The column list presumably came from selectColumnNamesFromExprList(). -// The column list has only names, not types or collations. This -// routine goes through and adds the types and collations. -// -// This routine requires that all identifiers in the SELECT -// statement be resolved. +// C comment +// /* +// ** Add type and collation information to a column list based on +// ** a SELECT statement. +// ** +// ** The column list presumably came from selectColumnNamesFromExprList(). +// ** The column list has only names, not types or collations. This +// ** routine goes through and adds the types and collations. +// ** +// ** This routine requires that all identifiers in the SELECT +// ** statement be resolved. +// */ func _sqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pSelect *XSelect) { var _i, _1_n, _1_m int32 var _szAll uint64 @@ -72330,61 +75533,61 @@ func _sqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, _pParse *XParse, _pTa } }() func() { - if ((_pSelect.X3) & uint32(i32(4))) == uint32(i32(0)) { + if (_pSelect.X3 & uint32(i32(4))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000))), unsafe.Pointer(str(94328))) crt.X__builtin_abort(tls) } }() func() { - if int32(_pTab.X11) != ((*XExprList)(_pSelect.X0).X0) && (_db.X17) == 0 { + if int32(_pTab.X11) != ((*XExprList)(_pSelect.X0).X0) && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118289), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000))), unsafe.Pointer(str(94365))) crt.X__builtin_abort(tls) } }() - if (_db.X17) != 0 { + if _db.X17 != 0 { return } - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = (*XSrcList)(_pSelect.X8) + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = (*XSrcList)(_pSelect.X8) _a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2))))) *func() **XColumn { _i = i32(0); return &_pCol }() = (*XColumn)(_pTab.X1) _8: if _i >= int32(_pTab.X11) { goto _11 } - _p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 32*uintptr(_i))).X0) - _1_zType = _columnTypeImpl(tls, &_sNC, _p, (*uint8)(unsafe.Pointer(&(_pCol.X5)))) + _p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_a)) + 32*uintptr(_i))).X0) + _1_zType = _columnTypeImpl(tls, &_sNC, _p, (*uint8)(unsafe.Pointer(&_pCol.X5))) { p := &_szAll *p = (*p) + uint64(_pCol.X5) sink17(*p) } - *(*int8)(unsafe.Pointer(&(_pCol.X4))) = _sqlite3ExprAffinity(tls, _p) + *(*int8)(unsafe.Pointer(&_pCol.X4)) = _sqlite3ExprAffinity(tls, _p) if _1_zType == nil || store1(&_1_m, _sqlite3Strlen30(tls, _1_zType)) <= i32(0) { goto _13 } _1_n = _sqlite3Strlen30(tls, _pCol.X0) - *(**int8)(unsafe.Pointer(&(_pCol.X0))) = (*int8)(_sqlite3DbReallocOrFree(tls, _db, (unsafe.Pointer)(_pCol.X0), uint64((_1_n+_1_m)+i32(2)))) - if (_pCol.X0) != nil { - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCol.X0))+1*uintptr(_1_n+i32(1))))), (unsafe.Pointer)(_1_zType), uint64(_1_m+i32(1))) + *(**int8)(unsafe.Pointer(&_pCol.X0)) = (*int8)(_sqlite3DbReallocOrFree(tls, _db, unsafe.Pointer(_pCol.X0), uint64((_1_n+_1_m)+i32(2)))) + if _pCol.X0 != nil { + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCol.X0))+1*uintptr(_1_n+i32(1))))), unsafe.Pointer(_1_zType), uint64(_1_m+i32(1))) { - p := (*uint8)(unsafe.Pointer(&(_pCol.X6))) + p := (*uint8)(unsafe.Pointer(&_pCol.X6)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } } _13: if int32(_pCol.X4) == i32(0) { - *(*int8)(unsafe.Pointer(&(_pCol.X4))) = int8(i32(65)) + *(*int8)(unsafe.Pointer(&_pCol.X4)) = int8(i32(65)) } _pColl = _sqlite3ExprCollSeq(tls, _pParse, _p) - if (_pColl != nil) && ((_pCol.X2) == nil) { - *(**int8)(unsafe.Pointer(&(_pCol.X2))) = _sqlite3DbStrDup(tls, _db, _pColl.X0) + if (_pColl != nil) && (_pCol.X2 == nil) { + *(**int8)(unsafe.Pointer(&_pCol.X2)) = _sqlite3DbStrDup(tls, _db, _pColl.X0) } *(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32) goto _8 _11: - *(*int16)(unsafe.Pointer(&(_pTab.X13))) = _sqlite3LogEst(tls, _szAll*uint64(i32(4))) + *(*int16)(unsafe.Pointer(&_pTab.X13)) = _sqlite3LogEst(tls, _szAll*uint64(i32(4))) _ = _sNC } @@ -72439,15 +75642,15 @@ _9: _3_pTabList = (*XSrcList)(_pNC.X1) _j = i32(0) _12: - if _j >= (_3_pTabList.X0) || ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2)))))+112*uintptr(_j))).X11) == (_pExpr.X8) { + if _j >= _3_pTabList.X0 || ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_3_pTabList.X2))))+112*uintptr(_j))).X11) == _pExpr.X8 { goto _16 } _j += 1 goto _12 _16: - if _j < (_3_pTabList.X0) { - _2_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2))))) + 112*uintptr(_j))).X4) - _2_pS = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2))))) + 112*uintptr(_j))).X5) + if _j < _3_pTabList.X0 { + _2_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_3_pTabList.X2)))) + 112*uintptr(_j))).X4) + _2_pS = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_3_pTabList.X2)))) + 112*uintptr(_j))).X5) goto _18 } _pNC = (*XNameContext)(_pNC.X4) @@ -72476,15 +75679,15 @@ _10: return i32(0) }() }() != 0 { - _8_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_2_pS.X0).X2))))) + 32*uintptr(_2_iCol))).X0) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X1))))) = (*XSrcList)(_2_pS.X8) - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X4))))) = _pNC - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X0))))) = (*XParse)(_pNC.X0) + _8_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_2_pS.X0).X2))))) + 32*uintptr(_2_iCol))).X0) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_8_sNC.X1)))) = (*XSrcList)(_2_pS.X8) + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_8_sNC.X4)))) = _pNC + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_8_sNC.X0)))) = (*XParse)(_pNC.X0) _zType = _columnTypeImpl(tls, &_8_sNC, _8_p, &_estWidth) } goto _29 _23: - if (*XSchema)(_2_pTab.X20) == nil { + if _2_pTab.X20 == nil { goto _29 } func() { @@ -72512,17 +75715,17 @@ _38: _29: goto _8 _7: - _12_pS = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) - _12_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_12_pS.X0).X2))))) + 32*uintptr(i32(0)))).X0) + _12_pS = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) + _12_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_12_pS.X0).X2))))) + 32*uintptr(i32(0)))).X0) func() { - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118016), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(45159))) crt.X__builtin_abort(tls) } }() - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X1))))) = (*XSrcList)(_12_pS.X8) - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X4))))) = _pNC - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X0))))) = (*XParse)(_pNC.X0) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_sNC.X1)))) = (*XSrcList)(_12_pS.X8) + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_sNC.X4)))) = _pNC + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_sNC.X0)))) = (*XParse)(_pNC.X0) _zType = _columnTypeImpl(tls, &_12_sNC, _12_p, &_estWidth) goto _8 _8: @@ -72542,13 +75745,16 @@ func init() { crt.Xstrncpy(nil, &_columnTypeImplØ00__func__Ø000[0], str(94547), 15) } -// Return the collation sequence for the expression pExpr. If -// there is no defined collating sequence, return NULL. -// -// The collating sequence might be determined by a COLLATE operator -// or by the presence of a column with a defined collating sequence. -// COLLATE operators take first precedence. Left operands take -// precedence over right operands. +// C comment +// /* +// ** Return the collation sequence for the expression pExpr. If +// ** there is no defined collating sequence, return NULL. +// ** +// ** The collating sequence might be determined by a COLLATE operator +// ** or by the presence of a column with a defined collating sequence. +// ** COLLATE operators take first precedence. Left operands take +// ** precedence over right operands. +// */ func _sqlite3ExprCollSeq(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *XCollSeq) { var _1_op, _4_j, _9_i int32 var _5_zColl *int8 @@ -72563,7 +75769,7 @@ _0: goto _1 } _1_op = int32(_p.X0) - if ((_p.X2) & uint32(i32(512))) != 0 { + if (_p.X2 & uint32(i32(512))) != 0 { goto _1 } if (_1_op == i32(37)) || (_1_op == i32(156)) { @@ -72571,7 +75777,7 @@ _0: goto _0 } if (_1_op == i32(94)) || ((_1_op == i32(157)) && (int32(_p.X12) == i32(94))) { - _pColl = _sqlite3GetCollSeq(tls, _pParse, _db.X14, nil, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + _pColl = _sqlite3GetCollSeq(tls, _pParse, _db.X14, nil, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) goto _1 } if _1_op != i32(154) && _1_op != i32(152) && _1_op != i32(157) && _1_op != i32(61) || (*XTable)(_p.X14) == nil { @@ -72584,22 +75790,22 @@ _0: } goto _1 _12: - if ((_p.X2) & uint32(i32(256))) == 0 { + if (_p.X2 & uint32(i32(256))) == 0 { goto _14 } - if ((*XExpr)(_p.X4) != nil) && ((((*XExpr)(_p.X4).X2) & uint32(i32(256))) != uint32(i32(0))) { + if (_p.X4 != nil) && ((((*XExpr)(_p.X4).X2) & uint32(i32(256))) != uint32(i32(0))) { _p = (*XExpr)(_p.X4) goto _17 } _8_pNext = (*XExpr)(_p.X5) func() { - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil && (*XExpr)(_p.X5) != nil { + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil && (*XExpr)(_p.X5) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91064), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000))), unsafe.Pointer(str(21285))) crt.X__builtin_abort(tls) } }() - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) == nil || func() int32 { - if ((_p.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) == nil || func() int32 { + if (_p.X2 & uint32(i32(2048))) == uint32(i32(0)) { return i32(1) } return func() int32 { @@ -72613,7 +75819,7 @@ _12: _9_i = i32(0) _25: if func() int32 { - if _9_i < ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X0) { + if _9_i < ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X0) { return i32(1) } return func() int32 { @@ -72624,8 +75830,8 @@ _25: }() == 0 { goto _30 } - if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2))))) + 32*uintptr(_9_i))).X0).X2) & uint32(i32(256))) != uint32(i32(0)) { - _8_pNext = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2))))) + 32*uintptr(_9_i))).X0) + if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X2))))) + 32*uintptr(_9_i))).X0).X2) & uint32(i32(256))) != uint32(i32(0)) { + _8_pNext = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X2))))) + 32*uintptr(_9_i))).X0) goto _30 } _9_i += 1 @@ -72652,15 +75858,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCollSeqØ00__func__Ø000[0], str(94562), 19) } -// This routine is called on a collation sequence before it is used to -// check that it is defined. An undefined collation sequence exists when -// a database is loaded that contains references to collation sequences -// that have not been defined by sqlite3_create_collation() etc. -// -// If required, this routine calls the 'collation needed' callback to -// request a definition of the collating sequence. If this doesn't work, -// an equivalent collating sequence that uses a text encoding different -// from the main database is substituted, if one is available. +// C comment +// /* +// ** This routine is called on a collation sequence before it is used to +// ** check that it is defined. An undefined collation sequence exists when +// ** a database is loaded that contains references to collation sequences +// ** that have not been defined by sqlite3_create_collation() etc. +// ** +// ** If required, this routine calls the 'collation needed' callback to +// ** request a definition of the collating sequence. If this doesn't work, +// ** an equivalent collating sequence that uses a text encoding different +// ** from the main database is substituted, if one is available. +// */ func _sqlite3CheckCollSeq(tls *crt.TLS, _pParse *XParse, _pColl *XCollSeq) (r0 int32) { var _1_zName *int8 var _1_db *Xsqlite3 @@ -72690,20 +75899,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CheckCollSeqØ00__func__Ø000[0], str(94590), 20) } -// If the source-list item passed as an argument was augmented with an -// INDEXED BY clause, then try to locate the specified index. If there -// was such a clause and the named index cannot be found, return -// SQLITE_ERROR and leave an error in pParse. Otherwise, populate -// pFrom->pIndex and return SQLITE_OK. +// C comment +// /* +// ** If the source-list item passed as an argument was augmented with an +// ** INDEXED BY clause, then try to locate the specified index. If there +// ** was such a clause and the named index cannot be found, return +// ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate +// ** pFrom->pIndex and return SQLITE_OK. +// */ func _sqlite3IndexedByLookup(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) { var _1_zIndexedBy *int8 var _1_pTab *XTable var _1_pIdx *XIndex - if (*XTable)(_pFrom.X4) == nil || ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) == 0 { + if _pFrom.X4 == nil || ((uint32(((*t28)(unsafe.Pointer(&_pFrom.X9)).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) == 0 { goto _1 } _1_pTab = (*XTable)(_pFrom.X4) - _1_zIndexedBy = *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pFrom.X15))))) + _1_zIndexedBy = *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pFrom.X15)))) _1_pIdx = (*XIndex)(_1_pTab.X2) _2: if _1_pIdx == nil || _sqlite3StrICmp(tls, _1_pIdx.X0, _1_zIndexedBy) == 0 { @@ -72714,26 +75926,29 @@ _2: _6: if _1_pIdx == nil { _sqlite3ErrorMsg(tls, _pParse, str(94610), unsafe.Pointer(_1_zIndexedBy), i32(0)) - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) return i32(1) } - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X16))))) = _1_pIdx + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFrom.X16)))) = _1_pIdx _1: return i32(0) } -// This routine processes the join information for a SELECT statement. -// ON and USING clauses are converted into extra terms of the WHERE clause. -// NATURAL joins also create extra WHERE clause terms. -// -// The terms of a FROM clause are contained in the Select.pSrc structure. -// The left most table is the first entry in Select.pSrc. The right-most -// table is the last entry. The join operator is held in the entry to -// the left. Thus entry 0 contains the join operator for the join between -// entries 0 and 1. Any ON or USING clauses associated with the join are -// also attached to the left entry. -// -// This routine returns the number of errors encountered. +// C comment +// /* +// ** This routine processes the join information for a SELECT statement. +// ** ON and USING clauses are converted into extra terms of the WHERE clause. +// ** NATURAL joins also create extra WHERE clause terms. +// ** +// ** The terms of a FROM clause are contained in the Select.pSrc structure. +// ** The left most table is the first entry in Select.pSrc. The right-most +// ** table is the last entry. The join operator is held in the entry to +// ** the left. Thus entry 0 contains the join operator for the join between +// ** entries 0 and 1. Any ON or USING clauses associated with the join are +// ** also attached to the left entry. +// ** +// ** This routine returns the number of errors encountered. +// */ func _sqliteProcessJoin(tls *crt.TLS, _pParse *XParse, _p *XSelect) (r0 int32) { var _i, _j, _1_isOuter, _4_iLeft, _4_iLeftCol, _9_iLeft, _9_iLeftCol, _9_iRightCol int32 var _4_zName, _9_zName *int8 @@ -72742,11 +75957,11 @@ func _sqliteProcessJoin(tls *crt.TLS, _pParse *XParse, _p *XSelect) (r0 int32) { var _pLeft, _pRight *TSrcList_item var _8_pList *XIdList _pSrc = (*XSrcList)(_p.X8) - _pLeft = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(i32(0)))) - _pRight = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLeft)) + 112*uintptr(i32(1)))) + _pLeft = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(i32(0)))) + _pRight = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLeft)) + 112*uintptr(i32(1)))) _i = i32(0) _0: - if _i >= ((_pSrc.X0) - i32(1)) { + if _i >= (_pSrc.X0 - i32(1)) { goto _3 } _1_pLeftTab = (*XTable)(_pLeft.X4) @@ -72763,11 +75978,11 @@ _0: }() != 0 { goto _1 } - _1_isOuter = bool2int((int32((*t28)(unsafe.Pointer(&(_pRight.X9))).X0) & i32(32)) != i32(0)) - if (int32((*t28)(unsafe.Pointer(&(_pRight.X9))).X0) & i32(4)) == 0 { + _1_isOuter = bool2int((int32((*t28)(unsafe.Pointer(&_pRight.X9)).X0) & i32(32)) != i32(0)) + if (int32((*t28)(unsafe.Pointer(&_pRight.X9)).X0) & i32(4)) == 0 { goto _8 } - if ((*XExpr)(_pRight.X12) != nil) || ((*XIdList)(_pRight.X13) != nil) { + if (_pRight.X12 != nil) || (_pRight.X13 != nil) { _sqlite3ErrorMsg(tls, _pParse, str(94628), i32(0)) return i32(1) } @@ -72778,32 +75993,32 @@ _11: } _4_zName = (*XColumn)(unsafe.Pointer(uintptr(_1_pRightTab.X1) + 32*uintptr(_j))).X0 if _tableAndColumnIndex(tls, _pSrc, _i+i32(1), _4_zName, &_4_iLeft, &_4_iLeftCol) != 0 { - _addWhereTerm(tls, _pParse, _pSrc, _4_iLeft, _4_iLeftCol, _i+i32(1), _j, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9)))))) + _addWhereTerm(tls, _pParse, _pSrc, _4_iLeft, _4_iLeftCol, _i+i32(1), _j, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9))))) } _j += 1 goto _11 _14: _8: - if ((*XExpr)(_pRight.X12) != nil) && ((*XIdList)(_pRight.X13) != nil) { + if (_pRight.X12 != nil) && (_pRight.X13 != nil) { _sqlite3ErrorMsg(tls, _pParse, str(94678)) return i32(1) } - if (*XExpr)(_pRight.X12) == nil { + if _pRight.X12 == nil { goto _18 } if _1_isOuter != 0 { _setJoinExpr(tls, (*XExpr)(_pRight.X12), _pRight.X11) } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_p.X9), (*XExpr)(_pRight.X12)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRight.X12))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_p.X9), (*XExpr)(_pRight.X12)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRight.X12)))) = nil _18: - if (*XIdList)(_pRight.X13) == nil { + if _pRight.X13 == nil { goto _20 } _8_pList = (*XIdList)(_pRight.X13) _j = i32(0) _21: - if _j >= (_8_pList.X1) { + if _j >= _8_pList.X1 { goto _24 } _9_zName = (*TIdList_item)(unsafe.Pointer(uintptr(_8_pList.X0) + 16*uintptr(_j))).X0 @@ -72812,7 +76027,7 @@ _21: _sqlite3ErrorMsg(tls, _pParse, str(94733), unsafe.Pointer(_9_zName)) return i32(1) } - _addWhereTerm(tls, _pParse, _pSrc, _9_iLeft, _9_iLeftCol, _i+i32(1), _9_iRightCol, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9)))))) + _addWhereTerm(tls, _pParse, _pSrc, _9_iLeft, _9_iLeftCol, _i+i32(1), _9_iRightCol, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9))))) _j += 1 goto _21 _24: @@ -72833,13 +76048,16 @@ func init() { crt.Xstrncpy(nil, &_sqliteProcessJoinØ00__func__Ø000[0], str(94797), 18) } -// Search the first N tables in pSrc, from left to right, looking for a -// table that has a column named zCol. -// -// When found, set *piTab and *piCol to the table index and column index -// of the matching column and return TRUE. -// -// If not found, return FALSE. +// C comment +// /* +// ** Search the first N tables in pSrc, from left to right, looking for a +// ** table that has a column named zCol. +// ** +// ** When found, set *piTab and *piCol to the table index and column index +// ** of the matching column and return TRUE. +// ** +// ** If not found, return FALSE. +// */ func _tableAndColumnIndex(tls *crt.TLS, _pSrc *XSrcList, _N int32, _zCol *int8, _piTab *int32, _piCol *int32) (r0 int32) { var _i, _iCol int32 func() { @@ -72853,7 +76071,7 @@ _2: if _i >= _N { goto _5 } - _iCol = _columnIndex(tls, (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_i))).X4), _zCol) + _iCol = _columnIndex(tls, (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(_i))).X4), _zCol) if _iCol < i32(0) { goto _6 } @@ -72876,8 +76094,11 @@ func init() { crt.Xstrncpy(nil, &_tableAndColumnIndexØ00__func__Ø000[0], str(94838), 20) } -// Return the index of a column in a table. Return -1 if the column -// is not contained in the table. +// C comment +// /* +// ** Return the index of a column in a table. Return -1 if the column +// ** is not contained in the table. +// */ func _columnIndex(tls *crt.TLS, _pTab *XTable, _zCol *int8) (r0 int32) { var _i int32 _i = i32(0) @@ -72894,15 +76115,18 @@ _3: return i32(-1) } -// This function is used to add terms implied by JOIN syntax to the -// WHERE clause expression of a SELECT statement. The new term, which -// is ANDed with the existing WHERE clause, is of the form: -// -// (tab1.col1 = tab2.col2) -// -// where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the -// (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is -// column iColRight of tab2. +// C comment +// /* +// ** This function is used to add terms implied by JOIN syntax to the +// ** WHERE clause expression of a SELECT statement. The new term, which +// ** is ANDed with the existing WHERE clause, is of the form: +// ** +// ** (tab1.col1 = tab2.col2) +// ** +// ** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the +// ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is +// ** column iColRight of tab2. +// */ func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, _iColLeft int32, _iRight int32, _iColRight int32, _isOuterJoin int32, _ppWhere **XExpr) { var _db *Xsqlite3 var _pE1, _pE2, _pEq *XExpr @@ -72914,19 +76138,19 @@ func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, } }() func() { - if (_pSrc.X0) <= _iRight { + if _pSrc.X0 <= _iRight { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116850), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94871))) crt.X__builtin_abort(tls) } }() func() { - if (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_iLeft))).X4) == nil { + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_iLeft))).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116851), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94889))) crt.X__builtin_abort(tls) } }() func() { - if (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_iRight))).X4) == nil { + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_iRight))).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116852), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94909))) crt.X__builtin_abort(tls) } @@ -72936,22 +76160,22 @@ func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, _pEq = _sqlite3PExpr(tls, _pParse, i32(78), _pE1, _pE2) if (_pEq != nil) && _isOuterJoin != 0 { { - p := (*uint32)(unsafe.Pointer(&(_pEq.X2))) + p := (*uint32)(unsafe.Pointer(&_pEq.X2)) *p = (*p) | uint32(i32(1)) sink5(*p) } func() { - if ((_pEq.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_pEq.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116860), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94930))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_pEq.X2))) + p := (*uint32)(unsafe.Pointer(&_pEq.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } - *(*int16)(unsafe.Pointer(&(_pEq.X11))) = int16(_pE2.X8) + *(*int16)(unsafe.Pointer(&_pEq.X11)) = int16(_pE2.X8) } *_ppWhere = _sqlite3ExprAnd(tls, _db, *_ppWhere, _pEq) } @@ -72962,8 +76186,11 @@ func init() { crt.Xstrncpy(nil, &_addWhereTermØ00__func__Ø000[0], str(94977), 13) } -// Allocate and return a pointer to an expression to load the column iCol -// from datasource iSrc in SrcList pSrc. +// C comment +// /* +// ** Allocate and return a pointer to an expression to load the column iCol +// ** from datasource iSrc in SrcList pSrc. +// */ func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSrc int32, _iCol int32) (r0 *XExpr) { var _1_pItem *TSrcList_item var _p *XExpr @@ -72971,16 +76198,16 @@ func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSr if _p == nil { goto _0 } - _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_iSrc))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = (*XTable)(_1_pItem.X4) - *(*int32)(unsafe.Pointer(&(_p.X8))) = _1_pItem.X11 + _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_iSrc))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X14)))) = (*XTable)(_1_pItem.X4) + *(*int32)(unsafe.Pointer(&_p.X8)) = _1_pItem.X11 if int32((*XTable)(_p.X14).X10) == _iCol { - *(*int16)(unsafe.Pointer(&(_p.X9))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_p.X9)) = int16(i32(-1)) goto _2 } - *(*int16)(unsafe.Pointer(&(_p.X9))) = int16(_iCol) + *(*int16)(unsafe.Pointer(&_p.X9)) = int16(_iCol) { - p := (*uint64)(unsafe.Pointer(&(_1_pItem.X14))) + p := (*uint64)(unsafe.Pointer(&_1_pItem.X14)) *p = (*p) | (u64(1) << uint(func() int32 { if _iCol >= i32(64) { return i32(63) @@ -72991,7 +76218,7 @@ func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSr } _2: { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) *p = (*p) | uint32(i32(4)) sink5(*p) } @@ -72999,22 +76226,25 @@ _0: return _p } -// Allocate an Expr node which joins as many as two subtrees. -// -// One or both of the subtrees can be NULL. Return a pointer to the new -// Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed, -// free the subtrees and return NULL. +// C comment +// /* +// ** Allocate an Expr node which joins as many as two subtrees. +// ** +// ** One or both of the subtrees can be NULL. Return a pointer to the new +// ** Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed, +// ** free the subtrees and return NULL. +// */ func _sqlite3PExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) { var _p *XExpr - if (_op == i32(71)) && ((_pParse.X16) == i32(0)) { + if (_op == i32(71)) && (_pParse.X16 == i32(0)) { _p = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), _pLeft, _pRight) goto _2 } _p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), u64(72))) if _p != nil { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(_op & i32(255)) - *(*int16)(unsafe.Pointer(&(_p.X10))) = int16(i32(-1)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_p.X0)) = uint8(_op & i32(255)) + *(*int16)(unsafe.Pointer(&_p.X10)) = int16(i32(-1)) } _sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.X0), _p, _pLeft, _pRight) _2: @@ -73024,12 +76254,15 @@ _2: return _p } -// Join two expressions using an AND operator. If either expression is -// NULL, then just return the other expression. -// -// If one side or the other of the AND is known to be false, then instead -// of returning an AND expression, just return a constant expression with -// a value of false. +// C comment +// /* +// ** Join two expressions using an AND operator. If either expression is +// ** NULL, then just return the other expression. +// ** +// ** If one side or the other of the AND is known to be false, then instead +// ** of returning an AND expression, just return a constant expression with +// ** a value of false. +// */ func _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) { var _4_pNew *XExpr if _pLeft == nil { @@ -73041,7 +76274,7 @@ func _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) if _exprAlwaysFalse(tls, _pLeft) != 0 || _exprAlwaysFalse(tls, _pRight) != 0 { _sqlite3ExprDelete(tls, _db, _pLeft) _sqlite3ExprDelete(tls, _db, _pRight) - return _sqlite3ExprAlloc(tls, _db, i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+16*uintptr(i32(0)))), i32(0)) + return _sqlite3ExprAlloc(tls, _db, i32(134), (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3IntTokens))+16*uintptr(i32(0)))), i32(0)) } _4_pNew = _sqlite3ExprAlloc(tls, _db, i32(71), nil, i32(0)) _sqlite3ExprAttachSubtrees(tls, _db, _4_pNew, _pLeft, _pRight) @@ -73051,7 +76284,7 @@ func _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) func _exprAlwaysFalse(tls *crt.TLS, _p *XExpr) (r0 int32) { var _v int32 _v = i32(0) - if ((_p.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(1))) != uint32(i32(0)) { return i32(0) } if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 { @@ -73060,10 +76293,13 @@ func _exprAlwaysFalse(tls *crt.TLS, _p *XExpr) (r0 int32) { return bool2int(_v == i32(0)) } -// If the expression p codes a constant integer that is small enough -// to fit in a 32-bit integer, return 1 and put the value of the integer -// in *pValue. If the expression is not an integer or if it is too big -// to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. +// C comment +// /* +// ** If the expression p codes a constant integer that is small enough +// ** to fit in a 32-bit integer, return 1 and put the value of the integer +// ** in *pValue. If the expression is not an integer or if it is too big +// ** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. +// */ func _sqlite3ExprIsInteger(tls *crt.TLS, _p *XExpr, _pValue *int32) (r0 int32) { var _rc, _4_v int32 _rc = i32(0) @@ -73071,13 +76307,13 @@ func _sqlite3ExprIsInteger(tls *crt.TLS, _p *XExpr, _pValue *int32) (r0 int32) { return i32(0) } func() { - if int32(_p.X0) == i32(134) && ((_p.X2)&uint32(i32(1024))) == uint32(i32(0)) && _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))), &_rc) != i32(0) { + if int32(_p.X0) == i32(134) && (_p.X2&uint32(i32(1024))) == uint32(i32(0)) && _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))), &_rc) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000))), unsafe.Pointer(str(94990))) crt.X__builtin_abort(tls) } }() - if ((_p.X2) & uint32(i32(1024))) != 0 { - *_pValue = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))) + if (_p.X2 & uint32(i32(1024))) != 0 { + *_pValue = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))) return i32(1) } switch int32(_p.X0) { @@ -73122,14 +76358,17 @@ func init() { _sqlite3IntTokens = [2]XToken{XToken{X0: str(4908), X1: u32(1)}, XToken{X0: str(50040), X1: u32(1)}} } -// Attach subtrees pLeft and pRight to the Expr node pRoot. -// -// If pRoot==NULL that means that a memory allocation error has occurred. -// In that case, delete the subtrees pLeft and pRight. +// C comment +// /* +// ** Attach subtrees pLeft and pRight to the Expr node pRoot. +// ** +// ** If pRoot==NULL that means that a memory allocation error has occurred. +// ** In that case, delete the subtrees pLeft and pRight. +// */ func _sqlite3ExprAttachSubtrees(tls *crt.TLS, _db *Xsqlite3, _pRoot *XExpr, _pLeft *XExpr, _pRight *XExpr) { if _pRoot == nil { func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91693), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAttachSubtreesØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } @@ -73139,18 +76378,18 @@ func _sqlite3ExprAttachSubtrees(tls *crt.TLS, _db *Xsqlite3, _pRoot *XExpr, _pLe goto _3 } if _pRight != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRoot.X5))))) = _pRight + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRoot.X5)))) = _pRight { - p := (*uint32)(unsafe.Pointer(&(_pRoot.X2))) - *p = (*p) | (uint32(i32(2097408)) & (_pRight.X2)) + p := (*uint32)(unsafe.Pointer(&_pRoot.X2)) + *p = (*p) | (uint32(i32(2097408)) & _pRight.X2) sink5(*p) } } if _pLeft != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRoot.X4))))) = _pLeft + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRoot.X4)))) = _pLeft { - p := (*uint32)(unsafe.Pointer(&(_pRoot.X2))) - *p = (*p) | (uint32(i32(2097408)) & (_pLeft.X2)) + p := (*uint32)(unsafe.Pointer(&_pRoot.X2)) + *p = (*p) | (uint32(i32(2097408)) & _pLeft.X2) sink5(*p) } } @@ -73164,48 +76403,53 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprAttachSubtreesØ00__func__Ø000[0], str(95119), 26) } -// Set the Expr.nHeight variable in the structure passed as an -// argument. An expression with no children, Expr.pList or -// Expr.pSelect member has a height of 1. Any other expression -// has a height equal to the maximum height of any other -// referenced Expr plus one. -// -// Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, -// if appropriate. +// C comment +// /* +// ** Set the Expr.nHeight variable in the structure passed as an +// ** argument. An expression with no children, Expr.pList or +// ** Expr.pSelect member has a height of 1. Any other expression +// ** has a height equal to the maximum height of any other +// ** referenced Expr plus one. +// ** +// ** Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, +// ** if appropriate. +// */ func _exprSetHeight(tls *crt.TLS, _p *XExpr) { var _nHeight int32 _nHeight = i32(0) _heightOfExpr(tls, (*XExpr)(_p.X4), &_nHeight) _heightOfExpr(tls, (*XExpr)(_p.X5), &_nHeight) - if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) { - _heightOfSelect(tls, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), &_nHeight) + if (_p.X2 & uint32(i32(2048))) != uint32(i32(0)) { + _heightOfSelect(tls, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))), &_nHeight) goto _2 } - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil { - _heightOfExprList(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), &_nHeight) + if (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil { + _heightOfExprList(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))), &_nHeight) { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) - *p = (*p) | (uint32(i32(2097408)) & _sqlite3ExprListFlags(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) + *p = (*p) | (uint32(i32(2097408)) & _sqlite3ExprListFlags(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))))) sink5(*p) } } _2: - *(*int32)(unsafe.Pointer(&(_p.X7))) = _nHeight + i32(1) -} - -// The following three functions, heightOfExpr(), heightOfExprList() -// and heightOfSelect(), are used to determine the maximum height -// of any expression tree referenced by the structure passed as the -// first argument. -// -// If this maximum height is greater than the current value pointed -// to by pnHeight, the second parameter, then set *pnHeight to that -// value. + *(*int32)(unsafe.Pointer(&_p.X7)) = _nHeight + i32(1) +} + +// C comment +// /* The following three functions, heightOfExpr(), heightOfExprList() +// ** and heightOfSelect(), are used to determine the maximum height +// ** of any expression tree referenced by the structure passed as the +// ** first argument. +// ** +// ** If this maximum height is greater than the current value pointed +// ** to by pnHeight, the second parameter, then set *pnHeight to that +// ** value. +// */ func _heightOfExpr(tls *crt.TLS, _p *XExpr, _pnHeight *int32) { if _p == nil { goto _0 } - if (_p.X7) > (*_pnHeight) { + if _p.X7 > (*_pnHeight) { *_pnHeight = _p.X7 } _0: @@ -73231,18 +76475,21 @@ func _heightOfExprList(tls *crt.TLS, _p *XExprList, _pnHeight *int32) { } _1_i = i32(0) _1: - if _1_i >= (_p.X0) { + if _1_i >= _p.X0 { goto _4 } - _heightOfExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))+32*uintptr(_1_i))).X0), _pnHeight) + _heightOfExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2))))+32*uintptr(_1_i))).X0), _pnHeight) _1_i += 1 goto _1 _4: _0: } -// Return the bitwise-OR of all Expr.flags fields in the given -// ExprList. +// C comment +// /* +// ** Return the bitwise-OR of all Expr.flags fields in the given +// ** ExprList. +// */ func _sqlite3ExprListFlags(tls *crt.TLS, _pList *XExprList) (r0 uint32) { var _i int32 var _m uint32 @@ -73253,10 +76500,10 @@ func _sqlite3ExprListFlags(tls *crt.TLS, _pList *XExprList) (r0 uint32) { } _i = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } - _2_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_i))).X0) + _2_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_i))).X0) func() { if _2_pExpr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92578), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListFlagsØ00__func__Ø000))), unsafe.Pointer(str(43636))) @@ -73265,7 +76512,7 @@ _1: }() { p := &_m - *p = (*p) | (_2_pExpr.X2) + *p = (*p) | _2_pExpr.X2 sink5(*p) } _i += 1 @@ -73281,13 +76528,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListFlagsØ00__func__Ø000[0], str(95145), 21) } -// Check that argument nHeight is less than or equal to the maximum -// expression depth allowed. If it is not, leave an error message in -// pParse. +// C comment +// /* +// ** Check that argument nHeight is less than or equal to the maximum +// ** expression depth allowed. If it is not, leave an error message in +// ** pParse. +// */ func _sqlite3ExprCheckHeight(tls *crt.TLS, _pParse *XParse, _nHeight int32) (r0 int32) { var _rc, _mxHeight int32 _rc = i32(0) - _mxHeight = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(3)))) + _mxHeight = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(3)))) if _nHeight > _mxHeight { _sqlite3ErrorMsg(tls, _pParse, str(95166), _mxHeight) _rc = i32(1) @@ -73295,30 +76545,33 @@ func _sqlite3ExprCheckHeight(tls *crt.TLS, _pParse *XParse, _nHeight int32) (r0 return _rc } -// Set the EP_FromJoin property on all terms of the given expression. -// And set the Expr.iRightJoinTable to iTable for every term in the -// expression. -// -// The EP_FromJoin property is used on terms of an expression to tell -// the LEFT OUTER JOIN processing logic that this term is part of the -// join restriction specified in the ON or USING clause and not a part -// of the more general WHERE clause. These terms are moved over to the -// WHERE clause during join processing but we need to remember that they -// originated in the ON or USING clause. -// -// The Expr.iRightJoinTable tells the WHERE clause processing that the -// expression depends on table iRightJoinTable even if that table is not -// explicitly mentioned in the expression. That information is needed -// for cases like this: -// -// SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5 -// -// The where clause needs to defer the handling of the t1.x=5 -// term until after the t2 loop of the join. In that way, a -// NULL t2 row will be inserted whenever t1.x!=5. If we do not -// defer the handling of t1.x=5, it will be processed immediately -// after the t1 loop and rows with t1.x!=5 will never appear in -// the output, which is incorrect. +// C comment +// /* +// ** Set the EP_FromJoin property on all terms of the given expression. +// ** And set the Expr.iRightJoinTable to iTable for every term in the +// ** expression. +// ** +// ** The EP_FromJoin property is used on terms of an expression to tell +// ** the LEFT OUTER JOIN processing logic that this term is part of the +// ** join restriction specified in the ON or USING clause and not a part +// ** of the more general WHERE clause. These terms are moved over to the +// ** WHERE clause during join processing but we need to remember that they +// ** originated in the ON or USING clause. +// ** +// ** The Expr.iRightJoinTable tells the WHERE clause processing that the +// ** expression depends on table iRightJoinTable even if that table is not +// ** explicitly mentioned in the expression. That information is needed +// ** for cases like this: +// ** +// ** SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5 +// ** +// ** The where clause needs to defer the handling of the t1.x=5 +// ** term until after the t2 loop of the join. In that way, a +// ** NULL t2 row will be inserted whenever t1.x!=5. If we do not +// ** defer the handling of t1.x=5, it will be processed immediately +// ** after the t1 loop and rows with t1.x!=5 will never appear in +// ** the output, which is incorrect. +// */ func _setJoinExpr(tls *crt.TLS, _p *XExpr, _iTable int32) { var _2_i int32 _0: @@ -73326,31 +76579,31 @@ _0: goto _1 } { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) *p = (*p) | uint32(i32(1)) sink5(*p) } func() { - if ((_p.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116896), unsafe.Pointer((*int8)(unsafe.Pointer(&_setJoinExprØ00__func__Ø000))), unsafe.Pointer(str(49429))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } - *(*int16)(unsafe.Pointer(&(_p.X11))) = int16(_iTable) - if int32(_p.X0) != i32(151) || (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) == nil { + *(*int16)(unsafe.Pointer(&_p.X11)) = int16(_iTable) + if int32(_p.X0) != i32(151) || (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) == nil { goto _5 } _2_i = i32(0) _6: - if _2_i >= ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X0) { + if _2_i >= ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X0) { goto _9 } - _setJoinExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2)))))+32*uintptr(_2_i))).X0), _iTable) + _setJoinExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X2)))))+32*uintptr(_2_i))).X0), _iTable) _2_i += 1 goto _6 _9: @@ -73367,17 +76620,20 @@ func init() { crt.Xstrncpy(nil, &_setJoinExprØ00__func__Ø000[0], str(95214), 12) } -// Subqueries stores the original database, table and column names for their -// result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN". -// Check to see if the zSpan given to this routine matches the zDb, zTab, -// and zCol. If any of zDb, zTab, and zCol are NULL then those fields will -// match anything. +// C comment +// /* +// ** Subqueries stores the original database, table and column names for their +// ** result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN". +// ** Check to see if the zSpan given to this routine matches the zDb, zTab, +// ** and zCol. If any of zDb, zTab, and zCol are NULL then those fields will +// ** match anything. +// */ func _sqlite3MatchSpanName(tls *crt.TLS, _zSpan *int8, _zCol *int8, _zTab *int8, _zDb *int8) (r0 int32) { var _n int32 _n = i32(0) _0: if func() int32 { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSpan)) + 1*uintptr(_n)))) != 0 { return i32(1) } return func() int32 { @@ -73385,24 +76641,24 @@ _0: crt.X__builtin_abort(tls) return i32(0) }() - }() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) == i32(46) { + }() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSpan)) + 1*uintptr(_n)))) == i32(46) { goto _6 } _n += 1 goto _0 _6: - if (_zDb != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zDb, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDb)) + 1*uintptr(_n)))) != i32(0))) { + if (_zDb != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zDb, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDb)) + 1*uintptr(_n)))) != i32(0))) { return i32(0) } { p := &_zSpan - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n+i32(1)))) sink0(*p) } _n = i32(0) _10: if func() int32 { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSpan)) + 1*uintptr(_n)))) != 0 { return i32(1) } return func() int32 { @@ -73410,18 +76666,18 @@ _10: crt.X__builtin_abort(tls) return i32(0) }() - }() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) == i32(46) { + }() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSpan)) + 1*uintptr(_n)))) == i32(46) { goto _16 } _n += 1 goto _10 _16: - if (_zTab != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zTab, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTab)) + 1*uintptr(_n)))) != i32(0))) { + if (_zTab != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zTab, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTab)) + 1*uintptr(_n)))) != i32(0))) { return i32(0) } { p := &_zSpan - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_n+i32(1)))) sink0(*p) } if (_zCol != nil) && (_sqlite3StrICmp(tls, _zSpan, _zCol) != i32(0)) { @@ -73436,8 +76692,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MatchSpanNameØ00__func__Ø000[0], str(95226), 21) } -// Return the index in pList of the identifier named zId. Return -1 -// if not found. +// C comment +// /* +// ** Return the index in pList of the identifier named zId. Return -1 +// ** if not found. +// */ func _sqlite3IdListIndex(tls *crt.TLS, _pList *XIdList, _zName *int8) (r0 int32) { var _i int32 if _pList == nil { @@ -73445,7 +76704,7 @@ func _sqlite3IdListIndex(tls *crt.TLS, _pList *XIdList, _zName *int8) (r0 int32) } _i = i32(0) _1: - if _i >= (_pList.X1) { + if _i >= _pList.X1 { goto _4 } if _sqlite3StrICmp(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0)+16*uintptr(_i))).X0, _zName) == i32(0) { @@ -73457,18 +76716,24 @@ _4: return i32(-1) } -// Generate a Token object from a string +// C comment +// /* +// ** Generate a Token object from a string +// */ func _sqlite3TokenInit(tls *crt.TLS, _p *XToken, _z *int8) { - *(**int8)(unsafe.Pointer(&(_p.X0))) = _z - *(*uint32)(unsafe.Pointer(&(_p.X1))) = uint32(_sqlite3Strlen30(tls, _z)) -} - -// Set the ExprList.a[].zName element of the most recently added item -// on the expression list. -// -// pList might be NULL following an OOM error. But pName should never be -// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag -// is set. + *(**int8)(unsafe.Pointer(&_p.X0)) = _z + *(*uint32)(unsafe.Pointer(&_p.X1)) = uint32(_sqlite3Strlen30(tls, _z)) +} + +// C comment +// /* +// ** Set the ExprList.a[].zName element of the most recently added item +// ** on the expression list. +// ** +// ** pList might be NULL following an OOM error. But pName should never be +// ** NULL. If a memory allocation fails, the pParse->db->mallocFailed flag +// ** is set. +// */ func _sqlite3ExprListSetName(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pName *XToken, _dequote int32) { var _1_pItem *TExprList_item func() { @@ -73481,19 +76746,19 @@ func _sqlite3ExprListSetName(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _ goto _3 } func() { - if (_pList.X0) <= i32(0) { + if _pList.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000))), unsafe.Pointer(str(21335))) crt.X__builtin_abort(tls) } }() - _1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr((_pList.X0)-i32(1)))) + _1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_pList.X0-i32(1)))) func() { - if (_1_pItem.X1) != nil { + if _1_pItem.X1 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92501), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000))), unsafe.Pointer(str(95287))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_1_pItem.X1))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_pParse.X0), _pName.X0, uint64(_pName.X1)) + *(**int8)(unsafe.Pointer(&_1_pItem.X1)) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_pParse.X0), _pName.X0, uint64(_pName.X1)) if _dequote != 0 { _sqlite3Dequote(tls, _1_pItem.X1) } @@ -73506,17 +76771,20 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListSetNameØ00__func__Ø000[0], str(95303), 23) } -// If the SELECT passed as the second argument has an associated WITH -// clause, pop it from the stack stored as part of the Parse object. -// -// This function is used as the xSelectCallback2() callback by -// sqlite3SelectExpand() when walking a SELECT tree to resolve table -// names and other FROM clause elements. +// C comment +// /* +// ** If the SELECT passed as the second argument has an associated WITH +// ** clause, pop it from the stack stored as part of the Parse object. +// ** +// ** This function is used as the xSelectCallback2() callback by +// ** sqlite3SelectExpand() when walking a SELECT tree to resolve table +// ** names and other FROM clause elements. +// */ func _selectPopWith(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) { var _1_pWith *XWith var _pParse *XParse _pParse = (*XParse)(_pWalker.X0) - if (*XWith)(_pParse.X70) == nil || (*XSelect)(_p.X13) != nil { + if _pParse.X70 == nil || (*XSelect)(_p.X13) != nil { goto _1 } _1_pWith = (*XWith)(_findRightmost(tls, _p).X17) @@ -73527,15 +76795,18 @@ func _selectPopWith(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) { crt.X__builtin_abort(tls) } }() - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = (*XWith)(_1_pWith.X1) + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X70)))) = (*XWith)(_1_pWith.X1) } _1: } -// Return a pointer to the right-most SELECT statement in a compound. +// C comment +// /* +// ** Return a pointer to the right-most SELECT statement in a compound. +// */ func _findRightmost(tls *crt.TLS, _p *XSelect) (r0 *XSelect) { _0: - if (*XSelect)(_p.X14) != nil { + if _p.X14 != nil { _p = (*XSelect)(_p.X14) goto _0 } @@ -73548,16 +76819,19 @@ func init() { crt.Xstrncpy(nil, &_selectPopWithØ00__func__Ø000[0], str(95347), 14) } -// Resolve all names in all expressions of a SELECT and in all -// decendents of the SELECT, including compounds off of p->pPrior, -// subqueries in expressions, and subqueries used as FROM clause -// terms. -// -// See sqlite3ResolveExprNames() for a description of the kinds of -// transformations that occur. -// -// All SELECT statements should have been expanded using -// sqlite3SelectExpand() prior to invoking this routine. +// C comment +// /* +// ** Resolve all names in all expressions of a SELECT and in all +// ** decendents of the SELECT, including compounds off of p->pPrior, +// ** subqueries in expressions, and subqueries used as FROM clause +// ** terms. +// ** +// ** See sqlite3ResolveExprNames() for a description of the kinds of +// ** transformations that occur. +// ** +// ** All SELECT statements should have been expanded using +// ** sqlite3SelectExpand() prior to invoking this routine. +// */ func _sqlite3ResolveSelectNames(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) { var _w XWalker func() { @@ -73566,11 +76840,11 @@ func _sqlite3ResolveSelectNames(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOu crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _resolveExprStep - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _resolveSelectStep - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pOuterNC + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _resolveExprStep + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _resolveSelectStep + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = _pParse + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = _pOuterNC _sqlite3WalkSelect(tls, &_w, _p) _ = _w } @@ -73581,15 +76855,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ResolveSelectNamesØ00__func__Ø000[0], str(95361), 26) } -// This routine is callback for sqlite3WalkExpr(). -// -// Resolve symbolic names into TK_COLUMN operators for the current -// node in the expression tree. Return 0 to continue the search down -// the tree or 2 to abort the tree walk. -// -// This routine also does error checking and name resolution for -// function names. The operator for aggregate functions is changed -// to TK_AGG_FUNCTION. +// C comment +// /* +// ** This routine is callback for sqlite3WalkExpr(). +// ** +// ** Resolve symbolic names into TK_COLUMN operators for the current +// ** node in the expression tree. Return 0 to continue the search down +// ** the tree or 2 to abort the tree walk. +// ** +// ** This routine also does error checking and name resolution for +// ** function names. The operator for aggregate functions is changed +// ** to TK_AGG_FUNCTION. +// */ func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _1_i, _9_n, _9_no_such_func, _9_wrong_num_args, _9_is_agg, _9_nId, _18_auth, _30_nRef, _33_nLeft, _33_nRight int32 var _4_zColumn, _4_zTable, _4_zDb, _9_zId *int8 @@ -73600,7 +76877,7 @@ func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) var _4_pRight *XExpr var _pParse *XParse var _pNC, _26_pNC2 *XNameContext - _pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) func() { if _pNC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89925), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95387))) @@ -73614,15 +76891,15 @@ func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) crt.X__builtin_abort(tls) } }() - if ((_pExpr.X2) & uint32(i32(4))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(4))) != uint32(i32(0)) { return i32(1) } { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(4)) sink5(*p) } - if (*XSrcList)(_pNC.X1) == nil || ((*XSrcList)(_pNC.X1).X1) <= uint32(i32(0)) { + if _pNC.X1 == nil || ((*XSrcList)(_pNC.X1).X1) <= uint32(i32(0)) { goto _6 } _1_pSrcList = (*XSrcList)(_pNC.X1) @@ -73632,7 +76909,7 @@ _7: goto _10 } func() { - if ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrcList.X2)))))+112*uintptr(_1_i))).X11) < i32(0) || ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrcList.X2)))))+112*uintptr(_1_i))).X11) >= (_pParse.X17) { + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_1_pSrcList.X2))))+112*uintptr(_1_i))).X11) < i32(0) || ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_1_pSrcList.X2))))+112*uintptr(_1_i))).X11) >= _pParse.X17 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89936), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95418))) crt.X__builtin_abort(tls) } @@ -73682,7 +76959,7 @@ _15: if int32(_pExpr.X0) == i32(27) { _4_zDb = nil _4_zTable = nil - _4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) goto _33 } _notValid(tls, _pParse, _pNC, str(95483), i32(32)) @@ -73690,7 +76967,7 @@ _15: if int32(_4_pRight.X0) == i32(27) { _4_zDb = nil _4_zTable = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X3))))) - _4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pRight.X3))))) + _4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_4_pRight.X3)))) goto _35 } func() { @@ -73707,10 +76984,10 @@ _33: return _lookupName(tls, _pParse, _4_zDb, _4_zTable, _4_zColumn, _pNC, _pExpr) _17: - _9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _9_n = func() int32 { if _9_pList != nil { - return (_9_pList.X0) + return _9_pList.X0 } return i32(0) }() @@ -73719,12 +76996,12 @@ _17: _9_is_agg = i32(0) _9_enc = (*Xsqlite3)(_pParse.X0).X14 func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90011), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() - _9_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _9_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) _9_nId = _sqlite3Strlen30(tls, _9_zId) _9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), _9_zId, _9_n, _9_enc, uint8(i32(0))) if _9_pDef != nil { @@ -73741,31 +77018,32 @@ _44: _42: _9_is_agg = bool2int(*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context) - }{(*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{(_9_pDef.X5)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_context) { + v := _9_pDef.X5 + return *(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_context) }{nil}))) if (int32(_9_pDef.X1) & i32(1024)) == 0 { goto _46 } { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(266240)) sink5(*p) } if _9_n != i32(2) { goto _47 } - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _exprProbability(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pList.X2)))))+32*uintptr(i32(1)))).X0)) - if (_pExpr.X8) < i32(0) { + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _exprProbability(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pList.X2))))+32*uintptr(i32(1)))).X0)) + if _pExpr.X8 < i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(95519)) - *(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1 + *(*int32)(unsafe.Pointer(&_pNC.X6)) += 1 } goto _49 _47: - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = func() int32 { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_9_pDef.X6)) + 1*uintptr(i32(0))))) == i32(117) { + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = func() int32 { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_9_pDef.X6)) + 1*uintptr(i32(0))))) == i32(117) { return i32(8388608) } return i32(125829120) @@ -73778,15 +77056,15 @@ _46: } if _18_auth == i32(1) { _sqlite3ErrorMsg(tls, _pParse, str(95590), unsafe.Pointer(_9_pDef.X6)) - *(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1 + *(*int32)(unsafe.Pointer(&_pNC.X6)) += 1 } - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(101)) return i32(1) _52: if (int32(_9_pDef.X1) & i32(10240)) != 0 { { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(524288)) sink5(*p) } @@ -73797,23 +77075,23 @@ _52: _45: if _9_is_agg != 0 && ((int32(_pNC.X7) & i32(1)) == i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(95653), _9_nId, unsafe.Pointer(_9_zId)) - *(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1 + *(*int32)(unsafe.Pointer(&_pNC.X6)) += 1 _9_is_agg = i32(0) goto _62 } if _9_no_such_func != 0 && (int32((*t21)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X33))).X2) == i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(95689), _9_nId, unsafe.Pointer(_9_zId)) - *(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1 + *(*int32)(unsafe.Pointer(&_pNC.X6)) += 1 goto _62 } if _9_wrong_num_args != 0 { _sqlite3ErrorMsg(tls, _pParse, str(95712), _9_nId, unsafe.Pointer(_9_zId)) - *(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1 + *(*int32)(unsafe.Pointer(&_pNC.X6)) += 1 } _62: if _9_is_agg != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pNC.X7))) + p := (*uint16)(unsafe.Pointer(&_pNC.X7)) *p = uint16(int32(*p) & i32(-2)) sink14(*p) } @@ -73823,11 +77101,11 @@ _62: goto _64 } _26_pNC2 = _pNC - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(153)) - *(*uint8)(unsafe.Pointer(&(_pExpr.X12))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(153)) + *(*uint8)(unsafe.Pointer(&_pExpr.X12)) = uint8(i32(0)) _65: if (_26_pNC2 != nil) && (_sqlite3FunctionUsesThisSrc(tls, _pExpr, (*XSrcList)(_26_pNC2.X1)) == 0) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X12))) += 1 + *(*uint8)(unsafe.Pointer(&_pExpr.X12)) += 1 _26_pNC2 = (*XNameContext)(_26_pNC2.X4) goto _65 } @@ -73840,13 +77118,13 @@ _65: if _26_pNC2 != nil { i32(0) { - p := (*uint16)(unsafe.Pointer(&(_26_pNC2.X7))) + p := (*uint16)(unsafe.Pointer(&_26_pNC2.X7)) *p = uint16(int32(*p) | (i32(16) | (int32(_9_pDef.X1) & i32(4096)))) sink14(*p) } } { - p := (*uint16)(unsafe.Pointer(&(_pNC.X7))) + p := (*uint16)(unsafe.Pointer(&_pNC.X7)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } @@ -73854,26 +77132,26 @@ _64: return i32(1) _18: - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { goto _71 } _30_nRef = _pNC.X5 _notValid(tls, _pParse, _pNC, str(95765), i32(38)) - _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) + _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) func() { - if (_pNC.X5) < _30_nRef { + if _pNC.X5 < _30_nRef { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90125), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95776))) crt.X__builtin_abort(tls) } }() - if _30_nRef != (_pNC.X5) { + if _30_nRef != _pNC.X5 { { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(32)) sink5(*p) } { - p := (*uint16)(unsafe.Pointer(&(_pNC.X7))) + p := (*uint16)(unsafe.Pointer(&_pNC.X7)) *p = uint16(int32(*p) | i32(64)) sink14(*p) } @@ -73897,9 +77175,9 @@ _22: if int32(_pExpr.X0) != i32(73) { goto _78 } - _33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2)))))+32*uintptr(i32(0)))).X0)) + _33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2)))))+32*uintptr(i32(0)))).X0)) if _33_nRight == _33_nLeft { - _33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2)))))+32*uintptr(i32(1)))).X0)) + _33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2)))))+32*uintptr(i32(1)))).X0)) } goto _80 _78: @@ -73917,7 +77195,7 @@ _80: goto _31 _31: return func() int32 { - if (_pParse.X16) != 0 || (((*Xsqlite3)(_pParse.X0).X17) != 0) { + if _pParse.X16 != 0 || (((*Xsqlite3)(_pParse.X0).X17) != 0) { return i32(2) } return i32(0) @@ -73930,8 +77208,11 @@ func init() { crt.Xstrncpy(nil, &_resolveExprStepØ00__func__Ø000[0], str(95836), 16) } -// Report an error that an expression is not valid for some set of -// pNC->ncFlags values determined by validMask. +// C comment +// /* +// ** Report an error that an expression is not valid for some set of +// ** pNC->ncFlags values determined by validMask. +// */ func _notValid(tls *crt.TLS, _pParse *XParse, _pNC *XNameContext, _zMsg *int8, _validMask int32) { var _1_zIn *int8 func() { @@ -73962,31 +77243,34 @@ func init() { crt.Xstrncpy(nil, &_notValidØ00__func__Ø000[0], str(95987), 9) } -// Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up -// that name in the set of source tables in pSrcList and make the pExpr -// expression node refer back to that source column. The following changes -// are made to pExpr: -// -// pExpr->iDb Set the index in db->aDb[] of the database X -// (even if X is implied). -// pExpr->iTable Set to the cursor number for the table obtained -// from pSrcList. -// pExpr->pTab Points to the Table structure of X.Y (even if -// X and/or Y are implied.) -// pExpr->iColumn Set to the column number within the table. -// pExpr->op Set to TK_COLUMN. -// pExpr->pLeft Any expression this points to is deleted -// pExpr->pRight Any expression this points to is deleted. -// -// The zDb variable is the name of the database (the "X"). This value may be -// NULL meaning that name is of the form Y.Z or Z. Any available database -// can be used. The zTable variable is the name of the table (the "Y"). This -// value can be NULL if zDb is also NULL. If zTable is NULL it -// means that the form of the name is Z and that columns from any table -// can be used. -// -// If the name cannot be resolved unambiguously, leave an error message -// in pParse and return WRC_Abort. Return WRC_Prune on success. +// C comment +// /* +// ** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up +// ** that name in the set of source tables in pSrcList and make the pExpr +// ** expression node refer back to that source column. The following changes +// ** are made to pExpr: +// ** +// ** pExpr->iDb Set the index in db->aDb[] of the database X +// ** (even if X is implied). +// ** pExpr->iTable Set to the cursor number for the table obtained +// ** from pSrcList. +// ** pExpr->pTab Points to the Table structure of X.Y (even if +// ** X and/or Y are implied.) +// ** pExpr->iColumn Set to the column number within the table. +// ** pExpr->op Set to TK_COLUMN. +// ** pExpr->pLeft Any expression this points to is deleted +// ** pExpr->pRight Any expression this points to is deleted. +// ** +// ** The zDb variable is the name of the database (the "X"). This value may be +// ** NULL meaning that name is of the form Y.Z or Z. Any available database +// ** can be used. The zTable variable is the name of the table (the "Y"). This +// ** value can be NULL if zDb is also NULL. If zTable is NULL it +// ** means that the form of the name is Z and that columns from any table +// ** can be used. +// ** +// ** If the name cannot be resolved unambiguously, leave an error message +// ** in pParse and return WRC_Abort. Return WRC_Prune on success. +// */ func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol *int8, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) { var _i, _j, _cnt, _cntTab, _nSubquery, _isTrigger, _9_hit, _21_op, _25_iCol, _45_n int32 var _13_zTabName, _36_zAs, _41_zErr *int8 @@ -74021,15 +77305,15 @@ func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol * } }() func() { - if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89550), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96005))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(-1) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = i32(-1) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = nil { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } @@ -74042,7 +77326,7 @@ func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol * } _i = i32(0) _9: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _12 } func() { @@ -74071,14 +77355,14 @@ _19: if _6_pSrcList == nil { goto _20 } - *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_6_pSrcList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_6_pSrcList.X2)))) _21: - if _i >= (_6_pSrcList.X0) { + if _i >= _6_pSrcList.X0 { goto _24 } _pTab = (*XTable)(_pItem.X4) func() { - if _pTab == nil || (_pTab.X0) == nil { + if _pTab == nil || _pTab.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89590), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96088))) crt.X__builtin_abort(tls) } @@ -74089,21 +77373,21 @@ _21: crt.X__builtin_abort(tls) } }() - if (*XSelect)(_pItem.X5) == nil || (((*XSelect)(_pItem.X5).X3)&uint32(i32(2048))) == uint32(i32(0)) { + if _pItem.X5 == nil || (((*XSelect)(_pItem.X5).X3)&uint32(i32(2048))) == uint32(i32(0)) { goto _31 } _9_hit = i32(0) _6_pEList = (*XExprList)((*XSelect)(_pItem.X5).X0) _j = i32(0) _32: - if _j >= (_6_pEList.X0) { + if _j >= _6_pEList.X0 { goto _35 } - if _sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2)))))+32*uintptr(_j))).X2, _zCol, _zTab, _zDb) != 0 { + if _sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pEList.X2))))+32*uintptr(_j))).X2, _zCol, _zTab, _zDb) != 0 { _cnt += 1 _cntTab = i32(2) _pMatch = _pItem - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_j) + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = int16(_j) _9_hit = i32(1) } _j += 1 @@ -74120,10 +77404,10 @@ _31: goto _41 } _13_zTabName = func() *int8 { - if (_pItem.X3) != nil { - return (_pItem.X3) + if _pItem.X3 != nil { + return _pItem.X3 } - return (_pTab.X0) + return _pTab.X0 }() func() { if _13_zTabName == nil { @@ -74135,7 +77419,7 @@ _31: goto _22 } _41: - if i32(0) == postInc1(&_cntTab, int32(1)) { + if i32(0) == postInc1(&_cntTab, 1) { _pMatch = _pItem } *func() **XColumn { _j = i32(0); return &_pCol }() = (*XColumn)(_pTab.X1) @@ -74149,7 +77433,7 @@ _48: if _cnt != i32(1) { goto _53 } - if (int32((*t28)(unsafe.Pointer(&(_pItem.X9))).X0) & i32(4)) != 0 { + if (int32((*t28)(unsafe.Pointer(&_pItem.X9)).X0) & i32(4)) != 0 { goto _49 } if _nameInUsingClause(tls, (*XIdList)(_pItem.X13), _zCol) != 0 { @@ -74158,7 +77442,7 @@ _48: _53: _cnt += 1 _pMatch = _pItem - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(func() int32 { + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = int16(func() int32 { if _j == int32(_pTab.X10) { return i32(-1) } @@ -74177,17 +77461,17 @@ _24: if _pMatch == nil { goto _58 } - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pMatch.X11 - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = (*XTable)(_pMatch.X4) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _pMatch.X11 + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = (*XTable)(_pMatch.X4) func() { - if (int32((*t28)(unsafe.Pointer(&(_pMatch.X9))).X0) & i32(16)) != i32(0) { + if (int32((*t28)(unsafe.Pointer(&_pMatch.X9)).X0) & i32(16)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89641), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96139))) crt.X__builtin_abort(tls) } }() - if (int32((*t28)(unsafe.Pointer(&(_pMatch.X9))).X0) & i32(8)) != i32(0) { + if (int32((*t28)(unsafe.Pointer(&_pMatch.X9)).X0) & i32(8)) != i32(0) { { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(1048576)) sink5(*p) } @@ -74206,12 +77490,12 @@ _20: } }() if (_21_op != i32(109)) && (_sqlite3StrICmp(tls, str(43173), _zTab) == i32(0)) { - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(1) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = i32(1) _pTab = (*XTable)(_pParse.X40) goto _75 } if (_21_op != i32(108)) && (_sqlite3StrICmp(tls, str(43177), _zTab) == i32(0)) { - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(0) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = i32(0) _pTab = (*XTable)(_pParse.X40) goto _75 } @@ -74238,7 +77522,7 @@ _81: *(*uintptr)(unsafe.Pointer(func() **XColumn { _25_iCol += 1; return &_pCol }())) += uintptr(32) goto _77 _80: - if ((_25_iCol >= int32(_pTab.X11)) && _sqlite3IsRowid(tls, _zCol) != 0) && (((_pTab.X9) & uint32(i32(64))) == uint32(i32(0))) { + if ((_25_iCol >= int32(_pTab.X11)) && _sqlite3IsRowid(tls, _zCol) != 0) && ((_pTab.X9 & uint32(i32(64))) == uint32(i32(0))) { _25_iCol = i32(-1) } if _25_iCol >= int32(_pTab.X11) { @@ -74246,12 +77530,12 @@ _80: } _cnt += 1 if _25_iCol < i32(0) { - *(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68)) + *(*int8)(unsafe.Pointer(&_pExpr.X1)) = int8(i32(68)) goto _92 } - if (_pExpr.X8) == i32(0) { + if _pExpr.X8 == i32(0) { { - p := (*uint32)(unsafe.Pointer(&(_pParse.X43))) + p := (*uint32)(unsafe.Pointer(&_pParse.X43)) *p = (*p) | func() uint32 { if _25_iCol >= i32(32) { return u32(4294967295) @@ -74263,7 +77547,7 @@ _80: goto _92 } { - p := (*uint32)(unsafe.Pointer(&(_pParse.X44))) + p := (*uint32)(unsafe.Pointer(&_pParse.X44)) *p = (*p) | func() uint32 { if _25_iCol >= i32(32) { return u32(4294967295) @@ -74273,26 +77557,26 @@ _80: sink5(*p) } _92: - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_25_iCol) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = _pTab + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = int16(_25_iCol) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = _pTab _isTrigger = i32(1) _86: _76: _65: if (((((_cnt == i32(0)) && (_cntTab == i32(1))) && (_pMatch != nil)) && ((int32(_pNC.X7) & i32(32)) == i32(0))) && _sqlite3IsRowid(tls, _zCol) != 0) && ((((*XTable)(_pMatch.X4).X9) & uint32(i32(64))) == uint32(i32(0))) { _cnt = i32(1) - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(i32(-1)) - *(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68)) + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = int16(i32(-1)) + *(*int8)(unsafe.Pointer(&_pExpr.X1)) = int8(i32(68)) } if store42(&_6_pEList, (*XExprList)(_pNC.X2)) == nil || _zTab != nil || _cnt != i32(0) { goto _103 } _j = i32(0) _104: - if _j >= (_6_pEList.X0) { + if _j >= _6_pEList.X0 { goto _107 } - _36_zAs = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2))))) + 32*uintptr(_j))).X1 + _36_zAs = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pEList.X2)))) + 32*uintptr(_j))).X1 if _36_zAs == nil || _sqlite3StrICmp(tls, _36_zAs, _zCol) != i32(0) { goto _109 } @@ -74303,19 +77587,19 @@ _104: } }() func() { - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil { + if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89745), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96259))) crt.X__builtin_abort(tls) } }() func() { - if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil { + if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89746), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96277))) crt.X__builtin_abort(tls) } }() - _37_pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2))))) + 32*uintptr(_j))).X0) - if ((int32(_pNC.X7) & i32(1)) == i32(0)) && (((_37_pOrig.X2) & uint32(i32(2))) != uint32(i32(0))) { + _37_pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pEList.X2)))) + 32*uintptr(_j))).X0) + if ((int32(_pNC.X7) & i32(1)) == i32(0)) && ((_37_pOrig.X2 & uint32(i32(2))) != uint32(i32(0))) { _sqlite3ErrorMsg(tls, _pParse, str(96297), unsafe.Pointer(_36_zAs)) return i32(2) } @@ -74347,9 +77631,9 @@ _103: goto _19 } _124: - if ((_cnt == i32(0)) && (_zTab == nil)) && (((_pExpr.X2) & uint32(i32(64))) != uint32(i32(0))) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(97)) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil + if ((_cnt == i32(0)) && (_zTab == nil)) && ((_pExpr.X2 & uint32(i32(64))) != uint32(i32(0))) { + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(97)) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = nil return i32(1) } if _cnt == i32(1) { @@ -74371,8 +77655,8 @@ _124: } _sqlite3ErrorMsg(tls, _pParse, str(49832), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zCol)) _134: - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_pTopNC.X6))) += 1 + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pTopNC.X6)) += 1 _128: if int32(_pExpr.X9) < i32(0) || _pMatch == nil { goto _136 @@ -74382,22 +77666,22 @@ _128: _45_n = i32(63) } func() { - if (_pMatch.X11) != (_pExpr.X8) { + if _pMatch.X11 != _pExpr.X8 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89820), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96396))) crt.X__builtin_abort(tls) } }() { - p := (*uint64)(unsafe.Pointer(&(_pMatch.X14))) + p := (*uint64)(unsafe.Pointer(&_pMatch.X14)) *p = (*p) | (u64(1) << uint(_45_n)) sink17(*p) } _136: _sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.X4)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X4)))) = nil _sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.X5)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = nil - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(func() int32 { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X5)))) = nil + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(func() int32 { if _isTrigger != 0 { return i32(61) } @@ -74413,7 +77697,7 @@ _lookupname_end: crt.X__builtin_abort(tls) } }() - if ((_pExpr.X2) & uint32(i32(4194304))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(4194304))) == uint32(i32(0)) { _sqlite3AuthRead(tls, _pParse, _pExpr, _pSchema, (*XSrcList)(_pNC.X1)) } _145: @@ -74423,7 +77707,7 @@ _145: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pTopNC.X5))) += 1 + *(*int32)(unsafe.Pointer(&_pTopNC.X5)) += 1 if _pTopNC == _pNC { goto _148 } @@ -74442,10 +77726,13 @@ func init() { crt.Xstrncpy(nil, &_lookupNameØ00__func__Ø000[0], str(96437), 11) } -// Return TRUE if the name zCol occurs anywhere in the USING clause. -// -// Return FALSE if the USING clause is NULL or if it does not contain -// zCol. +// C comment +// /* +// ** Return TRUE if the name zCol occurs anywhere in the USING clause. +// ** +// ** Return FALSE if the USING clause is NULL or if it does not contain +// ** zCol. +// */ func _nameInUsingClause(tls *crt.TLS, _pUsing *XIdList, _zCol *int8) (r0 int32) { var _1_k int32 if _pUsing == nil { @@ -74453,7 +77740,7 @@ func _nameInUsingClause(tls *crt.TLS, _pUsing *XIdList, _zCol *int8) (r0 int32) } _1_k = i32(0) _1: - if _1_k >= (_pUsing.X1) { + if _1_k >= _pUsing.X1 { goto _4 } if _sqlite3StrICmp(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pUsing.X0)+16*uintptr(_1_k))).X0, _zCol) == i32(0) { @@ -74466,7 +77753,10 @@ _0: return i32(0) } -// Return TRUE if the given string is a row-id column name. +// C comment +// /* +// ** Return TRUE if the given string is a row-id column name. +// */ func _sqlite3IsRowid(tls *crt.TLS, _z *int8) (r0 int32) { if _sqlite3StrICmp(tls, _z, str(96448)) == i32(0) { return i32(1) @@ -74480,33 +77770,36 @@ func _sqlite3IsRowid(tls *crt.TLS, _z *int8) (r0 int32) { return i32(0) } -// Turn the pExpr expression into an alias for the iCol-th column of the -// result set in pEList. -// -// If the reference is followed by a COLLATE operator, then make sure -// the COLLATE operator is preserved. For example: -// -// SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase; -// -// Should be transformed into: -// -// SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase; -// -// The nSubquery parameter specifies how many levels of subquery the -// alias is removed from the original expression. The usual value is -// zero but it might be more if the alias is contained within a subquery -// of the original expression. The Expr.op2 field of TK_AGG_FUNCTION -// structures must be increased by the nSubquery amount. +// C comment +// /* +// ** Turn the pExpr expression into an alias for the iCol-th column of the +// ** result set in pEList. +// ** +// ** If the reference is followed by a COLLATE operator, then make sure +// ** the COLLATE operator is preserved. For example: +// ** +// ** SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase; +// ** +// ** Should be transformed into: +// ** +// ** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase; +// ** +// ** The nSubquery parameter specifies how many levels of subquery the +// ** alias is removed from the original expression. The usual value is +// ** zero but it might be more if the alias is contained within a subquery +// ** of the original expression. The Expr.op2 field of TK_AGG_FUNCTION +// ** structures must be increased by the nSubquery amount. +// */ func _resolveAlias(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _iCol int32, _pExpr *XExpr, _zType *int8, _nSubquery int32) { var _db *Xsqlite3 var _pOrig, _pDup *XExpr func() { - if _iCol < i32(0) || _iCol >= (_pEList.X0) { + if _iCol < i32(0) || _iCol >= _pEList.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89423), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96466))) crt.X__builtin_abort(tls) } }() - _pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_iCol))).X0) + _pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_iCol))).X0) func() { if _pOrig == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89425), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96496))) @@ -74518,39 +77811,39 @@ func _resolveAlias(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _iCol int3 if _pDup == nil { return } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(i32(0))))) != i32(71) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zType)) + 1*uintptr(i32(0))))) != i32(71) { _incrAggFunctionDepth(tls, _pDup, _nSubquery) } if int32(_pExpr.X0) == i32(94) { - _pDup = _sqlite3ExprAddCollateString(tls, _pParse, _pDup, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) + _pDup = _sqlite3ExprAddCollateString(tls, _pParse, _pDup, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) } { - p := (*uint32)(unsafe.Pointer(&(_pDup.X2))) + p := (*uint32)(unsafe.Pointer(&_pDup.X2)) *p = (*p) | uint32(i32(4194304)) sink5(*p) } { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(32768)) sink5(*p) } _sqlite3ExprDelete(tls, _db, _pExpr) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pExpr), (unsafe.Pointer)(_pDup), u64(72)) - if (((_pExpr.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) != nil) { + crt.Xmemcpy(tls, unsafe.Pointer(_pExpr), unsafe.Pointer(_pDup), u64(72)) + if ((_pExpr.X2 & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) != nil) { func() { - if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89446), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96505))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) + *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3))))) { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(65536)) sink5(*p) } } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pDup)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pDup)) } var _resolveAliasØ00__func__Ø000 [13]int8 @@ -74562,26 +77855,29 @@ func init() { func _incrAggFunctionDepth(tls *crt.TLS, _pExpr *XExpr, _N int32) { var _1_w XWalker if _N > i32(0) { - crt.Xmemset(tls, (unsafe.Pointer)(&_1_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_w.X1))))) = _incrAggDepth - *(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_1_w.X6))))) = _N + crt.Xmemset(tls, unsafe.Pointer(&_1_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_1_w.X1)))) = _incrAggDepth + *(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_1_w.X6)))) = _N _sqlite3WalkExpr(tls, &_1_w, _pExpr) } _ = _1_w } -// Walk the expression tree pExpr and increase the aggregate function -// depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node. -// This needs to occur when copying a TK_AGG_FUNCTION node from an -// outer query into an inner subquery. -// -// incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..) -// is a helper function - a callback for the tree walker. +// C comment +// /* +// ** Walk the expression tree pExpr and increase the aggregate function +// ** depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node. +// ** This needs to occur when copying a TK_AGG_FUNCTION node from an +// ** outer query into an inner subquery. +// ** +// ** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..) +// ** is a helper function - a callback for the tree walker. +// */ func _incrAggDepth(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { if int32(_pExpr.X0) == i32(153) { { - p := (*uint8)(unsafe.Pointer(&(_pExpr.X12))) - *p = uint8(int32(*p) + (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))) + p := (*uint8)(unsafe.Pointer(&_pExpr.X12)) + *p = uint8(int32(*p) + (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6)))))) sink2(*p) } } @@ -74609,22 +77905,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprAddCollateStringØ00__func__Ø000[0], str(96570), 28) } -// Set the collating sequence for expression pExpr to be the collating -// sequence named by pToken. Return a pointer to a new Expr node that -// implements the COLLATE operator. -// -// If a memory allocation error occurs, that fact is recorded in pParse->db -// and the pExpr parameter is returned unchanged. +// C comment +// /* +// ** Set the collating sequence for expression pExpr to be the collating +// ** sequence named by pToken. Return a pointer to a new Expr node that +// ** implements the COLLATE operator. +// ** +// ** If a memory allocation error occurs, that fact is recorded in pParse->db +// ** and the pExpr parameter is returned unchanged. +// */ func _sqlite3ExprAddCollateToken(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pCollName *XToken, _dequote int32) (r0 *XExpr) { var _1_pNew *XExpr - if (_pCollName.X1) <= uint32(i32(0)) { + if _pCollName.X1 <= uint32(i32(0)) { goto _0 } _1_pNew = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(94), _pCollName, _dequote) if _1_pNew != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X4))))) = _pExpr + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pNew.X4)))) = _pExpr { - p := (*uint32)(unsafe.Pointer(&(_1_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_1_pNew.X2)) *p = (*p) | uint32(i32(4352)) sink5(*p) } @@ -74634,13 +77933,16 @@ _0: return _pExpr } -// The pExpr should be a TK_COLUMN expression. The table referred to -// is in pTabList or else it is the NEW or OLD table of a trigger. -// Check to see if it is OK to read this particular column. -// -// If the auth function returns SQLITE_IGNORE, change the TK_COLUMN -// instruction into a TK_NULL. If the auth function returns SQLITE_DENY, -// then generate an error. +// C comment +// /* +// ** The pExpr should be a TK_COLUMN expression. The table referred to +// ** is in pTabList or else it is the NEW or OLD table of a trigger. +// ** Check to see if it is OK to read this particular column. +// ** +// ** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN +// ** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, +// ** then generate an error. +// */ func _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XSchema, _pTabList *XSrcList) { var _iSrc, _iDb, _iCol int32 var _zCol *int8 @@ -74650,7 +77952,7 @@ func _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XS _pTab = nil if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32 - }{(_db.X59)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{_db.X59})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32 }{nil})) { return @@ -74678,7 +77980,7 @@ func _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XS _iSrc = i32(0) _9: if func() int32 { - if _iSrc < (_pTabList.X0) { + if _iSrc < _pTabList.X0 { return i32(1) } return func() int32 { @@ -74689,8 +77991,8 @@ _9: }() == 0 { goto _14 } - if (_pExpr.X8) == ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_iSrc))).X11) { - _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_iSrc))).X4) + if _pExpr.X8 == ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_iSrc))).X11) { + _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_iSrc))).X4) goto _14 } _iSrc += 1 @@ -74733,13 +78035,13 @@ _6: _zCol = str(96456) _26: func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99607), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } }() if i32(2) == _sqlite3AuthReadCol(tls, _pParse, _pTab.X0, _zCol, _iDb) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(101)) } } @@ -74749,33 +78051,36 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AuthReadØ00__func__Ø000[0], str(96676), 16) } -// Invoke the authorization callback for permission to read column zCol from -// table zTab in database zDb. This function assumes that an authorization -// callback has been registered (i.e. that sqlite3.xAuth is not NULL). -// -// If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed -// to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE -// is treated as SQLITE_DENY. In this case an error is left in pParse. +// C comment +// /* +// ** Invoke the authorization callback for permission to read column zCol from +// ** table zTab in database zDb. This function assumes that an authorization +// ** callback has been registered (i.e. that sqlite3.xAuth is not NULL). +// ** +// ** If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed +// ** to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE +// ** is treated as SQLITE_DENY. In this case an error is left in pParse. +// */ func _sqlite3AuthReadCol(tls *crt.TLS, _pParse *XParse, _zTab *int8, _zCol *int8, _iDb int32) (r0 int32) { var _rc int32 var _zDb *int8 var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) _zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { return i32(0) } - _rc = (_db.X59)(tls, _db.X60, i32(20), _zTab, _zCol, _zDb, _pParse.X65) + _rc = _db.X59(tls, _db.X60, i32(20), _zTab, _zCol, _zDb, _pParse.X65) if _rc != i32(1) { goto _1 } - if ((_db.X5) > i32(2)) || (_iDb != i32(0)) { + if (_db.X5 > i32(2)) || (_iDb != i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(96692), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol)) goto _4 } _sqlite3ErrorMsg(tls, _pParse, str(96725), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol)) _4: - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(23) + *(*int32)(unsafe.Pointer(&_pParse.X3)) = i32(23) goto _7 _1: if (_rc != i32(2)) && (_rc != i32(0)) { @@ -74785,16 +78090,19 @@ _7: return _rc } -// Expression p should encode a floating point value between 1.0 and 0.0. -// Return 1024 times this value. Or return -1 if p is not a floating point -// value between 1.0 and 0.0. +// C comment +// /* +// ** Expression p should encode a floating point value between 1.0 and 0.0. +// ** Return 1024 times this value. Or return -1 if p is not a floating point +// ** value between 1.0 and 0.0. +// */ func _exprProbability(tls *crt.TLS, _p *XExpr) (r0 int32) { var _r float64 _r = -1 if int32(_p.X0) != i32(132) { return i32(-1) } - _sqlite3AtoF(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))), &_r, _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), uint8(i32(1))) + _sqlite3AtoF(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))), &_r, _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))), uint8(i32(1))) func() { if _r < float64(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89904), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprProbabilityØ00__func__Ø000))), unsafe.Pointer(str(96755))) @@ -74813,10 +78121,13 @@ func init() { crt.Xstrncpy(nil, &_exprProbabilityØ00__func__Ø000[0], str(96762), 16) } -// Determine if any of the arguments to the pExpr Function reference -// pSrcList. Return true if they do. Also return true if the function -// has no arguments or has only constant arguments. Return false if pExpr -// references columns but not columns of tables found in pSrcList. +// C comment +// /* +// ** Determine if any of the arguments to the pExpr Function reference +// ** pSrcList. Return true if they do. Also return true if the function +// ** has no arguments or has only constant arguments. Return false if pExpr +// ** references columns but not columns of tables found in pSrcList. +// */ func _sqlite3FunctionUsesThisSrc(tls *crt.TLS, _pExpr *XExpr, _pSrcList *XSrcList) (r0 int32) { var _w XWalker var _cnt TSrcCount @@ -74826,14 +78137,14 @@ func _sqlite3FunctionUsesThisSrc(tls *crt.TLS, _pExpr *XExpr, _pSrcList *XSrcLis crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprSrcCount - *(**TSrcCount)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_cnt - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_cnt.X0))))) = _pSrcList - *(*int32)(unsafe.Pointer(&(_cnt.X1))) = i32(0) - *(*int32)(unsafe.Pointer(&(_cnt.X2))) = i32(0) - _sqlite3WalkExprList(tls, &_w, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) - return bool2int(((_cnt.X1) > i32(0)) || ((_cnt.X2) == i32(0))) + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _exprSrcCount + *(**TSrcCount)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = &_cnt + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_cnt.X0)))) = _pSrcList + *(*int32)(unsafe.Pointer(&_cnt.X1)) = i32(0) + *(*int32)(unsafe.Pointer(&_cnt.X2)) = i32(0) + _sqlite3WalkExprList(tls, &_w, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) + return bool2int((_cnt.X1 > i32(0)) || (_cnt.X2 == i32(0))) _ = _w _ = _cnt @@ -74846,7 +78157,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FunctionUsesThisSrcØ00__func__Ø000[0], str(96805), 27) } -// Count the number of references to columns. +// C comment +// /* +// ** Count the number of references to columns. +// */ func _exprSrcCount(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _1_i, _1_nSrc int32 var _1_pSrc *XSrcList @@ -74863,11 +78177,11 @@ func _exprSrcCount(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { }() == 0 { goto _3 } - _1_p = (*TSrcCount)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _1_p = (*TSrcCount)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) _1_pSrc = (*XSrcList)(_1_p.X0) _1_nSrc = func() int32 { if _1_pSrc != nil { - return (_1_pSrc.X0) + return _1_pSrc.X0 } return i32(0) }() @@ -74876,17 +78190,17 @@ _6: if _1_i >= _1_nSrc { goto _9 } - if (_pExpr.X8) == ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2))))) + 112*uintptr(_1_i))).X11) { + if _pExpr.X8 == ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_1_pSrc.X2)))) + 112*uintptr(_1_i))).X11) { goto _9 } _1_i += 1 goto _6 _9: if _1_i < _1_nSrc { - *(*int32)(unsafe.Pointer(&(_1_p.X1))) += 1 + *(*int32)(unsafe.Pointer(&_1_p.X1)) += 1 goto _12 } - *(*int32)(unsafe.Pointer(&(_1_p.X2))) += 1 + *(*int32)(unsafe.Pointer(&_1_p.X2)) += 1 _12: _3: return i32(0) @@ -74898,7 +78212,10 @@ func init() { crt.Xstrncpy(nil, &_exprSrcCountØ00__func__Ø000[0], str(96832), 13) } -// Resolve names in the SELECT statement p and all of its descendants. +// C comment +// /* +// ** Resolve names in the SELECT statement p and all of its descendants. +// */ func _resolveSelectStep(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) { var _isCompound, _nCompound, _i, _7_nRef int32 var _7_zSavedContext *int8 @@ -74916,16 +78233,16 @@ func _resolveSelectStep(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) crt.X__builtin_abort(tls) } }() - if ((_p.X3) & uint32(i32(4))) != 0 { + if (_p.X3 & uint32(i32(4))) != 0 { return i32(1) } - _pOuterNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _pOuterNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) _pParse = (*XParse)(_pWalker.X0) _db = (*Xsqlite3)(_pParse.X0) - if ((_p.X3) & uint32(i32(64))) == uint32(i32(0)) { + if (_p.X3 & uint32(i32(64))) == uint32(i32(0)) { _sqlite3SelectPrep(tls, _pParse, _p, _pOuterNC) return func() int32 { - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { return i32(2) } return i32(1) @@ -74939,51 +78256,51 @@ _7: goto _8 } func() { - if ((_p.X3) & uint32(i32(64))) == uint32(i32(0)) { + if (_p.X3 & uint32(i32(64))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90545), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96845))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X3) & uint32(i32(4))) != uint32(i32(0)) { + if (_p.X3 & uint32(i32(4))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90546), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96876))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(4)) sink5(*p) } - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pParse if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X15)) != 0 || _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X16)) != 0 { return i32(2) } - if ((_p.X3) & uint32(i32(65536))) != 0 { - _5_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X5) + if (_p.X3 & uint32(i32(65536))) != 0 { + _5_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X5) func() { - if ((*XSrcList)(_p.X8).X0) != i32(1) || (*XExprList)(_p.X12) == nil { + if ((*XSrcList)(_p.X8).X0) != i32(1) || _p.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90567), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96907))) crt.X__builtin_abort(tls) } }() func() { - if (*XSelect)(_5_pSub.X13) == nil || (*XExprList)(_5_pSub.X12) != nil { + if _5_pSub.X13 == nil || (*XExprList)(_5_pSub.X12) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90568), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96939))) crt.X__builtin_abort(tls) } }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pSub.X12))))) = (*XExprList)(_p.X12) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pSub.X12)))) = (*XExprList)(_p.X12) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = nil } _i = i32(0) _22: if _i >= ((*XSrcList)(_p.X8).X0) { goto _25 } - _6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_i))) - if (*XSelect)(_6_pItem.X5) == nil { + _6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_i))) + if _6_pItem.X5 == nil { goto _26 } _7_nRef = i32(0) @@ -74995,18 +78312,18 @@ _27: } { p := &_7_nRef - *p = (*p) + (_7_pNC.X5) + *p = (*p) + _7_pNC.X5 sink1(*p) } _7_pNC = (*XNameContext)(_7_pNC.X4) goto _27 _30: - if (_6_pItem.X2) != nil { - *(**int8)(unsafe.Pointer(&(_pParse.X65))) = _6_pItem.X2 + if _6_pItem.X2 != nil { + *(**int8)(unsafe.Pointer(&_pParse.X65)) = _6_pItem.X2 } _sqlite3ResolveSelectNames(tls, _pParse, (*XSelect)(_6_pItem.X5), _pOuterNC) - *(**int8)(unsafe.Pointer(&(_pParse.X65))) = _7_zSavedContext - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + *(**int8)(unsafe.Pointer(&_pParse.X65)) = _7_zSavedContext + if _pParse.X16 != 0 || (_db.X17 != 0) { return i32(2) } _7_pNC = _pOuterNC @@ -75016,31 +78333,31 @@ _34: } { p := &_7_nRef - *p = (*p) - (_7_pNC.X5) + *p = (*p) - _7_pNC.X5 sink1(*p) } _7_pNC = (*XNameContext)(_7_pNC.X4) goto _34 _37: func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_6_pItem.X9))).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) || _7_nRef > i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_6_pItem.X9)).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) || _7_nRef > i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90595), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96973))) crt.X__builtin_abort(tls) } }() - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_6_pItem.X9))).X1))), int8(bool2int(_7_nRef != i32(0))), 8, 3) + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_6_pItem.X9)).X1))), int8(bool2int(_7_nRef != i32(0))), 8, 3) _26: _i += 1 goto _22 _25: - *(*uint16)(unsafe.Pointer(&(_sNC.X7))) = uint16(i32(1)) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = (*XSrcList)(_p.X8) - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = _pOuterNC + *(*uint16)(unsafe.Pointer(&_sNC.X7)) = uint16(i32(1)) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = (*XSrcList)(_p.X8) + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X4)))) = _pOuterNC if _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(_p.X0)) != 0 { return i32(2) } func() { - if ((_p.X3) & uint32(i32(8))) != uint32(i32(0)) { + if (_p.X3 & uint32(i32(8))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90613), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(97010))) crt.X__builtin_abort(tls) } @@ -75049,23 +78366,23 @@ _25: if (_pGroupBy != nil) || ((int32(_sNC.X7) & i32(16)) != i32(0)) { i32(0) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(8)|(int32(_sNC.X7)&i32(4096))) sink5(*p) } goto _46 } { - p := (*uint16)(unsafe.Pointer(&(_sNC.X7))) + p := (*uint16)(unsafe.Pointer(&_sNC.X7)) *p = uint16(int32(*p) & i32(-2)) sink14(*p) } _46: - if ((*XExpr)(_p.X11) != nil) && (_pGroupBy == nil) { + if (_p.X11 != nil) && (_pGroupBy == nil) { _sqlite3ErrorMsg(tls, _pParse, str(97042)) return i32(2) } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X2))))) = (*XExprList)(_p.X0) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X2)))) = (*XExprList)(_p.X0) if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X11)) != 0 { return i32(2) } @@ -75077,39 +78394,39 @@ _51: if _i >= ((*XSrcList)(_p.X8).X0) { goto _54 } - _11_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_i))) - if (((uint32(((*t28)(unsafe.Pointer(&(_11_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_11_pItem.X15))))))) != 0 { + _11_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(_i))) + if (((uint32(((*t28)(unsafe.Pointer(&_11_pItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_11_pItem.X15)))))) != 0 { return i32(2) } _i += 1 goto _51 _54: - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = nil + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X4)))) = nil { - p := (*uint16)(unsafe.Pointer(&(_sNC.X7))) + p := (*uint16)(unsafe.Pointer(&_sNC.X7)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } - if ((_p.X3) & uint32(i32(65536))) != 0 { - _13_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X5) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = (*XExprList)(_13_pSub.X12) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_13_pSub.X12))))) = nil + if (_p.X3 & uint32(i32(65536))) != 0 { + _13_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X5) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = (*XExprList)(_13_pSub.X12) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_13_pSub.X12)))) = nil } if (_isCompound <= _nCompound) && _resolveOrderGroupBy(tls, &_sNC, _p, (*XExprList)(_p.X12), str(25745)) != 0 { return i32(2) } - if (_db.X17) != 0 { + if _db.X17 != 0 { return i32(2) } if _pGroupBy == nil { goto _61 } - if _resolveOrderGroupBy(tls, &_sNC, _p, _pGroupBy, str(25751)) != 0 || ((_db.X17) != 0) { + if _resolveOrderGroupBy(tls, &_sNC, _p, _pGroupBy, str(25751)) != 0 || (_db.X17 != 0) { return i32(2) } - *func() **TExprList_item { _i = i32(0); return &_16_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2))))) + *func() **TExprList_item { _i = i32(0); return &_16_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pGroupBy.X2)))) _64: - if _i >= (_pGroupBy.X0) { + if _i >= _pGroupBy.X0 { goto _67 } if (((*XExpr)(_16_pItem.X0).X2) & uint32(i32(2))) != uint32(i32(0)) { @@ -75120,7 +78437,7 @@ _64: goto _64 _67: _61: - if ((*XSelect)(_p.X14) != nil) && (((*XExprList)(_p.X0).X0) != ((*XExprList)((*XSelect)(_p.X14).X0).X0)) { + if (_p.X14 != nil) && (((*XExprList)(_p.X0).X0) != ((*XExprList)((*XSelect)(_p.X14).X0).X0)) { _sqlite3SelectWrongNumTermsError(tls, _pParse, (*XSelect)(_p.X14)) return i32(2) } @@ -75143,52 +78460,55 @@ func init() { crt.Xstrncpy(nil, &_resolveSelectStepØ00__func__Ø000[0], str(97145), 18) } -// This routine walks an expression tree and resolves references to -// table columns and result-set columns. At the same time, do error -// checking on function usage and set a flag if any aggregate functions -// are seen. -// -// To resolve table columns references we look for nodes (or subtrees) of the -// form X.Y.Z or Y.Z or just Z where -// -// X: The name of a database. Ex: "main" or "temp" or -// the symbolic name assigned to an ATTACH-ed database. -// -// Y: The name of a table in a FROM clause. Or in a trigger -// one of the special names "old" or "new". -// -// Z: The name of a column in table Y. -// -// The node at the root of the subtree is modified as follows: -// -// Expr.op Changed to TK_COLUMN -// Expr.pTab Points to the Table object for X.Y -// Expr.iColumn The column index in X.Y. -1 for the rowid. -// Expr.iTable The VDBE cursor number for X.Y -// -// -// To resolve result-set references, look for expression nodes of the -// form Z (with no X and Y prefix) where the Z matches the right-hand -// size of an AS clause in the result-set of a SELECT. The Z expression -// is replaced by a copy of the left-hand side of the result-set expression. -// Table-name and function resolution occurs on the substituted expression -// tree. For example, in: -// -// SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x; -// -// The "x" term of the order by is replaced by "a+b" to render: -// -// SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b; -// -// Function calls are checked to make sure that the function is -// defined and that the correct number of arguments are specified. -// If the function is an aggregate function, then the NC_HasAgg flag is -// set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION. -// If an expression contains aggregate functions then the EP_Agg -// property on the expression is set. -// -// An error message is left in pParse if anything is amiss. The number -// if errors is returned. +// C comment +// /* +// ** This routine walks an expression tree and resolves references to +// ** table columns and result-set columns. At the same time, do error +// ** checking on function usage and set a flag if any aggregate functions +// ** are seen. +// ** +// ** To resolve table columns references we look for nodes (or subtrees) of the +// ** form X.Y.Z or Y.Z or just Z where +// ** +// ** X: The name of a database. Ex: "main" or "temp" or +// ** the symbolic name assigned to an ATTACH-ed database. +// ** +// ** Y: The name of a table in a FROM clause. Or in a trigger +// ** one of the special names "old" or "new". +// ** +// ** Z: The name of a column in table Y. +// ** +// ** The node at the root of the subtree is modified as follows: +// ** +// ** Expr.op Changed to TK_COLUMN +// ** Expr.pTab Points to the Table object for X.Y +// ** Expr.iColumn The column index in X.Y. -1 for the rowid. +// ** Expr.iTable The VDBE cursor number for X.Y +// ** +// ** +// ** To resolve result-set references, look for expression nodes of the +// ** form Z (with no X and Y prefix) where the Z matches the right-hand +// ** size of an AS clause in the result-set of a SELECT. The Z expression +// ** is replaced by a copy of the left-hand side of the result-set expression. +// ** Table-name and function resolution occurs on the substituted expression +// ** tree. For example, in: +// ** +// ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x; +// ** +// ** The "x" term of the order by is replaced by "a+b" to render: +// ** +// ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b; +// ** +// ** Function calls are checked to make sure that the function is +// ** defined and that the correct number of arguments are specified. +// ** If the function is an aggregate function, then the NC_HasAgg flag is +// ** set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION. +// ** If an expression contains aggregate functions then the EP_Agg +// ** property on the expression is set. +// ** +// ** An error message is left in pParse if anything is amiss. The number +// ** if errors is returned. +// */ func _sqlite3ResolveExprNames(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) { var _savedHasAgg uint16 var _1_pParse *XParse @@ -75197,61 +78517,64 @@ func _sqlite3ResolveExprNames(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) ( return i32(0) } _1_pParse = (*XParse)(_pNC.X0) - if _sqlite3ExprCheckHeight(tls, _1_pParse, (_pExpr.X7)+((*XParse)(_pNC.X0).X57)) != 0 { + if _sqlite3ExprCheckHeight(tls, _1_pParse, _pExpr.X7+((*XParse)(_pNC.X0).X57)) != 0 { return i32(1) } { - p := (*int32)(unsafe.Pointer(&(_1_pParse.X57))) - *p = (*p) + (_pExpr.X7) + p := (*int32)(unsafe.Pointer(&_1_pParse.X57)) + *p = (*p) + _pExpr.X7 sink1(*p) } _savedHasAgg = uint16(int32(_pNC.X7) & i32(4112)) { - p := (*uint16)(unsafe.Pointer(&(_pNC.X7))) + p := (*uint16)(unsafe.Pointer(&_pNC.X7)) *p = uint16(int32(*p) & i32(-4113)) sink14(*p) } - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = (*XParse)(_pNC.X0) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _resolveExprStep - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _resolveSelectStep - *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = nil - *(*int32)(unsafe.Pointer(&(_w.X4))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(0)) - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pNC + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = (*XParse)(_pNC.X0) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _resolveExprStep + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _resolveSelectStep + *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&_w.X3)))) = nil + *(*int32)(unsafe.Pointer(&_w.X4)) = i32(0) + *(*uint8)(unsafe.Pointer(&_w.X5)) = uint8(i32(0)) + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = _pNC _sqlite3WalkExpr(tls, &_w, _pExpr) { p := (*int32)(unsafe.Pointer(&((*XParse)(_pNC.X0).X57))) - *p = (*p) - (_pExpr.X7) + *p = (*p) - _pExpr.X7 sink1(*p) } - if ((_pNC.X6) > i32(0)) || (((*XParse)(_w.X0).X16) > i32(0)) { + if (_pNC.X6 > i32(0)) || (((*XParse)(_w.X0).X16) > i32(0)) { { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(8)) sink5(*p) } } if (int32(_pNC.X7) & i32(16)) != 0 { { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(2)) sink5(*p) } } { - p := (*uint16)(unsafe.Pointer(&(_pNC.X7))) + p := (*uint16)(unsafe.Pointer(&_pNC.X7)) *p = uint16(int32(*p) | int32(_savedHasAgg)) sink14(*p) } - return bool2int(((_pExpr.X2) & uint32(i32(8))) != uint32(i32(0))) + return bool2int((_pExpr.X2 & uint32(i32(8))) != uint32(i32(0))) _ = _w panic(0) } -// Resolve all names for all expression in an expression list. This is -// just like sqlite3ResolveExprNames() except that it works for an expression -// list rather than a single expression. +// C comment +// /* +// ** Resolve all names for all expression in an expression list. This is +// ** just like sqlite3ResolveExprNames() except that it works for an expression +// ** list rather than a single expression. +// */ func _sqlite3ResolveExprListNames(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) (r0 int32) { var _i int32 if _pList == nil { @@ -75259,10 +78582,10 @@ func _sqlite3ResolveExprListNames(tls *crt.TLS, _pNC *XNameContext, _pList *XExp } _i = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } - if _sqlite3ResolveExprNames(tls, _pNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) != 0 { + if _sqlite3ResolveExprNames(tls, _pNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) != 0 { return i32(2) } _i += 1 @@ -75272,22 +78595,25 @@ _0: return i32(0) } -// pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect. -// The Name context of the SELECT statement is pNC. zType is either -// "ORDER" or "GROUP" depending on which type of clause pOrderBy is. -// -// This routine resolves each term of the clause into an expression. -// If the order-by term is an integer I between 1 and N (where N is the -// number of columns in the result set of the SELECT) then the expression -// in the resolution is a copy of the I-th result-set expression. If -// the order-by term is an identifier that corresponds to the AS-name of -// a result-set expression, then the term resolves to a copy of the -// result-set expression. Otherwise, the expression is resolved in -// the usual way - using sqlite3ResolveExprNames(). -// -// This routine returns the number of errors. If errors occur, then -// an appropriate error message might be left in pParse. (OOM errors -// excepted.) +// C comment +// /* +// ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect. +// ** The Name context of the SELECT statement is pNC. zType is either +// ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is. +// ** +// ** This routine resolves each term of the clause into an expression. +// ** If the order-by term is an integer I between 1 and N (where N is the +// ** number of columns in the result set of the SELECT) then the expression +// ** in the resolution is a copy of the I-th result-set expression. If +// ** the order-by term is an identifier that corresponds to the AS-name of +// ** a result-set expression, then the term resolves to a copy of the +// ** result-set expression. Otherwise, the expression is resolved in +// ** the usual way - using sqlite3ResolveExprNames(). +// ** +// ** This routine returns the number of errors. If errors occur, then +// ** an appropriate error message might be left in pParse. (OOM errors +// ** excepted.) +// */ func _resolveOrderGroupBy(tls *crt.TLS, _pNC *XNameContext, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) { var _i, _j, _iCol, _nResult int32 var _pItem *TExprList_item @@ -75298,19 +78624,19 @@ func _resolveOrderGroupBy(tls *crt.TLS, _pNC *XNameContext, _pSelect *XSelect, _ } _nResult = (*XExprList)(_pSelect.X0).X0 _pParse = (*XParse)(_pNC.X0) - *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) _1: - if _i >= (_pOrderBy.X0) { + if _i >= _pOrderBy.X0 { goto _4 } _1_pE = (*XExpr)(_pItem.X0) _1_pE2 = _sqlite3ExprSkipCollate(tls, _1_pE) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(i32(0))))) == i32(71) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zType)) + 1*uintptr(i32(0))))) == i32(71) { goto _5 } _iCol = _resolveAsName(tls, _pParse, (*XExprList)(_pSelect.X0), _1_pE2) if _iCol > i32(0) { - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_iCol) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0))) = uint16(_iCol) goto _2 } _5: @@ -75321,10 +78647,10 @@ _5: _resolveOutOfRangeError(tls, _pParse, _zType, _i+i32(1), _nResult) return i32(1) } - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_iCol) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0))) = uint16(_iCol) goto _2 _7: - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0))) = uint16(i32(0)) if _sqlite3ResolveExprNames(tls, _pNC, _1_pE) != 0 { return i32(1) } @@ -75333,8 +78659,8 @@ _11: if _j >= ((*XExprList)(_pSelect.X0).X0) { goto _14 } - if _sqlite3ExprCompare(tls, _1_pE, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+32*uintptr(_j))).X0), i32(-1)) == i32(0) { - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_j + i32(1)) + if _sqlite3ExprCompare(tls, _1_pE, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+32*uintptr(_j))).X0), i32(-1)) == i32(0) { + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0))) = uint16(_j + i32(1)) } _j += 1 goto _11 @@ -75346,16 +78672,19 @@ _4: return _sqlite3ResolveOrderGroupBy(tls, _pParse, _pSelect, _pOrderBy, _zType) } -// pEList is a list of expressions which are really the result set of the -// a SELECT statement. pE is a term in an ORDER BY or GROUP BY clause. -// This routine checks to see if pE is a simple identifier which corresponds -// to the AS-name of one of the terms of the expression list. If it is, -// this routine return an integer between 1 and N where N is the number of -// elements in pEList, corresponding to the matching entry. If there is -// no match, or if pE is not a simple identifier, then this routine -// return 0. -// -// pEList has been resolved. pE has not. +// C comment +// /* +// ** pEList is a list of expressions which are really the result set of the +// ** a SELECT statement. pE is a term in an ORDER BY or GROUP BY clause. +// ** This routine checks to see if pE is a simple identifier which corresponds +// ** to the AS-name of one of the terms of the expression list. If it is, +// ** this routine return an integer between 1 and N where N is the number of +// ** elements in pEList, corresponding to the matching entry. If there is +// ** no match, or if pE is not a simple identifier, then this routine +// ** return 0. +// ** +// ** pEList has been resolved. pE has not. +// */ func _resolveAsName(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pE *XExpr) (r0 int32) { var _i int32 var _1_zCol, _2_zAs *int8 @@ -75363,13 +78692,13 @@ func _resolveAsName(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pE *XExp if int32(_pE.X0) != i32(27) { goto _0 } - _1_zCol = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pE.X3))))) + _1_zCol = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pE.X3)))) _i = i32(0) _1: - if _i >= (_pEList.X0) { + if _i >= _pEList.X0 { goto _4 } - _2_zAs = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X1 + _2_zAs = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X1 if (_2_zAs != nil) && (_sqlite3StrICmp(tls, _2_zAs, _1_zCol) == i32(0)) { return _i + i32(1) } @@ -75380,31 +78709,37 @@ _0: return i32(0) } -// Generate an ORDER BY or GROUP BY term out-of-range error. +// C comment +// /* +// ** Generate an ORDER BY or GROUP BY term out-of-range error. +// */ func _resolveOutOfRangeError(tls *crt.TLS, _pParse *XParse, _zType *int8, _i int32, _mx int32) { _sqlite3ErrorMsg(tls, _pParse, str(97163), _i, unsafe.Pointer(_zType), _mx) } -// Do a deep comparison of two expression trees. Return 0 if the two -// expressions are completely identical. Return 1 if they differ only -// by a COLLATE operator at the top level. Return 2 if there are differences -// other than the top-level COLLATE operator. -// -// If any subelement of pB has Expr.iTable==(-1) then it is allowed -// to compare equal to an equivalent element in pA with Expr.iTable==iTab. -// -// The pA side might be using TK_REGISTER. If that is the case and pB is -// not using TK_REGISTER but is otherwise equivalent, then still return 0. -// -// Sometimes this routine will return 2 even if the two expressions -// really are equivalent. If we cannot prove that the expressions are -// identical, we return 2 just to be safe. So if this routine -// returns 2, then you do not really know for certain if the two -// expressions are the same. But if you get a 0 or 1 return, then you -// can be sure the expressions are the same. In the places where -// this routine is used, it does not hurt to get an extra 2 - that -// just might result in some slightly slower code. But returning -// an incorrect 0 or 1 could lead to a malfunction. +// C comment +// /* +// ** Do a deep comparison of two expression trees. Return 0 if the two +// ** expressions are completely identical. Return 1 if they differ only +// ** by a COLLATE operator at the top level. Return 2 if there are differences +// ** other than the top-level COLLATE operator. +// ** +// ** If any subelement of pB has Expr.iTable==(-1) then it is allowed +// ** to compare equal to an equivalent element in pA with Expr.iTable==iTab. +// ** +// ** The pA side might be using TK_REGISTER. If that is the case and pB is +// ** not using TK_REGISTER but is otherwise equivalent, then still return 0. +// ** +// ** Sometimes this routine will return 2 even if the two expressions +// ** really are equivalent. If we cannot prove that the expressions are +// ** identical, we return 2 just to be safe. So if this routine +// ** returns 2, then you do not really know for certain if the two +// ** expressions are the same. But if you get a 0 or 1 return, then you +// ** can be sure the expressions are the same. In the places where +// ** this routine is used, it does not hurt to get an extra 2 - that +// ** just might result in some slightly slower code. But returning +// ** an incorrect 0 or 1 could lead to a malfunction. +// */ func _sqlite3ExprCompare(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) { var _combinedFlags uint32 if (_pA == nil) || (_pB == nil) { @@ -75415,11 +78750,11 @@ func _sqlite3ExprCompare(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 return i32(2) }() } - _combinedFlags = (_pA.X2) | (_pB.X2) + _combinedFlags = _pA.X2 | _pB.X2 if (_combinedFlags & uint32(i32(1024))) == 0 { goto _4 } - if ((((_pA.X2) & (_pB.X2)) & uint32(i32(1024))) != uint32(i32(0))) && ((*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3)))))) == (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3))))))) { + if (((_pA.X2 & _pB.X2) & uint32(i32(1024))) != uint32(i32(0))) && ((*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pA.X3))))) == (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pB.X3)))))) { return i32(0) } return i32(2) @@ -75437,18 +78772,18 @@ _4: return i32(2) _7: - if int32(_pA.X0) == i32(152) || int32(_pA.X0) == i32(154) || (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3)))))) == nil { + if int32(_pA.X0) == i32(152) || int32(_pA.X0) == i32(154) || (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pA.X3))))) == nil { goto _14 } if int32(_pA.X0) != i32(151) { goto _15 } - if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3)))))) != i32(0) { + if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pA.X3)))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pB.X3))))) != i32(0) { return i32(2) } goto _18 _15: - if crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3)))))) != i32(0) { + if crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pA.X3)))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pB.X3))))) != i32(0) { return func() int32 { if int32(_pA.X0) == i32(94) { return i32(1) @@ -75458,7 +78793,7 @@ _15: } _18: _14: - if ((_pA.X2) & uint32(i32(16))) != ((_pB.X2) & uint32(i32(16))) { + if (_pA.X2 & uint32(i32(16))) != (_pB.X2 & uint32(i32(16))) { return i32(2) } if func() int32 { @@ -75482,7 +78817,7 @@ _14: if _sqlite3ExprCompare(tls, (*XExpr)(_pA.X5), (*XExpr)(_pB.X5), _iTab) != 0 { return i32(2) } - if _sqlite3ExprListCompare(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pA.X6)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pB.X6)))))), _iTab) != 0 { + if _sqlite3ExprListCompare(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pA.X6))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pB.X6))))), _iTab) != 0 { return i32(2) } if func() int32 { @@ -75500,8 +78835,8 @@ _14: if int32(_pA.X9) != int32(_pB.X9) { return i32(2) } - if ((_pA.X8) != (_pB.X8)) && (((_pA.X8) != _iTab) || func() int32 { - if (_pB.X8) >= i32(0) { + if (_pA.X8 != _pB.X8) && ((_pA.X8 != _iTab) || func() int32 { + if _pB.X8 >= i32(0) { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -75523,19 +78858,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCompareØ00__func__Ø000[0], str(97219), 19) } -// Compare two ExprList objects. Return 0 if they are identical and -// non-zero if they differ in any way. -// -// If any subelement of pB has Expr.iTable==(-1) then it is allowed -// to compare equal to an equivalent element in pA with Expr.iTable==iTab. -// -// This routine might return non-zero for equivalent ExprLists. The -// only consequence will be disabled optimizations. But this routine -// must never return 0 if the two ExprList objects are different, or -// a malfunction will result. -// -// Two NULL pointers are considered to be the same. But a NULL pointer -// always differs from a non-NULL pointer. +// C comment +// /* +// ** Compare two ExprList objects. Return 0 if they are identical and +// ** non-zero if they differ in any way. +// ** +// ** If any subelement of pB has Expr.iTable==(-1) then it is allowed +// ** to compare equal to an equivalent element in pA with Expr.iTable==iTab. +// ** +// ** This routine might return non-zero for equivalent ExprLists. The +// ** only consequence will be disabled optimizations. But this routine +// ** must never return 0 if the two ExprList objects are different, or +// ** a malfunction will result. +// ** +// ** Two NULL pointers are considered to be the same. But a NULL pointer +// ** always differs from a non-NULL pointer. +// */ func _sqlite3ExprListCompare(tls *crt.TLS, _pA *XExprList, _pB *XExprList, _iTab int32) (r0 int32) { var _i int32 var _1_pExprA, _1_pExprB *XExpr @@ -75545,17 +78883,17 @@ func _sqlite3ExprListCompare(tls *crt.TLS, _pA *XExprList, _pB *XExprList, _iTab if (_pA == nil) || (_pB == nil) { return i32(1) } - if (_pA.X0) != (_pB.X0) { + if _pA.X0 != _pB.X0 { return i32(1) } _i = i32(0) _5: - if _i >= (_pA.X0) { + if _i >= _pA.X0 { goto _8 } - _1_pExprA = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pA.X2))))) + 32*uintptr(_i))).X0) - _1_pExprB = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pB.X2))))) + 32*uintptr(_i))).X0) - if int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pA.X2)))))+32*uintptr(_i))).X3) != int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pB.X2)))))+32*uintptr(_i))).X3) { + _1_pExprA = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pA.X2)))) + 32*uintptr(_i))).X0) + _1_pExprB = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pB.X2)))) + 32*uintptr(_i))).X0) + if int32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pA.X2))))+32*uintptr(_i))).X3) != int32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pB.X2))))+32*uintptr(_i))).X3) { return i32(1) } if _sqlite3ExprCompare(tls, _1_pExprA, _1_pExprB, _iTab) != 0 { @@ -75567,14 +78905,17 @@ _8: return i32(0) } -// Check every term in the ORDER BY or GROUP BY clause pOrderBy of -// the SELECT statement pSelect. If any term is reference to a -// result set expression (as determined by the ExprList.a.u.x.iOrderByCol -// field) then convert that term into a copy of the corresponding result set -// column. -// -// If any errors are detected, add an error message to pParse and -// return non-zero. Return zero if no errors are seen. +// C comment +// /* +// ** Check every term in the ORDER BY or GROUP BY clause pOrderBy of +// ** the SELECT statement pSelect. If any term is reference to a +// ** result set expression (as determined by the ExprList.a.u.x.iOrderByCol +// ** field) then convert that term into a copy of the corresponding result set +// ** column. +// ** +// ** If any errors are detected, add an error message to pParse and +// ** return non-zero. Return zero if no errors are seen. +// */ func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) { var _i int32 var _db *Xsqlite3 @@ -75584,7 +78925,7 @@ func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelec if (_pOrderBy == nil) || (((*Xsqlite3)(_pParse.X0).X17) != 0) { return i32(0) } - if (_pOrderBy.X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) { + if _pOrderBy.X0 > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(2))))) { _sqlite3ErrorMsg(tls, _pParse, str(97238), unsafe.Pointer(_zType)) return i32(1) } @@ -75595,19 +78936,19 @@ func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelec crt.X__builtin_abort(tls) } }() - *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) _5: - if _i >= (_pOrderBy.X0) { + if _i >= _pOrderBy.X0 { goto _8 } - if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0) == 0 { + if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0) == 0 { goto _9 } - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0) > (_pEList.X0) { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0) > _pEList.X0 { _resolveOutOfRangeError(tls, _pParse, _zType, _i+i32(1), _pEList.X0) return i32(1) } - _resolveAlias(tls, _pParse, _pEList, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0)-i32(1), (*XExpr)(_pItem.X0), _zType, i32(0)) + _resolveAlias(tls, _pParse, _pEList, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0)-i32(1), (*XExpr)(_pItem.X0), _zType, i32(0)) _9: *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32) goto _5 @@ -75621,10 +78962,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ResolveOrderGroupByØ00__func__Ø000[0], str(97269), 27) } -// Error message for when two or more terms of a compound select have different -// size result sets. +// C comment +// /* +// ** Error message for when two or more terms of a compound select have different +// ** size result sets. +// */ func _sqlite3SelectWrongNumTermsError(tls *crt.TLS, _pParse *XParse, _p *XSelect) { - if ((_p.X3) & uint32(i32(512))) != 0 { + if (_p.X3 & uint32(i32(512))) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(97296)) goto _1 } @@ -75632,7 +78976,10 @@ func _sqlite3SelectWrongNumTermsError(tls *crt.TLS, _pParse *XParse, _p *XSelect _1: } -// Name of the connection operator, used for error messages. +// C comment +// /* +// ** Name of the connection operator, used for error messages. +// */ func _selectOpName(tls *crt.TLS, _id int32) (r0 *int8) { var _z *int8 switch _id { @@ -75662,19 +79009,22 @@ _5: return _z } -// Analyze the ORDER BY clause in a compound SELECT statement. Modify -// each term of the ORDER BY clause is a constant integer between 1 -// and N where N is the number of columns in the compound SELECT. -// -// ORDER BY terms that are already an integer between 1 and N are -// unmodified. ORDER BY terms that are integers outside the range of -// 1 through N generate an error. ORDER BY terms that are expressions -// are matched against result set expressions of compound SELECT -// beginning with the left-most SELECT and working toward the right. -// At the first match, the ORDER BY expression is transformed into -// the integer column number. -// -// Return the number of errors seen. +// C comment +// /* +// ** Analyze the ORDER BY clause in a compound SELECT statement. Modify +// ** each term of the ORDER BY clause is a constant integer between 1 +// ** and N where N is the number of columns in the compound SELECT. +// ** +// ** ORDER BY terms that are already an integer between 1 and N are +// ** unmodified. ORDER BY terms that are integers outside the range of +// ** 1 through N generate an error. ORDER BY terms that are expressions +// ** are matched against result set expressions of compound SELECT +// ** beginning with the left-most SELECT and working toward the right. +// ** At the first match, the ORDER BY expression is transformed into +// ** the integer column number. +// ** +// ** Return the number of errors seen. +// */ func _resolveCompoundOrderBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 int32) { var _i, _moreToDo, _5_iCol int32 var _db *Xsqlite3 @@ -75687,22 +79037,22 @@ func _resolveCompoundOrderBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) ( return i32(0) } _db = (*Xsqlite3)(_pParse.X0) - if (_pOrderBy.X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) { + if _pOrderBy.X0 > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(2))))) { _sqlite3ErrorMsg(tls, _pParse, str(97424)) return i32(1) } _i = i32(0) _2: - if _i >= (_pOrderBy.X0) { + if _i >= _pOrderBy.X0 { goto _5 } - storebits3((*int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_i))).X4))), int8(i32(0)), 1, 0) + storebits3((*int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_i))).X4))), int8(i32(0)), 1, 0) _i += 1 goto _2 _5: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelect.X14))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSelect.X14)))) = nil _6: - if (*XSelect)(_pSelect.X13) != nil { + if _pSelect.X13 != nil { *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSelect)(_pSelect.X13).X14))))) = _pSelect _pSelect = (*XSelect)(_pSelect.X13) goto _6 @@ -75719,9 +79069,9 @@ _7: crt.X__builtin_abort(tls) } }() - *func() **TExprList_item { _i = i32(0); return &_4_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + *func() **TExprList_item { _i = i32(0); return &_4_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) _13: - if _i >= (_pOrderBy.X0) { + if _i >= _pOrderBy.X0 { goto _16 } _5_iCol = i32(-1) @@ -75732,7 +79082,7 @@ _13: if _sqlite3ExprIsInteger(tls, _5_pE, &_5_iCol) == 0 { goto _18 } - if (_5_iCol <= i32(0)) || (_5_iCol > (_pEList.X0)) { + if (_5_iCol <= i32(0)) || (_5_iCol > _pEList.X0) { _resolveOutOfRangeError(tls, _pParse, str(25745), _i+i32(1), _pEList.X0) return i32(1) } @@ -75743,7 +79093,7 @@ _18: goto _22 } _5_pDup = _sqlite3ExprDup(tls, _db, _5_pE, i32(0)) - if (_db.X17) == 0 { + if _db.X17 == 0 { func() { if _5_pDup == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90348), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000))), unsafe.Pointer(str(97458))) @@ -75763,13 +79113,13 @@ _21: return i32(1) } { - p := (*uint32)(unsafe.Pointer(&(_11_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_11_pNew.X2)) *p = (*p) | uint32(i32(1024)) sink5(*p) } - *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_11_pNew.X3))))) = _5_iCol + *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_11_pNew.X3)))) = _5_iCol if (*XExpr)(_4_pItem.X0) == _5_pE { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pItem.X0))))) = _11_pNew + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pItem.X0)))) = _11_pNew goto _29 } _13_pParent = (*XExpr)(_4_pItem.X0) @@ -75790,11 +79140,11 @@ _32: crt.X__builtin_abort(tls) } }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_13_pParent.X4))))) = _11_pNew + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_13_pParent.X4)))) = _11_pNew _29: _sqlite3ExprDelete(tls, _db, _5_pE) - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_4_pItem.X5))))).X0))) = uint16(_5_iCol) - storebits3((*int8)(unsafe.Pointer(&(_4_pItem.X4))), int8(i32(1)), 1, 0) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_4_pItem.X5)))).X0))) = uint16(_5_iCol) + storebits3((*int8)(unsafe.Pointer(&_4_pItem.X4)), int8(i32(1)), 1, 0) goto _36 _26: _moreToDo = i32(1) @@ -75808,10 +79158,10 @@ _16: _9: _i = i32(0) _37: - if _i >= (_pOrderBy.X0) { + if _i >= _pOrderBy.X0 { goto _40 } - if int32((uint32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X4)<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + if int32((uint32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X4)<<uint(i32(31)))>>uint(i32(31))) == i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(97506), _i+i32(1)) return i32(1) } @@ -75827,22 +79177,25 @@ func init() { crt.Xstrncpy(nil, &_resolveCompoundOrderByØ00__func__Ø000[0], str(97567), 23) } -// pE is a pointer to an expression which is a single term in the -// ORDER BY of a compound SELECT. The expression has not been -// name resolved. -// -// At the point this routine is called, we already know that the -// ORDER BY term is not an integer index into the result set. That -// case is handled by the calling routine. -// -// Attempt to match pE against result set columns in the left-most -// SELECT statement. Return the index i of the matching column, -// as an indication to the caller that it should sort by the i-th column. -// The left-most column is 1. In other words, the value returned is the -// same integer value that would be used in the SQL statement to indicate -// the column. -// -// If there is no match, return 0. Return -1 if an error occurs. +// C comment +// /* +// ** pE is a pointer to an expression which is a single term in the +// ** ORDER BY of a compound SELECT. The expression has not been +// ** name resolved. +// ** +// ** At the point this routine is called, we already know that the +// ** ORDER BY term is not an integer index into the result set. That +// ** case is handled by the calling routine. +// ** +// ** Attempt to match pE against result set columns in the left-most +// ** SELECT statement. Return the index i of the matching column, +// ** as an indication to the caller that it should sort by the i-th column. +// ** The left-most column is 1. In other words, the value returned is the +// ** same integer value that would be used in the SQL statement to indicate +// ** the column. +// ** +// ** If there is no match, return 0. Return -1 if an error occurs. +// */ func _resolveOrderByTermToExprList(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pE *XExpr) (r0 int32) { var _i, _rc int32 var _savedSuppErr uint8 @@ -75856,26 +79209,26 @@ func _resolveOrderByTermToExprList(tls *crt.TLS, _pParse *XParse, _pSelect *XSel } }() _pEList = (*XExprList)(_pSelect.X0) - crt.Xmemset(tls, (unsafe.Pointer)(&_nc), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X1))))) = (*XSrcList)(_pSelect.X8) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X2))))) = _pEList - *(*uint16)(unsafe.Pointer(&(_nc.X7))) = uint16(i32(1)) - *(*int32)(unsafe.Pointer(&(_nc.X6))) = i32(0) + crt.Xmemset(tls, unsafe.Pointer(&_nc), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_nc.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_nc.X1)))) = (*XSrcList)(_pSelect.X8) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_nc.X2)))) = _pEList + *(*uint16)(unsafe.Pointer(&_nc.X7)) = uint16(i32(1)) + *(*int32)(unsafe.Pointer(&_nc.X6)) = i32(0) _db = (*Xsqlite3)(_pParse.X0) _savedSuppErr = _db.X21 - *(*uint8)(unsafe.Pointer(&(_db.X21))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_db.X21)) = uint8(i32(1)) _rc = _sqlite3ResolveExprNames(tls, &_nc, _pE) - *(*uint8)(unsafe.Pointer(&(_db.X21))) = _savedSuppErr + *(*uint8)(unsafe.Pointer(&_db.X21)) = _savedSuppErr if _rc != 0 { return i32(0) } _i = i32(0) _3: - if _i >= (_pEList.X0) { + if _i >= _pEList.X0 { goto _6 } - if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X0), _pE, i32(-1)) < i32(2) { + if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X0), _pE, i32(-1)) < i32(2) { return _i + i32(1) } _i += 1 @@ -75893,32 +79246,38 @@ func init() { crt.Xstrncpy(nil, &_resolveOrderByTermToExprListØ00__func__Ø000[0], str(97622), 29) } -// This routine adds datatype and collating sequence information to -// the Table structures of all FROM-clause subqueries in a -// SELECT statement. -// -// Use this routine after name resolution. +// C comment +// /* +// ** This routine adds datatype and collating sequence information to +// ** the Table structures of all FROM-clause subqueries in a +// ** SELECT statement. +// ** +// ** Use this routine after name resolution. +// */ func _sqlite3SelectAddTypeInfo(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = _selectAddSubqueryTypeInfo - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _sqlite3ExprWalkNoop - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&_w.X3)))) = _selectAddSubqueryTypeInfo + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _sqlite3ExprWalkNoop + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = _pParse _sqlite3WalkSelect(tls, &_w, _pSelect) _ = _w } -// This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo() -// interface. -// -// For each FROM-clause subquery, add Column.zType and Column.zColl -// information to the Table structure that represents the result set -// of that subquery. -// -// The Table structure that represents the result set was constructed -// by selectExpander() but the type and collation information was omitted -// at that point because identifiers had not yet been resolved. This -// routine is called after identifier resolution. +// C comment +// /* +// ** This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo() +// ** interface. +// ** +// ** For each FROM-clause subquery, add Column.zType and Column.zColl +// ** information to the Table structure that represents the result set +// ** of that subquery. +// ** +// ** The Table structure that represents the result set was constructed +// ** by selectExpander() but the type and collation information was omitted +// ** at that point because identifiers had not yet been resolved. This +// ** routine is called after identifier resolution. +// */ func _selectAddSubqueryTypeInfo(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) { var _i int32 var _1_pTab *XTable @@ -75927,27 +79286,27 @@ func _selectAddSubqueryTypeInfo(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) { var _2_pSel *XSelect var _pParse *XParse func() { - if ((_p.X3) & uint32(i32(4))) == 0 { + if (_p.X3 & uint32(i32(4))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121182), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000))), unsafe.Pointer(str(97651))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X3) & uint32(i32(128))) != uint32(i32(0)) { + if (_p.X3 & uint32(i32(128))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121183), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000))), unsafe.Pointer(str(97677))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(128)) sink5(*p) } _pParse = (*XParse)(_pWalker.X0) _pTabList = (*XSrcList)(_p.X8) - *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) _4: - if _i >= (_pTabList.X0) { + if _i >= _pTabList.X0 { goto _7 } _1_pTab = (*XTable)(_pFrom.X4) @@ -75957,7 +79316,7 @@ _4: crt.X__builtin_abort(tls) } }() - if ((_1_pTab.X9) & uint32(i32(2))) == uint32(i32(0)) { + if (_1_pTab.X9 & uint32(i32(2))) == uint32(i32(0)) { goto _10 } _2_pSel = (*XSelect)(_pFrom.X5) @@ -75965,7 +79324,7 @@ _4: goto _11 } _12: - if (*XSelect)(_2_pSel.X13) != nil { + if _2_pSel.X13 != nil { _2_pSel = (*XSelect)(_2_pSel.X13) goto _12 } @@ -75983,144 +79342,147 @@ func init() { crt.Xstrncpy(nil, &_selectAddSubqueryTypeInfoØ00__func__Ø000[0], str(97711), 26) } -// This routine attempts to flatten subqueries as a performance optimization. -// This routine returns 1 if it makes changes and 0 if no flattening occurs. -// -// To understand the concept of flattening, consider the following -// query: -// -// SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5 -// -// The default way of implementing this query is to execute the -// subquery first and store the results in a temporary table, then -// run the outer query on that temporary table. This requires two -// passes over the data. Furthermore, because the temporary table -// has no indices, the WHERE clause on the outer query cannot be -// optimized. -// -// This routine attempts to rewrite queries such as the above into -// a single flat select, like this: -// -// SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 -// -// The code generated for this simplification gives the same result -// but only has to scan the data once. And because indices might -// exist on the table t1, a complete scan of the data might be -// avoided. -// -// Flattening is only attempted if all of the following are true: -// -// (1) The subquery and the outer query do not both use aggregates. -// -// (2) The subquery is not an aggregate or (2a) the outer query is not a join -// and (2b) the outer query does not use subqueries other than the one -// FROM-clause subquery that is a candidate for flattening. (2b is -// due to ticket [2f7170d73bf9abf80] from 2015-02-09.) -// -// (3) The subquery is not the right operand of a LEFT JOIN -// or the subquery is not itself a join and the outer query is not -// an aggregate. -// -// (4) The subquery is not DISTINCT. -// -// (**) At one point restrictions (4) and (5) defined a subset of DISTINCT -// sub-queries that were excluded from this optimization. Restriction -// (4) has since been expanded to exclude all DISTINCT subqueries. -// -// (6) The subquery does not use aggregates or the outer query is not -// DISTINCT. -// -// (7) The subquery has a FROM clause. TODO: For subqueries without -// A FROM clause, consider adding a FROM clause with the special -// table sqlite_once that consists of a single row containing a -// single NULL. -// -// (8) The subquery does not use LIMIT or the outer query is not a join. -// -// (9) The subquery does not use LIMIT or the outer query does not use -// aggregates. -// -// (**) Restriction (10) was removed from the code on 2005-02-05 but we -// accidently carried the comment forward until 2014-09-15. Original -// text: "The subquery does not use aggregates or the outer query -// does not use LIMIT." -// -// (11) The subquery and the outer query do not both have ORDER BY clauses. -// -// (**) Not implemented. Subsumed into restriction (3). Was previously -// a separate restriction deriving from ticket #350. -// -// (13) The subquery and outer query do not both use LIMIT. -// -// (14) The subquery does not use OFFSET. -// -// (15) The outer query is not part of a compound select or the -// subquery does not have a LIMIT clause. -// (See ticket #2339 and ticket [02a8e81d44]). -// -// (16) The outer query is not an aggregate or the subquery does -// not contain ORDER BY. (Ticket #2942) This used to not matter -// until we introduced the group_concat() function. -// -// (17) The sub-query is not a compound select, or it is a UNION ALL -// compound clause made up entirely of non-aggregate queries, and -// the parent query: -// -// * is not itself part of a compound select, -// * is not an aggregate or DISTINCT query, and -// * is not a join -// -// The parent and sub-query may contain WHERE clauses. Subject to -// rules (11), (13) and (14), they may also contain ORDER BY, -// LIMIT and OFFSET clauses. The subquery cannot use any compound -// operator other than UNION ALL because all the other compound -// operators have an implied DISTINCT which is disallowed by -// restriction (4). -// -// Also, each component of the sub-query must return the same number -// of result columns. This is actually a requirement for any compound -// SELECT statement, but all the code here does is make sure that no -// such (illegal) sub-query is flattened. The caller will detect the -// syntax error and return a detailed message. -// -// (18) If the sub-query is a compound select, then all terms of the -// ORDER by clause of the parent must be simple references to -// columns of the sub-query. -// -// (19) The subquery does not use LIMIT or the outer query does not -// have a WHERE clause. -// -// (20) If the sub-query is a compound select, then it must not use -// an ORDER BY clause. Ticket #3773. We could relax this constraint -// somewhat by saying that the terms of the ORDER BY clause must -// appear as unmodified result columns in the outer query. But we -// have other optimizations in mind to deal with that case. -// -// (21) The subquery does not use LIMIT or the outer query is not -// DISTINCT. (See ticket [752e1646fc]). -// -// (22) The subquery is not a recursive CTE. -// -// (23) The parent is not a recursive CTE, or the sub-query is not a -// compound query. This restriction is because transforming the -// parent to a compound query confuses the code that handles -// recursive queries in multiSelect(). -// -// (24) The subquery is not an aggregate that uses the built-in min() or -// or max() functions. (Without this restriction, a query like: -// "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily -// return the value X for which Y was maximal.) -// -// -// In this routine, the "p" parameter is a pointer to the outer query. -// The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query -// uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. -// -// If flattening is not attempted, this routine is a no-op and returns 0. -// If flattening is attempted this routine returns 1. -// -// All of the expression analysis must occur on both the outer query and -// the subquery before this routine runs. +// C comment +// /* +// ** This routine attempts to flatten subqueries as a performance optimization. +// ** This routine returns 1 if it makes changes and 0 if no flattening occurs. +// ** +// ** To understand the concept of flattening, consider the following +// ** query: +// ** +// ** SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5 +// ** +// ** The default way of implementing this query is to execute the +// ** subquery first and store the results in a temporary table, then +// ** run the outer query on that temporary table. This requires two +// ** passes over the data. Furthermore, because the temporary table +// ** has no indices, the WHERE clause on the outer query cannot be +// ** optimized. +// ** +// ** This routine attempts to rewrite queries such as the above into +// ** a single flat select, like this: +// ** +// ** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 +// ** +// ** The code generated for this simplification gives the same result +// ** but only has to scan the data once. And because indices might +// ** exist on the table t1, a complete scan of the data might be +// ** avoided. +// ** +// ** Flattening is only attempted if all of the following are true: +// ** +// ** (1) The subquery and the outer query do not both use aggregates. +// ** +// ** (2) The subquery is not an aggregate or (2a) the outer query is not a join +// ** and (2b) the outer query does not use subqueries other than the one +// ** FROM-clause subquery that is a candidate for flattening. (2b is +// ** due to ticket [2f7170d73bf9abf80] from 2015-02-09.) +// ** +// ** (3) The subquery is not the right operand of a LEFT JOIN +// ** or the subquery is not itself a join and the outer query is not +// ** an aggregate. +// ** +// ** (4) The subquery is not DISTINCT. +// ** +// ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT +// ** sub-queries that were excluded from this optimization. Restriction +// ** (4) has since been expanded to exclude all DISTINCT subqueries. +// ** +// ** (6) The subquery does not use aggregates or the outer query is not +// ** DISTINCT. +// ** +// ** (7) The subquery has a FROM clause. TODO: For subqueries without +// ** A FROM clause, consider adding a FROM clause with the special +// ** table sqlite_once that consists of a single row containing a +// ** single NULL. +// ** +// ** (8) The subquery does not use LIMIT or the outer query is not a join. +// ** +// ** (9) The subquery does not use LIMIT or the outer query does not use +// ** aggregates. +// ** +// ** (**) Restriction (10) was removed from the code on 2005-02-05 but we +// ** accidently carried the comment forward until 2014-09-15. Original +// ** text: "The subquery does not use aggregates or the outer query +// ** does not use LIMIT." +// ** +// ** (11) The subquery and the outer query do not both have ORDER BY clauses. +// ** +// ** (**) Not implemented. Subsumed into restriction (3). Was previously +// ** a separate restriction deriving from ticket #350. +// ** +// ** (13) The subquery and outer query do not both use LIMIT. +// ** +// ** (14) The subquery does not use OFFSET. +// ** +// ** (15) The outer query is not part of a compound select or the +// ** subquery does not have a LIMIT clause. +// ** (See ticket #2339 and ticket [02a8e81d44]). +// ** +// ** (16) The outer query is not an aggregate or the subquery does +// ** not contain ORDER BY. (Ticket #2942) This used to not matter +// ** until we introduced the group_concat() function. +// ** +// ** (17) The sub-query is not a compound select, or it is a UNION ALL +// ** compound clause made up entirely of non-aggregate queries, and +// ** the parent query: +// ** +// ** * is not itself part of a compound select, +// ** * is not an aggregate or DISTINCT query, and +// ** * is not a join +// ** +// ** The parent and sub-query may contain WHERE clauses. Subject to +// ** rules (11), (13) and (14), they may also contain ORDER BY, +// ** LIMIT and OFFSET clauses. The subquery cannot use any compound +// ** operator other than UNION ALL because all the other compound +// ** operators have an implied DISTINCT which is disallowed by +// ** restriction (4). +// ** +// ** Also, each component of the sub-query must return the same number +// ** of result columns. This is actually a requirement for any compound +// ** SELECT statement, but all the code here does is make sure that no +// ** such (illegal) sub-query is flattened. The caller will detect the +// ** syntax error and return a detailed message. +// ** +// ** (18) If the sub-query is a compound select, then all terms of the +// ** ORDER by clause of the parent must be simple references to +// ** columns of the sub-query. +// ** +// ** (19) The subquery does not use LIMIT or the outer query does not +// ** have a WHERE clause. +// ** +// ** (20) If the sub-query is a compound select, then it must not use +// ** an ORDER BY clause. Ticket #3773. We could relax this constraint +// ** somewhat by saying that the terms of the ORDER BY clause must +// ** appear as unmodified result columns in the outer query. But we +// ** have other optimizations in mind to deal with that case. +// ** +// ** (21) The subquery does not use LIMIT or the outer query is not +// ** DISTINCT. (See ticket [752e1646fc]). +// ** +// ** (22) The subquery is not a recursive CTE. +// ** +// ** (23) The parent is not a recursive CTE, or the sub-query is not a +// ** compound query. This restriction is because transforming the +// ** parent to a compound query confuses the code that handles +// ** recursive queries in multiSelect(). +// ** +// ** (24) The subquery is not an aggregate that uses the built-in min() or +// ** or max() functions. (Without this restriction, a query like: +// ** "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily +// ** return the value X for which Y was maximal.) +// ** +// ** +// ** In this routine, the "p" parameter is a pointer to the outer query. +// ** The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query +// ** uses aggregates and subqueryIsAgg is true if the subquery uses aggregates. +// ** +// ** If flattening is not attempted, this routine is a no-op and returns 0. +// ** If flattening is attempted this routine returns 1. +// ** +// ** All of the expression analysis must occur on both the outer query and +// ** the subquery before this routine runs. +// */ func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, _isAgg int32, _subqueryIsAgg int32) (r0 int32) { var _iParent, _iNewParent, _isLeftJoin, _i, _17_ii, _25_nSubSrc int32 var _zSavedAuthContext, _33_zName *int8 @@ -76155,12 +79517,12 @@ func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, } _pSrc = (*XSrcList)(_p.X8) func() { - if _pSrc == nil || _iFrom < i32(0) || _iFrom >= (_pSrc.X0) { + if _pSrc == nil || _iFrom < i32(0) || _iFrom >= _pSrc.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119957), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97750))) crt.X__builtin_abort(tls) } }() - _pSubitem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_iFrom))) + _pSubitem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_iFrom))) _iParent = _pSubitem.X11 _pSub = (*XSelect)(_pSubitem.X5) func() { @@ -76175,10 +79537,10 @@ func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, if _isAgg != 0 { return i32(0) } - if (_pSrc.X0) > i32(1) { + if _pSrc.X0 > i32(1) { return i32(0) } - if ((((*XExpr)(_p.X9) != nil) && ((((*XExpr)(_p.X9).X2) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X0)) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X12)) & uint32(i32(2097152))) != uint32(i32(0))) { + if (((_p.X9 != nil) && ((((*XExpr)(_p.X9).X2) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X0)) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X12)) & uint32(i32(2097152))) != uint32(i32(0))) { return i32(0) } _11: @@ -76189,60 +79551,60 @@ _11: crt.X__builtin_abort(tls) } }() - if ((*XExpr)(_pSub.X15) != nil) && ((*XExpr)(_p.X15) != nil) { + if (_pSub.X15 != nil) && (_p.X15 != nil) { return i32(0) } - if (*XExpr)(_pSub.X16) != nil { + if _pSub.X16 != nil { return i32(0) } - if (((_p.X3) & uint32(i32(256))) != uint32(i32(0))) && ((*XExpr)(_pSub.X15) != nil) { + if ((_p.X3 & uint32(i32(256))) != uint32(i32(0))) && (_pSub.X15 != nil) { return i32(0) } - if (_pSubSrc.X0) == i32(0) { + if _pSubSrc.X0 == i32(0) { return i32(0) } - if ((_pSub.X3) & uint32(i32(1))) != 0 { + if (_pSub.X3 & uint32(i32(1))) != 0 { return i32(0) } - if ((*XExpr)(_pSub.X15) != nil) && (((_pSrc.X0) > i32(1)) || _isAgg != 0) { + if (_pSub.X15 != nil) && ((_pSrc.X0 > i32(1)) || _isAgg != 0) { return i32(0) } - if (((_p.X3) & uint32(i32(1))) != uint32(i32(0))) && _subqueryIsAgg != 0 { + if ((_p.X3 & uint32(i32(1))) != uint32(i32(0))) && _subqueryIsAgg != 0 { return i32(0) } - if ((*XExprList)(_p.X12) != nil) && ((*XExprList)(_pSub.X12) != nil) { + if (_p.X12 != nil) && (_pSub.X12 != nil) { return i32(0) } - if _isAgg != 0 && ((*XExprList)(_pSub.X12) != nil) { + if _isAgg != 0 && (_pSub.X12 != nil) { return i32(0) } - if ((*XExpr)(_pSub.X15) != nil) && ((*XExpr)(_p.X9) != nil) { + if (_pSub.X15 != nil) && (_p.X9 != nil) { return i32(0) } - if ((*XExpr)(_pSub.X15) != nil) && (((_p.X3) & uint32(i32(1))) != uint32(i32(0))) { + if (_pSub.X15 != nil) && ((_p.X3 & uint32(i32(1))) != uint32(i32(0))) { return i32(0) } - if ((_pSub.X3) & uint32(i32(12288))) != 0 { + if (_pSub.X3 & uint32(i32(12288))) != 0 { return i32(0) } - if (((_p.X3) & uint32(i32(8192))) != 0) && ((*XSelect)(_pSub.X13) != nil) { + if ((_p.X3 & uint32(i32(8192))) != 0) && (_pSub.X13 != nil) { return i32(0) } - if (int32((*t28)(unsafe.Pointer(&(_pSubitem.X9))).X0) & i32(32)) == i32(0) { + if (int32((*t28)(unsafe.Pointer(&_pSubitem.X9)).X0) & i32(32)) == i32(0) { goto _43 } _isLeftJoin = i32(1) - if ((_pSubSrc.X0) > i32(1)) || _isAgg != 0 { + if (_pSubSrc.X0 > i32(1)) || _isAgg != 0 { return i32(0) } _43: - if (*XSelect)(_pSub.X13) == nil { + if _pSub.X13 == nil { goto _46 } - if (*XExprList)(_pSub.X12) != nil { + if _pSub.X12 != nil { return i32(0) } - if (_isAgg != 0 || (((_p.X3) & uint32(i32(1))) != uint32(i32(0)))) || ((_pSrc.X0) != i32(1)) { + if (_isAgg != 0 || ((_p.X3 & uint32(i32(1))) != uint32(i32(0)))) || (_pSrc.X0 != i32(1)) { return i32(0) } _pSub1 = _pSub @@ -76262,13 +79624,13 @@ _51: crt.X__builtin_abort(tls) } }() - if ((((_pSub1.X3) & uint32(i32(9))) != uint32(i32(0))) || (((*XSelect)(_pSub1.X13) != nil) && (int32(_pSub1.X1) != i32(116)))) || (((*XSrcList)(_pSub1.X8).X0) < i32(1)) { + if (((_pSub1.X3 & uint32(i32(9))) != uint32(i32(0))) || ((_pSub1.X13 != nil) && (int32(_pSub1.X1) != i32(116)))) || (((*XSrcList)(_pSub1.X8).X0) < i32(1)) { return i32(0) } _pSub1 = (*XSelect)(_pSub1.X13) goto _51 _54: - if (*XExprList)(_p.X12) == nil { + if _p.X12 == nil { goto _63 } _17_ii = i32(0) @@ -76276,7 +79638,7 @@ _64: if _17_ii >= ((*XExprList)(_p.X12).X0) { goto _67 } - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X12).X2))))) + 32*uintptr(_17_ii))).X5))))).X0) == i32(0) { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X12).X2))))) + 32*uintptr(_17_ii))).X5))))).X0) == i32(0) { return i32(0) } _17_ii += 1 @@ -76286,13 +79648,13 @@ _63: _46: if (Xsqlite3SelectTrace & i32(1)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(97859) - }(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_pSub.X6)))))), unsafe.Pointer(_pSub), _iFrom) + }(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_pSub.X6))))), unsafe.Pointer(_pSub), _iFrom) } - *(**int8)(unsafe.Pointer(&(_pParse.X65))) = _pSubitem.X2 + *(**int8)(unsafe.Pointer(&_pParse.X65)) = _pSubitem.X2 _i = _sqlite3AuthCheck(tls, _pParse, i32(21), nil, nil, nil) - *(**int8)(unsafe.Pointer(&(_pParse.X65))) = _zSavedAuthContext + *(**int8)(unsafe.Pointer(&_pParse.X65)) = _zSavedAuthContext _pSub = (*XSelect)(_pSub.X13) _70: if _pSub == nil { @@ -76302,49 +79664,49 @@ _70: _19_pLimit = (*XExpr)(_p.X15) _19_pOffset = (*XExpr)(_p.X16) _19_pPrior = (*XSelect)(_p.X13) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = nil + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X8)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = nil _19_pNew = _sqlite3SelectDup(tls, _db, _p, i32(0)) - _sqlite3SelectSetName(tls, _19_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_pSub.X6)))))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _19_pOffset - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _19_pLimit - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _19_pOrderBy - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pSrc - *(*uint8)(unsafe.Pointer(&(_p.X1))) = uint8(i32(116)) + _sqlite3SelectSetName(tls, _19_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_pSub.X6))))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = _19_pOffset + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = _19_pLimit + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = _19_pOrderBy + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X8)))) = _pSrc + *(*uint8)(unsafe.Pointer(&_p.X1)) = uint8(i32(116)) if _19_pNew == nil { - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _19_pPrior + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _19_pPrior goto _75 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pNew.X13))))) = _19_pPrior + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_19_pNew.X13)))) = _19_pPrior if _19_pPrior != nil { - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pPrior.X14))))) = _19_pNew + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_19_pPrior.X14)))) = _19_pNew } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pNew.X14))))) = _p - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _19_pNew + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_19_pNew.X14)))) = _p + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _19_pNew if (Xsqlite3SelectTrace & i32(2)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(97887) - }(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_19_pNew.X6)))))), unsafe.Pointer(_19_pNew)) + }(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_19_pNew.X6))))), unsafe.Pointer(_19_pNew)) } _75: - if (_db.X17) != 0 { + if _db.X17 != 0 { return i32(1) } _pSub = (*XSelect)(_pSub.X13) goto _70 _73: _pSub = store59(&_pSub1, (*XSelect)(_pSubitem.X5)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X2)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X3)) - *(**int8)(unsafe.Pointer(&(_pSubitem.X1))) = nil - *(**int8)(unsafe.Pointer(&(_pSubitem.X2))) = nil - *(**int8)(unsafe.Pointer(&(_pSubitem.X3))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubitem.X5))))) = nil + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.X1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.X2)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubitem.X3)) + *(**int8)(unsafe.Pointer(&_pSubitem.X1)) = nil + *(**int8)(unsafe.Pointer(&_pSubitem.X2)) = nil + *(**int8)(unsafe.Pointer(&_pSubitem.X3)) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubitem.X5)))) = nil if func() int32 { if (*XTable)(_pSubitem.X4) != nil { return i32(1) @@ -76358,20 +79720,20 @@ _73: goto _81 } _22_pTabToDel = (*XTable)(_pSubitem.X4) - if (_22_pTabToDel.X8) == uint32(i32(1)) { + if _22_pTabToDel.X8 == uint32(i32(1)) { _23_pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_22_pTabToDel.X21))))) = (*XTable)(_23_pToplevel.X68) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_23_pToplevel.X68))))) = _22_pTabToDel + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_22_pTabToDel.X21)))) = (*XTable)(_23_pToplevel.X68) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_23_pToplevel.X68)))) = _22_pTabToDel goto _85 } - *(*uint32)(unsafe.Pointer(&(_22_pTabToDel.X8))) -= 1 + *(*uint32)(unsafe.Pointer(&_22_pTabToDel.X8)) -= 1 _85: - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubitem.X4))))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubitem.X4)))) = nil _81: _pParent = _p _86: @@ -76389,7 +79751,7 @@ _86: crt.X__builtin_abort(tls) } }() - _25_jointype = (*t28)(unsafe.Pointer(&(_pSubitem.X9))).X0 + _25_jointype = (*t28)(unsafe.Pointer(&_pSubitem.X9)).X0 goto _93 } func() { @@ -76398,10 +79760,10 @@ _86: crt.X__builtin_abort(tls) } }() - _pSrc = store60((**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X8))))), _sqlite3SrcListAppend(tls, _db, nil, nil, nil)) + _pSrc = store60((**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X8)))), _sqlite3SrcListAppend(tls, _db, nil, nil, nil)) if _pSrc == nil { func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120216), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } @@ -76412,8 +79774,8 @@ _93: if _25_nSubSrc <= i32(1) { goto _99 } - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X8))))) = store60(&_pSrc, _sqlite3SrcListEnlarge(tls, _db, _pSrc, _25_nSubSrc-i32(1), _iFrom+i32(1))) - if (_db.X17) != 0 { + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X8)))) = store60(&_pSrc, _sqlite3SrcListEnlarge(tls, _db, _pSrc, _25_nSubSrc-i32(1), _iFrom+i32(1))) + if _db.X17 != 0 { goto _89 } _99: @@ -76422,44 +79784,44 @@ _101: if _i >= _25_nSubSrc { goto _104 } - _sqlite3IdListDelete(tls, _db, (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_i+_iFrom))).X13)) + _sqlite3IdListDelete(tls, _db, (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(_i+_iFrom))).X13)) func() { - if int32((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(_i+_iFrom))).X9))).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(_i+_iFrom))).X9))).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120248), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97960))) crt.X__builtin_abort(tls) } }() - *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i+_iFrom))) = *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2))))) + 112*uintptr(_i))) - _iNewParent = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2))))) + 112*uintptr(_i))).X11 - crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2)))))+112*uintptr(_i)))), i32(0), u64(112)) + *(*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i+_iFrom))) = *(*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSubSrc.X2)))) + 112*uintptr(_i))) + _iNewParent = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSubSrc.X2)))) + 112*uintptr(_i))).X11 + crt.Xmemset(tls, unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSubSrc.X2))))+112*uintptr(_i)))), i32(0), u64(112)) _i += 1 goto _101 _104: - *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_iFrom))).X9))).X0))) = _25_jointype + *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_iFrom))).X9))).X0))) = _25_jointype _pList = (*XExprList)(_pParent.X0) _i = i32(0) _107: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _110 } - if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_i))).X1) == nil { - _33_zName = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X2) + if ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_i))).X1) == nil { + _33_zName = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X2) _sqlite3Dequote(tls, _33_zName) - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_i))).X1))) = _33_zName + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_i))).X1))) = _33_zName } _i += 1 goto _107 _110: - if (*XExprList)(_pSub.X12) == nil { + if _pSub.X12 == nil { goto _112 } _34_pOrderBy = (*XExprList)(_pSub.X12) _i = i32(0) _113: - if _i >= (_34_pOrderBy.X0) { + if _i >= _34_pOrderBy.X0 { goto _116 } - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_34_pOrderBy.X2))))) + 32*uintptr(_i))).X5))))).X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_34_pOrderBy.X2)))) + 32*uintptr(_i))).X5))))).X0))) = uint16(i32(0)) _i += 1 goto _113 _116: @@ -76475,8 +79837,8 @@ _116: crt.X__builtin_abort(tls) } }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X12))))) = _34_pOrderBy - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSub.X12))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X12)))) = _34_pOrderBy + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSub.X12)))) = nil _112: _pWhere = _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.X9), i32(0)) if _isLeftJoin > i32(0) { @@ -76489,36 +79851,36 @@ _112: crt.X__builtin_abort(tls) } }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X11))))) = (*XExpr)(_pParent.X9) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X9))))) = _pWhere - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X11))))) = _sqlite3ExprAnd(tls, _db, _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.X11), i32(0)), (*XExpr)(_pParent.X11)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X11)))) = (*XExpr)(_pParent.X9) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X9)))) = _pWhere + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X11)))) = _sqlite3ExprAnd(tls, _db, _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.X11), i32(0)), (*XExpr)(_pParent.X11)) func() { if (*XExprList)(_pParent.X10) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120306), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(98050))) crt.X__builtin_abort(tls) } }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X10))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_pSub.X10), i32(0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X10)))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_pSub.X10), i32(0)) goto _127 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X9))))) = _sqlite3ExprAnd(tls, _db, _pWhere, (*XExpr)(_pParent.X9)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X9)))) = _sqlite3ExprAnd(tls, _db, _pWhere, (*XExpr)(_pParent.X9)) _127: if int32(_db.X17) == i32(0) { - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_39_x.X0))))) = _pParse - *(*int32)(unsafe.Pointer(&(_39_x.X1))) = _iParent - *(*int32)(unsafe.Pointer(&(_39_x.X2))) = _iNewParent - *(*int32)(unsafe.Pointer(&(_39_x.X3))) = _isLeftJoin - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_39_x.X4))))) = (*XExprList)(_pSub.X0) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_39_x.X0)))) = _pParse + *(*int32)(unsafe.Pointer(&_39_x.X1)) = _iParent + *(*int32)(unsafe.Pointer(&_39_x.X2)) = _iNewParent + *(*int32)(unsafe.Pointer(&_39_x.X3)) = _isLeftJoin + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_39_x.X4)))) = (*XExprList)(_pSub.X0) _substSelect(tls, &_39_x, _pParent, i32(0)) } { - p := (*uint32)(unsafe.Pointer(&(_pParent.X3))) - *p = (*p) | ((_pSub.X3) & uint32(i32(1))) + p := (*uint32)(unsafe.Pointer(&_pParent.X3)) + *p = (*p) | (_pSub.X3 & uint32(i32(1))) sink5(*p) } - if (*XExpr)(_pSub.X15) != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X15))))) = (*XExpr)(_pSub.X15) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSub.X15))))) = nil + if _pSub.X15 != nil { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParent.X15)))) = (*XExpr)(_pSub.X15) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSub.X15)))) = nil } *func() **XSelect { _pParent = (*XSelect)(_pParent.X13); return &_pSub }() = (*XSelect)(_pSub.X13) goto _86 @@ -76529,7 +79891,7 @@ _89: } if (Xsqlite3SelectTrace & i32(256)) != 0 { _sqlite3DebugPrintf(tls, func() *int8 { - _sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p)) + _sqlite3DebugPrintf(tls, str(45660), (_pParse.X35*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_p.X6))))), unsafe.Pointer(_p)) return str(98071) }()) } @@ -76558,8 +79920,8 @@ _0: _substExprList(tls, _pSubst, (*XExprList)(_p.X0)) _substExprList(tls, _pSubst, (*XExprList)(_p.X10)) _substExprList(tls, _pSubst, (*XExprList)(_p.X12)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X11)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X9)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X11)))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X11)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X9)))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X9)) _pSrc = (*XSrcList)(_p.X8) func() { if _pSrc == nil { @@ -76567,14 +79929,14 @@ _0: crt.X__builtin_abort(tls) } }() - *func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + *func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) _4: if _i <= i32(0) { goto _7 } _substSelect(tls, _pSubst, (*XSelect)(_pItem.X5), i32(1)) - if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))) + if ((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pItem.X15)))))) } *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(112) goto _4 @@ -76591,26 +79953,29 @@ func _substExprList(tls *crt.TLS, _pSubst *XSubstContext, _pList *XExprList) { } _i = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_i))).X0))))) = _substExpr(tls, _pSubst, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_i))).X0))))) = _substExpr(tls, _pSubst, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) _i += 1 goto _1 _4: } -// Scan through the expression pExpr. Replace every reference to -// a column in table number iTable with a copy of the iColumn-th -// entry in pEList. (But leave references to the ROWID column -// unchanged.) -// -// This routine is part of the flattening procedure. A subquery -// whose result set is defined by pEList appears as entry in the -// FROM clause of a SELECT such that the VDBE cursor assigned to that -// FORM clause entry is iTable. This routine makes the necessary -// changes to pExpr so that it refers directly to the source table -// of the subquery rather the result set of the subquery. +// C comment +// /* +// ** Scan through the expression pExpr. Replace every reference to +// ** a column in table number iTable with a copy of the iColumn-th +// ** entry in pEList. (But leave references to the ROWID column +// ** unchanged.) +// ** +// ** This routine is part of the flattening procedure. A subquery +// ** whose result set is defined by pEList appears as entry in the +// ** FROM clause of a SELECT such that the VDBE cursor assigned to that +// ** FORM clause entry is iTable. This routine makes the necessary +// ** changes to pExpr so that it refers directly to the source table +// ** of the subquery rather the result set of the subquery. +// */ func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) { var _6_db *Xsqlite3 var _4_pNew, _4_pCopy *XExpr @@ -76618,17 +79983,17 @@ func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) if _pExpr == nil { return nil } - if (((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0))) && (int32(_pExpr.X11) == (_pSubst.X1)) { - *(*int16)(unsafe.Pointer(&(_pExpr.X11))) = int16(_pSubst.X2) + if ((_pExpr.X2 & uint32(i32(1))) != uint32(i32(0))) && (int32(_pExpr.X11) == _pSubst.X1) { + *(*int16)(unsafe.Pointer(&_pExpr.X11)) = int16(_pSubst.X2) } - if int32(_pExpr.X0) != i32(152) || (_pExpr.X8) != (_pSubst.X1) { + if int32(_pExpr.X0) != i32(152) || _pExpr.X8 != _pSubst.X1 { goto _4 } if int32(_pExpr.X9) < i32(0) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(101)) goto _6 } - _4_pCopy = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSubst.X4).X2))))) + 32*uintptr(_pExpr.X9))).X0) + _4_pCopy = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSubst.X4).X2))))) + 32*uintptr(_pExpr.X9))).X0) func() { if (*XExprList)(_pSubst.X4) == nil || int32(_pExpr.X9) >= ((*XExprList)(_pSubst.X4).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119715), unsafe.Pointer((*int8)(unsafe.Pointer(&_substExprØ00__func__Ø000))), unsafe.Pointer(str(98106))) @@ -76646,18 +80011,18 @@ func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) goto _14 } _6_db = (*Xsqlite3)((*XParse)(_pSubst.X0).X0) - if (_pSubst.X3) != 0 && (int32(_4_pCopy.X0) != i32(152)) { - crt.Xmemset(tls, (unsafe.Pointer)(&_4_ifNullRow), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_4_ifNullRow.X0))) = uint8(i32(160)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_ifNullRow.X4))))) = _4_pCopy - *(*int32)(unsafe.Pointer(&(_4_ifNullRow.X8))) = _pSubst.X2 + if _pSubst.X3 != 0 && (int32(_4_pCopy.X0) != i32(152)) { + crt.Xmemset(tls, unsafe.Pointer(&_4_ifNullRow), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_4_ifNullRow.X0)) = uint8(i32(160)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_ifNullRow.X4)))) = _4_pCopy + *(*int32)(unsafe.Pointer(&_4_ifNullRow.X8)) = _pSubst.X2 _4_pCopy = &_4_ifNullRow } _4_pNew = _sqlite3ExprDup(tls, _6_db, _4_pCopy, i32(0)) - if (_4_pNew != nil) && (((_pExpr.X2) & uint32(i32(1))) != 0) { - *(*int16)(unsafe.Pointer(&(_4_pNew.X11))) = _pExpr.X11 + if (_4_pNew != nil) && ((_pExpr.X2 & uint32(i32(1))) != 0) { + *(*int16)(unsafe.Pointer(&_4_pNew.X11)) = _pExpr.X11 { - p := (*uint32)(unsafe.Pointer(&(_4_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_4_pNew.X2)) *p = (*p) | uint32(i32(1)) sink5(*p) } @@ -76668,16 +80033,16 @@ _14: _6: goto _19 _4: - if (int32(_pExpr.X0) == i32(160)) && ((_pExpr.X8) == (_pSubst.X1)) { - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pSubst.X2 + if (int32(_pExpr.X0) == i32(160)) && (_pExpr.X8 == _pSubst.X1) { + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _pSubst.X2 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X4)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X5)) - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { - _substSelect(tls, _pSubst, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), i32(1)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X4)))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X4)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X5)))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X5)) + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { + _substSelect(tls, _pSubst, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))), i32(1)) goto _23 } - _substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) + _substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) _23: _19: return _pExpr @@ -76693,8 +80058,8 @@ func init() { } func _sqlite3VectorErrorMsg(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) { - if ((_pExpr.X2) & uint32(i32(2048))) != 0 { - _sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0, i32(1)) + if (_pExpr.X2 & uint32(i32(2048))) != 0 { + _sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0).X0, i32(1)) goto _1 } _sqlite3ErrorMsg(tls, _pParse, str(43181)) @@ -76713,35 +80078,38 @@ func init() { crt.Xstrncpy(nil, &_substSelectØ00__func__Ø000[0], str(98218), 12) } -// This routine is called to process a compound query form from -// two or more separate queries using UNION, UNION ALL, EXCEPT, or -// INTERSECT -// -// "p" points to the right-most of the two queries. the query on the -// left is p->pPrior. The left query could also be a compound query -// in which case this routine will be called recursively. -// -// The results of the total query are to be written into a destination -// of type eDest with parameter iParm. -// -// Example 1: Consider a three-way compound SQL statement. -// -// SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3 -// -// This statement is parsed up as follows: -// -// SELECT c FROM t3 -// | -// `-----> SELECT b FROM t2 -// | -// `------> SELECT a FROM t1 -// -// The arrows in the diagram above represent the Select.pPrior pointer. -// So if this routine is called with p equal to the t3 query, then -// pPrior will be the t2 query. p->op will be TK_UNION in this case. -// -// Notice that because of the way SQLite parses compound SELECTs, the -// individual selects always group from left to right. +// C comment +// /* +// ** This routine is called to process a compound query form from +// ** two or more separate queries using UNION, UNION ALL, EXCEPT, or +// ** INTERSECT +// ** +// ** "p" points to the right-most of the two queries. the query on the +// ** left is p->pPrior. The left query could also be a compound query +// ** in which case this routine will be called recursively. +// ** +// ** The results of the total query are to be written into a destination +// ** of type eDest with parameter iParm. +// ** +// ** Example 1: Consider a three-way compound SQL statement. +// ** +// ** SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3 +// ** +// ** This statement is parsed up as follows: +// ** +// ** SELECT c FROM t3 +// ** | +// ** `-----> SELECT b FROM t2 +// ** | +// ** `------> SELECT a FROM t1 +// ** +// ** The arrows in the diagram above represent the Select.pPrior pointer. +// ** So if this routine is called with p equal to the t3 query, then +// ** pPrior will be the t2 query. p->op will be TK_UNION in this case. +// ** +// ** Notice that because of the way SQLite parses compound SELECTs, the +// ** individual selects always group from left to right. +// */ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) { var _rc, _iSub1, _iSub2, _8_addr, _8_nLimit, _14_unionTab, _14_priorOp, _14_addr, _21_iCont, _21_iBreak, _21_iStart, _23_tab1, _23_tab2, _23_iCont, _23_iBreak, _23_iStart, _23_addr, _23_r1, _26_i, _26_nCol, _31_addr int32 var _14_op uint8 @@ -76757,13 +80125,13 @@ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDes _iSub1 = i32(0) _iSub2 = i32(0) func() { - if _p == nil || (*XSelect)(_p.X13) == nil { + if _p == nil || _p.X13 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118776), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98230))) crt.X__builtin_abort(tls) } }() func() { - if ((_p.X3)&uint32(i32(8192))) != uint32(i32(0)) && int32(_p.X1) != i32(116) && int32(_p.X1) != i32(115) { + if (_p.X3&uint32(i32(8192))) != uint32(i32(0)) && int32(_p.X1) != i32(116) && int32(_p.X1) != i32(115) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118777), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98245))) crt.X__builtin_abort(tls) } @@ -76771,12 +80139,12 @@ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDes _db = (*Xsqlite3)(_pParse.X0) _pPrior = (*XSelect)(_p.X13) _dest = *_pDest - if (*XExprList)(_pPrior.X12) != nil { + if _pPrior.X12 != nil { _sqlite3ErrorMsg(tls, _pParse, str(98313), unsafe.Pointer(_selectOpName(tls, int32(_p.X1)))) _rc = i32(1) goto _multi_select_end } - if (*XExpr)(_pPrior.X15) != nil { + if _pPrior.X15 != nil { _sqlite3ErrorMsg(tls, _pParse, str(98361), unsafe.Pointer(_selectOpName(tls, int32(_p.X1)))) _rc = i32(1) goto _multi_select_end @@ -76790,20 +80158,20 @@ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDes }() if int32(_dest.X0) == i32(12) { func() { - if (*XExprList)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118800), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406))) crt.X__builtin_abort(tls) } }() _sqlite3VdbeAddOp2(tls, _v, i32(110), _dest.X2, (*XExprList)(_p.X0).X0) - *(*uint8)(unsafe.Pointer(&(_dest.X0))) = uint8(i32(14)) + *(*uint8)(unsafe.Pointer(&_dest.X0)) = uint8(i32(14)) } - if ((_p.X3) & uint32(i32(1024))) != 0 { + if (_p.X3 & uint32(i32(1024))) != 0 { _rc = _multiSelectValues(tls, _pParse, _p, &_dest) goto _multi_select_end } func() { - if (*XExprList)(_p.X0) == nil || (*XExprList)(_pPrior.X0) == nil { + if _p.X0 == nil || _pPrior.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118815), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98416))) crt.X__builtin_abort(tls) } @@ -76814,11 +80182,11 @@ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDes crt.X__builtin_abort(tls) } }() - if ((_p.X3) & uint32(i32(8192))) != 0 { + if (_p.X3 & uint32(i32(8192))) != 0 { _generateWithRecursiveQuery(tls, _pParse, _p, &_dest) goto _39 } - if (*XExprList)(_p.X12) != nil { + if _p.X12 != nil { return _multiSelectOrderBy(tls, _pParse, _p, _pDest) } switch int32(_p.X1) { @@ -76835,41 +80203,41 @@ func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDes _25: _8_addr = i32(0) func() { - if (*XExpr)(_pPrior.X15) != nil { + if _pPrior.X15 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118836), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98484))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pPrior.X4))) = _p.X4 - *(*int32)(unsafe.Pointer(&(_pPrior.X5))) = _p.X5 - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X15))))) = (*XExpr)(_p.X15) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X16))))) = (*XExpr)(_p.X16) + *(*int32)(unsafe.Pointer(&_pPrior.X4)) = _p.X4 + *(*int32)(unsafe.Pointer(&_pPrior.X5)) = _p.X5 + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrior.X15)))) = (*XExpr)(_p.X15) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrior.X16)))) = (*XExpr)(_p.X16) _iSub1 = _pParse.X59 _rc = _sqlite3Select(tls, _pParse, _pPrior, &_dest) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = nil if _rc != 0 { goto _multi_select_end } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil - *(*int32)(unsafe.Pointer(&(_p.X4))) = _pPrior.X4 - *(*int32)(unsafe.Pointer(&(_p.X5))) = _pPrior.X5 - if (_p.X4) == 0 { + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil + *(*int32)(unsafe.Pointer(&_p.X4)) = _pPrior.X4 + *(*int32)(unsafe.Pointer(&_p.X5)) = _pPrior.X5 + if _p.X4 == 0 { goto _32 } _8_addr = _sqlite3VdbeAddOp1(tls, _v, i32(22), _p.X4) _sqlite3VdbeComment(tls, _v, str(98500)) - if (_p.X5) != 0 { - _sqlite3VdbeAddOp3(tls, _v, i32(149), _p.X4, (_p.X5)+i32(1), _p.X5) + if _p.X5 != 0 { + _sqlite3VdbeAddOp3(tls, _v, i32(149), _p.X4, _p.X5+i32(1), _p.X5) } _32: _iSub2 = _pParse.X59 _rc = _sqlite3Select(tls, _pParse, _p, &_dest) _pDelete = (*XSelect)(_p.X13) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) - if ((((*XExpr)(_pPrior.X15) != nil) && _sqlite3ExprIsInteger(tls, (*XExpr)(_pPrior.X15), &_8_nLimit) != 0) && (_8_nLimit > i32(0))) && (int32(_p.X2) > int32(_sqlite3LogEst(tls, uint64(_8_nLimit)))) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEst(tls, uint64(_8_nLimit)) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pPrior + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) + if (((_pPrior.X15 != nil) && _sqlite3ExprIsInteger(tls, (*XExpr)(_pPrior.X15), &_8_nLimit) != 0) && (_8_nLimit > i32(0))) && (int32(_p.X2) > int32(_sqlite3LogEst(tls, uint64(_8_nLimit)))) { + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3LogEst(tls, uint64(_8_nLimit)) } if _8_addr != 0 { _sqlite3VdbeJumpHere(tls, _v, _8_addr) @@ -76894,7 +80262,7 @@ _26: _14_unionTab = _dest.X2 goto _45 } - _14_unionTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _14_unionTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) func() { if (*XExprList)(_p.X12) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118900), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98555))) @@ -76903,26 +80271,26 @@ _26: }() _14_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _14_unionTab, i32(0)) func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0))))) != i32(-1) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(0))))) != i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118902), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98570))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _14_addr + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(0)))) = _14_addr { p := (*uint32)(unsafe.Pointer(&(_findRightmost(tls, _p).X3))) *p = (*p) | uint32(i32(32)) sink5(*p) } func() { - if (*XExprList)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118905), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406))) crt.X__builtin_abort(tls) } }() _45: func() { - if (*XExprList)(_pPrior.X12) != nil { + if _pPrior.X12 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118910), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98595))) crt.X__builtin_abort(tls) } @@ -76945,28 +80313,28 @@ _45: }() _14_op = uint8(i32(1)) _56: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil _14_pLimit = (*XExpr)(_p.X15) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = nil _14_pOffset = (*XExpr)(_p.X16) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil - *(*uint8)(unsafe.Pointer(&(_14_uniondest.X0))) = _14_op + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = nil + *(*uint8)(unsafe.Pointer(&_14_uniondest.X0)) = _14_op _iSub2 = _pParse.X59 _rc = _sqlite3Select(tls, _pParse, _p, &_14_uniondest) _sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12)) _pDelete = (*XSelect)(_p.X13) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pPrior + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = nil if int32(_p.X1) == i32(115) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) } _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _14_pLimit - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _14_pOffset - *(*int32)(unsafe.Pointer(&(_p.X4))) = i32(0) - *(*int32)(unsafe.Pointer(&(_p.X5))) = i32(0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = _14_pLimit + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = _14_pOffset + *(*int32)(unsafe.Pointer(&_p.X4)) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X5)) = i32(0) func() { - if _14_unionTab != (_dest.X2) && int32(_dest.X0) == _14_priorOp { + if _14_unionTab != _dest.X2 && int32(_dest.X0) == _14_priorOp { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118953), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98629))) crt.X__builtin_abort(tls) } @@ -76975,7 +80343,7 @@ _56: goto _63 } func() { - if (*XExprList)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118956), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406))) crt.X__builtin_abort(tls) } @@ -76985,7 +80353,7 @@ _56: } _22_pFirst = _p _67: - if (*XSelect)(_22_pFirst.X13) != nil { + if _22_pFirst.X13 != nil { _22_pFirst = (*XSelect)(_22_pFirst.X13) goto _67 } @@ -77010,8 +80378,8 @@ _28: crt.X__builtin_abort(tls) } }() - _23_tab1 = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - _23_tab2 = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _23_tab1 = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + _23_tab2 = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) func() { if (*XExprList)(_p.X12) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118990), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98555))) @@ -77020,19 +80388,19 @@ _28: }() _23_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _23_tab1, i32(0)) func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0))))) != i32(-1) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(0))))) != i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118993), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98570))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _23_addr + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(0)))) = _23_addr { p := (*uint32)(unsafe.Pointer(&(_findRightmost(tls, _p).X3))) *p = (*p) | uint32(i32(32)) sink5(*p) } func() { - if (*XExprList)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118996), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406))) crt.X__builtin_abort(tls) } @@ -77045,30 +80413,30 @@ _28: } _23_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _23_tab2, i32(0)) func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(1))))) != i32(-1) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(1))))) != i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119010), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98695))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(1)))) = _23_addr - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(1)))) = _23_addr + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil _23_pLimit = (*XExpr)(_p.X15) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = nil _23_pOffset = (*XExpr)(_p.X16) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil - *(*int32)(unsafe.Pointer(&(_23_intersectdest.X2))) = _23_tab2 + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = nil + *(*int32)(unsafe.Pointer(&_23_intersectdest.X2)) = _23_tab2 _iSub2 = _pParse.X59 _rc = _sqlite3Select(tls, _pParse, _p, &_23_intersectdest) _pDelete = (*XSelect)(_p.X13) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pPrior if int32(_p.X2) > int32(_pPrior.X2) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _pPrior.X2 + *(*int16)(unsafe.Pointer(&_p.X2)) = _pPrior.X2 } _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _23_pLimit - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _23_pOffset + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = _23_pLimit + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = _23_pOffset func() { - if (*XExprList)(_p.X0) == nil { + if _p.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119031), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406))) crt.X__builtin_abort(tls) } @@ -77078,7 +80446,7 @@ _28: } _25_pFirst = _p _84: - if (*XSelect)(_25_pFirst.X13) != nil { + if _25_pFirst.X13 != nil { _25_pFirst = (*XSelect)(_25_pFirst.X13) goto _84 } @@ -77101,7 +80469,7 @@ _83: goto _39 _39: _explainComposite(tls, _pParse, int32(_p.X1), _iSub1, _iSub2, bool2int(int32(_p.X1) != i32(116))) - if ((_p.X3) & uint32(i32(32))) == 0 { + if (_p.X3 & uint32(i32(32))) == 0 { goto _multi_select_end } func() { @@ -77116,7 +80484,7 @@ _39: _rc = _sqlite3NomemError(tls, i32(119078)) goto _multi_select_end } - *func() ***XCollSeq { _26_i = i32(0); return &_26_apColl }() = (**XCollSeq)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_26_pKeyInfo.X6))))) + *func() ***XCollSeq { _26_i = i32(0); return &_26_apColl }() = (**XCollSeq)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_26_pKeyInfo.X6)))) _90: if _26_i >= _26_nCol { goto _93 @@ -77138,10 +80506,10 @@ _99: if _26_i >= i32(2) { goto _102 } - _31_addr = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(_26_i))) + _31_addr = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_26_pLoop.X7)))) + 4*uintptr(_26_i))) if _31_addr < i32(0) { func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(i32(1))))) >= i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_26_pLoop.X7)))) + 4*uintptr(i32(1))))) >= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119094), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98732))) crt.X__builtin_abort(tls) } @@ -77150,7 +80518,7 @@ _99: } _sqlite3VdbeChangeP2(tls, _v, uint32(_31_addr), _26_nCol) _sqlite3VdbeChangeP4(tls, _v, _31_addr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _26_pKeyInfo))), i32(-5)) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(_26_i))) = i32(-1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_26_pLoop.X7)))) + 4*uintptr(_26_i))) = i32(-1) _26_i += 1 goto _99 _102: @@ -77159,8 +80527,8 @@ _102: _98: _sqlite3KeyInfoUnref(tls, _26_pKeyInfo) _multi_select_end: - *(*int32)(unsafe.Pointer(&(_pDest.X3))) = _dest.X3 - *(*int32)(unsafe.Pointer(&(_pDest.X4))) = _dest.X4 + *(*int32)(unsafe.Pointer(&_pDest.X3)) = _dest.X3 + *(*int32)(unsafe.Pointer(&_pDest.X4)) = _dest.X4 _sqlite3SelectDelete(tls, _db, _pDelete) return _rc @@ -77176,29 +80544,32 @@ func init() { crt.Xstrncpy(nil, &_multiSelectØ00__func__Ø000[0], str(98757), 12) } -// Handle the special case of a compound-select that originates from a -// VALUES clause. By handling this as a special case, we avoid deep -// recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT -// on a VALUES clause. -// -// Because the Select object originates from a VALUES clause: -// (1) It has no LIMIT or OFFSET -// (2) All terms are UNION ALL -// (3) There is no ORDER BY clause +// C comment +// /* +// ** Handle the special case of a compound-select that originates from a +// ** VALUES clause. By handling this as a special case, we avoid deep +// ** recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT +// ** on a VALUES clause. +// ** +// ** Because the Select object originates from a VALUES clause: +// ** (1) It has no LIMIT or OFFSET +// ** (2) All terms are UNION ALL +// ** (3) There is no ORDER BY clause +// */ func _multiSelectValues(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) { var _nRow, _rc int32 var _pPrior *XSelect _nRow = i32(1) _rc = i32(0) func() { - if ((_p.X3) & uint32(i32(1024))) == 0 { + if (_p.X3 & uint32(i32(1024))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118702), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98769))) crt.X__builtin_abort(tls) } }() _2: func() { - if ((_p.X3) & uint32(i32(512))) == 0 { + if (_p.X3 & uint32(i32(512))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118704), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98797))) crt.X__builtin_abort(tls) } @@ -77244,13 +80615,13 @@ _17: goto _21 } _pPrior = (*XSelect)(_p.X13) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil _rc = _sqlite3Select(tls, _pParse, _p, _pDest) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pPrior if _rc != 0 { goto _21 } - *(*int16)(unsafe.Pointer(&(_p.X2))) = int16(_nRow) + *(*int16)(unsafe.Pointer(&_p.X2)) = int16(_nRow) _p = (*XSelect)(_p.X14) goto _17 _21: @@ -77263,40 +80634,43 @@ func init() { crt.Xstrncpy(nil, &_multiSelectValuesØ00__func__Ø000[0], str(98950), 18) } -// This routine generates VDBE code to compute the content of a WITH RECURSIVE -// query of the form: -// -// <recursive-table> AS (<setup-query> UNION [ALL] <recursive-query>) -// \___________/ \_______________/ -// p->pPrior p -// -// -// There is exactly one reference to the recursive-table in the FROM clause -// of recursive-query, marked with the SrcList->a[].fg.isRecursive flag. -// -// The setup-query runs once to generate an initial set of rows that go -// into a Queue table. Rows are extracted from the Queue table one by -// one. Each row extracted from Queue is output to pDest. Then the single -// extracted row (now in the iCurrent table) becomes the content of the -// recursive-table for a recursive-query run. The output of the recursive-query -// is added back into the Queue table. Then another row is extracted from Queue -// and the iteration continues until the Queue table is empty. -// -// If the compound query operator is UNION then no duplicate rows are ever -// inserted into the Queue table. The iDistinct table keeps a copy of all rows -// that have ever been inserted into Queue and causes duplicates to be -// discarded. If the operator is UNION ALL, then duplicates are allowed. -// -// If the query has an ORDER BY, then entries in the Queue table are kept in -// ORDER BY order and the first entry is extracted for each cycle. Without -// an ORDER BY, the Queue table is just a FIFO. -// -// If a LIMIT clause is provided, then the iteration stops after LIMIT rows -// have been output to pDest. A LIMIT of zero means to output no rows and a -// negative LIMIT means to output all rows. If there is also an OFFSET clause -// with a positive value, then the first OFFSET outputs are discarded rather -// than being sent to pDest. The LIMIT count does not begin until after OFFSET -// rows have been skipped. +// C comment +// /* +// ** This routine generates VDBE code to compute the content of a WITH RECURSIVE +// ** query of the form: +// ** +// ** <recursive-table> AS (<setup-query> UNION [ALL] <recursive-query>) +// ** \___________/ \_______________/ +// ** p->pPrior p +// ** +// ** +// ** There is exactly one reference to the recursive-table in the FROM clause +// ** of recursive-query, marked with the SrcList->a[].fg.isRecursive flag. +// ** +// ** The setup-query runs once to generate an initial set of rows that go +// ** into a Queue table. Rows are extracted from the Queue table one by +// ** one. Each row extracted from Queue is output to pDest. Then the single +// ** extracted row (now in the iCurrent table) becomes the content of the +// ** recursive-table for a recursive-query run. The output of the recursive-query +// ** is added back into the Queue table. Then another row is extracted from Queue +// ** and the iteration continues until the Queue table is empty. +// ** +// ** If the compound query operator is UNION then no duplicate rows are ever +// ** inserted into the Queue table. The iDistinct table keeps a copy of all rows +// ** that have ever been inserted into Queue and causes duplicates to be +// ** discarded. If the operator is UNION ALL, then duplicates are allowed. +// ** +// ** If the query has an ORDER BY, then entries in the Queue table are kept in +// ** ORDER BY order and the first entry is extracted for each cycle. Without +// ** an ORDER BY, the Queue table is just a FIFO. +// ** +// ** If a LIMIT clause is provided, then the iteration stops after LIMIT rows +// ** have been output to pDest. A LIMIT of zero means to output no rows and a +// ** negative LIMIT means to output all rows. If there is also an OFFSET clause +// ** with a positive value, then the first OFFSET outputs are discarded rather +// ** than being sent to pDest. The LIMIT count does not begin until after OFFSET +// ** rows have been skipped. +// */ func _generateWithRecursiveQuery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) { var _nCol, _addrTop, _addrCont, _addrBreak, _iCurrent, _regCurrent, _iQueue, _iDistinct, _eDest, _i, _rc, _regLimit, _regOffset int32 var _v *TVdbe @@ -77317,19 +80691,19 @@ func _generateWithRecursiveQuery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pD return } _addrBreak = _sqlite3VdbeMakeLabel(tls, _v) - *(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(320)) + *(*int16)(unsafe.Pointer(&_p.X2)) = int16(i32(320)) _computeLimitRegisters(tls, _pParse, _p, _addrBreak) _pLimit = (*XExpr)(_p.X15) _pOffset = (*XExpr)(_p.X16) _regLimit = _p.X4 _regOffset = _p.X5 - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))), nil) - *(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X5))), i32(0)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))), nil) + *(*int32)(unsafe.Pointer(&_p.X4)) = store1((*int32)(unsafe.Pointer(&_p.X5)), i32(0)) _pOrderBy = (*XExprList)(_p.X12) _i = i32(0) _1: if func() int32 { - if _i < (_pSrc.X0) { + if _i < _pSrc.X0 { return i32(1) } return func() int32 { @@ -77340,14 +80714,14 @@ _1: }() == 0 { goto _6 } - if ((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i))).X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { - _iCurrent = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(_i))).X11 + if ((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i))).X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _iCurrent = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_i))).X11 goto _6 } _i += 1 goto _1 _6: - _iQueue = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iQueue = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) if int32(_p.X1) == i32(115) { _eDest = func() int32 { if _pOrderBy != nil { @@ -77355,7 +80729,7 @@ _6: } return i32(6) }() - _iDistinct = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iDistinct = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) goto _11 } _eDest = func() int32 { @@ -77366,36 +80740,36 @@ _6: }() _11: _sqlite3SelectDestInit(tls, &_destQueue, _eDest, _iQueue) - _regCurrent = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _regCurrent = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp3(tls, _v, i32(113), _iCurrent, _regCurrent, _nCol) if _pOrderBy != nil { _5_pKeyInfo = _multiSelectOrderByKeyInfo(tls, _pParse, _p, i32(1)) - _sqlite3VdbeAddOp4(tls, _v, i32(110), _iQueue, (_pOrderBy.X0)+i32(2), i32(0), (*int8)(unsafe.Pointer(_5_pKeyInfo)), i32(-5)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_destQueue.X5))))) = _pOrderBy + _sqlite3VdbeAddOp4(tls, _v, i32(110), _iQueue, _pOrderBy.X0+i32(2), i32(0), (*int8)(unsafe.Pointer(_5_pKeyInfo)), i32(-5)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_destQueue.X5)))) = _pOrderBy goto _15 } _sqlite3VdbeAddOp2(tls, _v, i32(110), _iQueue, _nCol) _15: _sqlite3VdbeComment(tls, _v, str(98968)) if _iDistinct != 0 { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iDistinct, i32(0)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_p.X7)))) + 4*uintptr(i32(0)))) = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iDistinct, i32(0)) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(32)) sink5(*p) } } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSetup.X14))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSetup.X14)))) = nil _rc = _sqlite3Select(tls, _pParse, _pSetup, &_destQueue) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSetup.X14))))) = _p + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSetup.X14)))) = _p if _rc != 0 { goto _end_of_recursive_query } _addrTop = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iQueue, _addrBreak) _sqlite3VdbeAddOp1(tls, _v, i32(126), _iCurrent) if _pOrderBy != nil { - _sqlite3VdbeAddOp3(tls, _v, i32(99), _iQueue, (_pOrderBy.X0)+i32(1), _regCurrent) + _sqlite3VdbeAddOp3(tls, _v, i32(99), _iQueue, _pOrderBy.X0+i32(1), _regCurrent) goto _19 } _sqlite3VdbeAddOp2(tls, _v, i32(124), _iQueue, _regCurrent) @@ -77408,11 +80782,11 @@ _19: _sqlite3VdbeAddOp2(tls, _v, i32(48), _regLimit, _addrBreak) } _sqlite3VdbeResolveLabel(tls, _v, _addrCont) - if ((_p.X3) & uint32(i32(8))) != 0 { + if (_p.X3 & uint32(i32(8))) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(98980)) goto _22 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil _sqlite3Select(tls, _pParse, _p, &_destQueue) func() { if (*XSelect)(_p.X13) != nil { @@ -77420,45 +80794,48 @@ _19: crt.X__builtin_abort(tls) } }() - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pSetup + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pSetup _22: _sqlite3VdbeGoto(tls, _v, _addrTop) _sqlite3VdbeResolveLabel(tls, _v, _addrBreak) _end_of_recursive_query: _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(_p.X12)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _pOrderBy - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _pLimit - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _pOffset + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = _pOrderBy + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = _pLimit + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = _pOffset _ = _destQueue } -// Compute the iLimit and iOffset fields of the SELECT based on the -// pLimit and pOffset expressions. pLimit and pOffset hold the expressions -// that appear in the original SQL statement after the LIMIT and OFFSET -// keywords. Or NULL if those keywords are omitted. iLimit and iOffset -// are the integer memory register numbers for counters used to compute -// the limit and offset. If there is no limit and/or offset, then -// iLimit and iOffset are negative. -// -// This routine changes the values of iLimit and iOffset only if -// a limit or offset is defined by pLimit and pOffset. iLimit and -// iOffset should have been preset to appropriate default values (zero) -// prior to calling this routine. -// -// The iOffset register (if it exists) is initialized to the value -// of the OFFSET. The iLimit register is initialized to LIMIT. Register -// iOffset+1 is initialized to LIMIT+OFFSET. -// -// Only if pLimit!=0 or pOffset!=0 do the limit registers get -// redefined. The UNION ALL operator uses this property to force -// the reuse of the same limit and offset registers across multiple -// SELECT statements. +// C comment +// /* +// ** Compute the iLimit and iOffset fields of the SELECT based on the +// ** pLimit and pOffset expressions. pLimit and pOffset hold the expressions +// ** that appear in the original SQL statement after the LIMIT and OFFSET +// ** keywords. Or NULL if those keywords are omitted. iLimit and iOffset +// ** are the integer memory register numbers for counters used to compute +// ** the limit and offset. If there is no limit and/or offset, then +// ** iLimit and iOffset are negative. +// ** +// ** This routine changes the values of iLimit and iOffset only if +// ** a limit or offset is defined by pLimit and pOffset. iLimit and +// ** iOffset should have been preset to appropriate default values (zero) +// ** prior to calling this routine. +// ** +// ** The iOffset register (if it exists) is initialized to the value +// ** of the OFFSET. The iLimit register is initialized to LIMIT. Register +// ** iOffset+1 is initialized to LIMIT+OFFSET. +// ** +// ** Only if pLimit!=0 or pOffset!=0 do the limit registers get +// ** redefined. The UNION ALL operator uses this property to force +// ** the reuse of the same limit and offset registers across multiple +// ** SELECT statements. +// */ func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak int32) { var _iLimit, _iOffset, _n int32 var _v *TVdbe _v = nil _iLimit = i32(0) - if (_p.X4) != 0 { + if _p.X4 != 0 { return } _sqlite3ExprCacheClear(tls, _pParse) @@ -77468,10 +80845,10 @@ func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak crt.X__builtin_abort(tls) } }() - if (*XExpr)(_p.X15) == nil { + if _p.X15 == nil { goto _4 } - *(*int32)(unsafe.Pointer(&(_p.X4))) = store1(&_iLimit, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) + *(*int32)(unsafe.Pointer(&_p.X4)) = store1(&_iLimit, preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) _v = _sqlite3GetVdbe(tls, _pParse) func() { if _v == nil { @@ -77489,9 +80866,9 @@ func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak goto _11 } if (_n >= i32(0)) && (int32(_p.X2) > int32(_sqlite3LogEst(tls, uint64(_n)))) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEst(tls, uint64(_n)) + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3LogEst(tls, uint64(_n)) { - p := (*uint32)(unsafe.Pointer(&(_p.X3))) + p := (*uint32)(unsafe.Pointer(&_p.X3)) *p = (*p) | uint32(i32(16384)) sink5(*p) } @@ -77504,9 +80881,9 @@ _7: _sqlite3VdbeComment(tls, _v, str(99052)) _sqlite3VdbeAddOp2(tls, _v, i32(22), _iLimit, _iBreak) _12: - if (*XExpr)(_p.X16) != nil { - *(*int32)(unsafe.Pointer(&(_p.X5))) = store1(&_iOffset, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) += 1 + if _p.X16 != nil { + *(*int32)(unsafe.Pointer(&_p.X5)) = store1(&_iOffset, preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) + *(*int32)(unsafe.Pointer(&_pParse.X18)) += 1 _sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.X16), _iOffset) _sqlite3VdbeAddOp1(tls, _v, i32(17), _iOffset) _sqlite3VdbeComment(tls, _v, str(99066)) @@ -77516,7 +80893,10 @@ _12: _4: } -// Clear all column cache entries. +// C comment +// /* +// ** Clear all column cache entries. +// */ func _sqlite3ExprCacheClear(tls *crt.TLS, _pParse *XParse) { var _i int32 if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 { @@ -77527,13 +80907,13 @@ _1: if _i >= int32(_pParse.X13) { goto _4 } - if (((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X2) != 0) && (int32(_pParse.X7) < i32(8)) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X4 + if (((*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))).X2) != 0) && (int32(_pParse.X7) < i32(8)) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&_pParse.X7)), byte(1))))) = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))).X4 } _i += 1 goto _1 _4: - *(*uint8)(unsafe.Pointer(&(_pParse.X13))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X13)) = uint8(i32(0)) } var _computeLimitRegistersØ00__func__Ø000 [22]int8 @@ -77542,7 +80922,9 @@ func init() { crt.Xstrncpy(nil, &_computeLimitRegistersØ00__func__Ø000[0], str(99101), 22) } -// Generate code for an unconditional jump to instruction iDest +// C comment +// /* Generate code for an unconditional jump to instruction iDest +// */ func _sqlite3VdbeGoto(tls *crt.TLS, _p *TVdbe, _iDest int32) (r0 int32) { return _sqlite3VdbeAddOp3(tls, _p, i32(13), i32(0), _iDest, i32(0)) } @@ -77553,13 +80935,16 @@ func init() { crt.Xstrncpy(nil, &_generateWithRecursiveQueryØ00__func__Ø000[0], str(99123), 27) } -// The select statement passed as the second parameter is a compound SELECT -// with an ORDER BY clause. This function allocates and returns a KeyInfo -// structure suitable for implementing the ORDER BY. -// -// Space to hold the KeyInfo structure is obtained from malloc. The calling -// function is responsible for ensuring that this structure is eventually -// freed. +// C comment +// /* +// ** The select statement passed as the second parameter is a compound SELECT +// ** with an ORDER BY clause. This function allocates and returns a KeyInfo +// ** structure suitable for implementing the ORDER BY. +// ** +// ** Space to hold the KeyInfo structure is obtained from malloc. The calling +// ** function is responsible for ensuring that this structure is eventually +// ** freed. +// */ func _multiSelectOrderByKeyInfo(tls *crt.TLS, _pParse *XParse, _p *XSelect, _nExtra int32) (r0 *XKeyInfo) { var _nOrderBy, _1_i int32 var _db *Xsqlite3 @@ -77580,17 +80965,17 @@ _1: if _1_i >= _nOrderBy { goto _4 } - _2_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_1_i))) + _2_pItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_1_i))) _2_pTerm = (*XExpr)(_2_pItem.X0) - if ((_2_pTerm.X2) & uint32(i32(256))) != 0 { + if (_2_pTerm.X2 & uint32(i32(256))) != 0 { _2_pColl = _sqlite3ExprCollSeq(tls, _pParse, _2_pTerm) goto _6 } - _2_pColl = _multiSelectCollSeq(tls, _pParse, _p, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0)-i32(1)) + _2_pColl = _multiSelectCollSeq(tls, _pParse, _p, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_2_pItem.X5)))).X0)-i32(1)) if _2_pColl == nil { _2_pColl = (*XCollSeq)(_db.X2) } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_1_i))).X0))))) = _sqlite3ExprAddCollateString(tls, _pParse, _2_pTerm, _2_pColl.X0) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_1_i))).X0))))) = _sqlite3ExprAddCollateString(tls, _pParse, _2_pTerm, _2_pColl.X0) _6: func() { if _sqlite3KeyInfoIsWriteable(tls, _pRet) == 0 { @@ -77598,8 +80983,8 @@ _6: crt.X__builtin_abort(tls) } }() - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pRet.X6))))) + 8*uintptr(_1_i))) = _2_pColl - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRet.X5)) + 1*uintptr(_1_i))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_1_i))).X3 + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pRet.X6)))) + 8*uintptr(_1_i))) = _2_pColl + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pRet.X5)) + 1*uintptr(_1_i))) = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_1_i))).X3 _1_i += 1 goto _1 _4: @@ -77607,15 +80992,18 @@ _0: return _pRet } -// Return the appropriate collating sequence for the iCol-th column of -// the result set for the compound-select statement "p". Return NULL if -// the column has no default collating sequence. -// -// The collating sequence for the compound select is taken from the -// left-most term of the select that has a collating sequence. +// C comment +// /* +// ** Return the appropriate collating sequence for the iCol-th column of +// ** the result set for the compound-select statement "p". Return NULL if +// ** the column has no default collating sequence. +// ** +// ** The collating sequence for the compound select is taken from the +// ** left-most term of the select that has a collating sequence. +// */ func _multiSelectCollSeq(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iCol int32) (r0 *XCollSeq) { var _pRet *XCollSeq - if (*XSelect)(_p.X13) != nil { + if _p.X13 != nil { _pRet = _multiSelectCollSeq(tls, _pParse, (*XSelect)(_p.X13), _iCol) goto _1 } @@ -77637,7 +81025,7 @@ _1: return i32(0) }() }() != 0 { - _pRet = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+32*uintptr(_iCol))).X0)) + _pRet = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+32*uintptr(_iCol))).X0)) } return _pRet } @@ -77654,7 +81042,10 @@ func init() { crt.Xstrncpy(nil, &_multiSelectOrderByKeyInfoØ00__func__Ø000[0], str(99209), 26) } -// Add code to implement the OFFSET +// C comment +// /* +// ** Add code to implement the OFFSET +// */ func _codeOffset(tls *crt.TLS, _v *TVdbe, _iOffset int32, _iContinue int32) { if _iOffset > i32(0) { _sqlite3VdbeAddOp3(tls, _v, i32(46), _iOffset, _iContinue, i32(1)) @@ -77662,13 +81053,16 @@ func _codeOffset(tls *crt.TLS, _v *TVdbe, _iOffset int32, _iContinue int32) { } } -// This routine generates the code for the inside of the inner loop -// of a SELECT. -// -// If srcTab is negative, then the pEList expressions -// are evaluated in order to get the data for this row. If srcTab is -// zero or more, then data is pulled from srcTab and pEList is used only -// to get the number of columns and the collation sequence for each column. +// C comment +// /* +// ** This routine generates the code for the inside of the inner loop +// ** of a SELECT. +// ** +// ** If srcTab is negative, then the pEList expressions +// ** are evaluated in order to get the data for this row. If srcTab is +// ** zero or more, then data is pulled from srcTab and pEList is used only +// ** to get the number of columns and the collation sequence for each column. +// */ func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExprList, _srcTab int32, _pSort *XSortCtx, _pDistinct *XDistinctCtx, _pDest *XSelectDest, _iContinue int32, _iBreak int32) { var _i, _hasDistinct, _eDest, _iParm, _nResultCol, _nPrefixReg, _regResult, _regOrig, _11_j, _15_iJump, _15_regPrev, _23_r1, _25_r1, _26_addr, _28_r2, _31_r1, _40_nKey, _40_r1, _40_r2, _40_r3, _40_addrTest int32 var _7_ecelFlags uint8 @@ -77711,7 +81105,7 @@ func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExpr _codeOffset(tls, _v, _p.X5, _iContinue) } _nResultCol = _pEList.X0 - if (_pDest.X3) != i32(0) { + if _pDest.X3 != i32(0) { goto _12 } if _pSort == nil { @@ -77722,28 +81116,28 @@ func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExpr _nPrefixReg += 1 } { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nPrefixReg sink1(*p) } _13: - *(*int32)(unsafe.Pointer(&(_pDest.X3))) = (_pParse.X18) + i32(1) + *(*int32)(unsafe.Pointer(&_pDest.X3)) = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nResultCol sink1(*p) } goto _16 _12: - if ((_pDest.X3) + _nResultCol) > (_pParse.X18) { + if (_pDest.X3 + _nResultCol) > _pParse.X18 { { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nResultCol sink1(*p) } } _16: - *(*int32)(unsafe.Pointer(&(_pDest.X4))) = _nResultCol + *(*int32)(unsafe.Pointer(&_pDest.X4)) = _nResultCol _regOrig = store1(&_regResult, _pDest.X3) if _srcTab < i32(0) { goto _17 @@ -77754,7 +81148,7 @@ _18: goto _21 } _sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _i, _regResult+_i) - _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X1)) + _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X1)) _i += 1 goto _18 _21: @@ -77782,8 +81176,8 @@ _32: if _i >= ((*XExprList)(_pSort.X0).X0) { goto _35 } - if store1(&_11_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSort.X0).X2)))))+32*uintptr(_i))).X5))))).X0)) > i32(0) { - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_11_j-i32(1)))).X5))))).X0))) = uint16((_i + i32(1)) - (_pSort.X1)) + if store1(&_11_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSort.X0).X2)))))+32*uintptr(_i))).X5))))).X0)) > i32(0) { + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_11_j-i32(1)))).X5))))).X0))) = uint16((_i + i32(1)) - _pSort.X1) } _i += 1 goto _32 @@ -77811,24 +81205,24 @@ _23: } _44: - _15_regPrev = (_pParse.X18) + i32(1) + _15_regPrev = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nResultCol sink1(*p) } _sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.X3) _15_pOp = _sqlite3VdbeGetOp(tls, _v, _pDistinct.X3) - *(*uint8)(unsafe.Pointer(&(_15_pOp.X0))) = uint8(i32(59)) - *(*int32)(unsafe.Pointer(&(_15_pOp.X3))) = i32(1) - *(*int32)(unsafe.Pointer(&(_15_pOp.X4))) = _15_regPrev + *(*uint8)(unsafe.Pointer(&_15_pOp.X0)) = uint8(i32(59)) + *(*int32)(unsafe.Pointer(&_15_pOp.X3)) = i32(1) + *(*int32)(unsafe.Pointer(&_15_pOp.X4)) = _15_regPrev _15_iJump = _sqlite3VdbeCurrentAddr(tls, _v) + _nResultCol _i = i32(0) _47: if _i >= _nResultCol { goto _50 } - _16_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X0)) + _16_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X0)) if _i < (_nResultCol - i32(1)) { _sqlite3VdbeAddOp3(tls, _v, i32(77), _regResult+_i, _15_iJump, _15_regPrev+_i) goto _52 @@ -77955,7 +81349,7 @@ _68: _69: if _pSort != nil { func() { - if _nResultCol > (_pDest.X4) { + if _nResultCol > _pDest.X4 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117451), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99488))) crt.X__builtin_abort(tls) } @@ -77964,7 +81358,7 @@ _69: goto _88 } func() { - if _nResultCol != (_pDest.X4) { + if _nResultCol != _pDest.X4 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117455), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99513))) crt.X__builtin_abort(tls) } @@ -78016,7 +81410,7 @@ _101: if _i >= _40_nKey { goto _104 } - _sqlite3VdbeAddOp2(tls, _v, i32(65), (_regResult+int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_40_pSO.X2)))))+32*uintptr(_i))).X5))))).X0))-i32(1), _40_r2+_i) + _sqlite3VdbeAddOp2(tls, _v, i32(65), (_regResult+int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_40_pSO.X2))))+32*uintptr(_i))).X5))))).X0))-i32(1), _40_r2+_i) _i += 1 goto _101 _104: @@ -78038,7 +81432,7 @@ _74: }() goto _75 _75: - if (_pSort == nil) && (_p.X4) != 0 { + if (_pSort == nil) && _p.X4 != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(48), _p.X4, _iBreak) } } @@ -78049,20 +81443,23 @@ func init() { crt.Xstrncpy(nil, &_selectInnerLoopØ00__func__Ø000[0], str(99578), 16) } -// Generate code that pushes the value of every element of the given -// expression list into a sequence of registers beginning at target. -// -// Return the number of elements evaluated. -// -// The SQLITE_ECEL_DUP flag prevents the arguments from being -// filled using OP_SCopy. OP_Copy must be used instead. -// -// The SQLITE_ECEL_FACTOR argument allows constant arguments to be -// factored out into initialization code. -// -// The SQLITE_ECEL_REF flag means that expressions in the list with -// ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored -// in registers at srcReg, and so the value can be copied from there. +// C comment +// /* +// ** Generate code that pushes the value of every element of the given +// ** expression list into a sequence of registers beginning at target. +// ** +// ** Return the number of elements evaluated. +// ** +// ** The SQLITE_ECEL_DUP flag prevents the arguments from being +// ** filled using OP_SCopy. OP_Copy must be used instead. +// ** +// ** The SQLITE_ECEL_FACTOR argument allows constant arguments to be +// ** factored out into initialization code. +// ** +// ** The SQLITE_ECEL_REF flag means that expressions in the list with +// ** ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored +// ** in registers at srcReg, and so the value can be copied from there. +// */ func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _target int32, _srcReg int32, _flags uint8) (r0 int32) { var _i, _j, _n, _6_inReg int32 var _copyOp uint8 @@ -78096,7 +81493,7 @@ func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, } }() _n = _pList.X0 - if (_pParse.X11) == 0 { + if _pParse.X11 == 0 { { p := &_flags *p = uint8(int32(*p) & i32(-3)) @@ -78104,7 +81501,7 @@ func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, } } *func() *int32 { - _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) return &_i }() = i32(0) _9: @@ -78112,7 +81509,7 @@ _9: goto _12 } _1_pExpr = (*XExpr)(_pItem.X0) - if (int32(_flags)&i32(4)) == i32(0) || store1(&_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0)) <= i32(0) { + if (int32(_flags)&i32(4)) == i32(0) || store1(&_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_pItem.X5)))).X0)) <= i32(0) { goto _14 } if (int32(_flags) & i32(8)) != 0 { @@ -78132,8 +81529,8 @@ _14: if _6_inReg == (_target + _i) { goto _21 } - if (((int32(_copyOp) == i32(64)) && (int32(store40(&_7_pOp, _sqlite3VdbeGetOp(tls, _v, i32(-1))).X0) == i32(64))) && ((((_7_pOp.X3) + (_7_pOp.X5)) + i32(1)) == _6_inReg)) && ((((_7_pOp.X4) + (_7_pOp.X5)) + i32(1)) == (_target + _i)) { - *(*int32)(unsafe.Pointer(&(_7_pOp.X5))) += 1 + if (((int32(_copyOp) == i32(64)) && (int32(store40(&_7_pOp, _sqlite3VdbeGetOp(tls, _v, i32(-1))).X0) == i32(64))) && (((_7_pOp.X3 + _7_pOp.X5) + i32(1)) == _6_inReg)) && (((_7_pOp.X4 + _7_pOp.X5) + i32(1)) == (_target + _i)) { + *(*int32)(unsafe.Pointer(&_7_pOp.X5)) += 1 goto _26 } _sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), _6_inReg, _target+_i) @@ -78152,23 +81549,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeExprListØ00__func__Ø000[0], str(99620), 24) } -// Walk an expression tree. Return non-zero if the expression is constant -// and 0 if it involves variables or function calls. -// -// For the purposes of this function, a double-quoted string (ex: "abc") -// is considered a variable but a single-quoted string (ex: 'abc') is -// a constant. +// C comment +// /* +// ** Walk an expression tree. Return non-zero if the expression is constant +// ** and 0 if it involves variables or function calls. +// ** +// ** For the purposes of this function, a double-quoted string (ex: "abc") +// ** is considered a variable but a single-quoted string (ex: 'abc') is +// ** a constant. +// */ func _sqlite3ExprIsConstant(tls *crt.TLS, _p *XExpr) (r0 int32) { return _exprIsConst(tls, _p, i32(1), i32(0)) } func _exprIsConst(tls *crt.TLS, _p *XExpr, _initFlag int32, _iCur int32) (r0 int32) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(_initFlag) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprNodeIsConstant - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _selectNodeIsConstant - *(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))) = _iCur + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*uint8)(unsafe.Pointer(&_w.X5)) = uint8(_initFlag) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _exprNodeIsConstant + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _selectNodeIsConstant + *(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))) = _iCur _sqlite3WalkExpr(tls, &_w, _p) return int32(_w.X5) @@ -78176,32 +81576,35 @@ func _exprIsConst(tls *crt.TLS, _p *XExpr, _initFlag int32, _iCur int32) (r0 int panic(0) } -// These routines are Walker callbacks used to check expressions to -// see if they are "constant" for some definition of constant. The -// Walker.eCode value determines the type of "constant" we are looking -// for. -// -// These callback routines are used to implement the following: -// -// sqlite3ExprIsConstant() pWalker->eCode==1 -// sqlite3ExprIsConstantNotJoin() pWalker->eCode==2 -// sqlite3ExprIsTableConstant() pWalker->eCode==3 -// sqlite3ExprIsConstantOrFunction() pWalker->eCode==4 or 5 -// -// In all cases, the callbacks set Walker.eCode=0 and abort if the expression -// is found to not be a constant. -// -// The sqlite3ExprIsConstantOrFunction() is used for evaluating expressions -// in a CREATE TABLE statement. The Walker.eCode value is 5 when parsing -// an existing schema and 4 when processing a new statement. A bound -// parameter raises an error for new statements, but is silently converted -// to NULL for existing schemas. This allows sqlite_master tables that -// contain a bound parameter because they were generated by older versions -// of SQLite to be parsed by newer versions of SQLite without raising a -// malformed schema error. +// C comment +// /* +// ** These routines are Walker callbacks used to check expressions to +// ** see if they are "constant" for some definition of constant. The +// ** Walker.eCode value determines the type of "constant" we are looking +// ** for. +// ** +// ** These callback routines are used to implement the following: +// ** +// ** sqlite3ExprIsConstant() pWalker->eCode==1 +// ** sqlite3ExprIsConstantNotJoin() pWalker->eCode==2 +// ** sqlite3ExprIsTableConstant() pWalker->eCode==3 +// ** sqlite3ExprIsConstantOrFunction() pWalker->eCode==4 or 5 +// ** +// ** In all cases, the callbacks set Walker.eCode=0 and abort if the expression +// ** is found to not be a constant. +// ** +// ** The sqlite3ExprIsConstantOrFunction() is used for evaluating expressions +// ** in a CREATE TABLE statement. The Walker.eCode value is 5 when parsing +// ** an existing schema and 4 when processing a new statement. A bound +// ** parameter raises an error for new statements, but is silently converted +// ** to NULL for existing schemas. This allows sqlite_master tables that +// ** contain a bound parameter because they were generated by older versions +// ** of SQLite to be parsed by newer versions of SQLite without raising a +// ** malformed schema error. +// */ func _exprNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { - if (int32(_pWalker.X5) == i32(2)) && (((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0))) { - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + if (int32(_pWalker.X5) == i32(2)) && ((_pExpr.X2 & uint32(i32(1))) != uint32(i32(0))) { + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) } switch int32(_pExpr.X0) { @@ -78224,27 +81627,27 @@ func _exprNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int } _3: - if (int32(_pWalker.X5) >= i32(4)) || (((_pExpr.X2) & uint32(i32(524288))) != uint32(i32(0))) { + if (int32(_pWalker.X5) >= i32(4)) || ((_pExpr.X2 & uint32(i32(524288))) != uint32(i32(0))) { return i32(0) } - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) _4: - if (int32(_pWalker.X5) == i32(3)) && ((_pExpr.X8) == (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))) { + if (int32(_pWalker.X5) == i32(3)) && (_pExpr.X8 == (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6)))))) { return i32(0) } _15: - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) _9: if int32(_pWalker.X5) == i32(5) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(101)) goto _18 } if int32(_pWalker.X5) == i32(4) { - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) } _18: @@ -78252,23 +81655,26 @@ _18: } func _selectNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _NotUsed *XSelect) (r0 int32) { - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) } -// Factor out the code of the given expression to initialization time. -// -// If regDest>=0 then the result is always stored in that register and the -// result is not reusable. If regDest<0 then this routine is free to -// store the value whereever it wants. The register where the expression -// is stored is returned. When regDest<0, two identical expressions will -// code to the same register. +// C comment +// /* +// ** Factor out the code of the given expression to initialization time. +// ** +// ** If regDest>=0 then the result is always stored in that register and the +// ** result is not reusable. If regDest<0 then this routine is free to +// ** store the value whereever it wants. The register where the expression +// ** is stored is returned. When regDest<0, two identical expressions will +// ** code to the same register. +// */ func _sqlite3ExprCodeAtInit(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _regDest int32) (r0 int32) { var _1_i int32 var _p *XExprList var _1_pItem, _4_pItem *TExprList_item func() { - if (_pParse.X11) == 0 { + if _pParse.X11 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeAtInitØ00__func__Ø000))), unsafe.Pointer(str(99644))) crt.X__builtin_abort(tls) } @@ -78278,15 +81684,15 @@ func _sqlite3ExprCodeAtInit(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _regDe goto _3 } *func() *int32 { - _1_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + _1_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2)))) return &_1_i }() = _p.X0 _4: if _1_i <= i32(0) { goto _7 } - if (((uint32((_1_pItem.X4)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_sqlite3ExprCompare(tls, (*XExpr)(_1_pItem.X0), _pExpr, i32(-1)) == i32(0)) { - return *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_1_pItem.X5))))) + if (((uint32(_1_pItem.X4>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_sqlite3ExprCompare(tls, (*XExpr)(_1_pItem.X0), _pExpr, i32(-1)) == i32(0)) { + return *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&_1_pItem.X5)))) } *func() *int32 { *(*uintptr)(unsafe.Pointer(&_1_pItem)) += uintptr(32); return &_1_i }() -= 1 goto _4 @@ -78297,14 +81703,14 @@ _3: if _p == nil { goto _10 } - _4_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr((_p.X0)-i32(1)))) - storebits3((*int8)(unsafe.Pointer(&(_4_pItem.X4))), int8(bool2int(_regDest < i32(0))), 4, 2) + _4_pItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_p.X0-i32(1)))) + storebits3((*int8)(unsafe.Pointer(&_4_pItem.X4)), int8(bool2int(_regDest < i32(0))), 4, 2) if _regDest < i32(0) { - _regDest = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _regDest = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) } - *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_4_pItem.X5))))) = _regDest + *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&_4_pItem.X5)))) = _regDest _10: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X27))))) = _p + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X27)))) = _p return _regDest } @@ -78314,23 +81720,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeAtInitØ00__func__Ø000[0], str(99666), 22) } -// Change the opcode at addr into OP_Noop +// C comment +// /* +// ** Change the opcode at addr into OP_Noop +// */ func _sqlite3VdbeChangeToNoop(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 int32) { var _pOp *XVdbeOp if ((*Xsqlite3)(_p.X0).X17) != 0 { return i32(0) } func() { - if _addr < i32(0) || _addr >= (_p.X27) { + if _addr < i32(0) || _addr >= _p.X27 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72328), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeToNoopØ00__func__Ø000))), unsafe.Pointer(str(99688))) crt.X__builtin_abort(tls) } }() _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_addr))) - _freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0)) - *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(164)) + _freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(0)) + *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))) = nil + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(164)) return i32(1) } @@ -78340,10 +81749,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeChangeToNoopØ00__func__Ø000[0], str(99711), 24) } -// Return the address of the next instruction to be inserted. +// C comment +// /* +// ** Return the address of the next instruction to be inserted. +// */ func _sqlite3VdbeCurrentAddr(tls *crt.TLS, _p *TVdbe) (r0 int32) { func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72061), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCurrentAddrØ00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } @@ -78357,13 +81769,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeCurrentAddrØ00__func__Ø000[0], str(99735), 23) } -// Add code that will check to make sure the N registers starting at iMem -// form a distinct entry. iTab is a sorting index that holds previously -// seen combinations of the N values. A new entry is made in iTab -// if the current N values are new. -// -// A jump to addrRepeat is made and the N+1 values are popped from the -// stack if the top N elements are not distinct. +// C comment +// /* +// ** Add code that will check to make sure the N registers starting at iMem +// ** form a distinct entry. iTab is a sorting index that holds previously +// ** seen combinations of the N values. A new entry is made in iTab +// ** if the current N values are new. +// ** +// ** A jump to addrRepeat is made and the N+1 values are popped from the +// ** stack if the top N elements are not distinct. +// */ func _codeDistinct(tls *crt.TLS, _pParse *XParse, _iTab int32, _addrRepeat int32, _N int32, _iMem int32) { var _r1 int32 var _v *TVdbe @@ -78376,43 +81791,52 @@ func _codeDistinct(tls *crt.TLS, _pParse *XParse, _iTab int32, _addrRepeat int32 _sqlite3ReleaseTempReg(tls, _pParse, _r1) } -// Allocate a single new register for use to hold some intermediate result. +// C comment +// /* +// ** Allocate a single new register for use to hold some intermediate result. +// */ func _sqlite3GetTempReg(tls *crt.TLS, _pParse *XParse) (r0 int32) { if int32(_pParse.X7) == i32(0) { - return preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + return preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) } - return *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(preInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), byte(255))))) + return *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(preInc2((*uint8)(unsafe.Pointer(&_pParse.X7)), byte(255))))) } -// Deallocate a register, making available for reuse for some other -// purpose. -// -// If a register is currently being used by the column cache, then -// the deallocation is deferred until the column cache line that uses -// the register becomes stale. +// C comment +// /* +// ** Deallocate a register, making available for reuse for some other +// ** purpose. +// ** +// ** If a register is currently being used by the column cache, then +// ** the deallocation is deferred until the column cache line that uses +// ** the register becomes stale. +// */ func _sqlite3ReleaseTempReg(tls *crt.TLS, _pParse *XParse, _iReg int32) { var _1_i int32 var _1_p *TyColCache if _iReg == 0 || int32(_pParse.X7) >= i32(8) { goto _1 } - *func() **TyColCache { _1_i = i32(0); return &_1_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _1_i = i32(0); return &_1_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _2: if _1_i >= int32(_pParse.X13) { goto _5 } - if (_1_p.X4) == _iReg { - *(*uint8)(unsafe.Pointer(&(_1_p.X2))) = uint8(i32(1)) + if _1_p.X4 == _iReg { + *(*uint8)(unsafe.Pointer(&_1_p.X2)) = uint8(i32(1)) return } *(*uintptr)(unsafe.Pointer(func() **TyColCache { _1_i += 1; return &_1_p }())) += uintptr(20) goto _2 _5: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = _iReg + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&_pParse.X7)), byte(1))))) = _iReg _1: } -// Allocate or deallocate a block of nReg consecutive registers. +// C comment +// /* +// ** Allocate or deallocate a block of nReg consecutive registers. +// */ func _sqlite3GetTempRange(tls *crt.TLS, _pParse *XParse, _nReg int32) (r0 int32) { var _i, _n int32 if _nReg == i32(1) { @@ -78428,20 +81852,20 @@ func _sqlite3GetTempRange(tls *crt.TLS, _pParse *XParse, _nReg int32) (r0 int32) } }() { - p := (*int32)(unsafe.Pointer(&(_pParse.X15))) + p := (*int32)(unsafe.Pointer(&_pParse.X15)) *p = (*p) + _nReg sink1(*p) } { - p := (*int32)(unsafe.Pointer(&(_pParse.X14))) + p := (*int32)(unsafe.Pointer(&_pParse.X14)) *p = (*p) - _nReg sink1(*p) } goto _4 } - _i = (_pParse.X18) + i32(1) + _i = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nReg sink1(*p) } @@ -78449,15 +81873,18 @@ _4: return _i } -// Return true if any register in the range iFrom..iTo (inclusive) -// is used as part of the column cache. -// -// This routine is used within assert() and testcase() macros only -// and does not appear in a normal build. +// C comment +// /* +// ** Return true if any register in the range iFrom..iTo (inclusive) +// ** is used as part of the column cache. +// ** +// ** This routine is used within assert() and testcase() macros only +// ** and does not appear in a normal build. +// */ func _usedAsColumnCache(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32) (r0 int32) { var _i, _1_r int32 var _p *TyColCache - *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + *func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) _0: if _i >= int32(_pParse.X13) { goto _3 @@ -78478,8 +81905,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GetTempRangeØ00__func__Ø000[0], str(99795), 20) } -// Generate code that will push the record in registers regData -// through regData+nData-1 onto the sorter. +// C comment +// /* +// ** Generate code that will push the record in registers regData +// ** through regData+nData-1 onto the sorter. +// */ func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect *XSelect, _regData int32, _regOrigData int32, _nData int32, _nPrefixReg int32) { var _bSeq, _nExpr, _nBase, _regBase, _regRecord, _nOBSat, _op, _iLimit, _5_regPrevKey, _5_addrFirst, _5_addrJmp, _5_nKey, _11_addr, _11_r1, _13_iBrk int32 var _v *TVdbe @@ -78489,7 +81919,7 @@ func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect * _bSeq = bool2int((int32(_pSort.X7) & i32(1)) == i32(0)) _nExpr = (*XExprList)(_pSort.X0).X0 _nBase = (_nExpr + _bSeq) + _nData - _regRecord = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _regRecord = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _nOBSat = _pSort.X1 func() { if _bSeq != i32(0) && _bSeq != i32(1) { @@ -78513,26 +81943,26 @@ func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect * _regBase = (_regData - _nExpr) - _bSeq goto _10 } - _regBase = (_pParse.X18) + i32(1) + _regBase = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nBase sink1(*p) } _10: func() { - if (_pSelect.X5) != i32(0) && (_pSelect.X4) == i32(0) { + if _pSelect.X5 != i32(0) && _pSelect.X4 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117052), unsafe.Pointer((*int8)(unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000))), unsafe.Pointer(str(99908))) crt.X__builtin_abort(tls) } }() _iLimit = func() int32 { - if (_pSelect.X5) != 0 { - return ((_pSelect.X5) + i32(1)) + if _pSelect.X5 != 0 { + return (_pSelect.X5 + i32(1)) } - return (_pSelect.X4) + return _pSelect.X4 }() - *(*int32)(unsafe.Pointer(&(_pSort.X6))) = _sqlite3VdbeMakeLabel(tls, _v) + *(*int32)(unsafe.Pointer(&_pSort.X6)) = _sqlite3VdbeMakeLabel(tls, _v) _sqlite3ExprCodeExprList(tls, _pParse, (*XExprList)(_pSort.X0), _regBase, _regOrigData, uint8(i32(1)|func() int32 { if _regOrigData != 0 { return i32(4) @@ -78549,13 +81979,13 @@ _10: if _nOBSat <= i32(0) { goto _21 } - _5_regPrevKey = (_pParse.X18) + i32(1) + _5_regPrevKey = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) - *p = (*p) + (_pSort.X1) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) + *p = (*p) + _pSort.X1 sink1(*p) } - _5_nKey = (_nExpr - (_pSort.X1)) + _bSeq + _5_nKey = (_nExpr - _pSort.X1) + _bSeq if _bSeq != 0 { _5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, i32(22), _regBase+_nExpr) goto _23 @@ -78567,15 +81997,15 @@ _23: if ((*Xsqlite3)(_pParse.X0).X17) != 0 { return } - *(*int32)(unsafe.Pointer(&(_5_pOp.X4))) = _5_nKey + _nData - _5_pKI = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_5_pOp.X6)))))) - crt.Xmemset(tls, (unsafe.Pointer)(_5_pKI.X5), i32(0), uint64(_5_pKI.X2)) + *(*int32)(unsafe.Pointer(&_5_pOp.X4)) = _5_nKey + _nData + _5_pKI = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_5_pOp.X6))))) + crt.Xmemset(tls, unsafe.Pointer(_5_pKI.X5), i32(0), uint64(_5_pKI.X2)) _sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(_5_pKI)), i32(-5)) - *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_5_pOp.X6))))))) = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_pSort.X0), _nOBSat, int32(_5_pKI.X3)-i32(1)) + *(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_5_pOp.X6)))))) = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_pSort.X0), _nOBSat, int32(_5_pKI.X3)-i32(1)) _5_addrJmp = _sqlite3VdbeCurrentAddr(tls, _v) _sqlite3VdbeAddOp3(tls, _v, i32(18), _5_addrJmp+i32(1), i32(0), _5_addrJmp+i32(1)) - *(*int32)(unsafe.Pointer(&(_pSort.X4))) = _sqlite3VdbeMakeLabel(tls, _v) - *(*int32)(unsafe.Pointer(&(_pSort.X3))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(*int32)(unsafe.Pointer(&_pSort.X4)) = _sqlite3VdbeMakeLabel(tls, _v) + *(*int32)(unsafe.Pointer(&_pSort.X3)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(14), _pSort.X3, _pSort.X4) _sqlite3VdbeAddOp1(tls, _v, i32(135), _pSort.X2) if _iLimit != 0 { @@ -78598,13 +82028,13 @@ _27: _11_r1 = i32(0) _11_addr = _sqlite3VdbeAddOp1(tls, _v, i32(47), _iLimit) _sqlite3VdbeAddOp1(tls, _v, i32(33), _pSort.X2) - if (_pSort.X8) != 0 { - _11_r1 = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if _pSort.X8 != 0 { + _11_r1 = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp3(tls, _v, i32(99), _pSort.X2, _nExpr, _11_r1) _sqlite3VdbeComment(tls, _v, str(61696)) } _sqlite3VdbeAddOp1(tls, _v, i32(120), _pSort.X2) - if (_pSort.X8) != 0 { + if _pSort.X8 != 0 { _13_iBrk = _sqlite3VdbeCurrentAddr(tls, _v) + i32(2) _sqlite3VdbeAddOp3(tls, _v, i32(78), _regBase+_nExpr, _13_iBrk, _11_r1) _sqlite3VdbeChangeP5(tls, _v, uint16(i32(128))) @@ -78619,8 +82049,11 @@ func init() { crt.Xstrncpy(nil, &_pushOntoSorterØ00__func__Ø000[0], str(99950), 15) } -// Generate code to move content from registers iFrom...iFrom+nReg-1 -// over to iTo..iTo+nReg-1. Keep the column cache up-to-date. +// C comment +// /* +// ** Generate code to move content from registers iFrom...iFrom+nReg-1 +// ** over to iTo..iTo+nReg-1. Keep the column cache up-to-date. +// */ func _sqlite3ExprCodeMove(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32, _nReg int32) { func() { if _iFrom < (_iTo+_nReg) && (_iFrom+_nReg) > _iTo { @@ -78638,18 +82071,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeMoveØ00__func__Ø000[0], str(100000), 20) } -// Given an expression list, generate a KeyInfo structure that records -// the collating sequence for each expression in that expression list. -// -// If the ExprList is an ORDER BY or GROUP BY clause then the resulting -// KeyInfo structure is appropriate for initializing a virtual index to -// implement that clause. If the ExprList is the result set of a SELECT -// then the KeyInfo structure is appropriate for initializing a virtual -// index to implement a DISTINCT test. -// -// Space to hold the KeyInfo structure is obtained from malloc. The calling -// function is responsible for seeing that this structure is eventually -// freed. +// C comment +// /* +// ** Given an expression list, generate a KeyInfo structure that records +// ** the collating sequence for each expression in that expression list. +// ** +// ** If the ExprList is an ORDER BY or GROUP BY clause then the resulting +// ** KeyInfo structure is appropriate for initializing a virtual index to +// ** implement that clause. If the ExprList is the result set of a SELECT +// ** then the KeyInfo structure is appropriate for initializing a virtual +// ** index to implement a DISTINCT test. +// ** +// ** Space to hold the KeyInfo structure is obtained from malloc. The calling +// ** function is responsible for seeing that this structure is eventually +// ** freed. +// */ func _keyInfoFromExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iStart int32, _nExtra int32) (r0 *XKeyInfo) { var _nExpr, _i int32 var _db *Xsqlite3 @@ -78668,7 +82104,7 @@ func _keyInfoFromExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iSt crt.X__builtin_abort(tls) } }() - *func() **TExprList_item { _i = _iStart; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))))) + uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(_iStart)*uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(32))))))))))) + *func() **TExprList_item { _i = _iStart; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))))) + uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(_iStart)*uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(32))))))))))) _3: if _i >= _nExpr { goto _6 @@ -78677,8 +82113,8 @@ _3: if _2_pColl == nil { _2_pColl = (*XCollSeq)(_db.X2) } - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X6))))) + 8*uintptr(_i-_iStart))) = _2_pColl - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pInfo.X5)) + 1*uintptr(_i-_iStart))) = _pItem.X3 + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pInfo.X6)))) + 8*uintptr(_i-_iStart))) = _2_pColl + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pInfo.X5)) + 1*uintptr(_i-_iStart))) = _pItem.X3 *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(32) goto _3 _6: @@ -78698,28 +82134,31 @@ func _sqlite3ReleaseTempRange(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg return } _sqlite3ExprCacheRemove(tls, _pParse, _iReg, _nReg) - if _nReg > (_pParse.X14) { - *(*int32)(unsafe.Pointer(&(_pParse.X14))) = _nReg - *(*int32)(unsafe.Pointer(&(_pParse.X15))) = _iReg + if _nReg > _pParse.X14 { + *(*int32)(unsafe.Pointer(&_pParse.X14)) = _nReg + *(*int32)(unsafe.Pointer(&_pParse.X15)) = _iReg } } -// Resolve label "x" to be the address of the next instruction to -// be inserted. The parameter "x" must have been obtained from -// a prior call to sqlite3VdbeMakeLabel(). +// C comment +// /* +// ** Resolve label "x" to be the address of the next instruction to +// ** be inserted. The parameter "x" must have been obtained from +// ** a prior call to sqlite3VdbeMakeLabel(). +// */ func _sqlite3VdbeResolveLabel(tls *crt.TLS, _v *TVdbe, _x int32) { var _j int32 var _p *XParse _p = (*XParse)(_v.X3) _j = i32(-1) - _x func() { - if (_v.X5) != uint32(i32(381479589)) { + if _v.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000))), unsafe.Pointer(str(44897))) crt.X__builtin_abort(tls) } }() func() { - if _j >= (_p.X25) { + if _j >= _p.X25 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71804), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000))), unsafe.Pointer(str(100073))) crt.X__builtin_abort(tls) } @@ -78730,8 +82169,8 @@ func _sqlite3VdbeResolveLabel(tls *crt.TLS, _v *TVdbe, _x int32) { crt.X__builtin_abort(tls) } }() - if (_p.X26) != nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X26)) + 4*uintptr(_j))) = _v.X27 + if _p.X26 != nil { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X26)) + 4*uintptr(_j))) = _v.X27 } } @@ -78800,18 +82239,18 @@ _11: if int32(_db.X17) != i32(0) || _i > ((*XExprList)(_p.X0).X0) { goto _15 } - *func() **TExprList_item { _j = i32(0); return &_2_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + *func() **TExprList_item { _j = i32(0); return &_2_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) _16: if _j >= _nOrderBy { goto _19 } func() { - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0) <= i32(0) { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_2_pItem.X5)))).X0) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119426), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100169))) crt.X__builtin_abort(tls) } }() - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0) == _i { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_2_pItem.X5)))).X0) == _i { goto _19 } *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _j += 1; return &_2_pItem }())) += uintptr(32) @@ -78825,14 +82264,14 @@ _19: return _sqlite3NomemError(tls, i32(119431)) } { - p := (*uint32)(unsafe.Pointer(&(_4_pNew.X2))) + p := (*uint32)(unsafe.Pointer(&_4_pNew.X2)) *p = (*p) | uint32(i32(1024)) sink5(*p) } - *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pNew.X3))))) = _i - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = store42(&_pOrderBy, _sqlite3ExprListAppend(tls, _pParse, _pOrderBy, _4_pNew)) + *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&_4_pNew.X3)))) = _i + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = store42(&_pOrderBy, _sqlite3ExprListAppend(tls, _pParse, _pOrderBy, _4_pNew)) if _pOrderBy != nil { - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(postInc1(&_nOrderBy, int32(1))))).X5))))).X0))) = uint16(_i) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(postInc1(&_nOrderBy, 1)))).X5))))).X0))) = uint16(_i) } _23: _i += 1 @@ -78843,25 +82282,25 @@ _10: if _aPermute == nil { goto _26 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPermute)) + 4*uintptr(i32(0)))) = _nOrderBy - *func() **TExprList_item { _i = i32(1); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPermute)) + 4*uintptr(i32(0)))) = _nOrderBy + *func() **TExprList_item { _i = i32(1); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) _27: if _i > _nOrderBy { goto _30 } func() { - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) <= i32(0) { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_5_pItem.X5)))).X0) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119452), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100169))) crt.X__builtin_abort(tls) } }() func() { - if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) > ((*XExprList)(_p.X0).X0) { + if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_5_pItem.X5)))).X0) > ((*XExprList)(_p.X0).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119453), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100194))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPermute)) + 4*uintptr(_i))) = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) - i32(1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aPermute)) + 4*uintptr(_i))) = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&_5_pItem.X5)))).X0) - i32(1) *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_5_pItem }())) += uintptr(32) goto _27 _30: @@ -78870,22 +82309,22 @@ _30: _26: _pKeyMerge = nil _35: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _pOrderBy - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X12))))) = _sqlite3ExprListDup(tls, (*Xsqlite3)(_pParse.X0), _pOrderBy, i32(0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X12)))) = _pOrderBy + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrior.X12)))) = _sqlite3ExprListDup(tls, (*Xsqlite3)(_pParse.X0), _pOrderBy, i32(0)) if _op == i32(116) { _regPrev = i32(0) goto _37 } _9_nExpr = (*XExprList)(_p.X0).X0 func() { - if _nOrderBy < _9_nExpr && (_db.X17) == 0 { + if _nOrderBy < _9_nExpr && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119474), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100235))) crt.X__builtin_abort(tls) } }() - _regPrev = (_pParse.X18) + i32(1) + _regPrev = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + (_9_nExpr + i32(1)) sink1(*p) } @@ -78905,28 +82344,28 @@ _44: if _i >= _9_nExpr { goto _47 } - *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyDup.X6))))) + 8*uintptr(_i))) = _multiSelectCollSeq(tls, _pParse, _p, _i) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyDup.X5)) + 1*uintptr(_i))) = uint8(i32(0)) + *(**XCollSeq)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&_pKeyDup.X6)))) + 8*uintptr(_i))) = _multiSelectCollSeq(tls, _pParse, _p, _i) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pKeyDup.X5)) + 1*uintptr(_i))) = uint8(i32(0)) _i += 1 goto _44 _47: _41: _37: - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X14))))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrior.X14)))) = nil _sqlite3ResolveOrderGroupBy(tls, _pParse, _p, (*XExprList)(_p.X12), str(25745)) if (*XSelect)(_pPrior.X13) == nil { _sqlite3ResolveOrderGroupBy(tls, _pParse, _pPrior, (*XExprList)(_pPrior.X12), str(25745)) } _computeLimitRegisters(tls, _pParse, _p, _labelEnd) - if (_p.X4) != 0 && (_op == i32(116)) { - _regLimitA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regLimitB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if _p.X4 != 0 && (_op == i32(116)) { + _regLimitA = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regLimitB = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(64), func() int32 { - if (_p.X5) != 0 { - return ((_p.X5) + i32(1)) + if _p.X5 != 0 { + return (_p.X5 + i32(1)) } - return (_p.X4) + return _p.X4 }(), _regLimitA) _sqlite3VdbeAddOp2(tls, _v, i32(64), _regLimitA, _regLimitB) goto _53 @@ -78934,19 +82373,19 @@ _37: _regLimitA = store1(&_regLimitB, i32(0)) _53: _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) = nil _sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X16)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil - _regAddrA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regAddrB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regOutA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regOutB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X16)))) = nil + _regAddrA = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regAddrB = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regOutA = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regOutB = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3SelectDestInit(tls, &_destA, i32(13), _regAddrA) _sqlite3SelectDestInit(tls, &_destB, i32(13), _regAddrB) _addrSelectA = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1) _addr1 = _sqlite3VdbeAddOp3(tls, _v, i32(15), _regAddrA, i32(0), _addrSelectA) _sqlite3VdbeComment(tls, _v, str(100306)) - *(*int32)(unsafe.Pointer(&(_pPrior.X4))) = _regLimitA + *(*int32)(unsafe.Pointer(&_pPrior.X4)) = _regLimitA _iSub1 = _pParse.X59 _sqlite3Select(tls, _pParse, _pPrior, &_destA) _sqlite3VdbeEndCoroutine(tls, _v, _regAddrA) @@ -78956,12 +82395,12 @@ _53: _sqlite3VdbeComment(tls, _v, str(100318)) _savedLimit = _p.X4 _savedOffset = _p.X5 - *(*int32)(unsafe.Pointer(&(_p.X4))) = _regLimitB - *(*int32)(unsafe.Pointer(&(_p.X5))) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X4)) = _regLimitB + *(*int32)(unsafe.Pointer(&_p.X5)) = i32(0) _iSub2 = _pParse.X59 _sqlite3Select(tls, _pParse, _p, &_destB) - *(*int32)(unsafe.Pointer(&(_p.X4))) = _savedLimit - *(*int32)(unsafe.Pointer(&(_p.X5))) = _savedOffset + *(*int32)(unsafe.Pointer(&_p.X4)) = _savedLimit + *(*int32)(unsafe.Pointer(&_p.X5)) = _savedOffset _sqlite3VdbeEndCoroutine(tls, _v, _regAddrB) _sqlite3VdbeNoopComment(tls, _v, str(100331)) _addrOutA = _generateOutputSubroutine(tls, _pParse, _p, &_destA, _pDest, _regOutA, _regPrev, _pKeyDup, _labelEnd) @@ -78978,14 +82417,14 @@ _53: _addrEofA = _sqlite3VdbeAddOp2(tls, _v, i32(14), _regOutB, _addrOutB) _addrEofA_noB = _sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrB, _labelEnd) _sqlite3VdbeGoto(tls, _v, _addrEofA) - *(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) + *(*int16)(unsafe.Pointer(&_p.X2)) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2) _58: if _op != i32(118) { goto _59 } _addrEofB = _addrEofA if int32(_p.X2) > int32(_pPrior.X2) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _pPrior.X2 + *(*int16)(unsafe.Pointer(&_p.X2)) = _pPrior.X2 } goto _61 _59: @@ -79032,19 +82471,19 @@ _65: } _24_pFirst = _pPrior _69: - if (*XSelect)(_24_pFirst.X13) != nil { + if _24_pFirst.X13 != nil { _24_pFirst = (*XSelect)(_24_pFirst.X13) goto _69 } _generateColumnNames(tls, _pParse, (*XSrcList)(_24_pFirst.X8), (*XExprList)(_24_pFirst.X0)) _68: - if (*XSelect)(_p.X13) != nil { + if _p.X13 != nil { _sqlite3SelectDelete(tls, _db, (*XSelect)(_p.X13)) } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X14))))) = _p + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _pPrior + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrior.X14)))) = _p _explainComposite(tls, _pParse, int32(_p.X1), _iSub1, _iSub2, i32(0)) - return bool2int((_pParse.X16) != i32(0)) + return bool2int(_pParse.X16 != i32(0)) _ = _destA _ = _destB @@ -79057,7 +82496,9 @@ func init() { crt.Xstrncpy(nil, &_multiSelectOrderByØ00__func__Ø000[0], str(100461), 19) } -// Insert the end of a co-routine +// C comment +// /* Insert the end of a co-routine +// */ func _sqlite3VdbeEndCoroutine(tls *crt.TLS, _v *TVdbe, _regYield int32) { _sqlite3VdbeAddOp1(tls, _v, i32(53), _regYield) *(*uint8)(unsafe.Pointer(&((*XParse)(_v.X3).X7))) = uint8(i32(0)) @@ -79074,24 +82515,27 @@ func _sqlite3VdbeNoopComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...in } } -// Code an output subroutine for a coroutine implementation of a -// SELECT statment. -// -// The data to be output is contained in pIn->iSdst. There are -// pIn->nSdst columns to be output. pDest is where the output should -// be sent. -// -// regReturn is the number of the register holding the subroutine -// return address. -// -// If regPrev>0 then it is the first register in a vector that -// records the previous output. mem[regPrev] is a flag that is false -// if there has been no previous output. If regPrev>0 then code is -// generated to suppress duplicates. pKeyInfo is used for comparing -// keys. -// -// If the LIMIT found in p->iLimit is reached, jump immediately to -// iBreak. +// C comment +// /* +// ** Code an output subroutine for a coroutine implementation of a +// ** SELECT statment. +// ** +// ** The data to be output is contained in pIn->iSdst. There are +// ** pIn->nSdst columns to be output. pDest is where the output should +// ** be sent. +// ** +// ** regReturn is the number of the register holding the subroutine +// ** return address. +// ** +// ** If regPrev>0 then it is the first register in a vector that +// ** records the previous output. mem[regPrev] is a flag that is false +// ** if there has been no previous output. If regPrev>0 then code is +// ** generated to suppress duplicates. pKeyInfo is used for comparing +// ** keys. +// ** +// ** If the LIMIT found in p->iLimit is reached, jump immediately to +// ** iBreak. +// */ func _generateOutputSubroutine(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pIn *XSelectDest, _pDest *XSelectDest, _regReturn int32, _regPrev int32, _pKeyInfo *XKeyInfo, _iBreak int32) (r0 int32) { var _iContinue, _addr, _1_addr1, _1_addr2, _3_r1, _3_r2, _4_r1 int32 var _v *TVdbe @@ -79103,7 +82547,7 @@ func _generateOutputSubroutine(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pIn _1_addr2 = _sqlite3VdbeAddOp4(tls, _v, i32(98), _pIn.X3, _regPrev+i32(1), _pIn.X4, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKeyInfo))), i32(-5)) _sqlite3VdbeAddOp3(tls, _v, i32(18), _1_addr2+i32(2), _iContinue, _1_addr2+i32(2)) _sqlite3VdbeJumpHere(tls, _v, _1_addr1) - _sqlite3VdbeAddOp3(tls, _v, i32(64), _pIn.X3, _regPrev+i32(1), (_pIn.X4)-i32(1)) + _sqlite3VdbeAddOp3(tls, _v, i32(64), _pIn.X3, _regPrev+i32(1), _pIn.X4-i32(1)) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _regPrev) } if ((*Xsqlite3)(_pParse.X0).X17) != 0 { @@ -79154,7 +82598,7 @@ _8: goto _12 _9: func() { - if (_pIn.X4) != i32(1) && (_pParse.X16) <= i32(0) { + if _pIn.X4 != i32(1) && _pParse.X16 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119220), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000))), unsafe.Pointer(str(100529))) crt.X__builtin_abort(tls) } @@ -79162,9 +82606,9 @@ _9: _sqlite3ExprCodeMove(tls, _pParse, _pIn.X3, _pDest.X2, i32(1)) goto _12 _10: - if (_pDest.X3) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pDest.X3))) = _sqlite3GetTempRange(tls, _pParse, _pIn.X4) - *(*int32)(unsafe.Pointer(&(_pDest.X4))) = _pIn.X4 + if _pDest.X3 == i32(0) { + *(*int32)(unsafe.Pointer(&_pDest.X3)) = _sqlite3GetTempRange(tls, _pParse, _pIn.X4) + *(*int32)(unsafe.Pointer(&_pDest.X4)) = _pIn.X4 } _sqlite3ExprCodeMove(tls, _pParse, _pIn.X3, _pDest.X3, _pIn.X4) _sqlite3VdbeAddOp1(tls, _v, i32(16), _pDest.X2) @@ -79180,7 +82624,7 @@ _11: _sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.X3, _pIn.X4) goto _12 _12: - if (_p.X4) != 0 { + if _p.X4 != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(48), _p.X4, _iBreak) } _sqlite3VdbeResolveLabel(tls, _v, _iContinue) @@ -79188,16 +82632,19 @@ _12: return _addr } -// Make a new pointer to a KeyInfo object +// C comment +// /* +// ** Make a new pointer to a KeyInfo object +// */ func _sqlite3KeyInfoRef(tls *crt.TLS, _p *XKeyInfo) (r0 *XKeyInfo) { if _p != nil { func() { - if (_p.X0) <= uint32(i32(0)) { + if _p.X0 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3KeyInfoRefØ00__func__Ø000))), unsafe.Pointer(str(13857))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_p.X0))) += 1 + *(*uint32)(unsafe.Pointer(&_p.X0)) += 1 } return _p } @@ -79214,10 +82661,13 @@ func init() { crt.Xstrncpy(nil, &_generateOutputSubroutineØ00__func__Ø000[0], str(100604), 25) } -// Find (an approximate) sum of two LogEst values. This computation is -// not a simple "+" operator because LogEst is stored as a logarithmic -// value. -// +// C comment +// /* +// ** Find (an approximate) sum of two LogEst values. This computation is +// ** not a simple "+" operator because LogEst is stored as a logarithmic +// ** value. +// ** +// */ func _sqlite3LogEstAdd(tls *crt.TLS, _a int16, _b int16) (r0 int16) { if int32(_a) < int32(_b) { goto _0 @@ -79228,7 +82678,7 @@ func _sqlite3LogEstAdd(tls *crt.TLS, _a int16, _b int16) (r0 int16) { if int32(_a) > (int32(_b) + i32(31)) { return int16(int32(_a) + i32(1)) } - return int16(int32(_a) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_a)-int32(_b)))))) + return int16(int32(_a) + int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_a)-int32(_b)))))) _0: if int32(_b) > (int32(_a) + i32(49)) { @@ -79237,7 +82687,7 @@ _0: if int32(_b) > (int32(_a) + i32(31)) { return int16(int32(_b) + i32(1)) } - return int16(int32(_b) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_b)-int32(_a)))))) + return int16(int32(_b) + int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_b)-int32(_a)))))) } var _sqlite3LogEstAddØ00xØ001 [32]uint8 @@ -79246,9 +82696,12 @@ func init() { _sqlite3LogEstAddØ00xØ001 = [32]uint8{10, 10, 9, 9, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2} } -// Generate code that will tell the VDBE the names of columns -// in the result set. This information is used to provide the -// azCol[] values in the callback. +// C comment +// /* +// ** Generate code that will tell the VDBE the names of columns +// ** in the result set. This information is used to provide the +// ** azCol[] values in the callback. +// */ func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) { var _i, _fullNames, _shortNames, _4_iCol int32 var _3_zName, _4_zCol, _8_zName, _10_z *int8 @@ -79258,10 +82711,10 @@ func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _p var _2_p *XExpr _v = (*TVdbe)(_pParse.X2) _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X54) != 0 { + if _pParse.X54 != 0 { return } - if ((_pParse.X4) != 0) || ((_db.X17) != 0) { + if (_pParse.X4 != 0) || (_db.X17 != 0) { return } func() { @@ -79276,16 +82729,16 @@ func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _p crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pParse.X4))) = uint8(i32(1)) - _fullNames = bool2int(((_db.X6) & i32(4)) != i32(0)) - _shortNames = bool2int(((_db.X6) & i32(64)) != i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X4)) = uint8(i32(1)) + _fullNames = bool2int((_db.X6 & i32(4)) != i32(0)) + _shortNames = bool2int((_db.X6 & i32(64)) != i32(0)) _sqlite3VdbeSetNumCols(tls, _v, _pEList.X0) _i = i32(0) _7: - if _i >= (_pEList.X0) { + if _i >= _pEList.X0 { goto _10 } - _2_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X0) + _2_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X0) if func() int32 { if _2_p == nil { return func() int32 { @@ -79298,9 +82751,12 @@ _7: }() != 0 { goto _8 } - if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X1) != nil { - _3_zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X1 - _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _3_zName, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + if ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X1) != nil { + _3_zName = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X1 + _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _3_zName, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) goto _31 } if int32(_2_p.X0) != i32(152) && int32(_2_p.X0) != i32(154) || store44(&_pTab, _tableWithCursor(tls, _pTabList, _2_p.X8)) == nil { @@ -79323,33 +82779,39 @@ _7: _4_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_4_iCol))).X0 _25: if (_shortNames == 0) && (_fullNames == 0) { - _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_i))).X2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_i))).X2), func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) goto _30 } if _fullNames != 0 { _8_zName = nil _8_zName = _sqlite3MPrintf(tls, _db, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_4_zCol)) - _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _8_zName, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _8_zName, func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) goto _30 } - _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _4_zCol, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _4_zCol, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _30: goto _31 _18: - _10_z = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X2 + _10_z = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X2 _10_z = func() *int8 { if _10_z == nil { return _sqlite3MPrintf(tls, _db, str(100641), _i+i32(1)) } return _sqlite3DbStrDup(tls, _db, _10_z) }() - _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _10_z, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + _sqlite3VdbeSetColName(tls, _v, _i, i32(0), _10_z, func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _31: _8: _i += 1 @@ -79364,17 +82826,20 @@ func init() { crt.Xstrncpy(nil, &_generateColumnNamesØ00__func__Ø000[0], str(100650), 20) } -// Return the Table objecct in the SrcList that has cursor iCursor. -// Or return NULL if no such Table object exists in the SrcList. +// C comment +// /* +// ** Return the Table objecct in the SrcList that has cursor iCursor. +// ** Or return NULL if no such Table object exists in the SrcList. +// */ func _tableWithCursor(tls *crt.TLS, _pList *XSrcList, _iCursor int32) (r0 *XTable) { var _j int32 _j = i32(0) _0: - if _j >= (_pList.X0) { + if _j >= _pList.X0 { goto _3 } - if ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 112*uintptr(_j))).X11) == _iCursor { - return (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 112*uintptr(_j))).X4) + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) + 112*uintptr(_j))).X11) == _iCursor { + return (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) + 112*uintptr(_j))).X4) } _j += 1 goto _0 @@ -79382,8 +82847,11 @@ _3: return nil } -// Generate code that will tell the VDBE the declaration types of columns -// in the result set. +// C comment +// /* +// ** Generate code that will tell the VDBE the declaration types of columns +// ** in the result set. +// */ func _generateColumnTypes(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) { var _i int32 var _1_zType *int8 @@ -79391,35 +82859,41 @@ func _generateColumnTypes(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _p var _1_p *XExpr var _sNC XNameContext _v = (*TVdbe)(_pParse.X2) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = nil + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = _pTabList + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pParse + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X4)))) = nil _i = i32(0) _0: - if _i >= (_pEList.X0) { + if _i >= _pEList.X0 { goto _3 } - _1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X0) + _1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X0) _1_zType = _columnTypeImpl(tls, &_sNC, _1_p, nil) - _sqlite3VdbeSetColName(tls, _v, _i, i32(1), _1_zType, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + _sqlite3VdbeSetColName(tls, _v, _i, i32(1), _1_zType, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _i += 1 goto _0 _3: _ = _sNC } -// Unless an "EXPLAIN QUERY PLAN" command is being processed, this function -// is a no-op. Otherwise, it adds a single row of output to the EQP result, -// where the caption is of one of the two forms: -// -// "COMPOSITE SUBQUERIES iSub1 and iSub2 (op)" -// "COMPOSITE SUBQUERIES iSub1 and iSub2 USING TEMP B-TREE (op)" -// -// where iSub1 and iSub2 are the integers passed as the corresponding -// function parameters, and op is the text representation of the parameter -// of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT, -// TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is -// false, or the second form if it is true. +// C comment +// /* +// ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function +// ** is a no-op. Otherwise, it adds a single row of output to the EQP result, +// ** where the caption is of one of the two forms: +// ** +// ** "COMPOSITE SUBQUERIES iSub1 and iSub2 (op)" +// ** "COMPOSITE SUBQUERIES iSub1 and iSub2 USING TEMP B-TREE (op)" +// ** +// ** where iSub1 and iSub2 are the integers passed as the corresponding +// ** function parameters, and op is the text representation of the parameter +// ** of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT, +// ** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is +// ** false, or the second form if it is true. +// */ func _explainComposite(tls *crt.TLS, _pParse *XParse, _op int32, _iSub1 int32, _iSub2 int32, _bUseTmp int32) { var _1_zMsg *int8 var _1_v *TVdbe @@ -79447,8 +82921,11 @@ func init() { crt.Xstrncpy(nil, &_explainCompositeØ00__func__Ø000[0], str(100790), 17) } -// Return the maximum height of any expression tree referenced -// by the select statement passed as an argument. +// C comment +// /* +// ** Return the maximum height of any expression tree referenced +// ** by the select statement passed as an argument. +// */ func _sqlite3SelectExprHeight(tls *crt.TLS, _p *XSelect) (r0 int32) { var _nHeight int32 _nHeight = i32(0) @@ -79456,39 +82933,42 @@ func _sqlite3SelectExprHeight(tls *crt.TLS, _p *XSelect) (r0 int32) { return _nHeight } -// Make copies of relevant WHERE clause terms of the outer query into -// the WHERE clause of subquery. Example: -// -// SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10; -// -// Transformed into: -// -// SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10) -// WHERE x=5 AND y=10; -// -// The hope is that the terms added to the inner query will make it more -// efficient. -// -// Do not attempt this optimization if: -// -// (1) The inner query is an aggregate. (In that case, we'd really want -// to copy the outer WHERE-clause terms onto the HAVING clause of the -// inner query. But they probably won't help there so do not bother.) -// -// (2) The inner query is the recursive part of a common table expression. -// -// (3) The inner query has a LIMIT clause (since the changes to the WHERE -// close would change the meaning of the LIMIT). -// -// (4) The inner query is the right operand of a LEFT JOIN. (The caller -// enforces this restriction since this routine does not have enough -// information to know.) -// -// (5) The WHERE clause expression originates in the ON or USING clause -// of a LEFT JOIN. -// -// Return 0 if no changes are made and non-zero if one or more WHERE clause -// terms are duplicated into the subquery. +// C comment +// /* +// ** Make copies of relevant WHERE clause terms of the outer query into +// ** the WHERE clause of subquery. Example: +// ** +// ** SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10; +// ** +// ** Transformed into: +// ** +// ** SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10) +// ** WHERE x=5 AND y=10; +// ** +// ** The hope is that the terms added to the inner query will make it more +// ** efficient. +// ** +// ** Do not attempt this optimization if: +// ** +// ** (1) The inner query is an aggregate. (In that case, we'd really want +// ** to copy the outer WHERE-clause terms onto the HAVING clause of the +// ** inner query. But they probably won't help there so do not bother.) +// ** +// ** (2) The inner query is the recursive part of a common table expression. +// ** +// ** (3) The inner query has a LIMIT clause (since the changes to the WHERE +// ** close would change the meaning of the LIMIT). +// ** +// ** (4) The inner query is the right operand of a LEFT JOIN. (The caller +// ** enforces this restriction since this routine does not have enough +// ** information to know.) +// ** +// ** (5) The WHERE clause expression originates in the ON or USING clause +// ** of a LEFT JOIN. +// ** +// ** Return 0 if no changes are made and non-zero if one or more WHERE clause +// ** terms are duplicated into the subquery. +// */ func _pushDownWhereTerms(tls *crt.TLS, _pParse *XParse, _pSubq *XSelect, _pWhere *XExpr, _iCursor int32) (r0 int32) { var _nChng int32 var _pX *XSelect @@ -79503,7 +82983,7 @@ _1: if _pX == nil { goto _4 } - if ((_pX.X3) & uint32(i32(8200))) != uint32(i32(0)) { + if (_pX.X3 & uint32(i32(8200))) != uint32(i32(0)) { return i32(0) } _pX = (*XSelect)(_pX.X13) @@ -79522,7 +83002,7 @@ _6: _pWhere = (*XExpr)(_pWhere.X4) goto _6 } - if ((_pWhere.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_pWhere.X2 & uint32(i32(1))) != uint32(i32(0)) { return i32(0) } if _sqlite3ExprIsTableConstant(tls, _pWhere, _iCursor) == 0 { @@ -79532,13 +83012,13 @@ _6: _11: if _pSubq != nil { _pNew = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _pWhere, i32(0)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_x.X0))))) = _pParse - *(*int32)(unsafe.Pointer(&(_6_x.X1))) = _iCursor - *(*int32)(unsafe.Pointer(&(_6_x.X2))) = _iCursor - *(*int32)(unsafe.Pointer(&(_6_x.X3))) = i32(0) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_x.X4))))) = (*XExprList)(_pSubq.X0) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_x.X0)))) = _pParse + *(*int32)(unsafe.Pointer(&_6_x.X1)) = _iCursor + *(*int32)(unsafe.Pointer(&_6_x.X2)) = _iCursor + *(*int32)(unsafe.Pointer(&_6_x.X3)) = i32(0) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_x.X4)))) = (*XExprList)(_pSubq.X0) _pNew = _substExpr(tls, &_6_x, _pNew) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubq.X9))))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_pSubq.X9), _pNew) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubq.X9)))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_pSubq.X9), _pNew) _pSubq = (*XSelect)(_pSubq.X13) goto _11 } @@ -79549,26 +83029,35 @@ _10: panic(0) } -// Walk an expression tree. Return non-zero if the expression is constant -// for any single row of the table with cursor iCur. In other words, the -// expression must not refer to any non-deterministic function nor any -// table other than iCur. +// C comment +// /* +// ** Walk an expression tree. Return non-zero if the expression is constant +// ** for any single row of the table with cursor iCur. In other words, the +// ** expression must not refer to any non-deterministic function nor any +// ** table other than iCur. +// */ func _sqlite3ExprIsTableConstant(tls *crt.TLS, _p *XExpr, _iCur int32) (r0 int32) { return _exprIsConst(tls, _p, i32(3), _iCur) } -// Mark all temporary registers as being unavailable for reuse. +// C comment +// /* +// ** Mark all temporary registers as being unavailable for reuse. +// */ func _sqlite3ClearTempRegCache(tls *crt.TLS, _pParse *XParse) { - *(*uint8)(unsafe.Pointer(&(_pParse.X7))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_pParse.X14))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pParse.X7)) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_pParse.X14)) = i32(0) } -// Check to see if the pThis entry of pTabList is a self-join of a prior view. -// If it is, then return the SrcList_item for the prior view. If it is not, -// then return 0. +// C comment +// /* +// ** Check to see if the pThis entry of pTabList is a self-join of a prior view. +// ** If it is, then return the SrcList_item for the prior view. If it is not, +// ** then return 0. +// */ func _isSelfJoinView(tls *crt.TLS, _pTabList *XSrcList, _pThis *TSrcList_item) (r0 *TSrcList_item) { var _pItem *TSrcList_item - _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) _0: if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pThis)) { goto _3 @@ -79576,10 +83065,10 @@ _0: if (*XSelect)(_pItem.X5) == nil { goto _1 } - if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { goto _1 } - if (_pItem.X2) == nil { + if _pItem.X2 == nil { goto _1 } if Xsqlite3_stricmp(tls, _pItem.X1, _pThis.X1) != i32(0) { @@ -79604,98 +83093,104 @@ func _sqlite3VdbeChangeP1(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) { *(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X3))) = _val } -// Change the value of the opcode, or P1, P2, P3, or P5 operands -// for a specific instruction. +// C comment +// /* +// ** Change the value of the opcode, or P1, P2, P3, or P5 operands +// ** for a specific instruction. +// */ func _sqlite3VdbeChangeOpcode(tls *crt.TLS, _p *TVdbe, _addr uint32, _iNewOpcode uint8) { *(*uint8)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X0))) = _iNewOpcode } -// Generate the beginning of the loop used for WHERE clause processing. -// The return value is a pointer to an opaque structure that contains -// information needed to terminate the loop. Later, the calling routine -// should invoke sqlite3WhereEnd() with the return value of this function -// in order to complete the WHERE clause processing. -// -// If an error occurs, this routine returns NULL. -// -// The basic idea is to do a nested loop, one loop for each table in -// the FROM clause of a select. (INSERT and UPDATE statements are the -// same as a SELECT with only a single table in the FROM clause.) For -// example, if the SQL is this: -// -// SELECT * FROM t1, t2, t3 WHERE ...; -// -// Then the code generated is conceptually like the following: -// -// foreach row1 in t1 do \ Code generated -// foreach row2 in t2 do |-- by sqlite3WhereBegin() -// foreach row3 in t3 do / -// ... -// end \ Code generated -// end |-- by sqlite3WhereEnd() -// end / -// -// Note that the loops might not be nested in the order in which they -// appear in the FROM clause if a different order is better able to make -// use of indices. Note also that when the IN operator appears in -// the WHERE clause, it might result in additional nested loops for -// scanning through all values on the right-hand side of the IN. -// -// There are Btree cursors associated with each table. t1 uses cursor -// number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor. -// And so forth. This routine generates code to open those VDBE cursors -// and sqlite3WhereEnd() generates the code to close them. -// -// The code that sqlite3WhereBegin() generates leaves the cursors named -// in pTabList pointing at their appropriate entries. The [...] code -// can use OP_Column and OP_Rowid opcodes on these cursors to extract -// data from the various tables of the loop. -// -// If the WHERE clause is empty, the foreach loops must each scan their -// entire tables. Thus a three-way join is an O(N^3) operation. But if -// the tables have indices and there are terms in the WHERE clause that -// refer to those indices, a complete table scan can be avoided and the -// code will run much faster. Most of the work of this routine is checking -// to see if there are indices that can be used to speed up the loop. -// -// Terms of the WHERE clause are also used to limit which rows actually -// make it to the "..." in the middle of the loop. After each "foreach", -// terms of the WHERE clause that use only terms in that loop and outer -// loops are evaluated and if false a jump is made around all subsequent -// inner loops (or around the "..." if the test occurs within the inner- -// most loop) -// -// OUTER JOINS -// -// An outer join of tables t1 and t2 is conceptally coded as follows: -// -// foreach row1 in t1 do -// flag = 0 -// foreach row2 in t2 do -// start: -// ... -// flag = 1 -// end -// if flag==0 then -// move the row2 cursor to a null row -// goto start -// fi -// end -// -// ORDER BY CLAUSE PROCESSING -// -// pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause -// if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement -// if there is one. If there is no ORDER BY clause or if this routine -// is called from an UPDATE or DELETE statement, then pOrderBy is NULL. -// -// The iIdxCur parameter is the cursor number of an index. If -// WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index -// to use for OR clause processing. The WHERE clause should use this -// specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is -// the first cursor in an array of cursors for all indices. iIdxCur should -// be used to compute the appropriate cursor depending on which index is -// used. +// C comment +// /* +// ** Generate the beginning of the loop used for WHERE clause processing. +// ** The return value is a pointer to an opaque structure that contains +// ** information needed to terminate the loop. Later, the calling routine +// ** should invoke sqlite3WhereEnd() with the return value of this function +// ** in order to complete the WHERE clause processing. +// ** +// ** If an error occurs, this routine returns NULL. +// ** +// ** The basic idea is to do a nested loop, one loop for each table in +// ** the FROM clause of a select. (INSERT and UPDATE statements are the +// ** same as a SELECT with only a single table in the FROM clause.) For +// ** example, if the SQL is this: +// ** +// ** SELECT * FROM t1, t2, t3 WHERE ...; +// ** +// ** Then the code generated is conceptually like the following: +// ** +// ** foreach row1 in t1 do \ Code generated +// ** foreach row2 in t2 do |-- by sqlite3WhereBegin() +// ** foreach row3 in t3 do / +// ** ... +// ** end \ Code generated +// ** end |-- by sqlite3WhereEnd() +// ** end / +// ** +// ** Note that the loops might not be nested in the order in which they +// ** appear in the FROM clause if a different order is better able to make +// ** use of indices. Note also that when the IN operator appears in +// ** the WHERE clause, it might result in additional nested loops for +// ** scanning through all values on the right-hand side of the IN. +// ** +// ** There are Btree cursors associated with each table. t1 uses cursor +// ** number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor. +// ** And so forth. This routine generates code to open those VDBE cursors +// ** and sqlite3WhereEnd() generates the code to close them. +// ** +// ** The code that sqlite3WhereBegin() generates leaves the cursors named +// ** in pTabList pointing at their appropriate entries. The [...] code +// ** can use OP_Column and OP_Rowid opcodes on these cursors to extract +// ** data from the various tables of the loop. +// ** +// ** If the WHERE clause is empty, the foreach loops must each scan their +// ** entire tables. Thus a three-way join is an O(N^3) operation. But if +// ** the tables have indices and there are terms in the WHERE clause that +// ** refer to those indices, a complete table scan can be avoided and the +// ** code will run much faster. Most of the work of this routine is checking +// ** to see if there are indices that can be used to speed up the loop. +// ** +// ** Terms of the WHERE clause are also used to limit which rows actually +// ** make it to the "..." in the middle of the loop. After each "foreach", +// ** terms of the WHERE clause that use only terms in that loop and outer +// ** loops are evaluated and if false a jump is made around all subsequent +// ** inner loops (or around the "..." if the test occurs within the inner- +// ** most loop) +// ** +// ** OUTER JOINS +// ** +// ** An outer join of tables t1 and t2 is conceptally coded as follows: +// ** +// ** foreach row1 in t1 do +// ** flag = 0 +// ** foreach row2 in t2 do +// ** start: +// ** ... +// ** flag = 1 +// ** end +// ** if flag==0 then +// ** move the row2 cursor to a null row +// ** goto start +// ** fi +// ** end +// ** +// ** ORDER BY CLAUSE PROCESSING +// ** +// ** pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause +// ** if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement +// ** if there is one. If there is no ORDER BY clause or if this routine +// ** is called from an UPDATE or DELETE statement, then pOrderBy is NULL. +// ** +// ** The iIdxCur parameter is the cursor number of an index. If +// ** WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index +// ** to use for OR clause processing. The WHERE clause should use this +// ** specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is +// ** the first cursor in an array of cursors for all indices. iIdxCur should +// ** be used to compute the appropriate cursor depending on which index is +// ** used. +// */ func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr, _pOrderBy *XExprList, _pResultSet *XExprList, _wctrlFlags uint16, _iAuxArg int32) (r0 *XWhereInfo) { var _nByteWInfo, _nTabList, _ii, _rc, _23_wsFlags, _23_bOnerow, _27_iDb, _29_iCur, _31_op, _33_n, _37_iIndexCur, _37_op, _45_addrExplain, _45_wsFlags int32 var _notReady, _9_m, _17_tabUsed, _33_b uint64 @@ -79727,11 +83222,11 @@ func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh } }() _db = (*Xsqlite3)(_pParse.X0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sWLB), i32(0), u64(48)) - if (_pOrderBy != nil) && ((_pOrderBy.X0) >= i32(64)) { + crt.Xmemset(tls, unsafe.Pointer(&_sWLB), i32(0), u64(48)) + if (_pOrderBy != nil) && (_pOrderBy.X0 >= i32(64)) { _pOrderBy = nil } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X2))))) = _pOrderBy + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWLB.X2)))) = _pOrderBy if (int32(_db.X13) & i32(32)) != i32(0) { { p := &_wctrlFlags @@ -79739,7 +83234,7 @@ func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh sink14(*p) } } - if (_pTabList.X0) > i32(64) { + if _pTabList.X0 > i32(64) { _sqlite3ErrorMsg(tls, _pParse, str(101009), i32(64)) return nil } @@ -79747,38 +83242,38 @@ func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh if (int32(_wctrlFlags) & i32(32)) != 0 { return i32(1) } - return (_pTabList.X0) + return _pTabList.X0 }() _nByteWInfo = int32(((u64(1008) + (uint64(_nTabList-i32(1)) * u64(88))) + uint64(i32(7))) & uint64(i32(-8))) _pWInfo = (*XWhereInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nByteWInfo)+u64(104))) - if (_db.X17) != 0 { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pWInfo)) + if _db.X17 != 0 { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pWInfo)) _pWInfo = nil goto _whereBeginError } - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X1))))) = _pTabList - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X2))))) = _pOrderBy - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X4))))) = _pWhere - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X3))))) = _pResultSet - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(0)))) = store1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6)))))+4*uintptr(i32(1)))), i32(-1)) - *(*uint8)(unsafe.Pointer(&(_pWInfo.X11))) = uint8(_nTabList) - *(*int32)(unsafe.Pointer(&(_pWInfo.X8))) = store1((*int32)(unsafe.Pointer(&(_pWInfo.X7))), _sqlite3VdbeMakeLabel(tls, _v)) - *(*uint16)(unsafe.Pointer(&(_pWInfo.X10))) = _wctrlFlags - *(*int16)(unsafe.Pointer(&(_pWInfo.X5))) = int16(_iAuxArg) - *(*int32)(unsafe.Pointer(&(_pWInfo.X9))) = int32(_pParse.X42) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(&(_pWInfo.X12)))), i32(0), u64(37)) - crt.Xmemset(tls, (unsafe.Pointer)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))+88*uintptr(i32(0))))), i32(0), u64(104)+(uint64(_nTabList)*u64(88))) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X1)))) = _pTabList + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X2)))) = _pOrderBy + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X4)))) = _pWhere + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X3)))) = _pResultSet + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pWInfo.X6)))) + 4*uintptr(i32(0)))) = store1((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pWInfo.X6))))+4*uintptr(i32(1)))), i32(-1)) + *(*uint8)(unsafe.Pointer(&_pWInfo.X11)) = uint8(_nTabList) + *(*int32)(unsafe.Pointer(&_pWInfo.X8)) = store1((*int32)(unsafe.Pointer(&_pWInfo.X7)), _sqlite3VdbeMakeLabel(tls, _v)) + *(*uint16)(unsafe.Pointer(&_pWInfo.X10)) = _wctrlFlags + *(*int16)(unsafe.Pointer(&_pWInfo.X5)) = int16(_iAuxArg) + *(*int32)(unsafe.Pointer(&_pWInfo.X9)) = int32(_pParse.X42) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(&_pWInfo.X12))), i32(0), u64(37)) + crt.Xmemset(tls, unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24))))+88*uintptr(i32(0))))), i32(0), u64(104)+(uint64(_nTabList)*u64(88))) func() { if int32(_pWInfo.X14) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101037))) crt.X__builtin_abort(tls) } }() - _pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))) - *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X0))))) = _pWInfo - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X1))))) = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))) - *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X3))))) = (*XWhereLoop)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pWInfo)))) + uintptr(_nByteWInfo))))) + _pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)) + *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWLB.X0)))) = _pWInfo + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWLB.X1)))) = (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)) + *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWLB.X3)))) = (*XWhereLoop)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pWInfo)))) + uintptr(_nByteWInfo))))) func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*XWhereLoop)(_sWLB.X3)))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134858), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101067))) @@ -79787,9 +83282,9 @@ func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh }() _whereLoopInit(tls, (*XWhereLoop)(_sWLB.X3)) *(*int8)(unsafe.Pointer(&((*XWhereLoop)(_sWLB.X3).X2))) = int8(i32(42)) - *(*int32)(unsafe.Pointer(&(_pMaskSet.X0))) = i32(0) - _sqlite3WhereClauseInit(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pWInfo) - _sqlite3WhereSplit(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pWhere, uint8(i32(71))) + *(*int32)(unsafe.Pointer(&_pMaskSet.X0)) = i32(0) + _sqlite3WhereClauseInit(tls, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)), _pWInfo) + _sqlite3WhereSplit(tls, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)), _pWhere, uint8(i32(71))) _ii = i32(0) _18: if _ii >= ((*XWhereClause)(_sWLB.X1).X3) { @@ -79810,28 +83305,28 @@ _21: goto _24 } if _pOrderBy != nil { - *(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8(_pOrderBy.X0) + *(*int8)(unsafe.Pointer(&_pWInfo.X12)) = int8(_pOrderBy.X0) } if (int32(_wctrlFlags) & i32(256)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWInfo.X16)) = uint8(i32(1)) } _24: _ii = i32(0) _27: - if _ii >= (_pTabList.X0) { + if _ii >= _pTabList.X0 { goto _30 } - _createMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(_ii))).X11) - _sqlite3WhereTabFuncArgs(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(_ii))), (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))) + _createMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(_ii))).X11) + _sqlite3WhereTabFuncArgs(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(_ii))), (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22))) _ii += 1 goto _27 _30: _ii = i32(0) _31: - if _ii >= (_pTabList.X0) { + if _ii >= _pTabList.X0 { goto _34 } - _9_m = _sqlite3WhereGetMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(_ii))).X11) + _9_m = _sqlite3WhereGetMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(_ii))).X11) func() { if _9_m != (u64(1) << uint(_ii)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134912), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101099))) @@ -79841,24 +83336,24 @@ _31: _ii += 1 goto _31 _34: - _sqlite3WhereExprAnalyze(tls, _pTabList, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))) - if (_db.X17) != 0 { + _sqlite3WhereExprAnalyze(tls, _pTabList, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22))) + if _db.X17 != 0 { goto _whereBeginError } if (int32(_wctrlFlags) & i32(256)) == 0 { goto _38 } - if _isDistinctRedundant(tls, _pParse, _pTabList, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pResultSet) != 0 { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1)) + if _isDistinctRedundant(tls, _pParse, _pTabList, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)), _pResultSet) != 0 { + *(*uint8)(unsafe.Pointer(&_pWInfo.X16)) = uint8(i32(1)) goto _41 } if _pOrderBy == nil { { - p := (*uint16)(unsafe.Pointer(&(_pWInfo.X10))) + p := (*uint16)(unsafe.Pointer(&_pWInfo.X10)) *p = uint16(int32(*p) | i32(128)) sink14(*p) } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X2))))) = _pResultSet + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X2)))) = _pResultSet } _41: _38: @@ -79870,23 +83365,23 @@ _38: goto _whereBeginError } _wherePathSolver(tls, _pWInfo, int16(i32(0))) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _whereBeginError } - if (*XExprList)(_pWInfo.X2) == nil { + if _pWInfo.X2 == nil { goto _46 } _wherePathSolver(tls, _pWInfo, int16(int32(_pWInfo.X21)+i32(1))) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _whereBeginError } _46: _43: - if ((*XExprList)(_pWInfo.X2) == nil) && (((_db.X6) & i32(131072)) != i32(0)) { - *(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = u64(18446744073709551615) + if ((*XExprList)(_pWInfo.X2) == nil) && ((_db.X6 & i32(131072)) != i32(0)) { + *(*uint64)(unsafe.Pointer(&_pWInfo.X20)) = u64(18446744073709551615) } - if (_pParse.X16) != 0 || func() int32 { - if (_db.X17) != 0 { + if _pParse.X16 != 0 || func() int32 { + if _db.X17 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134972), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -79901,7 +83396,7 @@ _43: goto _56 } _17_tabUsed = _sqlite3WhereExprListUsage(tls, _pMaskSet, _pResultSet) - if (*XExprList)(_sWLB.X2) != nil { + if _sWLB.X2 != nil { { p := &_17_tabUsed *p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_sWLB.X2)) @@ -79912,14 +83407,14 @@ _57: if int32(_pWInfo.X11) < i32(2) { goto _59 } - _pLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(int32(_pWInfo.X11)-i32(1)))).X18) - if (int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLoop.X3))).X9))).X0) & i32(8)) == i32(0) { + _pLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(int32(_pWInfo.X11)-i32(1)))).X18) + if (int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLoop.X3))).X9))).X0) & i32(8)) == i32(0) { goto _59 } - if ((int32(_wctrlFlags) & i32(256)) == i32(0)) && (((_pLoop.X9) & uint32(i32(4096))) == uint32(i32(0))) { + if ((int32(_wctrlFlags) & i32(256)) == i32(0)) && ((_pLoop.X9 & uint32(i32(4096))) == uint32(i32(0))) { goto _59 } - if (_17_tabUsed & (_pLoop.X1)) != uint64(i32(0)) { + if (_17_tabUsed & _pLoop.X1) != uint64(i32(0)) { goto _59 } _19_pEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)((*XWhereClause)(_sWLB.X1).X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.X1).X3)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64))))))))))) @@ -79928,7 +83423,7 @@ _64: if crt.P2U(unsafe.Pointer(_19_pTerm)) >= crt.P2U(unsafe.Pointer(_19_pEnd)) { goto _67 } - if (((_19_pTerm.X12) & (_pLoop.X1)) != uint64(i32(0))) && ((((*XExpr)(_19_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0))) { + if ((_19_pTerm.X12 & _pLoop.X1) != uint64(i32(0))) && ((((*XExpr)(_19_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0))) { goto _67 } *(*uintptr)(unsafe.Pointer(&_19_pTerm)) += uintptr(64) @@ -79937,7 +83432,7 @@ _67: if crt.P2U(unsafe.Pointer(_19_pTerm)) < crt.P2U(unsafe.Pointer(_19_pEnd)) { goto _59 } - *(*uint8)(unsafe.Pointer(&(_pWInfo.X11))) -= 1 + *(*uint8)(unsafe.Pointer(&_pWInfo.X11)) -= 1 _nTabList -= 1 goto _57 _59: @@ -79956,64 +83451,64 @@ _56: if (int32(_wctrlFlags) & i32(4)) == i32(0) { goto _74 } - _23_wsFlags = int32((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(i32(0)))).X18).X9) + _23_wsFlags = int32((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(i32(0)))).X18).X9) _23_bOnerow = bool2int((_23_wsFlags & i32(4096)) != i32(0)) if _23_bOnerow == 0 && ((int32(_wctrlFlags)&i32(8)) == i32(0) || i32(0) != (_23_wsFlags&i32(1024))) { goto _77 } - *(*uint8)(unsafe.Pointer(&(_pWInfo.X14))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pWInfo.X14)) = uint8(func() int32 { if _23_bOnerow != 0 { return i32(1) } return i32(2) }()) - if (((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(i32(0)))).X4).X9)&uint32(i32(32))) != uint32(i32(0)) || (_23_wsFlags&i32(64)) == 0 { + if (((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(i32(0)))).X4).X9)&uint32(i32(32))) != uint32(i32(0)) || (_23_wsFlags&i32(64)) == 0 { goto _81 } if (int32(_wctrlFlags) & i32(8)) != 0 { _bFordelete = uint8(i32(8)) } - *(*uint32)(unsafe.Pointer(&((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(i32(0)))).X18).X9))) = uint32(_23_wsFlags & i32(-65)) + *(*uint32)(unsafe.Pointer(&((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(i32(0)))).X18).X9))) = uint32(_23_wsFlags & i32(-65)) _81: _77: _74: - *func() **XWhereLevel { _ii = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + *func() **XWhereLevel { _ii = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) _83: if _ii >= _nTabList { goto _86 } - _27_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_pLevel.X11))) + _27_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_pLevel.X11))) _27_pTab = (*XTable)(_27_pTabItem.X4) _27_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_27_pTab.X20)) _pLoop = (*XWhereLoop)(_pLevel.X18) - if (((_27_pTab.X9) & uint32(i32(2))) != uint32(i32(0))) || ((*XSelect)(_27_pTab.X3) != nil) { + if ((_27_pTab.X9 & uint32(i32(2))) != uint32(i32(0))) || (_27_pTab.X3 != nil) { goto _108 } - if ((_pLoop.X9) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pLoop.X9 & uint32(i32(1024))) != uint32(i32(0)) { _29_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _27_pTab))) _29_iCur = _27_pTabItem.X11 _sqlite3VdbeAddOp4(tls, _v, i32(158), _29_iCur, i32(0), i32(0), _29_pVTab, i32(-8)) goto _108 } - if (_27_pTab.X16) != 0 { + if _27_pTab.X16 != 0 { goto _108 } - if ((_pLoop.X9)&uint32(i32(64))) != uint32(i32(0)) || (int32(_wctrlFlags)&i32(32)) != i32(0) { + if (_pLoop.X9&uint32(i32(64))) != uint32(i32(0)) || (int32(_wctrlFlags)&i32(32)) != i32(0) { goto _95 } _31_op = i32(106) if int32(_pWInfo.X14) != i32(0) { _31_op = i32(107) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(0)))) = _27_pTabItem.X11 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pWInfo.X6)))) + 4*uintptr(i32(0)))) = _27_pTabItem.X11 } _sqlite3OpenTable(tls, _pParse, _27_pTabItem.X11, _27_iDb, _27_pTab, _31_op) func() { - if (_27_pTabItem.X11) != (_pLevel.X1) { + if _27_pTabItem.X11 != _pLevel.X1 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135090), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101175))) crt.X__builtin_abort(tls) } }() - if int32(_pWInfo.X14) != i32(0) || int32(_27_pTab.X11) >= i32(64) || ((_27_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) { + if int32(_pWInfo.X14) != i32(0) || int32(_27_pTab.X11) >= i32(64) || (_27_pTab.X9&uint32(i32(32))) != uint32(i32(0)) { goto _101 } _33_b = _27_pTabItem.X14 @@ -80025,7 +83520,7 @@ _102: *func() *int32 { _33_b = _33_b >> uint(i32(1)); return &_33_n }() += 1 goto _102 _105: - _sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)((unsafe.Pointer)(crt.U2P(uintptr(int64(_33_n))))), i32(-11)) + _sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(crt.U2P(uintptr(int64(_33_n))))), i32(-11)) func() { if _33_n > int32(_27_pTab.X11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135098), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101210))) @@ -80038,10 +83533,10 @@ _101: _95: _sqlite3TableLock(tls, _pParse, _27_iDb, _27_pTab.X7, uint8(i32(0)), _27_pTab.X0) _108: - if ((_pLoop.X9) & uint32(i32(512))) == 0 { + if (_pLoop.X9 & uint32(i32(512))) == 0 { goto _109 } - _37_pIx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4) + _37_pIx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4) _37_op = i32(106) func() { if _iAuxArg == i32(0) && (int32(_pWInfo.X10)&i32(4)) != i32(0) { @@ -80049,7 +83544,7 @@ _108: crt.X__builtin_abort(tls) } }() - if ((((_27_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_37_pIx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2))) && ((int32(_wctrlFlags) & i32(32)) != i32(0)) { + if (((_27_pTab.X9 & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_37_pIx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2))) && ((int32(_wctrlFlags) & i32(32)) != i32(0)) { _37_iIndexCur = _pLevel.X1 _37_op = i32(0) goto _128 @@ -80081,7 +83576,7 @@ _120: goto _120 } _37_op = i32(107) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(1)))) = _37_iIndexCur + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pWInfo.X6)))) + 4*uintptr(i32(1)))) = _37_iIndexCur goto _128 _117: if _iAuxArg != 0 && ((int32(_wctrlFlags) & i32(32)) != i32(0)) { @@ -80089,9 +83584,9 @@ _117: _37_op = i32(105) goto _128 } - _37_iIndexCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _37_iIndexCur = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _128: - *(*int32)(unsafe.Pointer(&(_pLevel.X2))) = _37_iIndexCur + *(*int32)(unsafe.Pointer(&_pLevel.X2)) = _37_iIndexCur func() { if (*XSchema)(_37_pIx.X6) != (*XSchema)(_27_pTab.X20) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101321))) @@ -80109,7 +83604,7 @@ _128: } _sqlite3VdbeAddOp3(tls, _v, _37_op, _37_iIndexCur, _37_pIx.X11, _27_iDb) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _37_pIx) - if (((((_pLoop.X9) & uint32(i32(15))) != uint32(i32(0))) && (((_pLoop.X9) & uint32(i32(32770))) == uint32(i32(0)))) && ((int32(_pWInfo.X10) & i32(1)) == i32(0))) && (int32(_pWInfo.X16) != i32(2)) { + if ((((_pLoop.X9 & uint32(i32(15))) != uint32(i32(0))) && ((_pLoop.X9 & uint32(i32(32770))) == uint32(i32(0)))) && ((int32(_pWInfo.X10) & i32(1)) == i32(0))) && (int32(_pWInfo.X16) != i32(2)) { _sqlite3VdbeChangeP5(tls, _v, uint16(i32(2))) } _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_37_pIx.X0)) @@ -80121,8 +83616,8 @@ _109: *(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _ii += 1; return &_pLevel }())) += uintptr(88) goto _83 _86: - *(*int32)(unsafe.Pointer(&(_pWInfo.X18))) = _sqlite3VdbeCurrentAddr(tls, _v) - if (_db.X17) != 0 { + *(*int32)(unsafe.Pointer(&_pWInfo.X18)) = _sqlite3VdbeCurrentAddr(tls, _v) + if _db.X17 != 0 { goto _whereBeginError } _notReady = u64(18446744073709551615) @@ -80131,20 +83626,20 @@ _140: if _ii >= _nTabList { goto _143 } - _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(_ii))) + _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(_ii))) _45_wsFlags = int32((*XWhereLoop)(_pLevel.X18).X9) if (((*XWhereLoop)(_pLevel.X18).X9) & uint32(i32(16384))) == uint32(i32(0)) { goto _144 } - _constructAutomaticIndex(tls, _pParse, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(_pLevel.X11))), _notReady, _pLevel) - if (_db.X17) != 0 { + _constructAutomaticIndex(tls, _pParse, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(_pLevel.X11))), _notReady, _pLevel) + if _db.X17 != 0 { goto _whereBeginError } _144: _45_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _pTabList, _pLevel, _ii, int32(_pLevel.X11), _wctrlFlags) - *(*int32)(unsafe.Pointer(&(_pLevel.X8))) = _sqlite3VdbeCurrentAddr(tls, _v) + *(*int32)(unsafe.Pointer(&_pLevel.X8)) = _sqlite3VdbeCurrentAddr(tls, _v) _notReady = _sqlite3WhereCodeOneLoopStart(tls, _pWInfo, _ii, _notReady) - *(*int32)(unsafe.Pointer(&(_pWInfo.X7))) = _pLevel.X6 + *(*int32)(unsafe.Pointer(&_pWInfo.X7)) = _pLevel.X6 if ((_45_wsFlags & i32(8192)) == i32(0)) && ((int32(_wctrlFlags) & i32(32)) == i32(0)) { } _ii += 1 @@ -80154,7 +83649,7 @@ _143: _whereBeginError: if _pWInfo != nil { - *(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(_pWInfo.X9) + *(*uint32)(unsafe.Pointer(&_pParse.X42)) = uint32(_pWInfo.X9) _whereInfoFree(tls, _db, _pWInfo) } return nil @@ -80170,43 +83665,52 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereBeginØ00__func__Ø000[0], str(101362), 18) } -// Convert bulk memory into a valid WhereLoop that can be passed -// to whereLoopClear harmlessly. +// C comment +// /* +// ** Convert bulk memory into a valid WhereLoop that can be passed +// ** to whereLoopClear harmlessly. +// */ func _whereLoopInit(tls *crt.TLS, _p *XWhereLoop) { - *(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) - *(*uint16)(unsafe.Pointer(&(_p.X10))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&(_p.X12))) = uint16(i32(3)) - *(*uint32)(unsafe.Pointer(&(_p.X9))) = uint32(i32(0)) + *(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) + *(*uint16)(unsafe.Pointer(&_p.X10)) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_p.X12)) = uint16(i32(3)) + *(*uint32)(unsafe.Pointer(&_p.X9)) = uint32(i32(0)) } -// Initialize a preallocated WhereClause structure. +// C comment +// /* +// ** Initialize a preallocated WhereClause structure. +// */ func _sqlite3WhereClauseInit(tls *crt.TLS, _pWC *XWhereClause, _pWInfo *XWhereInfo) { - *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X0))))) = _pWInfo - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X1))))) = nil - *(*int32)(unsafe.Pointer(&(_pWC.X3))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pWC.X4))) = i32(8) - *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6))))) -} - -// This routine identifies subexpressions in the WHERE clause where -// each subexpression is separated by the AND operator or some other -// operator specified in the op parameter. The WhereClause structure -// is filled with pointers to subexpressions. For example: -// -// WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22) -// \________/ \_______________/ \________________/ -// slot[0] slot[1] slot[2] -// -// The original WHERE clause in pExpr is unaltered. All this routine -// does is make slot[] entries point to substructure within pExpr. -// -// In the previous sentence and in the diagram, "slot[]" refers to -// the WhereClause.a[] array. The slot[] array grows as needed to contain -// all terms of the WHERE clause. + *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWC.X0)))) = _pWInfo + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWC.X1)))) = nil + *(*int32)(unsafe.Pointer(&_pWC.X3)) = i32(0) + *(*int32)(unsafe.Pointer(&_pWC.X4)) = i32(8) + *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWC.X5)))) = (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&_pWC.X6)))) +} + +// C comment +// /* +// ** This routine identifies subexpressions in the WHERE clause where +// ** each subexpression is separated by the AND operator or some other +// ** operator specified in the op parameter. The WhereClause structure +// ** is filled with pointers to subexpressions. For example: +// ** +// ** WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22) +// ** \________/ \_______________/ \________________/ +// ** slot[0] slot[1] slot[2] +// ** +// ** The original WHERE clause in pExpr is unaltered. All this routine +// ** does is make slot[] entries point to substructure within pExpr. +// ** +// ** In the previous sentence and in the diagram, "slot[]" refers to +// ** the WhereClause.a[] array. The slot[] array grows as needed to contain +// ** all terms of the WHERE clause. +// */ func _sqlite3WhereSplit(tls *crt.TLS, _pWC *XWhereClause, _pExpr *XExpr, _op uint8) { var _pE2 *XExpr _pE2 = _sqlite3ExprSkipCollate(tls, _pExpr) - *(*uint8)(unsafe.Pointer(&(_pWC.X2))) = _op + *(*uint8)(unsafe.Pointer(&_pWC.X2)) = _op if _pE2 == nil { return } @@ -80219,79 +83723,88 @@ func _sqlite3WhereSplit(tls *crt.TLS, _pWC *XWhereClause, _pExpr *XExpr, _op uin _2: } -// Add a single new WhereTerm entry to the WhereClause object pWC. -// The new WhereTerm object is constructed from Expr p and with wtFlags. -// The index in pWC->a[] of the new WhereTerm is returned on success. -// 0 is returned if the new WhereTerm could not be added due to a memory -// allocation error. The memory allocation failure will be recorded in -// the db->mallocFailed flag so that higher-level functions can detect it. -// -// This routine will increase the size of the pWC->a[] array as necessary. -// -// If the wtFlags argument includes TERM_DYNAMIC, then responsibility -// for freeing the expression p is assumed by the WhereClause object pWC. -// This is true even if this routine fails to allocate a new WhereTerm. -// -// WARNING: This routine might reallocate the space used to store -// WhereTerms. All pointers to WhereTerms should be invalidated after -// calling this routine. Such pointers may be reinitialized by referencing -// the pWC->a[] array. +// C comment +// /* +// ** Add a single new WhereTerm entry to the WhereClause object pWC. +// ** The new WhereTerm object is constructed from Expr p and with wtFlags. +// ** The index in pWC->a[] of the new WhereTerm is returned on success. +// ** 0 is returned if the new WhereTerm could not be added due to a memory +// ** allocation error. The memory allocation failure will be recorded in +// ** the db->mallocFailed flag so that higher-level functions can detect it. +// ** +// ** This routine will increase the size of the pWC->a[] array as necessary. +// ** +// ** If the wtFlags argument includes TERM_DYNAMIC, then responsibility +// ** for freeing the expression p is assumed by the WhereClause object pWC. +// ** This is true even if this routine fails to allocate a new WhereTerm. +// ** +// ** WARNING: This routine might reallocate the space used to store +// ** WhereTerms. All pointers to WhereTerms should be invalidated after +// ** calling this routine. Such pointers may be reinitialized by referencing +// ** the pWC->a[] array. +// */ func _whereClauseInsert(tls *crt.TLS, _pWC *XWhereClause, _p *XExpr, _wtFlags uint16) (r0 int32) { var _idx int32 var _1_db *Xsqlite3 var _pTerm, _1_pOld *XWhereTerm - if (_pWC.X3) < (_pWC.X4) { + if _pWC.X3 < _pWC.X4 { goto _0 } _1_pOld = (*XWhereTerm)(_pWC.X5) _1_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.X0).X0).X0) - *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = (*XWhereTerm)(_sqlite3DbMallocRawNN(tls, _1_db, (u64(64)*uint64(_pWC.X4))*uint64(i32(2)))) + *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWC.X5)))) = (*XWhereTerm)(_sqlite3DbMallocRawNN(tls, _1_db, (u64(64)*uint64(_pWC.X4))*uint64(i32(2)))) if (*XWhereTerm)(_pWC.X5) != nil { goto _1 } if (int32(_wtFlags) & i32(1)) != 0 { _sqlite3ExprDelete(tls, _1_db, _p) } - *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = _1_pOld + *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWC.X5)))) = _1_pOld return i32(0) _1: - crt.Xmemcpy(tls, _pWC.X5, (unsafe.Pointer)(_1_pOld), u64(64)*uint64(_pWC.X3)) - if _1_pOld != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6))))) { - _sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_1_pOld)) + crt.Xmemcpy(tls, _pWC.X5, unsafe.Pointer(_1_pOld), u64(64)*uint64(_pWC.X3)) + if _1_pOld != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&_pWC.X6)))) { + _sqlite3DbFree(tls, _1_db, unsafe.Pointer(_1_pOld)) } - *(*int32)(unsafe.Pointer(&(_pWC.X4))) = int32(uint64(_sqlite3DbMallocSize(tls, _1_db, _pWC.X5)) / u64(64)) + *(*int32)(unsafe.Pointer(&_pWC.X4)) = int32(uint64(_sqlite3DbMallocSize(tls, _1_db, _pWC.X5)) / u64(64)) _0: - _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(store1(&_idx, postInc1((*int32)(unsafe.Pointer(&(_pWC.X3))), int32(1)))))) - if (_p != nil) && (((_p.X2) & uint32(i32(262144))) != uint32(i32(0))) { - *(*int16)(unsafe.Pointer(&(_pTerm.X2))) = int16(int32(_sqlite3LogEst(tls, uint64(_p.X8))) - i32(270)) + _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(store1(&_idx, postInc1((*int32)(unsafe.Pointer(&_pWC.X3)), 1))))) + if (_p != nil) && ((_p.X2 & uint32(i32(262144))) != uint32(i32(0))) { + *(*int16)(unsafe.Pointer(&_pTerm.X2)) = int16(int32(_sqlite3LogEst(tls, uint64(_p.X8))) - i32(270)) goto _6 } - *(*int16)(unsafe.Pointer(&(_pTerm.X2))) = int16(i32(1)) + *(*int16)(unsafe.Pointer(&_pTerm.X2)) = int16(i32(1)) _6: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTerm.X0))))) = _sqlite3ExprSkipCollate(tls, _p) - *(*uint16)(unsafe.Pointer(&(_pTerm.X3))) = _wtFlags - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTerm.X1))))) = _pWC - *(*int32)(unsafe.Pointer(&(_pTerm.X7))) = i32(-1) - crt.Xmemset(tls, (unsafe.Pointer)((*uint16)(unsafe.Pointer(&(_pTerm.X4)))), i32(0), u64(44)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTerm.X0)))) = _sqlite3ExprSkipCollate(tls, _p) + *(*uint16)(unsafe.Pointer(&_pTerm.X3)) = _wtFlags + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTerm.X1)))) = _pWC + *(*int32)(unsafe.Pointer(&_pTerm.X7)) = i32(-1) + crt.Xmemset(tls, unsafe.Pointer((*uint16)(unsafe.Pointer(&_pTerm.X4))), i32(0), u64(44)) return _idx } -// Walk an expression tree. Return non-zero if the expression is constant -// that does no originate from the ON or USING clauses of a join. -// Return 0 if it involves variables or function calls or terms from -// an ON or USING clause. +// C comment +// /* +// ** Walk an expression tree. Return non-zero if the expression is constant +// ** that does no originate from the ON or USING clauses of a join. +// ** Return 0 if it involves variables or function calls or terms from +// ** an ON or USING clause. +// */ func _sqlite3ExprIsConstantNotJoin(tls *crt.TLS, _p *XExpr) (r0 int32) { return _exprIsConst(tls, _p, i32(2), i32(0)) } -// Generate code for a boolean expression such that a jump is made -// to the label "dest" if the expression is false but execution -// continues straight thru if the expression is true. -// -// If the expression evaluates to NULL (neither true nor false) then -// jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull -// is 0. +// C comment +// /* +// ** Generate code for a boolean expression such that a jump is made +// ** to the label "dest" if the expression is false but execution +// ** continues straight thru if the expression is true. +// ** +// ** If the expression evaluates to NULL (neither true nor false) then +// ** jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull +// ** is 0. +// */ func _sqlite3ExprIfFalse(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) { var _op, _regFree1, _regFree2, _r1, _r2, _3_d2, _10_destIfNull int32 var _v *TVdbe @@ -80484,19 +83997,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprIfFalseØ00__func__Ø000[0], str(101685), 19) } -// Remove from the column cache any entries that were added since the -// the previous sqlite3ExprCachePush operation. In other words, restore -// the cache to the state it was in prior the most recent Push. +// C comment +// /* +// ** Remove from the column cache any entries that were added since the +// ** the previous sqlite3ExprCachePush operation. In other words, restore +// ** the cache to the state it was in prior the most recent Push. +// */ func _sqlite3ExprCachePop(tls *crt.TLS, _pParse *XParse) { var _i int32 _i = i32(0) func() { - if (_pParse.X23) < i32(1) { + if _pParse.X23 < i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94086), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCachePopØ00__func__Ø000))), unsafe.Pointer(str(101704))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pParse.X23))) -= 1 + *(*int32)(unsafe.Pointer(&_pParse.X23)) -= 1 if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 { crt.Xprintf(tls, str(101727), _pParse.X23) } @@ -80504,7 +84020,7 @@ _2: if _i >= int32(_pParse.X13) { goto _4 } - if ((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X3) > (_pParse.X23) { + if ((*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&_pParse.X48)))) + 20*uintptr(_i))).X3) > _pParse.X23 { _cacheEntryClear(tls, _pParse, _i) goto _6 } @@ -80520,18 +84036,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCachePopØ00__func__Ø000[0], str(101739), 20) } -// Generate code for a boolean expression such that a jump is made -// to the label "dest" if the expression is true but execution -// continues straight thru if the expression is false. -// -// If the expression evaluates to NULL (neither true nor false), then -// take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL. -// -// This code depends on the fact that certain token values (ex: TK_EQ) -// are the same as opcode values (ex: OP_Eq) that implement the corresponding -// operation. Special comments in vdbe.c and the mkopcodeh.awk script in -// the make process cause these values to align. Assert()s in the code -// below verify that the numbers are aligned correctly. +// C comment +// /* +// ** Generate code for a boolean expression such that a jump is made +// ** to the label "dest" if the expression is true but execution +// ** continues straight thru if the expression is false. +// ** +// ** If the expression evaluates to NULL (neither true nor false), then +// ** take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL. +// ** +// ** This code depends on the fact that certain token values (ex: TK_EQ) +// ** are the same as opcode values (ex: OP_Eq) that implement the corresponding +// ** operation. Special comments in vdbe.c and the mkopcodeh.awk script in +// ** the make process cause these values to align. Assert()s in the code +// ** below verify that the numbers are aligned correctly. +// */ func _sqlite3ExprIfTrue(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) { var _op, _regFree1, _regFree2, _r1, _r2, _2_d2, _8_destIfFalse, _8_destIfNull int32 var _v *TVdbe @@ -80689,21 +84208,24 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprIfTrueØ00__func__Ø000[0], str(101759), 18) } -// Generate code to evaluate an expression and store the results -// into a register. Return the register number where the results -// are stored. -// -// If the register is a temporary register that can be deallocated, -// then write its number into *pReg. If the result register is not -// a temporary, then set *pReg to zero. -// -// If pExpr is a constant, then this routine might generate this -// code to fill the register in the initialization section of the -// VDBE program, in order to factor it out of the evaluation loop. +// C comment +// /* +// ** Generate code to evaluate an expression and store the results +// ** into a register. Return the register number where the results +// ** are stored. +// ** +// ** If the register is a temporary register that can be deallocated, +// ** then write its number into *pReg. If the result register is not +// ** a temporary, then set *pReg to zero. +// ** +// ** If pExpr is a constant, then this routine might generate this +// ** code to fill the register in the initialization section of the +// ** VDBE program, in order to factor it out of the evaluation loop. +// */ func _sqlite3ExprCodeTemp(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pReg *int32) (r0 int32) { var _r2, _2_r1 int32 _pExpr = _sqlite3ExprSkipCollate(tls, _pExpr) - if (((_pParse.X11) != 0) && (int32(_pExpr.X0) != i32(157))) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 { + if ((_pParse.X11 != 0) && (int32(_pExpr.X0) != i32(157))) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 { *_pReg = i32(0) _r2 = _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, i32(-1)) goto _3 @@ -80721,27 +84243,33 @@ _3: return _r2 } -// Generate code for a comparison operator. +// C comment +// /* +// ** Generate code for a comparison operator. +// */ func _codeCompare(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr, _opcode int32, _in1 int32, _in2 int32, _dest int32, _jumpIfNull int32) (r0 int32) { var _p5, _addr int32 var _p4 *XCollSeq _p4 = _sqlite3BinaryCompareCollSeq(tls, _pParse, _pLeft, _pRight) _p5 = int32(_binaryCompareP5(tls, _pLeft, _pRight, _jumpIfNull)) - _addr = _sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.X2), _opcode, _in2, _dest, _in1, (*int8)((unsafe.Pointer)(_p4)), i32(-3)) + _addr = _sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.X2), _opcode, _in2, _dest, _in1, (*int8)(unsafe.Pointer(unsafe.Pointer(_p4))), i32(-3)) _sqlite3VdbeChangeP5(tls, (*TVdbe)(_pParse.X2), uint16(uint8(_p5))) return _addr } -// Return a pointer to the collation sequence that should be used by -// a binary comparison operator comparing pLeft and pRight. -// -// If the left hand expression has a collating sequence type, then it is -// used. Otherwise the collation sequence for the right hand expression -// is used, or the default (BINARY) if neither expression has a collating -// type. -// -// Argument pRight (but not pLeft) may be a null pointer. In this case, -// it is not considered. +// C comment +// /* +// ** Return a pointer to the collation sequence that should be used by +// ** a binary comparison operator comparing pLeft and pRight. +// ** +// ** If the left hand expression has a collating sequence type, then it is +// ** used. Otherwise the collation sequence for the right hand expression +// ** is used, or the default (BINARY) if neither expression has a collating +// ** type. +// ** +// ** Argument pRight (but not pLeft) may be a null pointer. In this case, +// ** it is not considered. +// */ func _sqlite3BinaryCompareCollSeq(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr) (r0 *XCollSeq) { var _pColl *XCollSeq func() { @@ -80750,11 +84278,11 @@ func _sqlite3BinaryCompareCollSeq(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, crt.X__builtin_abort(tls) } }() - if ((_pLeft.X2) & uint32(i32(256))) != 0 { + if (_pLeft.X2 & uint32(i32(256))) != 0 { _pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft) goto _6 } - if (_pRight != nil) && (((_pRight.X2) & uint32(i32(256))) != uint32(i32(0))) { + if (_pRight != nil) && ((_pRight.X2 & uint32(i32(256))) != uint32(i32(0))) { _pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight) goto _6 } @@ -80772,8 +84300,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BinaryCompareCollSeqØ00__func__Ø000[0], str(101777), 28) } -// Return the P5 value that should be used for a binary comparison -// opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2. +// C comment +// /* +// ** Return the P5 value that should be used for a binary comparison +// ** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2. +// */ func _binaryCompareP5(tls *crt.TLS, _pExpr1 *XExpr, _pExpr2 *XExpr, _jumpIfNull int32) (r0 uint8) { var _aff uint8 _aff = uint8(_sqlite3ExprAffinity(tls, _pExpr2)) @@ -80781,54 +84312,57 @@ func _binaryCompareP5(tls *crt.TLS, _pExpr1 *XExpr, _pExpr2 *XExpr, _jumpIfNull return _aff } -// Generate code for a BETWEEN operator. -// -// x BETWEEN y AND z -// -// The above is equivalent to -// -// x>=y AND x<=z -// -// Code it as such, taking care to do the common subexpression -// elimination of x. -// -// The xJumpIf parameter determines details: -// -// NULL: Store the boolean result in reg[dest] -// sqlite3ExprIfTrue: Jump to dest if true -// sqlite3ExprIfFalse: Jump to dest if false -// -// The jumpIfNull parameter is ignored if xJumpIf is NULL. +// C comment +// /* +// ** Generate code for a BETWEEN operator. +// ** +// ** x BETWEEN y AND z +// ** +// ** The above is equivalent to +// ** +// ** x>=y AND x<=z +// ** +// ** Code it as such, taking care to do the common subexpression +// ** elimination of x. +// ** +// ** The xJumpIf parameter determines details: +// ** +// ** NULL: Store the boolean result in reg[dest] +// ** sqlite3ExprIfTrue: Jump to dest if true +// ** sqlite3ExprIfFalse: Jump to dest if false +// ** +// ** The jumpIfNull parameter is ignored if xJumpIf is NULL. +// */ func _exprCodeBetween(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _xJump func(*crt.TLS, *XParse, *XExpr, int32, int32), _jumpIfNull int32) { var _regFree1 int32 var _exprAnd, _compLeft, _compRight, _exprX XExpr _regFree1 = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_compLeft), i32(0), u64(72)) - crt.Xmemset(tls, (unsafe.Pointer)(&_compRight), i32(0), u64(72)) - crt.Xmemset(tls, (unsafe.Pointer)(&_exprAnd), i32(0), u64(72)) + crt.Xmemset(tls, unsafe.Pointer(&_compLeft), i32(0), u64(72)) + crt.Xmemset(tls, unsafe.Pointer(&_compRight), i32(0), u64(72)) + crt.Xmemset(tls, unsafe.Pointer(&_exprAnd), i32(0), u64(72)) func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95222), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprCodeBetweenØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() _exprX = *(*XExpr)(_pExpr.X4) - *(*uint8)(unsafe.Pointer(&(_exprAnd.X0))) = uint8(i32(71)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_exprAnd.X4))))) = &_compLeft - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_exprAnd.X5))))) = &_compRight - *(*uint8)(unsafe.Pointer(&(_compLeft.X0))) = uint8(i32(82)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compLeft.X4))))) = &_exprX - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compLeft.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(0)))).X0) - *(*uint8)(unsafe.Pointer(&(_compRight.X0))) = uint8(i32(80)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compRight.X4))))) = &_exprX - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compRight.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(1)))).X0) + *(*uint8)(unsafe.Pointer(&_exprAnd.X0)) = uint8(i32(71)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_exprAnd.X4)))) = &_compLeft + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_exprAnd.X5)))) = &_compRight + *(*uint8)(unsafe.Pointer(&_compLeft.X0)) = uint8(i32(82)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_compLeft.X4)))) = &_exprX + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_compLeft.X5)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(0)))).X0) + *(*uint8)(unsafe.Pointer(&_compRight.X0)) = uint8(i32(80)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_compRight.X4)))) = &_exprX + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_compRight.X5)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(1)))).X0) _exprToRegister(tls, &_exprX, _exprCodeVector(tls, _pParse, &_exprX, &_regFree1)) if _xJump != nil { _xJump(tls, _pParse, &_exprAnd, _dest, _jumpIfNull) goto _3 } { - p := (*uint32)(unsafe.Pointer(&(_exprX.X2))) + p := (*uint32)(unsafe.Pointer(&_exprX.X2)) *p = (*p) | uint32(i32(1)) sink5(*p) } @@ -80847,28 +84381,34 @@ func init() { crt.Xstrncpy(nil, &_exprCodeBetweenØ00__func__Ø000[0], str(101805), 16) } -// Convert a scalar expression node to a TK_REGISTER referencing -// register iReg. The caller must ensure that iReg already contains -// the correct value for the expression. +// C comment +// /* +// ** Convert a scalar expression node to a TK_REGISTER referencing +// ** register iReg. The caller must ensure that iReg already contains +// ** the correct value for the expression. +// */ func _exprToRegister(tls *crt.TLS, _p *XExpr, _iReg int32) { - *(*uint8)(unsafe.Pointer(&(_p.X12))) = _p.X0 - *(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(i32(157)) - *(*int32)(unsafe.Pointer(&(_p.X8))) = _iReg + *(*uint8)(unsafe.Pointer(&_p.X12)) = _p.X0 + *(*uint8)(unsafe.Pointer(&_p.X0)) = uint8(i32(157)) + *(*int32)(unsafe.Pointer(&_p.X8)) = _iReg { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) *p = (*p) & uint32(i32(-4097)) sink5(*p) } } -// Evaluate an expression (either a vector or a scalar expression) and store -// the result in continguous temporary registers. Return the index of -// the first register used to store the result. -// -// If the returned result register is a temporary scalar, then also write -// that register number into *piFreeable. If the returned result register -// is not a temporary or if the expression is a vector set *piFreeable -// to 0. +// C comment +// /* +// ** Evaluate an expression (either a vector or a scalar expression) and store +// ** the result in continguous temporary registers. Return the index of +// ** the first register used to store the result. +// ** +// ** If the returned result register is a temporary scalar, then also write +// ** that register number into *piFreeable. If the returned result register +// ** is not a temporary or if the expression is a vector set *piFreeable +// ** to 0. +// */ func _exprCodeVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _piFreeable *int32) (r0 int32) { var _iResult, _nResult, _4_i int32 _nResult = _sqlite3ExprVectorSize(tls, _p) @@ -80881,9 +84421,9 @@ func _exprCodeVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _piFreeable *int3 _iResult = _sqlite3CodeSubselect(tls, _pParse, _p, i32(0), i32(0)) goto _3 } - _iResult = (_pParse.X18) + i32(1) + _iResult = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nResult sink1(*p) } @@ -80892,7 +84432,7 @@ _4: if _4_i >= _nResult { goto _7 } - _sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2)))))+32*uintptr(_4_i))).X0), _4_i+_iResult) + _sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))).X2)))))+32*uintptr(_4_i))).X0), _4_i+_iResult) _4_i += 1 goto _4 _7: @@ -80901,12 +84441,15 @@ _1: return _iResult } -// Generate code that will evaluate expression pExpr and store the -// results in register target. The results are guaranteed to appear -// in register target. If the expression is constant, then this routine -// might choose to code the expression at initialization time. +// C comment +// /* +// ** Generate code that will evaluate expression pExpr and store the +// ** results in register target. The results are guaranteed to appear +// ** in register target. If the expression is constant, then this routine +// ** might choose to code the expression at initialization time. +// */ func _sqlite3ExprCodeFactorable(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) { - if ((_pParse.X11) != 0) && _sqlite3ExprIsConstant(tls, _pExpr) != 0 { + if (_pParse.X11 != 0) && _sqlite3ExprIsConstant(tls, _pExpr) != 0 { _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, _target) goto _2 } @@ -80914,29 +84457,32 @@ func _sqlite3ExprCodeFactorable(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _t _2: } -// Generate code for an IN expression. -// -// x IN (SELECT ...) -// x IN (value, value, ...) -// -// The left-hand side (LHS) is a scalar or vector expression. The -// right-hand side (RHS) is an array of zero or more scalar values, or a -// subquery. If the RHS is a subquery, the number of result columns must -// match the number of columns in the vector on the LHS. If the RHS is -// a list of values, the LHS must be a scalar. -// -// The IN operator is true if the LHS value is contained within the RHS. -// The result is false if the LHS is definitely not in the RHS. The -// result is NULL if the presence of the LHS in the RHS cannot be -// determined due to NULLs. -// -// This routine generates code that jumps to destIfFalse if the LHS is not -// contained within the RHS. If due to NULLs we cannot determine if the LHS -// is contained in the RHS then jump to destIfNull. If the LHS is contained -// within the RHS then fall through. -// -// See the separate in-operator.md documentation file in the canonical -// SQLite source tree for additional information. +// C comment +// /* +// ** Generate code for an IN expression. +// ** +// ** x IN (SELECT ...) +// ** x IN (value, value, ...) +// ** +// ** The left-hand side (LHS) is a scalar or vector expression. The +// ** right-hand side (RHS) is an array of zero or more scalar values, or a +// ** subquery. If the RHS is a subquery, the number of result columns must +// ** match the number of columns in the vector on the LHS. If the RHS is +// ** a list of values, the LHS must be a scalar. +// ** +// ** The IN operator is true if the LHS value is contained within the RHS. +// ** The result is false if the LHS is definitely not in the RHS. The +// ** result is NULL if the presence of the LHS in the RHS cannot be +// ** determined due to NULLs. +// ** +// ** This routine generates code that jumps to destIfFalse if the LHS is not +// ** contained within the RHS. If due to NULLs we cannot determine if the LHS +// ** is contained in the RHS then jump to destIfNull. If the LHS is contained +// ** within the RHS then fall through. +// ** +// ** See the separate in-operator.md documentation file in the canonical +// ** SQLite source tree for additional information. +// */ func _sqlite3ExprCodeIN(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _destIfFalse int32, _destIfNull int32) { var _rRhsHasNull, _eType, _rLhs, _rLhsOrig, _nVector, _iDummy, _i, _destStep2, _destStep6, _addrTruthOp, _destNotNull, _addrTop, _1_j, _1_cnt, _6_labelOk, _6_r2, _6_regToFree, _6_regCkNull, _6_ii, _23_r3 int32 var _aiMap *int32 @@ -80974,7 +84520,7 @@ func _sqlite3ExprCodeIN(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _destIfFal return &_rRhsHasNull }(), _aiMap) func() { - if (_pParse.X16) == 0 && _nVector != i32(1) && _eType != i32(2) && _eType != i32(3) && _eType != i32(4) { + if _pParse.X16 == 0 && _nVector != i32(1) && _eType != i32(2) && _eType != i32(3) && _eType != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93729), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(101835))) crt.X__builtin_abort(tls) } @@ -80989,7 +84535,7 @@ _16: if _1_j >= _nVector { goto _19 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_1_j)))) == _i { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiMap)) + 4*uintptr(_1_j)))) == _i { _1_cnt += 1 } _1_j += 1 @@ -81008,7 +84554,7 @@ _15: _rLhsOrig = _exprCodeVector(tls, _pParse, _pLeft, &_iDummy) _i = i32(0) _23: - if _i >= _nVector || (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_i)))) != _i { + if _i >= _nVector || (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiMap)) + 4*uintptr(_i)))) != _i { goto _27 } _i += 1 @@ -81024,7 +84570,7 @@ _30: if _i >= _nVector { goto _33 } - _sqlite3VdbeAddOp3(tls, _v, i32(64), _rLhsOrig+_i, _rLhs+(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_i)))), i32(0)) + _sqlite3VdbeAddOp3(tls, _v, i32(64), _rLhsOrig+_i, _rLhs+(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiMap)) + 4*uintptr(_i)))), i32(0)) _i += 1 goto _30 _33: @@ -81032,12 +84578,12 @@ _29: if _eType != i32(5) { goto _34 } - _6_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _6_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) _6_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4)) _6_labelOk = _sqlite3VdbeMakeLabel(tls, _v) _6_regCkNull = i32(0) func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } @@ -81048,16 +84594,16 @@ _29: } _6_ii = i32(0) _38: - if _6_ii >= (_6_pList.X0) { + if _6_ii >= _6_pList.X0 { goto _41 } - _6_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pList.X2)))))+32*uintptr(_6_ii))).X0), &_6_regToFree) - if _6_regCkNull != 0 && _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pList.X2)))))+32*uintptr(_6_ii))).X0)) != 0 { + _6_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pList.X2))))+32*uintptr(_6_ii))).X0), &_6_regToFree) + if _6_regCkNull != 0 && _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_6_pList.X2))))+32*uintptr(_6_ii))).X0)) != 0 { _sqlite3VdbeAddOp3(tls, _v, i32(84), _6_regCkNull, _6_r2, _6_regCkNull) } - if (_6_ii < ((_6_pList.X0) - i32(1))) || (_destIfNull != _destIfFalse) { - _sqlite3VdbeAddOp4(tls, _v, i32(78), _rLhs, _6_labelOk, _6_r2, (*int8)((unsafe.Pointer)(_6_pColl)), i32(-3)) - _sqlite3VdbeChangeP5(tls, _v, uint16(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0)))))) + if (_6_ii < (_6_pList.X0 - i32(1))) || (_destIfNull != _destIfFalse) { + _sqlite3VdbeAddOp4(tls, _v, i32(78), _rLhs, _6_labelOk, _6_r2, (*int8)(unsafe.Pointer(unsafe.Pointer(_6_pColl))), i32(-3)) + _sqlite3VdbeChangeP5(tls, _v, uint16(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(i32(0)))))) goto _46 } func() { @@ -81066,8 +84612,8 @@ _38: crt.X__builtin_abort(tls) } }() - _sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs, _destIfFalse, _6_r2, (*int8)((unsafe.Pointer)(_6_pColl)), i32(-3)) - _sqlite3VdbeChangeP5(tls, _v, uint16(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0)))))|i32(16))) + _sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs, _destIfFalse, _6_r2, (*int8)(unsafe.Pointer(unsafe.Pointer(_6_pColl))), i32(-3)) + _sqlite3VdbeChangeP5(tls, _v, uint16(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(i32(0)))))|i32(16))) _46: _sqlite3ReleaseTempReg(tls, _pParse, _6_regToFree) _6_ii += 1 @@ -81136,7 +84682,7 @@ _66: _23_p = _sqlite3VectorFieldSubexpr(tls, _pLeft, _i) _23_pColl = _sqlite3ExprCollSeq(tls, _pParse, _23_p) _sqlite3VdbeAddOp3(tls, _v, i32(99), _pExpr.X8, _i, _23_r3) - _sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs+_i, _destNotNull, _23_r3, (*int8)((unsafe.Pointer)(_23_pColl)), i32(-3)) + _sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs+_i, _destNotNull, _23_r3, (*int8)(unsafe.Pointer(unsafe.Pointer(_23_pColl))), i32(-3)) _sqlite3ReleaseTempReg(tls, _pParse, _23_r3) _i += 1 goto _66 @@ -81155,23 +84701,26 @@ _sqlite3ExprCodeIN_finished: _sqlite3ExprCachePop(tls, _pParse) _sqlite3VdbeComment(tls, _v, str(101975)) _sqlite3ExprCodeIN_oom_error: - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_aiMap)) - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zAff)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_aiMap)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_zAff)) _ = _iDummy } -// Expr pIn is an IN(...) expression. This function checks that the -// sub-select on the RHS of the IN() operator has the same number of -// columns as the vector on the LHS. Or, if the RHS of the IN() is not -// a sub-query, that the LHS is a vector of size 1. +// C comment +// /* +// ** Expr pIn is an IN(...) expression. This function checks that the +// ** sub-select on the RHS of the IN() operator has the same number of +// ** columns as the vector on the LHS. Or, if the RHS of the IN() is not +// ** a sub-query, that the LHS is a vector of size 1. +// */ func _sqlite3ExprCheckIN(tls *crt.TLS, _pParse *XParse, _pIn *XExpr) (r0 int32) { var _nVector int32 _nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pIn.X4)) - if ((_pIn.X2) & uint32(i32(2048))) == 0 { + if (_pIn.X2 & uint32(i32(2048))) == 0 { goto _0 } - if _nVector != ((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pIn.X6)))))).X0).X0) { - _sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pIn.X6)))))).X0).X0, _nVector) + if _nVector != ((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pIn.X6))))).X0).X0) { + _sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pIn.X6))))).X0).X0, _nVector) return i32(1) } goto _3 @@ -81205,7 +84754,7 @@ func _sqlite3FindInIndex(tls *crt.TLS, _pParse *XParse, _pX *XExpr, _inFlags uin var _6_pIdx *XIndex var _13_pReq *XCollSeq _eType = i32(0) - _iTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _v = _sqlite3GetVdbe(tls, _pParse) func() { if int32(_pX.X0) != i32(74) { @@ -81214,26 +84763,26 @@ func _sqlite3FindInIndex(tls *crt.TLS, _pParse *XParse, _pX *XExpr, _inFlags uin } }() _mustBeUnique = bool2int((_inFlags & uint32(i32(4))) != uint32(i32(0))) - if _prRhsHasNull == nil || ((_pX.X2)&uint32(i32(2048))) == 0 { + if _prRhsHasNull == nil || (_pX.X2&uint32(i32(2048))) == 0 { goto _3 } - _1_pEList = (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))).X0) + _1_pEList = (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pX.X6))))).X0) _1_i = i32(0) _4: - if _1_i >= (_1_pEList.X0) { + if _1_i >= _1_pEList.X0 { goto _7 } - if _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_1_pEList.X2)))))+32*uintptr(_1_i))).X0)) != 0 { + if _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_1_pEList.X2))))+32*uintptr(_1_i))).X0)) != 0 { goto _7 } _1_i += 1 goto _4 _7: - if _1_i == (_1_pEList.X0) { + if _1_i == _1_pEList.X0 { _prRhsHasNull = nil } _3: - if (_pParse.X16) != i32(0) || store59(&_p, _isCandidateForInOpt(tls, _pX)) == nil { + if _pParse.X16 != i32(0) || store59(&_p, _isCandidateForInOpt(tls, _pX)) == nil { goto _11 } _4_db = (*Xsqlite3)(_pParse.X0) @@ -81246,7 +84795,7 @@ _3: } }() func() { - if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+32*uintptr(i32(0)))).X0) == nil { + if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+32*uintptr(i32(0)))).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93133), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102019))) crt.X__builtin_abort(tls) } @@ -81257,7 +84806,7 @@ _3: crt.X__builtin_abort(tls) } }() - _4_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X4) + _4_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X4) _4_iDb = int16(_sqlite3SchemaToIndex(tls, _4_db, (*XSchema)(_4_pTab.X20))) _sqlite3CodeVerifySchema(tls, _pParse, int32(_4_iDb)) _sqlite3TableLock(tls, _pParse, int32(_4_iDb), _4_pTab.X7, uint8(i32(0)), _4_pTab.X0) @@ -81267,7 +84816,7 @@ _3: crt.X__builtin_abort(tls) } }() - if (_4_nExpr == i32(1)) && (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2)))))+32*uintptr(i32(0)))).X0).X9) < i32(0)) { + if (_4_nExpr == i32(1)) && (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_4_pEList.X2))))+32*uintptr(i32(0)))).X0).X9) < i32(0)) { _5_iAddr = _sqlite3VdbeAddOp0(tls, _v, i32(20)) _sqlite3OpenTable(tls, _pParse, _iTab, int32(_4_iDb), _4_pTab, i32(106)) _eType = i32(1) @@ -81281,7 +84830,7 @@ _23: goto _27 } _7_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.X4), _6_i) - _7_iCol = int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2))))) + 32*uintptr(_6_i))).X0).X9) + _7_iCol = int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_4_pEList.X2)))) + 32*uintptr(_6_i))).X0).X9) _7_idxaff = _sqlite3TableColumnAffinity(tls, _4_pTab, _7_iCol) _7_cmpaff = _sqlite3CompareAffinity(tls, _7_pLhs, _7_idxaff) switch int32(_7_cmpaff) { @@ -81337,10 +84886,10 @@ _47: goto _50 } _13_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.X4), _6_i) - _13_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2))))) + 32*uintptr(_6_i))).X0) + _13_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_4_pEList.X2)))) + 32*uintptr(_6_i))).X0) _13_pReq = _sqlite3BinaryCompareCollSeq(tls, _pParse, _13_pLhs, _13_pRhs) func() { - if _13_pReq == nil && int32(_13_pRhs.X9) != i32(-1) && (_pParse.X16) == 0 { + if _13_pReq == nil && int32(_13_pRhs.X9) != i32(-1) && _pParse.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93209), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102079))) crt.X__builtin_abort(tls) } @@ -81350,16 +84899,16 @@ _55: if _13_j >= _4_nExpr { goto _58 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X1)) + 2*uintptr(_13_j)))) != int32(_13_pRhs.X9) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_pIdx.X1)) + 2*uintptr(_13_j)))) != int32(_13_pRhs.X9) { goto _56 } func() { - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X8)) + 8*uintptr(_13_j)))) == nil { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_pIdx.X8)) + 8*uintptr(_13_j)))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93212), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102130))) crt.X__builtin_abort(tls) } }() - if (_13_pReq != nil) && (_sqlite3StrICmp(tls, _13_pReq.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X8)) + 8*uintptr(_13_j)))) != i32(0)) { + if (_13_pReq != nil) && (_sqlite3StrICmp(tls, _13_pReq.X0, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_pIdx.X8)) + 8*uintptr(_13_j)))) != i32(0)) { goto _56 } goto _58 @@ -81380,7 +84929,7 @@ _58: sink17(*p) } if _aiMap != nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_6_i))) = _13_j + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiMap)) + 4*uintptr(_6_i))) = _13_j } _6_i += 1 goto _47 @@ -81400,11 +84949,11 @@ _50: _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _6_pIdx) _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_6_pIdx.X0)) i32(0) - _eType = i32(3) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X7)) + 1*uintptr(i32(0))))) + _eType = i32(3) + int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_pIdx.X7)) + 1*uintptr(i32(0))))) if _prRhsHasNull == nil { goto _71 } - *_prRhsHasNull = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *_prRhsHasNull = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) if _4_nExpr == i32(1) { _sqlite3SetHasNullFlag(tls, _v, _iTab, *_prRhsHasNull) } @@ -81418,7 +84967,7 @@ _40: _35: _22: _11: - if (((_eType == i32(0)) && ((_inFlags & uint32(i32(1))) != 0)) && (((_pX.X2) & uint32(i32(2048))) == uint32(i32(0)))) && ((_sqlite3InRhsIsConstant(tls, _pX) == 0) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))).X0) <= i32(2))) { + if (((_eType == i32(0)) && ((_inFlags & uint32(i32(1))) != 0)) && ((_pX.X2 & uint32(i32(2048))) == uint32(i32(0)))) && ((_sqlite3InRhsIsConstant(tls, _pX) == 0) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pX.X6))))).X0) <= i32(2))) { _eType = i32(5) } if _eType != i32(0) { @@ -81430,21 +84979,21 @@ _11: if (_inFlags & uint32(i32(4))) == 0 { goto _79 } - *(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(i32(0)) - if (int32((*XExpr)(_pX.X4).X9) < i32(0)) && (((_pX.X2) & uint32(i32(2048))) == uint32(i32(0))) { + *(*uint32)(unsafe.Pointer(&_pParse.X42)) = uint32(i32(0)) + if (int32((*XExpr)(_pX.X4).X9) < i32(0)) && ((_pX.X2 & uint32(i32(2048))) == uint32(i32(0))) { _eType = i32(1) } goto _83 _79: if _prRhsHasNull != nil { - *_prRhsHasNull = store1(&_20_rMayHaveNull, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) + *_prRhsHasNull = store1(&_20_rMayHaveNull, preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) } _83: _sqlite3CodeSubselect(tls, _pParse, _pX, _20_rMayHaveNull, bool2int(_eType == i32(1))) - *(*uint32)(unsafe.Pointer(&(_pParse.X42))) = _20_savedNQueryLoop + *(*uint32)(unsafe.Pointer(&_pParse.X42)) = _20_savedNQueryLoop goto _84 _78: - *(*int32)(unsafe.Pointer(&(_pX.X8))) = _iTab + *(*int32)(unsafe.Pointer(&_pX.X8)) = _iTab _84: if _aiMap == nil || _eType == i32(3) || _eType == i32(4) { goto _87 @@ -81455,7 +85004,7 @@ _88: if _25_i >= _25_n { goto _91 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_25_i))) = _25_i + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiMap)) + 4*uintptr(_25_i))) = _25_i _25_i += 1 goto _88 _91: @@ -81469,18 +85018,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FindInIndexØ00__func__Ø000[0], str(102217), 19) } -// Return FALSE if there is no chance that the expression can be NULL. -// -// If the expression might be NULL or if the expression is too complex -// to tell return TRUE. -// -// This routine is used as an optimization, to skip OP_IsNull opcodes -// when we know that a value cannot be NULL. Hence, a false positive -// (returning TRUE when in fact the expression can never be NULL) might -// be a small performance hit but is otherwise harmless. On the other -// hand, a false negative (returning FALSE when the result could be NULL) -// will likely result in an incorrect answer. So when in doubt, return -// TRUE. +// C comment +// /* +// ** Return FALSE if there is no chance that the expression can be NULL. +// ** +// ** If the expression might be NULL or if the expression is too complex +// ** to tell return TRUE. +// ** +// ** This routine is used as an optimization, to skip OP_IsNull opcodes +// ** when we know that a value cannot be NULL. Hence, a false positive +// ** (returning TRUE when in fact the expression can never be NULL) might +// ** be a small performance hit but is otherwise harmless. On the other +// ** hand, a false negative (returning FALSE when the result could be NULL) +// ** will likely result in an incorrect answer. So when in doubt, return +// ** TRUE. +// */ func _sqlite3ExprCanBeNull(tls *crt.TLS, _p *XExpr) (r0 int32) { var _op uint8 _0: @@ -81517,7 +85069,7 @@ _9: crt.X__builtin_abort(tls) } }() - return bool2int((((_p.X2) & uint32(i32(1048576))) != uint32(i32(0))) || ((int32(_p.X9) >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_p.X14).X1)+32*uintptr(_p.X9))).X3) == i32(0)))) + return bool2int(((_p.X2 & uint32(i32(1048576))) != uint32(i32(0))) || ((int32(_p.X9) >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_p.X14).X1)+32*uintptr(_p.X9))).X3) == i32(0)))) _10: return i32(1) @@ -81536,17 +85088,17 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { var _pEList *XExprList var _p *XSelect var _2_pRes *XExpr - if ((_pX.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pX.X2 & uint32(i32(2048))) == uint32(i32(0)) { return nil } - if ((_pX.X2) & uint32(i32(32))) != uint32(i32(0)) { + if (_pX.X2 & uint32(i32(32))) != uint32(i32(0)) { return nil } - _p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))) - if (*XSelect)(_p.X13) != nil { + _p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pX.X6))))) + if _p.X13 != nil { return nil } - if ((_p.X3) & uint32(i32(9))) != 0 { + if (_p.X3 & uint32(i32(9))) != 0 { return nil } func() { @@ -81555,7 +85107,7 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { crt.X__builtin_abort(tls) } }() - if (*XExpr)(_p.X15) != nil { + if _p.X15 != nil { return nil } func() { @@ -81564,7 +85116,7 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { crt.X__builtin_abort(tls) } }() - if (*XExpr)(_p.X9) != nil { + if _p.X9 != nil { return nil } _pSrc = (*XSrcList)(_p.X8) @@ -81574,13 +85126,13 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { crt.X__builtin_abort(tls) } }() - if (_pSrc.X0) != i32(1) { + if _pSrc.X0 != i32(1) { return nil } - if (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(i32(0)))).X5) != nil { + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(i32(0)))).X5) != nil { return nil } - _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(i32(0)))).X4) + _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(i32(0)))).X4) func() { if _pTab == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92957), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(43594))) @@ -81593,7 +85145,7 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { crt.X__builtin_abort(tls) } }() - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return nil } _pEList = (*XExprList)(_p.X0) @@ -81605,15 +85157,15 @@ func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) { }() _i = i32(0) _21: - if _i >= (_pEList.X0) { + if _i >= _pEList.X0 { goto _24 } - _2_pRes = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 32*uintptr(_i))).X0) + _2_pRes = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(_i))).X0) if int32(_2_pRes.X0) != i32(152) { return nil } func() { - if (_2_pRes.X8) != ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(i32(0)))).X11) { + if _2_pRes.X8 != ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(i32(0)))).X11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92966), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(102285))) crt.X__builtin_abort(tls) } @@ -81630,14 +85182,17 @@ func init() { crt.Xstrncpy(nil, &_isCandidateForInOptØ00__func__Ø000[0], str(102318), 20) } -// Record the fact that the schema cookie will need to be verified -// for database iDb. The code to actually verify the schema cookie -// will occur at the end of the top-level VDBE and will be generated -// later, by sqlite3FinishCoding(). +// C comment +// /* +// ** Record the fact that the schema cookie will need to be verified +// ** for database iDb. The code to actually verify the schema cookie +// ** will occur at the end of the top-level VDBE and will be generated +// ** later, by sqlite3FinishCoding(). +// */ func _sqlite3CodeVerifySchema(tls *crt.TLS, _pParse *XParse, _iDb int32) { var _pToplevel *XParse _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse @@ -81666,11 +85221,11 @@ func _sqlite3CodeVerifySchema(tls *crt.TLS, _pParse *XParse, _iDb int32) { crt.X__builtin_abort(tls) } }() - if bool2int(((_pToplevel.X30)&(u32(1)<<uint(_iDb))) != uint32(i32(0))) != i32(0) { + if bool2int((_pToplevel.X30&(u32(1)<<uint(_iDb))) != uint32(i32(0))) != i32(0) { goto _12 } { - p := (*uint32)(unsafe.Pointer(&(_pToplevel.X30))) + p := (*uint32)(unsafe.Pointer(&_pToplevel.X30)) *p = (*p) | (u32(1) << uint(_iDb)) sink5(*p) } @@ -81686,25 +85241,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CodeVerifySchemaØ00__func__Ø000[0], str(102475), 24) } -// Make sure the TEMP database is open and available for use. Return -// the number of errors. Leave any error messages in the pParse structure. +// C comment +// /* +// ** 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 _sqlite3OpenTempDatabase(tls *crt.TLS, _pParse *XParse) (r0 int32) { var _1_rc int32 var _db *Xsqlite3 var _1_pBt *XBtree _db = (*Xsqlite3)(_pParse.X0) - if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X1) != nil || (_pParse.X54) != 0 { + if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X1) != nil || _pParse.X54 != 0 { goto _1 } _1_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), nil, _db, &_1_pBt, i32(0), _sqlite3OpenTempDatabaseØ00flagsØ001) if _1_rc != i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(102499)) - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _1_rc + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _1_rc return i32(1) } *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X1))))) = _1_pBt func() { - if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4) == nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103738), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTempDatabaseØ00__func__Ø000))), unsafe.Pointer(str(102569))) crt.X__builtin_abort(tls) } @@ -81729,10 +85287,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3OpenTempDatabaseØ00__func__Ø000[0], str(102588), 24) } -// Generate code that checks the left-most column of index table iCur to see if -// 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. +// C comment +// /* +// ** Generate code that checks the left-most column of index table iCur to see if +// ** 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 *crt.TLS, _v *TVdbe, _iCur int32, _regHasNull int32) { var _addr1 int32 _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regHasNull) @@ -81743,21 +85304,24 @@ func _sqlite3SetHasNullFlag(tls *crt.TLS, _v *TVdbe, _iCur int32, _regHasNull in _sqlite3VdbeJumpHere(tls, _v, _addr1) } -// The argument is an IN operator with a list (not a subquery) on the -// right-hand side. Return TRUE if that list is constant. +// C comment +// /* +// ** 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 *crt.TLS, _pIn *XExpr) (r0 int32) { var _res int32 var _pLHS *XExpr func() { - if ((_pIn.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pIn.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92999), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InRhsIsConstantØ00__func__Ø000))), unsafe.Pointer(str(102631))) crt.X__builtin_abort(tls) } }() _pLHS = (*XExpr)(_pIn.X4) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X4))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIn.X4)))) = nil _res = _sqlite3ExprIsConstant(tls, _pIn) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X4))))) = _pLHS + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIn.X4)))) = _pLHS return _res } @@ -81767,22 +85331,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3InRhsIsConstantØ00__func__Ø000[0], str(102667), 23) } -// If the expression is always either TRUE or FALSE (respectively), -// then return 1. If one cannot determine the truth value of the -// expression at compile-time return 0. -// -// This is an optimization. If is OK to return 0 here even if -// the expression really is always false or false (a false negative). -// But it is a bug to return 1 if the expression might have different -// boolean values in different circumstances (a false positive.) -// -// Note that if the expression is part of conditional for a -// LEFT JOIN, then we cannot determine at compile-time whether or not -// is it true or false, so always return 0. +// C comment +// /* +// ** If the expression is always either TRUE or FALSE (respectively), +// ** then return 1. If one cannot determine the truth value of the +// ** expression at compile-time return 0. +// ** +// ** This is an optimization. If is OK to return 0 here even if +// ** the expression really is always false or false (a false negative). +// ** But it is a bug to return 1 if the expression might have different +// ** boolean values in different circumstances (a false positive.) +// ** +// ** Note that if the expression is part of conditional for a +// ** LEFT JOIN, then we cannot determine at compile-time whether or not +// ** is it true or false, so always return 0. +// */ func _exprAlwaysTrue(tls *crt.TLS, _p *XExpr) (r0 int32) { var _v int32 _v = i32(0) - if ((_p.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(1))) != uint32(i32(0)) { return i32(0) } if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 { @@ -81791,20 +85358,23 @@ func _exprAlwaysTrue(tls *crt.TLS, _p *XExpr) (r0 int32) { return bool2int(_v != i32(0)) } -// Create a new mask for cursor iCursor. -// -// There is one cursor per table in the FROM clause. The number of -// 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. +// C comment +// /* +// ** Create a new mask for cursor iCursor. +// ** +// ** There is one cursor per table in the FROM clause. The number of +// ** 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 *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) { func() { - if (_pMaskSet.X0) >= i32(64) { + if _pMaskSet.X0 >= i32(64) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130573), unsafe.Pointer((*int8)(unsafe.Pointer(&_createMaskØ00__func__Ø000))), unsafe.Pointer(str(102690))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&(_pMaskSet.X1))))) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pMaskSet.X0))), int32(1))))) = _iCursor + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[64]int32)(unsafe.Pointer(&_pMaskSet.X1)))) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&_pMaskSet.X0)), 1)))) = _iCursor } var _createMaskØ00__func__Ø000 [11]int8 @@ -81813,17 +85383,20 @@ func init() { crt.Xstrncpy(nil, &_createMaskØ00__func__Ø000[0], str(102728), 11) } -// For table-valued-functions, transform the function arguments into -// new WHERE clause terms. -// -// Each function argument translates into an equality constraint against -// a HIDDEN column in the table. +// C comment +// /* +// ** For table-valued-functions, transform the function arguments into +// ** new WHERE clause terms. +// ** +// ** Each function argument translates into an equality constraint against +// ** a HIDDEN column in the table. +// */ func _sqlite3WhereTabFuncArgs(tls *crt.TLS, _pParse *XParse, _pItem *TSrcList_item, _pWC *XWhereClause) { var _j, _k int32 var _pTab *XTable var _pArgs *XExprList var _pColRef, _pTerm *XExpr - if int32((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) { return } _pTab = (*XTable)(_pItem.X4) @@ -81833,13 +85406,13 @@ func _sqlite3WhereTabFuncArgs(tls *crt.TLS, _pParse *XParse, _pItem *TSrcList_it crt.X__builtin_abort(tls) } }() - _pArgs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15)))))) + _pArgs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_pItem.X15))))) if _pArgs == nil { return } _j = store1(&_k, i32(0)) _4: - if _j >= (_pArgs.X0) { + if _j >= _pArgs.X0 { goto _7 } _8: @@ -81855,10 +85428,10 @@ _8: if _pColRef == nil { return } - *(*int32)(unsafe.Pointer(&(_pColRef.X8))) = _pItem.X11 - *(*int16)(unsafe.Pointer(&(_pColRef.X9))) = int16(postInc1(&_k, int32(1))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pColRef.X14))))) = _pTab - _pTerm = _sqlite3PExpr(tls, _pParse, i32(78), _pColRef, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pArgs.X2)))))+32*uintptr(_j))).X0), i32(0))) + *(*int32)(unsafe.Pointer(&_pColRef.X8)) = _pItem.X11 + *(*int16)(unsafe.Pointer(&_pColRef.X9)) = int16(postInc1(&_k, 1)) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pColRef.X14)))) = _pTab + _pTerm = _sqlite3PExpr(tls, _pParse, i32(78), _pColRef, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pArgs.X2))))+32*uintptr(_j))).X0), i32(0))) _whereClauseInsert(tls, _pWC, _pTerm, uint16(i32(1))) _j += 1 goto _4 @@ -81871,22 +85444,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereTabFuncArgsØ00__func__Ø000[0], str(102775), 24) } -// Return the bitmask for the given cursor number. Return 0 if -// iCursor is not in the set. +// C comment +// /* +// ** Return the bitmask for the given cursor number. Return 0 if +// ** iCursor is not in the set. +// */ func _sqlite3WhereGetMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) (r0 uint64) { var _i int32 func() { - if (_pMaskSet.X0) > i32(64) { + if _pMaskSet.X0 > i32(64) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130555), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereGetMaskØ00__func__Ø000))), unsafe.Pointer(str(102799))) crt.X__builtin_abort(tls) } }() _i = i32(0) _2: - if _i >= (_pMaskSet.X0) { + if _i >= _pMaskSet.X0 { goto _5 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&(_pMaskSet.X1))))) + 4*uintptr(_i)))) == _iCursor { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[64]int32)(unsafe.Pointer(&_pMaskSet.X1)))) + 4*uintptr(_i)))) == _iCursor { return u64(1) << uint(_i) } _i += 1 @@ -81901,15 +85477,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereGetMaskØ00__func__Ø000[0], str(102835), 20) } -// Call exprAnalyze on all terms in a WHERE clause. -// -// Note that exprAnalyze() might add new virtual terms onto the -// end of the WHERE clause. We do not want to analyze these new -// virtual terms, so start analyzing at the end and work forward -// so that the added virtual terms are never processed. +// C comment +// /* +// ** Call exprAnalyze on all terms in a WHERE clause. +// ** +// ** Note that exprAnalyze() might add new virtual terms onto the +// ** end of the WHERE clause. We do not want to analyze these new +// ** virtual terms, so start analyzing at the end and work forward +// ** so that the added virtual terms are never processed. +// */ func _sqlite3WhereExprAnalyze(tls *crt.TLS, _pTabList *XSrcList, _pWC *XWhereClause) { var _i int32 - _i = (_pWC.X3) - i32(1) + _i = _pWC.X3 - i32(1) _0: if _i < i32(0) { goto _3 @@ -81920,22 +85499,25 @@ _0: _3: } -// The input to this routine is an WhereTerm structure with only the -// "pExpr" field filled in. The job of this routine is to analyze the -// subexpression and populate all the other fields of the WhereTerm -// structure. -// -// If the expression is of the form "<expr> <op> X" it gets commuted -// to the standard form of "X <op> <expr>". -// -// If the expression is of the form "X <op> Y" where both X and Y are -// columns, then the original expression is unchanged and a new virtual -// term of the form "Y <op> X" is added to the WHERE clause and -// analyzed separately. The original term is marked with TERM_COPIED -// and the new term is marked with TERM_DYNAMIC (because it's pExpr -// needs to be freed with the WhereClause) and TERM_VIRTUAL (because it -// is a commuted copy of a prior term.) The original term has nChild=1 -// and the copy has idxParent set to the index of the original term. +// C comment +// /* +// ** The input to this routine is an WhereTerm structure with only the +// ** "pExpr" field filled in. The job of this routine is to analyze the +// ** subexpression and populate all the other fields of the WhereTerm +// ** structure. +// ** +// ** If the expression is of the form "<expr> <op> X" it gets commuted +// ** to the standard form of "X <op> <expr>". +// ** +// ** If the expression is of the form "X <op> Y" where both X and Y are +// ** columns, then the original expression is unchanged and a new virtual +// ** term of the form "Y <op> X" is added to the WHERE clause and +// ** analyzed separately. The original term is marked with TERM_COPIED +// ** and the new term is marked with TERM_DYNAMIC (because it's pExpr +// ** needs to be freed with the WhereClause) and TERM_VIRTUAL (because it +// ** is a commuted copy of a prior term.) The original term has nChild=1 +// ** and the copy has idxParent set to the index of the original term. +// */ func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) { var _isComplete, _noCase, _op, _nLeft, _13_idxNew, _17_i, _18_idxNew, _20_idxNew1, _20_idxNew2, _21_i, _26_idxNew, _28_i, _29_idxNew, _30_i, _31_idxNew int32 var _21_c int8 @@ -81959,11 +85541,11 @@ func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm in _noCase = i32(0) _pParse = (*XParse)(_pWInfo.X0) _db = (*Xsqlite3)(_pParse.X0) - if (_db.X17) != 0 { + if _db.X17 != 0 { return } _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) - _pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))) + _pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)) _pExpr = (*XExpr)(_pTerm.X0) func() { if int32(_pExpr.X0) == i32(24) || int32(_pExpr.X0) == i32(94) { @@ -81985,22 +85567,22 @@ func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm in if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 { return } - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { - *(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { + *(*uint64)(unsafe.Pointer(&_pTerm.X11)) = _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) goto _9 } - *(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) + *(*uint64)(unsafe.Pointer(&_pTerm.X11)) = _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) _9: goto _12 _4: if _op == i32(75) { - *(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = uint64(i32(0)) + *(*uint64)(unsafe.Pointer(&_pTerm.X11)) = uint64(i32(0)) goto _12 } - *(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.X5)) + *(*uint64)(unsafe.Pointer(&_pTerm.X11)) = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.X5)) _12: _prereqAll = _sqlite3WhereExprUsage(tls, _pMaskSet, _pExpr) - if ((_pExpr.X2) & uint32(i32(1))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1))) == uint32(i32(0)) { goto _13 } _7_x = _sqlite3WhereGetMask(tls, _pMaskSet, int32(_pExpr.X11)) @@ -82015,22 +85597,22 @@ _12: return } _13: - *(*uint64)(unsafe.Pointer(&(_pTerm.X12))) = _prereqAll - *(*int32)(unsafe.Pointer(&(_pTerm.X8))) = i32(-1) - *(*int32)(unsafe.Pointer(&(_pTerm.X7))) = i32(-1) - *(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(0)) + *(*uint64)(unsafe.Pointer(&_pTerm.X12)) = _prereqAll + *(*int32)(unsafe.Pointer(&_pTerm.X8)) = i32(-1) + *(*int32)(unsafe.Pointer(&_pTerm.X7)) = i32(-1) + *(*uint16)(unsafe.Pointer(&_pTerm.X4)) = uint16(i32(0)) if _allowedOp(tls, _op) == 0 { goto _15 } _9_pLeft = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.X4)) _9_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.X5)) _9_opMask = uint16(func() int32 { - if ((_pTerm.X11) & _prereqLeft) == uint64(i32(0)) { + if (_pTerm.X11 & _prereqLeft) == uint64(i32(0)) { return i32(8191) } return i32(2048) }()) - if (_pTerm.X9) > i32(0) { + if _pTerm.X9 > i32(0) { func() { if _op != i32(74) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129903), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102955))) @@ -82043,16 +85625,16 @@ _13: crt.X__builtin_abort(tls) } }() - _9_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_9_pLeft.X6)))))).X2))))) + 32*uintptr((_pTerm.X9)-i32(1)))).X0) + _9_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_9_pLeft.X6))))).X2))))) + 32*uintptr(_pTerm.X9-i32(1)))).X0) } if _exprMightBeIndexed(tls, _pSrc, _prereqLeft, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pLeft, _op) != 0 { - *(*int32)(unsafe.Pointer(&(_pTerm.X8))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(0)))) - *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(1)))) - *(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(int32(_operatorMask(tls, _op)) & int32(_9_opMask)) + *(*int32)(unsafe.Pointer(&_pTerm.X8)) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_9_aiCurCol)) + 4*uintptr(i32(0)))) + *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_9_aiCurCol)) + 4*uintptr(i32(1)))) + *(*uint16)(unsafe.Pointer(&_pTerm.X4)) = uint16(int32(_operatorMask(tls, _op)) & int32(_9_opMask)) } if _op == i32(72) { { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(2048)) sink14(*p) } @@ -82062,16 +85644,16 @@ _13: } _12_eExtraOp = u16(0) func() { - if (_pTerm.X9) != i32(0) { + if _pTerm.X9 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129920), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102986))) crt.X__builtin_abort(tls) } }() - if (_pTerm.X8) < i32(0) { + if _pTerm.X8 < i32(0) { goto _29 } _12_pDup = _sqlite3ExprDup(tls, _db, _pExpr, i32(0)) - if (_db.X17) != 0 { + if _db.X17 != 0 { _sqlite3ExprDelete(tls, _db, _12_pDup) return } @@ -82083,20 +85665,20 @@ _13: _markTermAsChild(tls, _pWC, _13_idxNew, _idxTerm) if _op == i32(72) { { - p := (*uint16)(unsafe.Pointer(&(_12_pNew.X3))) + p := (*uint16)(unsafe.Pointer(&_12_pNew.X3)) *p = uint16(int32(*p) | i32(2048)) sink14(*p) } } _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } if _termIsEquivalence(tls, _pParse, _12_pDup) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X4))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X4)) *p = uint16(int32(*p) | i32(2048)) sink14(*p) } @@ -82108,18 +85690,18 @@ _29: _12_pNew = _pTerm _34: _exprCommute(tls, _pParse, _12_pDup) - *(*int32)(unsafe.Pointer(&(_12_pNew.X8))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(0)))) - *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_12_pNew.X10))))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(1)))) - *(*uint64)(unsafe.Pointer(&(_12_pNew.X11))) = _prereqLeft | _extraRight - *(*uint64)(unsafe.Pointer(&(_12_pNew.X12))) = _prereqAll - *(*uint16)(unsafe.Pointer(&(_12_pNew.X4))) = uint16((int32(_operatorMask(tls, int32(_12_pDup.X0))) + int32(_12_eExtraOp)) & int32(_9_opMask)) + *(*int32)(unsafe.Pointer(&_12_pNew.X8)) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_9_aiCurCol)) + 4*uintptr(i32(0)))) + *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_12_pNew.X10)))) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_9_aiCurCol)) + 4*uintptr(i32(1)))) + *(*uint64)(unsafe.Pointer(&_12_pNew.X11)) = _prereqLeft | _extraRight + *(*uint64)(unsafe.Pointer(&_12_pNew.X12)) = _prereqAll + *(*uint16)(unsafe.Pointer(&_12_pNew.X4)) = uint16((int32(_operatorMask(tls, int32(_12_pDup.X0))) + int32(_12_eExtraOp)) & int32(_9_opMask)) _26: goto _47 _15: if int32(_pExpr.X0) != i32(73) || int32(_pWC.X2) != i32(71) { goto _37 } - _17_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) + _17_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) func() { if _17_pList == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129974), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(90087))) @@ -82127,7 +85709,7 @@ _15: } }() func() { - if (_17_pList.X0) != i32(2) { + if _17_pList.X0 != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129975), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(103003))) crt.X__builtin_abort(tls) } @@ -82137,7 +85719,7 @@ _42: if _17_i >= i32(2) { goto _45 } - _18_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_exprAnalyzeØ00opsØ001)) + 1*uintptr(_17_i)))), _sqlite3ExprDup(tls, _db, (*XExpr)(_pExpr.X4), i32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_17_pList.X2)))))+32*uintptr(_17_i))).X0), i32(0))) + _18_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_exprAnalyzeØ00opsØ001)) + 1*uintptr(_17_i)))), _sqlite3ExprDup(tls, _db, (*XExpr)(_pExpr.X4), i32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_17_pList.X2))))+32*uintptr(_17_i))).X0), i32(0))) _transferJoinMarkings(tls, _18_pNewExpr, _pExpr) _18_idxNew = _whereClauseInsert(tls, _pWC, _18_pNewExpr, uint16(i32(3))) _exprAnalyze(tls, _pSrc, _pWC, _18_idxNew) @@ -82163,31 +85745,31 @@ _47: goto _51 } _20_wtFlags = u16(259) - _20_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(1)))).X0) + _20_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(1)))).X0) _20_pStr2 = _sqlite3ExprDup(tls, _db, _pStr1, i32(0)) if _noCase == 0 || ((*Xsqlite3)(_pParse.X0).X17) != 0 { goto _53 } { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(1024)) sink14(*p) } _21_i = i32(0) _54: - if int32(store3(&_21_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pStr1.X3))))))) + 1*uintptr(_21_i))))) == i32(0) { + if int32(store3(&_21_c, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pStr1.X3)))))) + 1*uintptr(_21_i))))) == i32(0) { goto _57 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pStr1.X3))))))) + 1*uintptr(_21_i))) = int8(int32(_21_c) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_21_c))))) & i32(32)))) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))) + 1*uintptr(_21_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_21_c))))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pStr1.X3)))))) + 1*uintptr(_21_i))) = int8(int32(_21_c) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_21_c))))) & i32(32)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_20_pStr2.X3)))))) + 1*uintptr(_21_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_21_c))))) _21_i += 1 goto _54 _57: _53: - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _58 } - _23_pC = (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))) + 1*uintptr(_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))-i32(1)))))) + _23_pC = (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_20_pStr2.X3)))))) + 1*uintptr(_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_20_pStr2.X3)))))-i32(1)))))) _23_c = *_23_pC if _noCase == 0 { goto _59 @@ -82195,7 +85777,7 @@ _53: if int32(_23_c) == i32(64) { _isComplete = i32(0) } - _23_c = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(_23_c))) + _23_c = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(_23_c))) _59: *_23_pC = uint8(int32(_23_c) + i32(1)) _58: @@ -82224,27 +85806,27 @@ _51: if int32(_pWC.X2) != i32(71) || _isMatchOfColumn(tls, _pExpr, &_eOp2) == 0 { goto _65 } - _26_pRight = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(0)))).X0) - _26_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(1)))).X0) + _26_pRight = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(0)))).X0) + _26_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(1)))).X0) _26_prereqExpr = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pRight) _26_prereqColumn = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pLeft) if (_26_prereqExpr & _26_prereqColumn) == uint64(i32(0)) { _27_pNewExpr = _sqlite3PExpr(tls, _pParse, i32(50), nil, _sqlite3ExprDup(tls, _db, _26_pRight, i32(0))) _26_idxNew = _whereClauseInsert(tls, _pWC, _27_pNewExpr, uint16(i32(3))) _26_pNewTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_26_idxNew))) - *(*uint64)(unsafe.Pointer(&(_26_pNewTerm.X11))) = _26_prereqExpr - *(*int32)(unsafe.Pointer(&(_26_pNewTerm.X8))) = _26_pLeft.X8 - *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_26_pNewTerm.X10))))) = int32(_26_pLeft.X9) - *(*uint16)(unsafe.Pointer(&(_26_pNewTerm.X4))) = uint16(i32(64)) - *(*uint8)(unsafe.Pointer(&(_26_pNewTerm.X6))) = _eOp2 + *(*uint64)(unsafe.Pointer(&_26_pNewTerm.X11)) = _26_prereqExpr + *(*int32)(unsafe.Pointer(&_26_pNewTerm.X8)) = _26_pLeft.X8 + *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_26_pNewTerm.X10)))) = int32(_26_pLeft.X9) + *(*uint16)(unsafe.Pointer(&_26_pNewTerm.X4)) = uint16(i32(64)) + *(*uint8)(unsafe.Pointer(&_26_pNewTerm.X6)) = _eOp2 _markTermAsChild(tls, _pWC, _26_idxNew, _idxTerm) _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(8)) sink14(*p) } - *(*uint64)(unsafe.Pointer(&(_26_pNewTerm.X12))) = _pTerm.X12 + *(*uint64)(unsafe.Pointer(&_26_pNewTerm.X12)) = _pTerm.X12 } _65: if int32(_pWC.X2) != i32(71) || int32(_pExpr.X0) != i32(78) && int32(_pExpr.X0) != i32(72) || store1(&_nLeft, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4))) <= i32(1) || _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X5)) != _nLeft || (((*XExpr)(_pExpr.X4).X2)&uint32(i32(2048))) != uint32(i32(0)) && (((*XExpr)(_pExpr.X5).X2)&uint32(i32(2048))) != uint32(i32(0)) { @@ -82265,10 +85847,10 @@ _74: goto _74 _77: _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) - *(*uint16)(unsafe.Pointer(&(_pTerm.X3))) = uint16(i32(6)) - *(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_pTerm.X3)) = uint16(i32(6)) + *(*uint16)(unsafe.Pointer(&_pTerm.X4)) = uint16(i32(0)) _73: - if int32(_pWC.X2) != i32(71) || int32(_pExpr.X0) != i32(74) || (_pTerm.X9) != i32(0) || int32((*XExpr)(_pExpr.X4).X0) != i32(158) || (*XSelect)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X13) != nil { + if int32(_pWC.X2) != i32(71) || int32(_pExpr.X0) != i32(74) || _pTerm.X9 != i32(0) || int32((*XExpr)(_pExpr.X4).X0) != i32(158) || (*XSelect)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X13) != nil { goto _82 } _30_i = i32(0) @@ -82286,7 +85868,7 @@ _86: _82: _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) { - p := (*uint64)(unsafe.Pointer(&(_pTerm.X11))) + p := (*uint64)(unsafe.Pointer(&_pTerm.X11)) *p = (*p) | _extraRight sink17(*p) } @@ -82299,9 +85881,12 @@ func init() { crt.Xstrncpy(nil, &_exprAnalyzeØ00__func__Ø000[0], str(103042), 12) } -// These routines walk (recursively) an expression tree and generate -// a bitmask indicating which tables are used in that expression -// tree. +// C comment +// /* +// ** These routines walk (recursively) an expression tree and generate +// ** a bitmask indicating which tables are used in that expression +// ** tree. +// */ func _sqlite3WhereExprUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _p *XExpr) (r0 uint64) { var _mask uint64 if _p == nil { @@ -82317,37 +85902,37 @@ func _sqlite3WhereExprUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _p *XExpr) ( return uint64(i32(0)) }() func() { - if ((_p.X2) & uint32(i32(16384))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(16384))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExprUsageØ00__func__Ø000))), unsafe.Pointer(str(103054))) crt.X__builtin_abort(tls) } }() - if (*XExpr)(_p.X5) != nil { + if _p.X5 != nil { { p := &_mask *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.X5)) sink17(*p) } } - if (*XExpr)(_p.X4) != nil { + if _p.X4 != nil { { p := &_mask *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.X4)) sink17(*p) } } - if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_p.X2 & uint32(i32(2048))) != uint32(i32(0)) { { p := &_mask - *p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))) + *p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6)))))) sink17(*p) } goto _10 } - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil { + if (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) != nil { { p := &_mask - *p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))) + *p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6)))))) sink17(*p) } } @@ -82361,9 +85946,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereExprUsageØ00__func__Ø000[0], str(103088), 22) } -// Recursively walk the expressions of a SELECT statement and generate -// a bitmask indicating which tables are used in that expression -// tree. +// C comment +// /* +// ** Recursively walk the expressions of a SELECT statement and generate +// ** a bitmask indicating which tables are used in that expression +// ** tree. +// */ func _exprSelectUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pS *XSelect) (r0 uint64) { var _2_i int32 var _mask uint64 @@ -82413,17 +86001,17 @@ _0: } _2_i = i32(0) _5: - if _2_i >= (_1_pSrc.X0) { + if _2_i >= _1_pSrc.X0 { goto _8 } { p := &_mask - *p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2)))))+112*uintptr(_2_i))).X5)) + *p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_1_pSrc.X2))))+112*uintptr(_2_i))).X5)) sink17(*p) } { p := &_mask - *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2)))))+112*uintptr(_2_i))).X12)) + *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_1_pSrc.X2))))+112*uintptr(_2_i))).X12)) sink17(*p) } _2_i += 1 @@ -82445,12 +86033,12 @@ func _sqlite3WhereExprListUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pList * } _i = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } { p := &_mask - *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) + *p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) sink17(*p) } _i += 1 @@ -82466,9 +86054,12 @@ func init() { crt.Xstrncpy(nil, &_exprSelectUsageØ00__func__Ø000[0], str(103110), 16) } -// Return TRUE if the given operator is one of the operators that is -// allowed for an indexable WHERE clause term. The allowed operators are -// "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" +// C comment +// /* +// ** Return TRUE if the given operator is one of the operators that is +// ** allowed for an indexable WHERE clause term. The allowed operators are +// ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" +// */ func _allowedOp(tls *crt.TLS, _op int32) (r0 int32) { i32(0) i32(0) @@ -82496,11 +86087,11 @@ func _exprMightBeIndexed(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCur return i32(0) }() }() != 0) { - _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 32*uintptr(i32(0)))).X0) + _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X2))))) + 32*uintptr(i32(0)))).X0) } if int32(_pExpr.X0) == i32(152) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(0)))) = _pExpr.X8 - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(1)))) = int32(_pExpr.X9) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCurCol)) + 4*uintptr(i32(0)))) = _pExpr.X8 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCurCol)) + 4*uintptr(i32(1)))) = int32(_pExpr.X9) return i32(1) } if _mPrereq == uint64(i32(0)) { @@ -82518,17 +86109,20 @@ func init() { crt.Xstrncpy(nil, &_exprMightBeIndexedØ00__func__Ø000[0], str(103136), 19) } -// Expression pExpr is one operand of a comparison operator that might -// be useful for indexing. This routine checks to see if pExpr appears -// in any index. Return TRUE (1) if pExpr is an indexed term and return -// FALSE (0) if not. If TRUE is returned, also set aiCurCol[0] to the cursor -// number of the table that is indexed and aiCurCol[1] to the column number -// of the column that is indexed, or XN_EXPR (-2) if an expression is being -// indexed. -// -// If pExpr is a TK_COLUMN column reference, then this routine always returns -// true even if that particular column is not indexed, because the column -// might be added to an automatic index later. +// C comment +// /* +// ** Expression pExpr is one operand of a comparison operator that might +// ** be useful for indexing. This routine checks to see if pExpr appears +// ** in any index. Return TRUE (1) if pExpr is an indexed term and return +// ** FALSE (0) if not. If TRUE is returned, also set aiCurCol[0] to the cursor +// ** number of the table that is indexed and aiCurCol[1] to the column number +// ** of the column that is indexed, or XN_EXPR (-2) if an expression is being +// ** indexed. +// ** +// ** If pExpr is a TK_COLUMN column reference, then this routine always returns +// ** true even if that particular column is not indexed, because the column +// ** might be added to an automatic index later. +// */ func _exprMightBeIndexed2(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr) (r0 int32) { var _i, _iCur int32 var _pIdx *XIndex @@ -82544,8 +86138,8 @@ _0: } goto _0 _3: - _iCur = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 112*uintptr(_i))).X11 - _pIdx = (*XIndex)((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 112*uintptr(_i))).X4).X2) + _iCur = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2)))) + 112*uintptr(_i))).X11 + _pIdx = (*XIndex)((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2)))) + 112*uintptr(_i))).X4).X2) _4: if _pIdx == nil { goto _7 @@ -82558,12 +86152,12 @@ _9: if _i >= int32(_pIdx.X13) { goto _12 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) != i32(-2) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) != i32(-2) { goto _10 } - if _sqlite3ExprCompareSkip(tls, _pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_i))).X0), _iCur) == i32(0) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(0)))) = _iCur - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(1)))) = i32(-2) + if _sqlite3ExprCompareSkip(tls, _pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_i))).X0), _iCur) == i32(0) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCurCol)) + 4*uintptr(i32(0)))) = _iCur + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCurCol)) + 4*uintptr(i32(1)))) = i32(-2) return i32(1) } _10: @@ -82577,13 +86171,19 @@ _7: return i32(0) } -// Like sqlite3ExprCompare() except COLLATE operators at the top-level -// are ignored. +// C comment +// /* +// ** Like sqlite3ExprCompare() except COLLATE operators at the top-level +// ** are ignored. +// */ func _sqlite3ExprCompareSkip(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) { return _sqlite3ExprCompare(tls, _sqlite3ExprSkipCollate(tls, _pA), _sqlite3ExprSkipCollate(tls, _pB), _iTab) } -// Translate from TK_xx operator to WO_xx bitmask. +// C comment +// /* +// ** Translate from TK_xx operator to WO_xx bitmask. +// */ func _operatorMask(tls *crt.TLS, _op int32) (r0 uint16) { var _c uint16 func() { @@ -82669,26 +86269,32 @@ func init() { crt.Xstrncpy(nil, &_operatorMaskØ00__func__Ø000[0], str(103382), 13) } -// Mark term iChild as being a child of term iParent +// C comment +// /* +// ** Mark term iChild as being a child of term iParent +// */ func _markTermAsChild(tls *crt.TLS, _pWC *XWhereClause, _iChild int32, _iParent int32) { *(*int32)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_iChild))).X7))) = _iParent *(*int16)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_iChild))).X2))) = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_iParent))).X2 *(*uint8)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_iParent))).X5))) += 1 } -// We already know that pExpr is a binary operator where both operands are -// column references. This routine checks to see if pExpr is an equivalence -// relation: -// 1. The SQLITE_Transitive optimization must be enabled -// 2. Must be either an == or an IS operator -// 3. Not originating in the ON clause of an OUTER JOIN -// 4. The affinities of A and B must be compatible -// 5a. Both operands use the same collating sequence OR -// 5b. The overall collating sequence is BINARY -// If this routine returns TRUE, that means that the RHS can be substituted -// for the LHS anyplace else in the WHERE clause where the LHS column occurs. -// This is an optimization. No harm comes from returning 0. But if 1 is -// returned when it should not be, then incorrect answers might result. +// C comment +// /* +// ** We already know that pExpr is a binary operator where both operands are +// ** column references. This routine checks to see if pExpr is an equivalence +// ** relation: +// ** 1. The SQLITE_Transitive optimization must be enabled +// ** 2. Must be either an == or an IS operator +// ** 3. Not originating in the ON clause of an OUTER JOIN +// ** 4. The affinities of A and B must be compatible +// ** 5a. Both operands use the same collating sequence OR +// ** 5b. The overall collating sequence is BINARY +// ** If this routine returns TRUE, that means that the RHS can be substituted +// ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. +// ** This is an optimization. No harm comes from returning 0. But if 1 is +// ** returned when it should not be, then incorrect answers might result. +// */ func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) { var _aff1, _aff2 int8 var _zColl1, _zColl2 *int8 @@ -82699,7 +86305,7 @@ func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) if (int32(_pExpr.X0) != i32(78)) && (int32(_pExpr.X0) != i32(72)) { return i32(0) } - if ((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1))) != uint32(i32(0)) { return i32(0) } _aff1 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.X4)) @@ -82714,30 +86320,33 @@ func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) _pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4)) _zColl1 = func() *int8 { if _pColl != nil { - return (_pColl.X0) + return _pColl.X0 } return nil }() _pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X5)) _zColl2 = func() *int8 { if _pColl != nil { - return (_pColl.X0) + return _pColl.X0 } return nil }() return bool2int(Xsqlite3_stricmp(tls, _zColl1, _zColl2) == i32(0)) } -// Commute a comparison operator. Expressions of the form "X op Y" -// are converted into "Y op X". -// -// If left/right precedence rules come into play when determining the -// collating sequence, then COLLATE operators are adjusted to ensure -// that the collating sequence does not change. For example: -// "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on -// the left hand side of a comparison overrides any collation sequence -// attached to the right. For the same reason the EP_Collate flag -// is not commuted. +// C comment +// /* +// ** Commute a comparison operator. Expressions of the form "X op Y" +// ** are converted into "Y op X". +// ** +// ** If left/right precedence rules come into play when determining the +// ** collating sequence, then COLLATE operators are adjusted to ensure +// ** that the collating sequence does not change. For example: +// ** "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on +// ** the left hand side of a comparison overrides any collation sequence +// ** attached to the right. For the same reason the EP_Collate flag +// ** is not commuted. +// */ func _exprCommute(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) { var _expRight, _expLeft uint16 var _4_t *XExpr @@ -82770,8 +86379,8 @@ func _exprCommute(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) { _6: _3: _4_t = (*XExpr)(_pExpr.X5) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = (*XExpr)(_pExpr.X4) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = _4_t + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X5)))) = (*XExpr)(_pExpr.X4) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X4)))) = _4_t if int32(_pExpr.X0) >= i32(79) { i32(0) i32(0) @@ -82783,7 +86392,7 @@ _3: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(((int32(_pExpr.X0) - i32(79)) ^ i32(2)) + i32(79)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(((int32(_pExpr.X0) - i32(79)) ^ i32(2)) + i32(79)) } } @@ -82799,104 +86408,110 @@ func init() { _exprAnalyzeØ00opsØ001 = [2]uint8{82, 80} } -// If the pBase expression originated in the ON or USING clause of -// a join, then transfer the appropriate markings over to derived. +// C comment +// /* +// ** If the pBase expression originated in the ON or USING clause of +// ** a join, then transfer the appropriate markings over to derived. +// */ func _transferJoinMarkings(tls *crt.TLS, _pDerived *XExpr, _pBase *XExpr) { if _pDerived != nil { { - p := (*uint32)(unsafe.Pointer(&(_pDerived.X2))) - *p = (*p) | ((_pBase.X2) & uint32(i32(1))) + p := (*uint32)(unsafe.Pointer(&_pDerived.X2)) + *p = (*p) | (_pBase.X2 & uint32(i32(1))) sink5(*p) } - *(*int16)(unsafe.Pointer(&(_pDerived.X11))) = _pBase.X11 - } -} - -// Analyze a term that consists of two or more OR-connected -// subterms. So in: -// -// ... WHERE (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13) -// ^^^^^^^^^^^^^^^^^^^^ -// -// This routine analyzes terms such as the middle term in the above example. -// A WhereOrTerm object is computed and attached to the term under -// analysis, regardless of the outcome of the analysis. Hence: -// -// WhereTerm.wtFlags |= TERM_ORINFO -// WhereTerm.u.pOrInfo = a dynamically allocated WhereOrTerm object -// -// The term being analyzed must have two or more of OR-connected subterms. -// A single subterm might be a set of AND-connected sub-subterms. -// Examples of terms under analysis: -// -// (A) t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5 -// (B) x=expr1 OR expr2=x OR x=expr3 -// (C) t1.x=t2.y OR (t1.x=t2.z AND t1.y=15) -// (D) x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*') -// (E) (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6) -// (F) x>A OR (x=A AND y>=B) -// -// CASE 1: -// -// If all subterms are of the form T.C=expr for some single column of C and -// a single table T (as shown in example B above) then create a new virtual -// term that is an equivalent IN expression. In other words, if the term -// being analyzed is: -// -// x = expr1 OR expr2 = x OR x = expr3 -// -// then create a new virtual term like this: -// -// x IN (expr1,expr2,expr3) -// -// CASE 2: -// -// If there are exactly two disjuncts and one side has x>A and the other side -// has x=A (for the same x and A) then add a new virtual conjunct term to the -// WHERE clause of the form "x>=A". Example: -// -// x>A OR (x=A AND y>B) adds: x>=A -// -// The added conjunct can sometimes be helpful in query planning. -// -// CASE 3: -// -// If all subterms are indexable by a single table T, then set -// -// WhereTerm.eOperator = WO_OR -// WhereTerm.u.pOrInfo->indexable |= the cursor number for table T -// -// A subterm is "indexable" if it is of the form -// "T.C <op> <expr>" where C is any column of table T and -// <op> is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN". -// A subterm is also indexable if it is an AND of two or more -// subsubterms at least one of which is indexable. Indexable AND -// subterms have their eOperator set to WO_AND and they have -// u.pAndInfo set to a dynamically allocated WhereAndTerm object. -// -// From another point of view, "indexable" means that the subterm could -// potentially be used with an index if an appropriate index exists. -// This analysis does not consider whether or not the index exists; that -// is decided elsewhere. This analysis only looks at whether subterms -// appropriate for indexing exist. -// -// All examples A through E above satisfy case 3. But if a term -// also satisfies case 1 (such as B) we know that the optimizer will -// always prefer case 1, so in that case we pretend that case 3 is not -// satisfied. -// -// It might be the case that multiple tables are indexable. For example, -// (E) above is indexable on tables P, Q, and R. -// -// Terms that satisfy case 3 are candidates for lookup by using -// separate indices to find rowids for each subterm and composing -// the union of all rowids using a RowSet object. This is similar -// to "bitmap indices" in other database engines. -// -// OTHERWISE: -// -// If none of cases 1, 2, or 3 apply, then leave the eOperator set to -// zero. This term is not useful for search. + *(*int16)(unsafe.Pointer(&_pDerived.X11)) = _pBase.X11 + } +} + +// C comment +// /* +// ** Analyze a term that consists of two or more OR-connected +// ** subterms. So in: +// ** +// ** ... WHERE (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13) +// ** ^^^^^^^^^^^^^^^^^^^^ +// ** +// ** This routine analyzes terms such as the middle term in the above example. +// ** A WhereOrTerm object is computed and attached to the term under +// ** analysis, regardless of the outcome of the analysis. Hence: +// ** +// ** WhereTerm.wtFlags |= TERM_ORINFO +// ** WhereTerm.u.pOrInfo = a dynamically allocated WhereOrTerm object +// ** +// ** The term being analyzed must have two or more of OR-connected subterms. +// ** A single subterm might be a set of AND-connected sub-subterms. +// ** Examples of terms under analysis: +// ** +// ** (A) t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5 +// ** (B) x=expr1 OR expr2=x OR x=expr3 +// ** (C) t1.x=t2.y OR (t1.x=t2.z AND t1.y=15) +// ** (D) x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*') +// ** (E) (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6) +// ** (F) x>A OR (x=A AND y>=B) +// ** +// ** CASE 1: +// ** +// ** If all subterms are of the form T.C=expr for some single column of C and +// ** a single table T (as shown in example B above) then create a new virtual +// ** term that is an equivalent IN expression. In other words, if the term +// ** being analyzed is: +// ** +// ** x = expr1 OR expr2 = x OR x = expr3 +// ** +// ** then create a new virtual term like this: +// ** +// ** x IN (expr1,expr2,expr3) +// ** +// ** CASE 2: +// ** +// ** If there are exactly two disjuncts and one side has x>A and the other side +// ** has x=A (for the same x and A) then add a new virtual conjunct term to the +// ** WHERE clause of the form "x>=A". Example: +// ** +// ** x>A OR (x=A AND y>B) adds: x>=A +// ** +// ** The added conjunct can sometimes be helpful in query planning. +// ** +// ** CASE 3: +// ** +// ** If all subterms are indexable by a single table T, then set +// ** +// ** WhereTerm.eOperator = WO_OR +// ** WhereTerm.u.pOrInfo->indexable |= the cursor number for table T +// ** +// ** A subterm is "indexable" if it is of the form +// ** "T.C <op> <expr>" where C is any column of table T and +// ** <op> is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN". +// ** A subterm is also indexable if it is an AND of two or more +// ** subsubterms at least one of which is indexable. Indexable AND +// ** subterms have their eOperator set to WO_AND and they have +// ** u.pAndInfo set to a dynamically allocated WhereAndTerm object. +// ** +// ** From another point of view, "indexable" means that the subterm could +// ** potentially be used with an index if an appropriate index exists. +// ** This analysis does not consider whether or not the index exists; that +// ** is decided elsewhere. This analysis only looks at whether subterms +// ** appropriate for indexing exist. +// ** +// ** All examples A through E above satisfy case 3. But if a term +// ** also satisfies case 1 (such as B) we know that the optimizer will +// ** always prefer case 1, so in that case we pretend that case 3 is not +// ** satisfied. +// ** +// ** It might be the case that multiple tables are indexable. For example, +// ** (E) above is indexable on tables P, Q, and R. +// ** +// ** Terms that satisfy case 3 are candidates for lookup by using +// ** separate indices to find rowids for each subterm and composing +// ** the union of all rowids using a RowSet object. This is similar +// ** to "bitmap indices" in other database engines. +// ** +// ** OTHERWISE: +// ** +// ** If none of cases 1, 2, or 3 apply, then leave the eOperator set to +// ** zero. This term is not useful for search. +// */ func _exprAnalyzeOrTerm(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) { var _i, _3_j, _12_iOne, _13_iTwo, _15_okToChngToIN, _15_iColumn, _15_iCursor, _15_j, _24_affLeft, _24_affRight, _29_idxNew int32 var _chngToIN, _indexable, _3_b, _8_b uint64 @@ -82926,32 +86541,32 @@ func _exprAnalyzeOrTerm(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxT crt.X__builtin_abort(tls) } }() - *(**XWhereOrInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))))) = store64(&_pOrInfo, (*XWhereOrInfo)(_sqlite3DbMallocZero(tls, _db, u64(560)))) + *(**XWhereOrInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))))) = store64(&_pOrInfo, (*XWhereOrInfo)(_sqlite3DbMallocZero(tls, _db, u64(560)))) if _pOrInfo == nil { return } { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } - _pOrWc = (*XWhereClause)(unsafe.Pointer(&(_pOrInfo.X0))) - crt.Xmemset(tls, (unsafe.Pointer)((*[8]XWhereTerm)(unsafe.Pointer(&(_pOrWc.X6)))), i32(0), u64(512)) + _pOrWc = (*XWhereClause)(unsafe.Pointer(&_pOrInfo.X0)) + crt.Xmemset(tls, unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&_pOrWc.X6))), i32(0), u64(512)) _sqlite3WhereClauseInit(tls, _pOrWc, _pWInfo) _sqlite3WhereSplit(tls, _pOrWc, _pExpr, uint8(i32(70))) _sqlite3WhereExprAnalyze(tls, _pSrc, _pOrWc) - if (_db.X17) != 0 { + if _db.X17 != 0 { return } func() { - if (_pOrWc.X3) < i32(2) { + if _pOrWc.X3 < i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129477), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103564))) crt.X__builtin_abort(tls) } }() _indexable = u64(18446744073709551615) _chngToIN = u64(18446744073709551615) - *func() **XWhereTerm { _i = (_pOrWc.X3) - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5) + *func() **XWhereTerm { _i = _pOrWc.X3 - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5) _8: if _i < i32(0) || _indexable == 0 { goto _12 @@ -82971,29 +86586,29 @@ _8: goto _16 } _3_b = uint64(i32(0)) - *(**XWhereAndInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10))))))) = _2_pAndInfo + *(**XWhereAndInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pOrTerm.X10)))))) = _2_pAndInfo { - p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pOrTerm.X3)) *p = uint16(int32(*p) | i32(32)) sink14(*p) } - *(*uint16)(unsafe.Pointer(&(_pOrTerm.X4))) = uint16(i32(1024)) - _3_pAndWC = (*XWhereClause)(unsafe.Pointer(&(_2_pAndInfo.X0))) - crt.Xmemset(tls, (unsafe.Pointer)((*[8]XWhereTerm)(unsafe.Pointer(&(_3_pAndWC.X6)))), i32(0), u64(512)) + *(*uint16)(unsafe.Pointer(&_pOrTerm.X4)) = uint16(i32(1024)) + _3_pAndWC = (*XWhereClause)(unsafe.Pointer(&_2_pAndInfo.X0)) + crt.Xmemset(tls, unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&_3_pAndWC.X6))), i32(0), u64(512)) _sqlite3WhereClauseInit(tls, _3_pAndWC, (*XWhereInfo)(_pWC.X0)) _sqlite3WhereSplit(tls, _3_pAndWC, (*XExpr)(_pOrTerm.X0), uint8(i32(71))) _sqlite3WhereExprAnalyze(tls, _pSrc, _3_pAndWC) - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pAndWC.X1))))) = _pWC - if (_db.X17) != 0 { + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pAndWC.X1)))) = _pWC + if _db.X17 != 0 { goto _17 } *func() **XWhereTerm { _3_j = i32(0); return &_3_pAndTerm }() = (*XWhereTerm)(_3_pAndWC.X5) _18: - if _3_j >= (_3_pAndWC.X3) { + if _3_j >= _3_pAndWC.X3 { goto _21 } func() { - if (*XExpr)(_3_pAndTerm.X0) == nil { + if _3_pAndTerm.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129506), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103631))) crt.X__builtin_abort(tls) } @@ -83001,7 +86616,7 @@ _18: if _allowedOp(tls, int32((*XExpr)(_3_pAndTerm.X0).X0)) != 0 || (int32(_3_pAndTerm.X4) == i32(64)) { { p := &_3_b - *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _3_pAndTerm.X8) + *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _3_pAndTerm.X8) sink17(*p) } } @@ -83020,12 +86635,12 @@ _13: if (int32(_pOrTerm.X3) & i32(8)) != 0 { goto _28 } - _8_b = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pOrTerm.X8) + _8_b = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _pOrTerm.X8) if (int32(_pOrTerm.X3) & i32(2)) != 0 { _9_pOther = (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5) + 64*uintptr(_pOrTerm.X7))) { p := &_8_b - *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _9_pOther.X8) + *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _9_pOther.X8) sink17(*p) } } @@ -83048,24 +86663,24 @@ _28: *(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(64) goto _8 _12: - *(*uint64)(unsafe.Pointer(&(_pOrInfo.X1))) = _indexable - *(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(func() int32 { + *(*uint64)(unsafe.Pointer(&_pOrInfo.X1)) = _indexable + *(*uint16)(unsafe.Pointer(&_pTerm.X4)) = uint16(func() int32 { if _indexable == uint64(i32(0)) { return i32(0) } return i32(512) }()) - if _indexable == 0 || (_pOrWc.X3) != i32(2) { + if _indexable == 0 || _pOrWc.X3 != i32(2) { goto _35 } _12_iOne = i32(0) _36: - if store65(&_12_pOne, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+64*uintptr(i32(0)))), postInc1(&_12_iOne, int32(1)))) == nil { + if store65(&_12_pOne, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+64*uintptr(i32(0)))), postInc1(&_12_iOne, 1))) == nil { goto _37 } _13_iTwo = i32(0) _38: - if store65(&_13_pTwo, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+64*uintptr(i32(1)))), postInc1(&_13_iTwo, int32(1)))) != nil { + if store65(&_13_pTwo, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+64*uintptr(i32(1)))), postInc1(&_13_iTwo, 1))) != nil { _whereCombineDisjuncts(tls, _pSrc, _pWC, _12_pOne, _13_pTwo) goto _38 } @@ -83085,7 +86700,7 @@ _41: goto _45 } _pOrTerm = (*XWhereTerm)(_pOrWc.X5) - _i = (_pOrWc.X3) - i32(1) + _i = _pOrWc.X3 - i32(1) _46: if _i < i32(0) { goto _49 @@ -83097,11 +86712,11 @@ _46: } }() { - p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pOrTerm.X3)) *p = uint16(int32(*p) & i32(-65)) sink14(*p) } - if (_pOrTerm.X8) == _15_iCursor { + if _pOrTerm.X8 == _15_iCursor { func() { if _15_j != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129597), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103674))) @@ -83110,7 +86725,7 @@ _46: }() goto _47 } - if (_chngToIN & _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pOrTerm.X8)) == uint64(i32(0)) { + if (_chngToIN & _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _pOrTerm.X8)) == uint64(i32(0)) { func() { if (int32(_pOrTerm.X3) & i32(10)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129608), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103679))) @@ -83119,7 +86734,7 @@ _46: }() goto _47 } - _15_iColumn = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10))))) + _15_iColumn = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pOrTerm.X10)))) _15_iCursor = _pOrTerm.X8 goto _49 _47: @@ -83140,7 +86755,7 @@ _49: } }() func() { - if _chngToIN != _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _15_iCursor) { + if _chngToIN != _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _15_iCursor) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129620), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103748))) crt.X__builtin_abort(tls) } @@ -83158,15 +86773,15 @@ _65: crt.X__builtin_abort(tls) } }() - if (_pOrTerm.X8) != _15_iCursor { + if _pOrTerm.X8 != _15_iCursor { { - p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pOrTerm.X3)) *p = uint16(int32(*p) & i32(-65)) sink14(*p) } goto _75 } - if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10)))))) != _15_iColumn { + if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pOrTerm.X10))))) != _15_iColumn { _15_okToChngToIN = i32(0) goto _75 } @@ -83177,7 +86792,7 @@ _65: goto _78 } { - p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pOrTerm.X3)) *p = uint16(int32(*p) | i32(64)) sink14(*p) } @@ -83194,7 +86809,7 @@ _45: } _27_pList = nil _27_pLeft = nil - *func() **XWhereTerm { _i = (_pOrWc.X3) - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5) + *func() **XWhereTerm { _i = _pOrWc.X3 - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5) _80: if _i < i32(0) { goto _83 @@ -83209,13 +86824,13 @@ _80: } }() func() { - if (_pOrTerm.X8) != _15_iCursor { + if _pOrTerm.X8 != _15_iCursor { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129664), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103806))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10)))))) != _15_iColumn { + if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pOrTerm.X10))))) != _15_iColumn { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129665), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103835))) crt.X__builtin_abort(tls) } @@ -83238,12 +86853,12 @@ _83: if _27_pNew != nil { _transferJoinMarkings(tls, _27_pNew, _pExpr) func() { - if ((_27_pNew.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_27_pNew.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129676), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103875))) crt.X__builtin_abort(tls) } }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_27_pNew.X6))))))) = _27_pList + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_27_pNew.X6)))))) = _27_pList _29_idxNew = _whereClauseInsert(tls, _pWC, _27_pNew, uint16(i32(3))) _exprAnalyze(tls, _pSrc, _pWC, _29_idxNew) _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_idxTerm))) @@ -83252,7 +86867,7 @@ _83: } _sqlite3ExprListDelete(tls, _db, _27_pList) _96: - *(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(4096)) + *(*uint16)(unsafe.Pointer(&_pTerm.X4)) = uint16(i32(4096)) _79: _40: _ = _12_iOne @@ -83265,9 +86880,12 @@ func init() { crt.Xstrncpy(nil, &_exprAnalyzeOrTermØ00__func__Ø000[0], str(103912), 18) } -// Return the N-th AND-connected subterm of pTerm. Or if pTerm is not -// a conjunction, then return just pTerm when N==0. If N is exceeds -// the number of available subterms, return NULL. +// C comment +// /* +// ** Return the N-th AND-connected subterm of pTerm. Or if pTerm is not +// ** a conjunction, then return just pTerm when N==0. If N is exceeds +// ** the number of available subterms, return NULL. +// */ func _whereNthSubterm(tls *crt.TLS, _pTerm *XWhereTerm, _N int32) (r0 *XWhereTerm) { if int32(_pTerm.X4) != i32(1024) { return func() *XWhereTerm { @@ -83277,30 +86895,33 @@ func _whereNthSubterm(tls *crt.TLS, _pTerm *XWhereTerm, _N int32) (r0 *XWhereTer return nil }() } - if _N < ((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))).X3) { - return (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))).X5) + 64*uintptr(_N))) + if _N < ((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))).X0))).X3) { + return (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))).X0))).X5) + 64*uintptr(_N))) } return nil } -// Subterms pOne and pTwo are contained within WHERE clause pWC. The -// two subterms are in disjunction - they are OR-ed together. -// -// If these two terms are both of the form: "A op B" with the same -// A and B values but different operators and if the operators are -// compatible (if one is = and the other is <, for example) then -// add a new virtual AND term to pWC that is the combination of the -// two. -// -// Some examples: -// -// x<y OR x=y --> x<=y -// x=y OR x=y --> x=y -// x<=y OR x<y --> x<=y -// -// The following is NOT generated: -// -// x<y OR x>y --> x!=y +// C comment +// /* +// ** Subterms pOne and pTwo are contained within WHERE clause pWC. The +// ** two subterms are in disjunction - they are OR-ed together. +// ** +// ** If these two terms are both of the form: "A op B" with the same +// ** A and B values but different operators and if the operators are +// ** compatible (if one is = and the other is <, for example) then +// ** add a new virtual AND term to pWC that is the combination of the +// ** two. +// ** +// ** Some examples: +// ** +// ** x<y OR x=y --> x<=y +// ** x=y OR x=y --> x=y +// ** x<=y OR x<y --> x<=y +// ** +// ** The following is NOT generated: +// ** +// ** x<y OR x>y --> x!=y +// */ func _whereCombineDisjuncts(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _pOne *XWhereTerm, _pTwo *XWhereTerm) { var _op, _idxNew int32 var _eOp uint16 @@ -83369,7 +86990,7 @@ _18: _op += 1 goto _18 _21: - *(*uint8)(unsafe.Pointer(&(_pNew.X0))) = uint8(_op) + *(*uint8)(unsafe.Pointer(&_pNew.X0)) = uint8(_op) _idxNew = _whereClauseInsert(tls, _pWC, _pNew, uint16(i32(3))) _exprAnalyze(tls, _pSrc, _pWC, _idxNew) } @@ -83380,16 +87001,19 @@ func init() { crt.Xstrncpy(nil, &_whereCombineDisjunctsØ00__func__Ø000[0], str(104055), 22) } -// Check to see if the given expression is a LIKE or GLOB operator that -// can be optimized using inequality constraints. Return TRUE if it is -// so and false if not. -// -// In order for the operator to be optimizible, the RHS must be a string -// literal that does not begin with a wildcard. The LHS must be a column -// that may only be NULL, a string, or a BLOB, never a number. (This means -// that virtual tables cannot participate in the LIKE optimization.) The -// collating sequence for the column on the LHS must be appropriate for -// the operator. +// C comment +// /* +// ** Check to see if the given expression is a LIKE or GLOB operator that +// ** can be optimized using inequality constraints. Return TRUE if it is +// ** so and false if not. +// ** +// ** In order for the operator to be optimizible, the RHS must be a string +// ** literal that does not begin with a wildcard. The LHS must be a column +// ** that may only be NULL, a string, or a BLOB, never a number. (This means +// ** that virtual tables cannot participate in the LIKE optimization.) The +// ** collating sequence for the column on the LHS must be appropriate for +// ** the operator. +// */ func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XExpr, _pisComplete *int32, _pnoCase *int32) (r0 int32) { var _c, _cnt, _op, _rc, _2_iCol, _11_r1 int32 var _z *int8 @@ -83405,9 +87029,9 @@ func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XEx if _sqlite3IsLikeFunction(tls, _db, _pExpr, _pnoCase, (*int8)(unsafe.Pointer(&_wc))) == 0 { return i32(0) } - _pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) - _pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(i32(1)))).X0) - _pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(i32(0)))).X0)) + _pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) + _pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(i32(1)))).X0) + _pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(i32(0)))).X0)) _op = int32(_pRight.X0) if _op != i32(135) { goto _1 @@ -83428,13 +87052,13 @@ func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XEx goto _8 _1: if _op == i32(97) { - _z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pRight.X3))))) + _z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pRight.X3)))) } _8: if _z == nil { goto _9 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))))))&i32(4)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(45) { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0)))))))))&i32(4)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(45) { goto _11 } if ((int32(_pLeft.X0) != i32(152)) || (int32(_sqlite3ExprAffinity(tls, _pLeft)) != i32(66))) || ((*XTable)(_pLeft.X14).X16) != 0 { @@ -83444,17 +87068,17 @@ _8: _11: _cnt = i32(0) _15: - if (((store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt))))) != i32(0)) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(0))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(1))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(2)))))) { + if (((store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_cnt))))) != i32(0)) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_wc)) + 1*uintptr(i32(0))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_wc)) + 1*uintptr(i32(1))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_wc)) + 1*uintptr(i32(2)))))) { _cnt += 1 goto _15 } - if _cnt == i32(0) || i32(255) == int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt-i32(1)))))) { + if _cnt == i32(0) || i32(255) == int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_cnt-i32(1)))))) { goto _21 } - *_pisComplete = bool2int((_c == int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(0)))))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt+i32(1))))) == i32(0))) + *_pisComplete = bool2int((_c == int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_wc)) + 1*uintptr(i32(0)))))) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_cnt+i32(1))))) == i32(0))) _9_pPrefix = _sqlite3Expr(tls, _db, i32(97), _z) if _9_pPrefix != nil { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_9_pPrefix.X3))))))) + 1*uintptr(_cnt))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_9_pPrefix.X3)))))) + 1*uintptr(_cnt))) = int8(i32(0)) } *_ppPrefix = _9_pPrefix if _op != i32(135) { @@ -83462,7 +87086,7 @@ _15: } _10_v = (*TVdbe)(_pParse.X2) _sqlite3VdbeSetVarmask(tls, _10_v, int32(_pRight.X9)) - if (*_pisComplete) != 0 && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pRight.X3))))))) + 1*uintptr(i32(1))))) != 0) { + if (*_pisComplete) != 0 && ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pRight.X3)))))) + 1*uintptr(i32(1))))) != 0) { _11_r1 = _sqlite3GetTempReg(tls, _pParse) _sqlite3ExprCodeTarget(tls, _pParse, _pRight, _11_r1) _sqlite3VdbeChangeP3(tls, _10_v, uint32(_sqlite3VdbeCurrentAddr(tls, _10_v)-i32(1)), i32(0)) @@ -83482,28 +87106,31 @@ _9: panic(0) } -// pExpr points to an expression which implements a function. If -// it is appropriate to apply the LIKE optimization to that function -// then set aWc[0] through aWc[2] to the wildcard characters and -// return TRUE. If the function is not a LIKE-style function then -// return FALSE. -// -// *pIsNocase is set to true if uppercase and lowercase are equivalent for -// the function (default for LIKE). If the function makes the distinction -// between uppercase and lowercase (as does GLOB) then *pIsNocase is set to -// false. +// C comment +// /* +// ** pExpr points to an expression which implements a function. If +// ** it is appropriate to apply the LIKE optimization to that function +// ** then set aWc[0] through aWc[2] to the wildcard characters and +// ** return TRUE. If the function is not a LIKE-style function then +// ** return FALSE. +// ** +// ** *pIsNocase is set to true if uppercase and lowercase are equivalent for +// ** the function (default for LIKE). If the function makes the distinction +// ** between uppercase and lowercase (as does GLOB) then *pIsNocase is set to +// ** false. +// */ func _sqlite3IsLikeFunction(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _pIsNocase *int32, _aWc *int8) (r0 int32) { var _pDef *XFuncDef - if ((int32(_pExpr.X0) != i32(151)) || ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil)) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) != i32(2)) { + if ((int32(_pExpr.X0) != i32(151)) || ((*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) == nil)) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0) != i32(2)) { return i32(0) } func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107262), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() - _pDef = _sqlite3FindFunction(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(2), uint8(i32(1)), uint8(i32(0))) + _pDef = _sqlite3FindFunction(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), i32(2), uint8(i32(1)), uint8(i32(0))) if func() int32 { if _pDef == nil { return func() int32 { @@ -83516,21 +87143,21 @@ func _sqlite3IsLikeFunction(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _pIsNoca }() != 0 || ((int32(_pDef.X1) & i32(4)) == i32(0)) { return i32(0) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_aWc), _pDef.X2, uint64(i32(3))) + crt.Xmemcpy(tls, unsafe.Pointer(_aWc), _pDef.X2, uint64(i32(3))) func() { - if (*int8)(unsafe.Pointer(&_likeInfoAlt)) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X0))))) { + if (*int8)(unsafe.Pointer(&_likeInfoAlt)) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&_likeInfoAlt.X0)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107273), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104128))) crt.X__builtin_abort(tls) } }() func() { - if (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_likeInfoAlt))+1*uintptr(i32(1)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X1))))) { + if (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_likeInfoAlt))+1*uintptr(i32(1)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&_likeInfoAlt.X1)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107274), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104180))) crt.X__builtin_abort(tls) } }() func() { - if (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_likeInfoAlt))+1*uintptr(i32(2)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X2))))) { + if (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_likeInfoAlt))+1*uintptr(i32(2)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&_likeInfoAlt.X2)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107275), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104238))) crt.X__builtin_abort(tls) } @@ -83551,12 +87178,15 @@ func init() { _likeInfoAlt = TcompareInfo{X0: u8(37), X1: u8(95), X2: u8(0), X3: u8(0)} } -// Return a pointer to an sqlite3_value structure containing the value bound -// parameter iVar of VM v. Except, if the value is an SQL NULL, return -// 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* -// constants) to the value before returning it. -// -// The returned value must be freed by the caller using sqlite3ValueFree(). +// C comment +// /* +// ** Return a pointer to an sqlite3_value structure containing the value bound +// ** parameter iVar of VM v. Except, if the value is an SQL NULL, return +// ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* +// ** constants) to the value before returning it. +// ** +// ** The returned value must be freed by the caller using sqlite3ValueFree(). +// */ func _sqlite3VdbeGetBoundValue(tls *crt.TLS, _v *TVdbe, _iVar int32, _aff uint8) (r0 *XMem) { var _1_pMem, _2_pRet *XMem func() { @@ -83590,9 +87220,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeGetBoundValueØ00__func__Ø000[0], str(104325), 25) } -// Configure SQL variable iVar so that binding a new value to it signals -// to sqlite3_reoptimize() that re-preparing the statement may result -// in a better query plan. +// C comment +// /* +// ** Configure SQL variable iVar so that binding a new value to it signals +// ** to sqlite3_reoptimize() that re-preparing the statement may result +// ** in a better query plan. +// */ func _sqlite3VdbeSetVarmask(tls *crt.TLS, _v *TVdbe, _iVar int32) { func() { if _iVar <= i32(0) { @@ -83602,14 +87235,14 @@ func _sqlite3VdbeSetVarmask(tls *crt.TLS, _v *TVdbe, _iVar int32) { }() if _iVar >= i32(32) { { - p := (*uint32)(unsafe.Pointer(&(_v.X41))) + p := (*uint32)(unsafe.Pointer(&_v.X41)) *p = (*p) | u32(2147483648) sink5(*p) } goto _3 } { - p := (*uint32)(unsafe.Pointer(&(_v.X41))) + p := (*uint32)(unsafe.Pointer(&_v.X41)) *p = (*p) | (u32(1) << uint(_iVar-i32(1))) sink5(*p) } @@ -83632,14 +87265,17 @@ func _sqlite3VdbeChangeP3(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) { *(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X5))) = _val } -// Check to see if the given expression is of the form -// -// column OP expr -// -// where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a -// column of a virtual table. -// -// If it is then return TRUE. If not, return FALSE. +// C comment +// /* +// ** Check to see if the given expression is of the form +// ** +// ** column OP expr +// ** +// ** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a +// ** column of a virtual table. +// ** +// ** If it is then return TRUE. If not, return FALSE. +// */ func _isMatchOfColumn(tls *crt.TLS, _pExpr *XExpr, _peOp2 *uint8) (r0 int32) { var _i int32 var _pList *XExprList @@ -83647,11 +87283,11 @@ func _isMatchOfColumn(tls *crt.TLS, _pExpr *XExpr, _peOp2 *uint8) (r0 int32) { if int32(_pExpr.X0) != i32(151) { return i32(0) } - _pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) - if (_pList == nil) || ((_pList.X0) != i32(2)) { + _pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) + if (_pList == nil) || (_pList.X0 != i32(2)) { return i32(0) } - _pCol = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(i32(1)))).X0) + _pCol = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(i32(1)))).X0) if (int32(_pCol.X0) != i32(152)) || (((*XTable)(_pCol.X14).X16) == 0) { return i32(0) } @@ -83660,8 +87296,8 @@ _5: if _i >= i32(4) { goto _8 } - if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_isMatchOfColumnØ00aOpØ001))+16*uintptr(_i))).X0) == i32(0) { - *_peOp2 = (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_isMatchOfColumnØ00aOpØ001)) + 16*uintptr(_i))).X1 + if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001))+16*uintptr(_i))).X0) == i32(0) { + *_peOp2 = (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_isMatchOfColumnØ00aOpØ001)) + 16*uintptr(_i))).X1 return i32(1) } _i += 1 @@ -83676,43 +87312,46 @@ func init() { _isMatchOfColumnØ00aOpØ001 = [4]TEncName{TEncName{X0: str(61759), X1: u8(64)}, TEncName{X0: str(7961), X1: u8(66)}, TEncName{X0: str(7966), X1: u8(65)}, TEncName{X0: str(104385), X1: u8(67)}} } -// Compute and return a new Expr object which when passed to -// sqlite3ExprCode() will generate all necessary code to compute -// the iField-th column of the vector expression pVector. -// -// It is ok for pVector to be a scalar (as long as iField==0). -// In that case, this routine works like sqlite3ExprDup(). -// -// The caller owns the returned Expr object and is responsible for -// ensuring that the returned value eventually gets freed. -// -// The caller retains ownership of pVector. If pVector is a TK_SELECT, -// then the returned object will reference pVector and so pVector must remain -// valid for the life of the returned object. If pVector is a TK_VECTOR -// or a scalar expression, then it can be deleted as soon as this routine -// returns. -// -// A trick to cause a TK_SELECT pVector to be deleted together with -// the returned Expr object is to attach the pVector to the pRight field -// of the returned TK_SELECT_COLUMN Expr object. +// C comment +// /* +// ** Compute and return a new Expr object which when passed to +// ** sqlite3ExprCode() will generate all necessary code to compute +// ** the iField-th column of the vector expression pVector. +// ** +// ** It is ok for pVector to be a scalar (as long as iField==0). +// ** In that case, this routine works like sqlite3ExprDup(). +// ** +// ** The caller owns the returned Expr object and is responsible for +// ** ensuring that the returned value eventually gets freed. +// ** +// ** The caller retains ownership of pVector. If pVector is a TK_SELECT, +// ** then the returned object will reference pVector and so pVector must remain +// ** valid for the life of the returned object. If pVector is a TK_VECTOR +// ** or a scalar expression, then it can be deleted as soon as this routine +// ** returns. +// ** +// ** A trick to cause a TK_SELECT pVector to be deleted together with +// ** the returned Expr object is to attach the pVector to the pRight field +// ** of the returned TK_SELECT_COLUMN Expr object. +// */ func _sqlite3ExprForVectorField(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32) (r0 *XExpr) { var _pRet *XExpr if int32(_pVector.X0) != i32(119) { goto _0 } func() { - if ((_pVector.X2) & uint32(i32(2048))) == 0 { + if (_pVector.X2 & uint32(i32(2048))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91309), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000))), unsafe.Pointer(str(104392))) crt.X__builtin_abort(tls) } }() _pRet = _sqlite3PExpr(tls, _pParse, i32(159), nil, nil) if _pRet != nil { - *(*int16)(unsafe.Pointer(&(_pRet.X9))) = int16(_iField) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X4))))) = _pVector + *(*int16)(unsafe.Pointer(&_pRet.X9)) = int16(_iField) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X4)))) = _pVector } func() { - if _pRet != nil && (_pRet.X8) != i32(0) { + if _pRet != nil && _pRet.X8 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91331), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000))), unsafe.Pointer(str(104422))) crt.X__builtin_abort(tls) } @@ -83720,7 +87359,7 @@ func _sqlite3ExprForVectorField(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, goto _7 _0: if int32(_pVector.X0) == i32(158) { - _pVector = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 32*uintptr(_iField))).X0) + _pVector = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pVector.X6))))).X2))))) + 32*uintptr(_iField))).X0) } _pRet = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _pVector, i32(0)) _7: @@ -83733,28 +87372,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprForVectorFieldØ00__func__Ø000[0], str(104449), 26) } -// Return true if the DISTINCT expression-list passed as the third argument -// is redundant. -// -// A DISTINCT list is redundant if any subset of the columns in the -// DISTINCT list are collectively unique and individually non-null. +// C comment +// /* +// ** Return true if the DISTINCT expression-list passed as the third argument +// ** is redundant. +// ** +// ** A DISTINCT list is redundant if any subset of the columns in the +// ** DISTINCT list are collectively unique and individually non-null. +// */ func _isDistinctRedundant(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWC *XWhereClause, _pDistinct *XExprList) (r0 int32) { var _i, _iBase int32 var _pTab *XTable var _1_p *XExpr var _pIdx *XIndex - if (_pTabList.X0) != i32(1) { + if _pTabList.X0 != i32(1) { return i32(0) } - _iBase = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X11 - _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X4) + _iBase = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X11 + _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X4) _i = i32(0) _1: - if _i >= (_pDistinct.X0) { + if _i >= _pDistinct.X0 { goto _4 } - _1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pDistinct.X2)))))+32*uintptr(_i))).X0)) - if ((int32(_1_p.X0) == i32(152)) && ((_1_p.X8) == _iBase)) && (int32(_1_p.X9) < i32(0)) { + _1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pDistinct.X2))))+32*uintptr(_i))).X0)) + if ((int32(_1_p.X0) == i32(152)) && (_1_p.X8 == _iBase)) && (int32(_1_p.X9) < i32(0)) { return i32(1) } _i += 1 @@ -83796,29 +87438,32 @@ _11: return i32(0) } -// Search for a term in the WHERE clause that is of the form "X <op> <expr>" -// where X is a reference to the iColumn of table iCur or of index pIdx -// if pIdx!=0 and <op> is one of the WO_xx operator codes specified by -// the op parameter. Return a pointer to the term. Return 0 if not found. -// -// If pIdx!=0 then it must be one of the indexes of table iCur. -// Search for terms matching the iColumn-th column of pIdx -// rather than the iColumn-th column of table iCur. -// -// The term returned might by Y=<expr> if there is another constraint in -// the WHERE clause that specifies that X=Y. Any such constraints will be -// identified by the WO_EQUIV bit in the pTerm->eOperator field. The -// aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11 -// slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10 -// other equivalent values. Hence a search for X will return <expr> if X=A1 -// and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>. -// -// If there are multiple terms in the WHERE clause of the form "X <op> <expr>" -// then try for the one with no dependencies on <expr> - in other words where -// <expr> is a constant expression of some kind. Only return entries of -// 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. +// C comment +// /* +// ** Search for a term in the WHERE clause that is of the form "X <op> <expr>" +// ** where X is a reference to the iColumn of table iCur or of index pIdx +// ** if pIdx!=0 and <op> is one of the WO_xx operator codes specified by +// ** the op parameter. Return a pointer to the term. Return 0 if not found. +// ** +// ** If pIdx!=0 then it must be one of the indexes of table iCur. +// ** Search for terms matching the iColumn-th column of pIdx +// ** rather than the iColumn-th column of table iCur. +// ** +// ** The term returned might by Y=<expr> if there is another constraint in +// ** the WHERE clause that specifies that X=Y. Any such constraints will be +// ** identified by the WO_EQUIV bit in the pTerm->eOperator field. The +// ** aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11 +// ** slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10 +// ** other equivalent values. Hence a search for X will return <expr> if X=A1 +// ** and A1=A2 and A2=A3 and ... and A9=A10 and A10=<expr>. +// ** +// ** If there are multiple terms in the WHERE clause of the form "X <op> <expr>" +// ** then try for the one with no dependencies on <expr> - in other words where +// ** <expr> is a constant expression of some kind. Only return entries of +// ** 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 _sqlite3WhereFindTerm(tls *crt.TLS, _pWC *XWhereClause, _iCur int32, _iColumn int32, _notReady uint64, _op uint32, _pIdx *XIndex) (r0 *XWhereTerm) { var _pResult, _p *XWhereTerm var _scan XWhereScan @@ -83833,10 +87478,10 @@ _0: if _p == nil { goto _1 } - if ((_p.X11) & _notReady) != uint64(i32(0)) { + if (_p.X11 & _notReady) != uint64(i32(0)) { goto _2 } - if ((_p.X11) == uint64(i32(0))) && ((uint32(_p.X4) & _op) != uint32(i32(0))) { + if (_p.X11 == uint64(i32(0))) && ((uint32(_p.X4) & _op) != uint32(i32(0))) { return _p } if _pResult == nil { @@ -83852,38 +87497,41 @@ _1: panic(0) } -// Initialize a WHERE clause scanner object. Return a pointer to the -// first match. Return NULL if there are no matches. -// -// The scanner will be searching the WHERE clause pWC. It will look -// for terms of the form "X <op> <expr>" where X is column iColumn of table -// iCur. Or if pIdx!=0 then X is column iColumn of index pIdx. pIdx -// must be one of the indexes of table iCur. -// -// The <op> must be one of the operators described by opMask. -// -// If the search is for X and the WHERE clause contains terms of the -// form X=Y then this routine might also return terms of the form -// "Y <op> <expr>". The number of levels of transitivity is limited, -// but is enough to handle most commonly occurring SQL statements. -// -// If X is not the INTEGER PRIMARY KEY then X must be compatible with -// index pIdx. +// C comment +// /* +// ** Initialize a WHERE clause scanner object. Return a pointer to the +// ** first match. Return NULL if there are no matches. +// ** +// ** The scanner will be searching the WHERE clause pWC. It will look +// ** for terms of the form "X <op> <expr>" where X is column iColumn of table +// ** iCur. Or if pIdx!=0 then X is column iColumn of index pIdx. pIdx +// ** must be one of the indexes of table iCur. +// ** +// ** The <op> must be one of the operators described by opMask. +// ** +// ** If the search is for X and the WHERE clause contains terms of the +// ** form X=Y then this routine might also return terms of the form +// ** "Y <op> <expr>". The number of levels of transitivity is limited, +// ** but is enough to handle most commonly occurring SQL statements. +// ** +// ** If X is not the INTEGER PRIMARY KEY then X must be compatible with +// ** index pIdx. +// */ func _whereScanInit(tls *crt.TLS, _pScan *XWhereScan, _pWC *XWhereClause, _iCur int32, _iColumn int32, _opMask uint32, _pIdx *XIndex) (r0 *XWhereTerm) { var _1_j int32 - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X0))))) = _pWC - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X1))))) = _pWC - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X3))))) = nil - *(*int8)(unsafe.Pointer(&(_pScan.X4))) = int8(i32(0)) - *(**int8)(unsafe.Pointer(&(_pScan.X2))) = nil + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pScan.X0)))) = _pWC + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pScan.X1)))) = _pWC + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pScan.X3)))) = nil + *(*int8)(unsafe.Pointer(&_pScan.X4)) = int8(i32(0)) + *(**int8)(unsafe.Pointer(&_pScan.X2)) = nil if _pIdx == nil { goto _0 } _1_j = _iColumn - _iColumn = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_j)))) + _iColumn = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_1_j)))) if _iColumn == i32(-2) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X3))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2))))) + 32*uintptr(_1_j))).X0) - *(**int8)(unsafe.Pointer(&(_pScan.X2))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_1_j))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pScan.X3)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2))))) + 32*uintptr(_1_j))).X0) + *(**int8)(unsafe.Pointer(&_pScan.X2)) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_1_j))) goto _5 } if _iColumn == int32((*XTable)(_pIdx.X3).X10) { @@ -83891,8 +87539,8 @@ func _whereScanInit(tls *crt.TLS, _pScan *XWhereScan, _pWC *XWhereClause, _iCur goto _5 } if _iColumn >= i32(0) { - *(*int8)(unsafe.Pointer(&(_pScan.X4))) = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 32*uintptr(_iColumn))).X4 - *(**int8)(unsafe.Pointer(&(_pScan.X2))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_1_j))) + *(*int8)(unsafe.Pointer(&_pScan.X4)) = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 32*uintptr(_iColumn))).X4 + *(**int8)(unsafe.Pointer(&_pScan.X2)) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_1_j))) } _5: goto _7 @@ -83901,18 +87549,21 @@ _0: return nil } _7: - *(*uint32)(unsafe.Pointer(&(_pScan.X7))) = _opMask - *(*int32)(unsafe.Pointer(&(_pScan.X8))) = i32(0) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(i32(0)))) = _iCur - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(i32(0)))) = int16(_iColumn) - *(*uint8)(unsafe.Pointer(&(_pScan.X5))) = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_pScan.X6))) = uint8(i32(1)) + *(*uint32)(unsafe.Pointer(&_pScan.X7)) = _opMask + *(*int32)(unsafe.Pointer(&_pScan.X8)) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int32)(unsafe.Pointer(&_pScan.X9)))) + 4*uintptr(i32(0)))) = _iCur + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int16)(unsafe.Pointer(&_pScan.X10)))) + 2*uintptr(i32(0)))) = int16(_iColumn) + *(*uint8)(unsafe.Pointer(&_pScan.X5)) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pScan.X6)) = uint8(i32(1)) return _whereScanNext(tls, _pScan) } -// Advance to the next WhereTerm that matches according to the criteria -// established when the pScan object was initialized by whereScanInit(). -// Return NULL if there are no more matching WhereTerms. +// C comment +// /* +// ** Advance to the next WhereTerm that matches according to the criteria +// ** established when the pScan object was initialized by whereScanInit(). +// ** Return NULL if there are no more matching WhereTerms. +// */ func _whereScanNext(tls *crt.TLS, _pScan *XWhereScan) (r0 *XWhereTerm) { var _iColumn int16 var _iCur, _k, _5_j int32 @@ -83930,8 +87581,8 @@ func _whereScanNext(tls *crt.TLS, _pScan *XWhereScan) (r0 *XWhereTerm) { }() _pWC = (*XWhereClause)(_pScan.X1) _2: - _iColumn = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(int32(_pScan.X6)-i32(1)))) - _iCur = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(int32(_pScan.X6)-i32(1)))) + _iColumn = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int16)(unsafe.Pointer(&_pScan.X10)))) + 2*uintptr(int32(_pScan.X6)-i32(1)))) + _iCur = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int32)(unsafe.Pointer(&_pScan.X9)))) + 4*uintptr(int32(_pScan.X6)-i32(1)))) func() { if _pWC == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130595), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereScanNextØ00__func__Ø000))), unsafe.Pointer(str(104504))) @@ -83941,10 +87592,10 @@ _2: _6: _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_k)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64))))))))))) _7: - if _k >= (_pWC.X3) { + if _k >= _pWC.X3 { goto _10 } - if (_pTerm.X8) != _iCur || (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) != int32(_iColumn) || int32(_iColumn) == i32(-2) && _sqlite3ExprCompareSkip(tls, (*XExpr)((*XExpr)(_pTerm.X0).X4), (*XExpr)(_pScan.X3), _iCur) != i32(0) || int32(_pScan.X6) > i32(1) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) != uint32(i32(0)) { + if _pTerm.X8 != _iCur || (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))) != int32(_iColumn) || int32(_iColumn) == i32(-2) && _sqlite3ExprCompareSkip(tls, (*XExpr)((*XExpr)(_pTerm.X0).X4), (*XExpr)(_pScan.X3), _iCur) != i32(0) || int32(_pScan.X6) > i32(1) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) != uint32(i32(0)) { goto _16 } if (int32(_pTerm.X4)&i32(2048)) == i32(0) || int32(_pScan.X5) >= i32(11) || int32(store36(&_pX, _sqlite3ExprSkipCollate(tls, (*XExpr)((*XExpr)(_pTerm.X0).X5))).X0) != i32(152) { @@ -83955,22 +87606,22 @@ _20: if _5_j >= int32(_pScan.X5) { goto _23 } - if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(_5_j)))) == (_pX.X8)) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(_5_j)))) == int32(_pX.X9)) { + if ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int32)(unsafe.Pointer(&_pScan.X9)))) + 4*uintptr(_5_j)))) == _pX.X8) && (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int16)(unsafe.Pointer(&_pScan.X10)))) + 2*uintptr(_5_j)))) == int32(_pX.X9)) { goto _23 } _5_j += 1 goto _20 _23: if _5_j == int32(_pScan.X5) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(_5_j))) = _pX.X8 - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(_5_j))) = _pX.X9 - *(*uint8)(unsafe.Pointer(&(_pScan.X5))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int32)(unsafe.Pointer(&_pScan.X9)))) + 4*uintptr(_5_j))) = _pX.X8 + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int16)(unsafe.Pointer(&_pScan.X10)))) + 2*uintptr(_5_j))) = _pX.X9 + *(*uint8)(unsafe.Pointer(&_pScan.X5)) += 1 } _19: - if (uint32(_pTerm.X4) & (_pScan.X7)) == uint32(i32(0)) { + if (uint32(_pTerm.X4) & _pScan.X7) == uint32(i32(0)) { goto _27 } - if (_pScan.X2) == nil || (int32(_pTerm.X4)&i32(256)) != i32(0) { + if _pScan.X2 == nil || (int32(_pTerm.X4)&i32(256)) != i32(0) { goto _29 } _10_pParse = (*XParse)((*XWhereInfo)(_pWC.X0).X0) @@ -83979,7 +87630,7 @@ _19: goto _8 } func() { - if (*XExpr)(_pX.X4) == nil { + if _pX.X4 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130631), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereScanNextØ00__func__Ø000))), unsafe.Pointer(str(104511))) crt.X__builtin_abort(tls) } @@ -83992,11 +87643,11 @@ _19: goto _8 } _29: - if ((((int32(_pTerm.X4) & i32(130)) != i32(0)) && (int32(store36(&_pX, (*XExpr)((*XExpr)(_pTerm.X0).X5)).X0) == i32(152))) && ((_pX.X8) == (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(i32(0))))))) && (int32(_pX.X9) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(i32(0)))))) { + if ((((int32(_pTerm.X4) & i32(130)) != i32(0)) && (int32(store36(&_pX, (*XExpr)((*XExpr)(_pTerm.X0).X5)).X0) == i32(152))) && (_pX.X8 == (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int32)(unsafe.Pointer(&_pScan.X9)))) + 4*uintptr(i32(0))))))) && (int32(_pX.X9) == int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer((*[11]int16)(unsafe.Pointer(&_pScan.X10)))) + 2*uintptr(i32(0)))))) { goto _8 } - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X1))))) = _pWC - *(*int32)(unsafe.Pointer(&(_pScan.X8))) = _k + i32(1) + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pScan.X1)))) = _pWC + *(*int32)(unsafe.Pointer(&_pScan.X8)) = _k + i32(1) return _pTerm _27: @@ -84015,7 +87666,7 @@ _10: } _pWC = (*XWhereClause)(_pScan.X0) _k = i32(0) - *(*uint8)(unsafe.Pointer(&(_pScan.X6))) += 1 + *(*uint8)(unsafe.Pointer(&_pScan.X6)) += 1 goto _2 _3: return nil @@ -84027,10 +87678,13 @@ func init() { crt.Xstrncpy(nil, &_whereScanNextØ00__func__Ø000[0], str(104521), 14) } -// pExpr is a comparison expression, eg. '=', '<', IN(...) etc. -// idx_affinity is the affinity of an indexed column. Return true -// if the index with affinity idx_affinity may be used to implement -// the comparison in pExpr. +// C comment +// /* +// ** pExpr is a comparison expression, eg. '=', '<', IN(...) etc. +// ** idx_affinity is the affinity of an indexed column. Return true +// ** if the index with affinity idx_affinity may be used to implement +// ** the comparison in pExpr. +// */ func _sqlite3IndexAffinityOk(tls *crt.TLS, _pExpr *XExpr, _idx_affinity int8) (r0 int32) { var _aff int8 _aff = _comparisonAffinity(tls, _pExpr) @@ -84053,8 +87707,11 @@ _3: return bool2int(int32(_idx_affinity) >= i32(67)) } -// pExpr is a comparison operator. Return the type affinity that should -// be applied to both operands prior to doing the comparison. +// C comment +// /* +// ** pExpr is a comparison operator. Return the type affinity that should +// ** be applied to both operands prior to doing the comparison. +// */ func _comparisonAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) { var _aff int8 func() { @@ -84064,18 +87721,18 @@ func _comparisonAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) { } }() func() { - if (*XExpr)(_pExpr.X4) == nil { + if _pExpr.X4 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91126), unsafe.Pointer((*int8)(unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000))), unsafe.Pointer(str(104715))) crt.X__builtin_abort(tls) } }() _aff = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.X4)) - if (*XExpr)(_pExpr.X5) != nil { + if _pExpr.X5 != nil { _aff = _sqlite3CompareAffinity(tls, (*XExpr)(_pExpr.X5), _aff) goto _16 } - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { - _aff = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X2)))))+32*uintptr(i32(0)))).X0), _aff) + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { + _aff = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0).X2)))))+32*uintptr(i32(0)))).X0), _aff) goto _16 } if int32(_aff) == i32(0) { @@ -84091,27 +87748,30 @@ func init() { crt.Xstrncpy(nil, &_comparisonAffinityØ00__func__Ø000[0], str(104728), 19) } -// This function searches pList for an entry that matches the iCol-th column -// of index pIdx. -// -// If such an expression is found, its index in pList->a[] is returned. If -// no expression is found, -1 is returned. +// C comment +// /* +// ** This function searches pList for an entry that matches the iCol-th column +// ** of index pIdx. +// ** +// ** If such an expression is found, its index in pList->a[] is returned. If +// ** no expression is found, -1 is returned. +// */ func _findIndexCol(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iBase int32, _pIdx *XIndex, _iCol int32) (r0 int32) { var _i int32 var _zColl *int8 var _1_p *XExpr var _2_pColl *XCollSeq - _zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_iCol))) + _zColl = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_iCol))) _i = i32(0) _0: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _3 } - _1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) - if int32(_1_p.X0) != i32(152) || int32(_1_p.X9) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iCol)))) || (_1_p.X8) != _iBase { + _1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) + if int32(_1_p.X0) != i32(152) || int32(_1_p.X9) != int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_iCol)))) || _1_p.X8 != _iBase { goto _6 } - _2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) + _2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) if (_2_pColl != nil) && (i32(0) == _sqlite3StrICmp(tls, _2_pColl.X0, _zColl)) { return _i } @@ -84122,7 +87782,10 @@ _3: return i32(-1) } -// Return TRUE if the iCol-th column of index pIdx is NOT NULL +// C comment +// /* +// ** Return TRUE if the iCol-th column of index pIdx is NOT NULL +// */ func _indexColumnNotNull(tls *crt.TLS, _pIdx *XIndex, _iCol int32) (r0 int32) { var _j int32 func() { @@ -84137,7 +87800,7 @@ func _indexColumnNotNull(tls *crt.TLS, _pIdx *XIndex, _iCol int32) (r0 int32) { crt.X__builtin_abort(tls) } }() - _j = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iCol)))) + _j = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_iCol)))) if _j >= i32(0) { return int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 32*uintptr(_j))).X3) } @@ -84159,15 +87822,18 @@ func init() { crt.Xstrncpy(nil, &_indexColumnNotNullØ00__func__Ø000[0], str(104785), 19) } -// Most queries use only a single table (they are not joins) and have -// simple == constraints against indexed fields. This routine attempts -// to plan those simple cases using much less ceremony than the -// general-purpose query planner, and thereby yield faster sqlite3_prepare() -// times for the common case. -// -// Return non-zero on success, if this query can be handled by this -// no-frills query planner. Return zero if this query needs the -// general-purpose query planner. +// C comment +// /* +// ** Most queries use only a single table (they are not joins) and have +// ** simple == constraints against indexed fields. This routine attempts +// ** to plan those simple cases using much less ceremony than the +// ** general-purpose query planner, and thereby yield faster sqlite3_prepare() +// ** times for the common case. +// ** +// ** Return non-zero on success, if this query can be handled by this +// ** no-frills query planner. Return zero if this query needs the +// ** general-purpose query planner. +// */ func _whereShortCut(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) { var _iCur, _j, _3_opMask int32 var _pTab *XTable @@ -84189,24 +87855,24 @@ func _whereShortCut(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) { }() _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) _pTab = (*XTable)(_pItem.X4) - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return i32(0) } - if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_pItem.X9)).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 { return i32(0) } _iCur = _pItem.X11 - _pWC = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))) + _pWC = (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)) _pLoop = (*XWhereLoop)(_pBuilder.X3) - *(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(0)) - *(*uint16)(unsafe.Pointer(&(_pLoop.X11))) = uint16(i32(0)) + *(*uint32)(unsafe.Pointer(&_pLoop.X9)) = uint32(i32(0)) + *(*uint16)(unsafe.Pointer(&_pLoop.X11)) = uint16(i32(0)) _pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, i32(-1), uint64(i32(0)), uint32(i32(130)), nil) if _pTerm != nil { - *(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(4353)) - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(i32(0)))) = _pTerm - *(*uint16)(unsafe.Pointer(&(_pLoop.X10))) = uint16(i32(1)) - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = uint16(i32(1)) - *(*int16)(unsafe.Pointer(&(_pLoop.X6))) = int16(i32(33)) + *(*uint32)(unsafe.Pointer(&_pLoop.X9)) = uint32(i32(4353)) + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(i32(0)))) = _pTerm + *(*uint16)(unsafe.Pointer(&_pLoop.X10)) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0))) = uint16(i32(1)) + *(*int16)(unsafe.Pointer(&_pLoop.X6)) = int16(i32(33)) goto _6 } _pIdx = (*XIndex)(_pTab.X2) @@ -84215,7 +87881,7 @@ _7: goto _10 } func() { - if (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_pLoop.X15))))) != (**XWhereTerm)(unsafe.Pointer(_pLoop.X13)) { + if (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&_pLoop.X15)))) != (**XWhereTerm)(unsafe.Pointer(_pLoop.X13)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134629), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereShortCutØ00__func__Ø000))), unsafe.Pointer(str(104830))) crt.X__builtin_abort(tls) } @@ -84224,7 +87890,7 @@ _7: goto _8 } _3_opMask = func() int32 { - if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { return i32(130) } return i32(2) @@ -84238,52 +87904,52 @@ _18: if _pTerm == nil { goto _21 } - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j))) = _pTerm + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j))) = _pTerm _j += 1 goto _18 _21: if _j != int32(_pIdx.X13) { goto _8 } - *(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(4609)) - if (((uint32((_pIdx.X16)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0) || (((_pItem.X14) & (^_columnsInIndex(tls, _pIdx))) == uint64(i32(0))) { + *(*uint32)(unsafe.Pointer(&_pLoop.X9)) = uint32(i32(4609)) + if (((uint32(_pIdx.X16>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0) || ((_pItem.X14 & (^_columnsInIndex(tls, _pIdx))) == uint64(i32(0))) { { - p := (*uint32)(unsafe.Pointer(&(_pLoop.X9))) + p := (*uint32)(unsafe.Pointer(&_pLoop.X9)) *p = (*p) | uint32(i32(64)) sink5(*p) } } - *(*uint16)(unsafe.Pointer(&(_pLoop.X10))) = uint16(_j) - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = uint16(_j) - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4))))) = _pIdx - *(*int16)(unsafe.Pointer(&(_pLoop.X6))) = int16(i32(39)) + *(*uint16)(unsafe.Pointer(&_pLoop.X10)) = uint16(_j) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0))) = uint16(_j) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4))))) = _pIdx + *(*int16)(unsafe.Pointer(&_pLoop.X6)) = int16(i32(39)) goto _10 _8: _pIdx = (*XIndex)(_pIdx.X5) goto _7 _10: _6: - if (_pLoop.X9) == 0 { + if _pLoop.X9 == 0 { goto _26 } - *(*int16)(unsafe.Pointer(&(_pLoop.X7))) = i16(1) - *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(i32(0)))).X18))))) = _pLoop + *(*int16)(unsafe.Pointer(&_pLoop.X7)) = i16(1) + *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(i32(0)))).X18))))) = _pLoop func() { - if ((*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))).X0) != i32(1) || _iCur != (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&((*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))).X1))))) + 4*uintptr(i32(0))))) { + if ((*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)).X0) != i32(1) || _iCur != (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[64]int32)(unsafe.Pointer(&((*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)).X1))))) + 4*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134657), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereShortCutØ00__func__Ø000))), unsafe.Pointer(str(104864))) crt.X__builtin_abort(tls) } }() - *(*uint64)(unsafe.Pointer(&(_pLoop.X1))) = uint64(i32(1)) - *(*int32)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(i32(0)))).X1))) = _iCur - *(*int16)(unsafe.Pointer(&(_pWInfo.X21))) = int16(i32(1)) - if (*XExprList)(_pWInfo.X2) != nil { - *(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8((*XExprList)(_pWInfo.X2).X0) + *(*uint64)(unsafe.Pointer(&_pLoop.X1)) = uint64(i32(1)) + *(*int32)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(i32(0)))).X1))) = _iCur + *(*int16)(unsafe.Pointer(&_pWInfo.X21)) = int16(i32(1)) + if _pWInfo.X2 != nil { + *(*int8)(unsafe.Pointer(&_pWInfo.X12)) = int8((*XExprList)(_pWInfo.X2).X0) } if (int32(_pWInfo.X10) & i32(256)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pWInfo.X16)) = uint8(i32(1)) } - *(*int8)(unsafe.Pointer(&(_pLoop.X2))) = int8(i32(48)) + *(*int8)(unsafe.Pointer(&_pLoop.X2)) = int8(i32(48)) return i32(1) _26: @@ -84296,8 +87962,11 @@ func init() { crt.Xstrncpy(nil, &_whereShortCutØ00__func__Ø000[0], str(104918), 14) } -// Return a bitmask where 1s indicate that the corresponding column of -// the table is used by an index. Only the first 63 columns are considered. +// C comment +// /* +// ** Return a bitmask where 1s indicate that the corresponding column of +// ** the table is used by an index. Only the first 63 columns are considered. +// */ func _columnsInIndex(tls *crt.TLS, _pIdx *XIndex) (r0 uint64) { var _j, _1_x int32 var _m uint64 @@ -84307,7 +87976,7 @@ _0: if _j < i32(0) { goto _3 } - _1_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))) + _1_x = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_j)))) if _1_x < i32(0) { goto _4 } @@ -84325,7 +87994,10 @@ _3: return _m } -// Add all WhereLoop objects for all tables +// C comment +// /* +// ** Add all WhereLoop objects for all tables +// */ func _whereLoopAddAll(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) { var _iTab, _rc int32 var _mPrereq, _mPrior, _1_mUnusable uint64 @@ -84339,36 +88011,36 @@ func _whereLoopAddAll(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) { _mPrereq = u64(0) _mPrior = u64(0) _pTabList = (*XSrcList)(_pWInfo.X1) - _pEnd = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_pWInfo.X11))) + _pEnd = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_pWInfo.X11))) _db = (*Xsqlite3)((*XParse)(_pWInfo.X0).X0) _rc = i32(0) _priorJointype = u8(0) _pNew = (*XWhereLoop)(_pBuilder.X3) _whereLoopInit(tls, _pNew) - *func() **TSrcList_item { _iTab = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + *func() **TSrcList_item { _iTab = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) _0: if crt.P2U(unsafe.Pointer(_pItem)) >= crt.P2U(unsafe.Pointer(_pEnd)) { goto _3 } _1_mUnusable = uint64(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pNew.X3))) = uint8(_iTab) - *(*uint64)(unsafe.Pointer(&(_pNew.X1))) = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pItem.X11) - if ((int32((*t28)(unsafe.Pointer(&(_pItem.X9))).X0) | int32(_priorJointype)) & i32(10)) != i32(0) { + *(*uint8)(unsafe.Pointer(&_pNew.X3)) = uint8(_iTab) + *(*uint64)(unsafe.Pointer(&_pNew.X1)) = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _pItem.X11) + if ((int32((*t28)(unsafe.Pointer(&_pItem.X9)).X0) | int32(_priorJointype)) & i32(10)) != i32(0) { _mPrereq = _mPrior } - _priorJointype = (*t28)(unsafe.Pointer(&(_pItem.X9))).X0 + _priorJointype = (*t28)(unsafe.Pointer(&_pItem.X9)).X0 if ((*XTable)(_pItem.X4).X16) == 0 { goto _5 } - _3_p = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem)) + 112*uintptr(i32(1)))) + _3_p = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pItem)) + 112*uintptr(i32(1)))) _6: if crt.P2U(unsafe.Pointer(_3_p)) >= crt.P2U(unsafe.Pointer(_pEnd)) { goto _9 } - if (_1_mUnusable != 0) || (int32((*t28)(unsafe.Pointer(&(_3_p.X9))).X0)&i32(10)) != 0 { + if (_1_mUnusable != 0) || (int32((*t28)(unsafe.Pointer(&_3_p.X9)).X0)&i32(10)) != 0 { { p := &_1_mUnusable - *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _3_p.X11) + *p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _3_p.X11) sink17(*p) } } @@ -84385,10 +88057,10 @@ _12: } { p := &_mPrior - *p = (*p) | (_pNew.X1) + *p = (*p) | _pNew.X1 sink17(*p) } - if _rc != 0 || ((_db.X17) != 0) { + if _rc != 0 || (_db.X17 != 0) { goto _3 } *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _iTab += 1; return &_pItem }())) += uintptr(112) @@ -84398,29 +88070,32 @@ _3: return _rc } -// Add all WhereLoop objects for a table of the join identified by -// pBuilder->pNew->iTab. That table is guaranteed to be a virtual table. -// -// If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and -// mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause -// entries that occur before the virtual table in the FROM clause and are -// separated from it by at least one LEFT or CROSS JOIN. Similarly, the -// mUnusable mask contains all FROM clause entries that occur after the -// virtual table and are separated from it by at least one LEFT or -// CROSS JOIN. -// -// For example, if the query were: -// -// ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6; -// -// then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6). -// -// All the tables in mPrereq must be scanned before the current virtual -// table. So any terms for which all prerequisites are satisfied by -// mPrereq may be specified as "usable" in all calls to xBestIndex. -// Conversely, all tables in mUnusable must be scanned after the current -// virtual table, so any terms for which the prerequisites overlap with -// mUnusable should always be configured as "not-usable" for xBestIndex. +// C comment +// /* +// ** Add all WhereLoop objects for a table of the join identified by +// ** pBuilder->pNew->iTab. That table is guaranteed to be a virtual table. +// ** +// ** If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and +// ** mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause +// ** entries that occur before the virtual table in the FROM clause and are +// ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the +// ** mUnusable mask contains all FROM clause entries that occur after the +// ** virtual table and are separated from it by at least one LEFT or +// ** CROSS JOIN. +// ** +// ** For example, if the query were: +// ** +// ** ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6; +// ** +// ** then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6). +// ** +// ** All the tables in mPrereq must be scanned before the current virtual +// ** table. So any terms for which all prerequisites are satisfied by +// ** mPrereq may be specified as "usable" in all calls to xBestIndex. +// ** Conversely, all tables in mUnusable must be scanned after the current +// ** virtual table, so any terms for which the prerequisites overlap with +// ** mUnusable should always be configured as "not-usable" for xBestIndex. +// */ func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) { var _rc, _nConstraint, _bIn, _2_seenZero, _2_seenZeroNoIN, _5_i int32 var _mBest, _2_mPrev, _2_mBestNoIn, _5_mNext, _6_mThis uint64 @@ -84442,7 +88117,7 @@ func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq u _pParse = (*XParse)(_pWInfo.X0) _pWC = (*XWhereClause)(_pBuilder.X1) _pNew = (*XWhereLoop)(_pBuilder.X3) - _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pNew.X3))) + _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pNew.X3))) func() { if ((*XTable)(_pSrc.X4).X16) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133556), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000))), unsafe.Pointer(str(104957))) @@ -84453,17 +88128,17 @@ func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq u if _p == nil { return _sqlite3NomemError(tls, i32(133559)) } - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(1024)) - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(0)) - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(i32(0)) + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(i32(1024)) + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = uint16(i32(0)) + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = uint8(i32(0)) _nConstraint = _p.X0 if _whereLoopResize(tls, (*Xsqlite3)(_pParse.X0), _pNew, _nConstraint) != 0 { - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_p)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_p)) return _sqlite3NomemError(tls, i32(133567)) } _rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, u64(18446744073709551615), uint16(i32(0)), _p, _mNoOmit, &_bIn) - if _rc != i32(0) || store17(&_mBest, (_pNew.X0)&(^_mPrereq)) == uint64(i32(0)) { + if _rc != i32(0) || store17(&_mBest, _pNew.X0&(^_mPrereq)) == uint64(i32(0)) { goto _7 } _2_seenZero = i32(0) @@ -84480,7 +88155,7 @@ func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq u crt.X__builtin_abort(tls) } }() - _2_mBestNoIn = (_pNew.X0) & (^_mPrereq) + _2_mBestNoIn = _pNew.X0 & (^_mPrereq) if _2_mBestNoIn == uint64(i32(0)) { _2_seenZero = i32(1) _2_seenZeroNoIN = i32(1) @@ -84516,7 +88191,7 @@ _19: goto _8 } _rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _5_mNext|_mPrereq, uint16(i32(0)), _p, _mNoOmit, &_bIn) - if (_pNew.X0) != _mPrereq { + if _pNew.X0 != _mPrereq { goto _25 } _2_seenZero = i32(1) @@ -84538,10 +88213,10 @@ _28: _rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, uint16(i32(1)), _p, _mNoOmit, &_bIn) } _7: - if (_p.X7) != 0 { - Xsqlite3_free(tls, (unsafe.Pointer)(_p.X6)) + if _p.X7 != 0 { + Xsqlite3_free(tls, unsafe.Pointer(_p.X6)) } - _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_p)) + _sqlite3DbFreeNN(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_p)) return _rc } @@ -84551,9 +88226,12 @@ func init() { crt.Xstrncpy(nil, &_whereLoopAddVirtualØ00__func__Ø000[0], str(104994), 20) } -// Allocate and populate an sqlite3_index_info structure. It is the -// responsibility of the caller to eventually release the structure -// by passing the pointer returned by this function to sqlite3_free(). +// C comment +// /* +// ** Allocate and populate an sqlite3_index_info structure. It is the +// ** responsibility of the caller to eventually release the structure +// ** by passing the pointer returned by this function to sqlite3_free(). +// */ func _allocateIndexInfo(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _mUnusable uint64, _pSrc *TSrcList_item, _pOrderBy *XExprList, _pmNoOmit *uint16) (r0 *Xsqlite3_index_info) { var _i, _j, _nTerm, _nOrderBy, _2_n int32 var _mNoOmit uint16 @@ -84566,13 +88244,13 @@ func _allocateIndexInfo(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _mUnu _mNoOmit = u16(0) *func() **XWhereTerm { _i = store1(&_nTerm, i32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.X5) _0: - if _i >= (_pWC.X3) { + if _i >= _pWC.X3 { goto _3 } - if (_pTerm.X8) != (_pSrc.X11) { + if _pTerm.X8 != _pSrc.X11 { goto _1 } - if ((_pTerm.X11) & _mUnusable) != 0 { + if (_pTerm.X11 & _mUnusable) != 0 { goto _1 } func() { @@ -84588,7 +88266,7 @@ _0: goto _1 } func() { - if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(-1) { + if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))) < i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131253), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105057))) crt.X__builtin_abort(tls) } @@ -84608,8 +88286,8 @@ _13: if _i >= _2_n { goto _16 } - _3_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_i))).X0) - if (int32(_3_pExpr.X0) != i32(152)) || ((_3_pExpr.X8) != (_pSrc.X11)) { + _3_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_i))).X0) + if (int32(_3_pExpr.X0) != i32(152)) || (_3_pExpr.X8 != _pSrc.X11) { goto _16 } _i += 1 @@ -84624,23 +88302,23 @@ _12: _sqlite3ErrorMsg(tls, _pParse, str(59419)) return nil } - _pIdxCons = (*Tsqlite3_index_constraint)(unsafe.Pointer((*Xsqlite3_index_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxInfo)) + 96*uintptr(i32(1)))))) - _pIdxOrderBy = (*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_nTerm))))) - _pUsage = (*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_nOrderBy))) - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X0))) = _nTerm - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X2))) = _nOrderBy - *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1))))) = _pIdxCons - *(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X3))))) = _pIdxOrderBy - *(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X4))))) = _pUsage + _pIdxCons = (*Tsqlite3_index_constraint)(unsafe.Pointer((*Xsqlite3_index_info)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxInfo)) + 96*uintptr(i32(1)))))) + _pIdxOrderBy = (*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_nTerm))))) + _pUsage = (*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxOrderBy)) + 8*uintptr(_nOrderBy))) + *(*int32)(unsafe.Pointer(&_pIdxInfo.X0)) = _nTerm + *(*int32)(unsafe.Pointer(&_pIdxInfo.X2)) = _nOrderBy + *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdxInfo.X1)))) = _pIdxCons + *(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdxInfo.X3)))) = _pIdxOrderBy + *(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdxInfo.X4)))) = _pUsage *func() **XWhereTerm { _i = store1(&_j, i32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.X5) _21: - if _i >= (_pWC.X3) { + if _i >= _pWC.X3 { goto _24 } - if (_pTerm.X8) != (_pSrc.X11) { + if _pTerm.X8 != _pSrc.X11 { goto _22 } - if ((_pTerm.X11) & _mUnusable) != 0 { + if (_pTerm.X11 & _mUnusable) != 0 { goto _22 } func() { @@ -84656,13 +88334,13 @@ _21: goto _22 } func() { - if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(-1) { + if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))) < i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131309), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105057))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X0))) = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))) - *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X3))) = _i + *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_j))).X0))) = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))) + *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_j))).X3))) = _i _6_op = uint8(int32(uint8(_pTerm.X4)) & i32(8191)) if int32(_6_op) == i32(1) { _6_op = uint8(i32(2)) @@ -84670,7 +88348,7 @@ _21: if int32(_6_op) == i32(64) { _6_op = _pTerm.X6 } - *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = _6_op + *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_j))).X1))) = _6_op i32(0) i32(0) i32(0) @@ -84694,10 +88372,10 @@ _21: } } if int32(_6_op) == i32(16) { - *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(8)) + *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(8)) } if int32(_6_op) == i32(4) { - *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(32)) + *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(32)) } _38: _j += 1 @@ -84710,9 +88388,9 @@ _42: if _i >= _nOrderBy { goto _45 } - _9_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_i))).X0) - *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_i))).X0))) = int32(_9_pExpr.X9) - *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_i))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_i))).X3 + _9_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_i))).X0) + *(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxOrderBy)) + 8*uintptr(_i))).X0))) = int32(_9_pExpr.X9) + *(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdxOrderBy)) + 8*uintptr(_i))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_i))).X3 _i += 1 goto _42 _45: @@ -84726,7 +88404,10 @@ func init() { crt.Xstrncpy(nil, &_allocateIndexInfoØ00__func__Ø000[0], str(105149), 18) } -// Increase the memory allocation for pLoop->aLTerm[] to be at least n. +// C comment +// /* +// ** Increase the memory allocation for pLoop->aLTerm[] to be at least n. +// */ func _whereLoopResize(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop, _n int32) (r0 int32) { var _paNew **XWhereTerm if int32(_p.X12) >= _n { @@ -84737,33 +88418,36 @@ func _whereLoopResize(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop, _n int32) (r0 if _paNew == nil { return _sqlite3NomemError(tls, i32(132201)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_paNew), (unsafe.Pointer)(_p.X13), u64(8)*uint64(_p.X12)) - if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p.X13)) + crt.Xmemcpy(tls, unsafe.Pointer(_paNew), unsafe.Pointer(_p.X13), u64(8)*uint64(_p.X12)) + if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) { + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.X13)) } - *(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _paNew - *(*uint16)(unsafe.Pointer(&(_p.X12))) = uint16(_n) + *(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _paNew + *(*uint16)(unsafe.Pointer(&_p.X12)) = uint16(_n) return i32(0) } -// Argument pIdxInfo is already populated with all constraints that may -// be used by the virtual table identified by pBuilder->pNew->iTab. This -// function marks a subset of those constraints usable, invokes the -// xBestIndex method and adds the returned plan to pBuilder. -// -// A constraint is marked usable if: -// -// * Argument mUsable indicates that its prerequisites are available, and -// -// * It is not one of the operators specified in the mExclude mask passed -// as the fourth argument (which in practice is either WO_IN or 0). -// -// Argument mPrereq is a mask of tables that must be scanned before the -// virtual table in question. These are added to the plans prerequisites -// before it is added to pBuilder. -// -// Output parameter *pbIn is set to true if the plan added to pBuilder -// uses one or more WO_IN terms, or false otherwise. +// C comment +// /* +// ** Argument pIdxInfo is already populated with all constraints that may +// ** be used by the virtual table identified by pBuilder->pNew->iTab. This +// ** function marks a subset of those constraints usable, invokes the +// ** xBestIndex method and adds the returned plan to pBuilder. +// ** +// ** A constraint is marked usable if: +// ** +// ** * Argument mUsable indicates that its prerequisites are available, and +// ** +// ** * It is not one of the operators specified in the mExclude mask passed +// ** as the fourth argument (which in practice is either WO_IN or 0). +// ** +// ** Argument mPrereq is a mask of tables that must be scanned before the +// ** virtual table in question. These are added to the plans prerequisites +// ** before it is added to pBuilder. +// ** +// ** Output parameter *pbIn is set to true if the plan added to pBuilder +// ** uses one or more WO_IN terms, or false otherwise. +// */ func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUsable uint64, _mExclude uint16, _pIdxInfo *Xsqlite3_index_info, _mNoOmit uint16, _pbIn *int32) (r0 int32) { var _i, _mxTerm, _rc, _nConstraint, _3_iTerm, _4_j int32 var _pSrc *TSrcList_item @@ -84778,7 +88462,7 @@ func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrere _rc = i32(0) _pNew = (*XWhereLoop)(_pBuilder.X3) _pParse = (*XParse)((*XWhereInfo)(_pBuilder.X0).X0) - _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pBuilder.X0).X1).X2))))) + 112*uintptr(_pNew.X3))) + _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pBuilder.X0).X1).X2))))) + 112*uintptr(_pNew.X3))) _nConstraint = _pIdxInfo.X0 func() { if (_mUsable & _mPrereq) != _mPrereq { @@ -84787,35 +88471,35 @@ func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrere } }() *_pbIn = i32(0) - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq - _pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1))))) + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = _mPrereq + _pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdxInfo.X1)))) _i = i32(0) _2: if _i >= _nConstraint { goto _5 } _1_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_pIdxCons.X3))) - *(*uint8)(unsafe.Pointer(&(_pIdxCons.X2))) = uint8(i32(0)) - if (((_1_pTerm.X11) & _mUsable) == (_1_pTerm.X11)) && ((int32(_1_pTerm.X4) & int32(_mExclude)) == i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pIdxCons.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pIdxCons.X2)) = uint8(i32(0)) + if ((_1_pTerm.X11 & _mUsable) == _1_pTerm.X11) && ((int32(_1_pTerm.X4) & int32(_mExclude)) == i32(0)) { + *(*uint8)(unsafe.Pointer(&_pIdxCons.X2)) = uint8(i32(1)) } *(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12) goto _2 _5: - crt.Xmemset(tls, (unsafe.Pointer)(_pUsage), i32(0), u64(8)*uint64(_nConstraint)) + crt.Xmemset(tls, unsafe.Pointer(_pUsage), i32(0), u64(8)*uint64(_nConstraint)) func() { - if (_pIdxInfo.X7) != i32(0) { + if _pIdxInfo.X7 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133418), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105196))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pIdxInfo.X6))) = nil - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X5))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X8))) = i32(0) - *(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(5e+98) - *(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(25)) - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X11))) = i32(0) - *(*uint64)(unsafe.Pointer(&(_pIdxInfo.X12))) = uint64(int64(_pSrc.X14)) + *(**int8)(unsafe.Pointer(&_pIdxInfo.X6)) = nil + *(*int32)(unsafe.Pointer(&_pIdxInfo.X5)) = i32(0) + *(*int32)(unsafe.Pointer(&_pIdxInfo.X8)) = i32(0) + *(*float64)(unsafe.Pointer(&_pIdxInfo.X9)) = float64(5e+98) + *(*int64)(unsafe.Pointer(&_pIdxInfo.X10)) = int64(i32(25)) + *(*int32)(unsafe.Pointer(&_pIdxInfo.X11)) = i32(0) + *(*uint64)(unsafe.Pointer(&_pIdxInfo.X12)) = uint64(int64(_pSrc.X14)) _rc = _vtabBestIndex(tls, _pParse, (*XTable)(_pSrc.X4), _pIdxInfo) if _rc != 0 { return _rc @@ -84832,30 +88516,30 @@ _13: if _i >= _nConstraint { goto _16 } - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(_i))) = nil + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(_i))) = nil _i += 1 goto _13 _16: - *(*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3))) = uint16(i32(0)) - _pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1))))) + *(*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X3))) = uint16(i32(0)) + _pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdxInfo.X1)))) _i = i32(0) _17: if _i >= _nConstraint { goto _20 } - if store1(&_3_iTerm, ((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pUsage))+8*uintptr(_i))).X0)-i32(1)) < i32(0) { + if store1(&_3_iTerm, ((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(_pUsage))+8*uintptr(_i))).X0)-i32(1)) < i32(0) { goto _21 } _4_j = _pIdxCons.X3 - if ((((_3_iTerm >= _nConstraint) || (_4_j < i32(0))) || (_4_j >= (_pWC.X3))) || ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(_3_iTerm)))) != nil)) || (int32(_pIdxCons.X2) == i32(0)) { + if ((((_3_iTerm >= _nConstraint) || (_4_j < i32(0))) || (_4_j >= _pWC.X3)) || ((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(_3_iTerm)))) != nil)) || (int32(_pIdxCons.X2) == i32(0)) { _rc = i32(1) _sqlite3ErrorMsg(tls, _pParse, str(105252), unsafe.Pointer((*XTable)(_pSrc.X4).X0)) return _rc } _4_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_4_j))) { - p := (*uint64)(unsafe.Pointer(&(_pNew.X0))) - *p = (*p) | (_4_pTerm.X11) + p := (*uint64)(unsafe.Pointer(&_pNew.X0)) + *p = (*p) | _4_pTerm.X11 sink17(*p) } func() { @@ -84864,21 +88548,21 @@ _17: crt.X__builtin_abort(tls) } }() - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(_3_iTerm))) = _4_pTerm + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(_3_iTerm))) = _4_pTerm if _3_iTerm > _mxTerm { _mxTerm = _3_iTerm } - if (_3_iTerm < i32(16)) && (((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pUsage)) + 8*uintptr(_i))).X1) != 0) { + if (_3_iTerm < i32(16)) && (((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(unsafe.Pointer(_pUsage)) + 8*uintptr(_i))).X1) != 0) { { - p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3))) + p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X3))) *p = uint16(int32(*p) | (i32(1) << uint(_3_iTerm))) sink14(*p) } } if (int32(_4_pTerm.X4) & i32(1)) != i32(0) { - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X8))) = i32(0) + *(*int32)(unsafe.Pointer(&_pIdxInfo.X8)) = i32(0) { - p := (*int32)(unsafe.Pointer(&(_pIdxInfo.X11))) + p := (*int32)(unsafe.Pointer(&_pIdxInfo.X11)) *p = (*p) & i32(-2) sink1(*p) } @@ -84895,48 +88579,48 @@ _21: goto _17 _20: { - p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3))) + p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X3))) *p = uint16(int32(*p) & (^int32(_mNoOmit))) sink14(*p) } - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(_mxTerm + i32(1)) + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = uint16(_mxTerm + i32(1)) func() { if int32(_pNew.X10) > int32(_pNew.X12) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133477), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105319))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _pIdxInfo.X5 - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(_pIdxInfo.X7) - *(*int32)(unsafe.Pointer(&(_pIdxInfo.X7))) = i32(0) - *(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))) = _pIdxInfo.X6 - *(*int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = int8(func() int32 { - if (_pIdxInfo.X8) != 0 { - return (_pIdxInfo.X2) + *(*int32)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = _pIdxInfo.X5 + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = uint8(_pIdxInfo.X7) + *(*int32)(unsafe.Pointer(&_pIdxInfo.X7)) = i32(0) + *(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X4))) = _pIdxInfo.X6 + *(*int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = int8(func() int32 { + if _pIdxInfo.X8 != 0 { + return _pIdxInfo.X2 } return i32(0) }()) - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstFromDouble(tls, _pIdxInfo.X9) - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _sqlite3LogEst(tls, uint64(_pIdxInfo.X10)) - if ((_pIdxInfo.X11) & i32(1)) != 0 { + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = _sqlite3LogEstFromDouble(tls, _pIdxInfo.X9) + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _sqlite3LogEst(tls, uint64(_pIdxInfo.X10)) + if (_pIdxInfo.X11 & i32(1)) != 0 { { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(4096)) sink5(*p) } goto _40 } { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) & uint32(i32(-4097)) sink5(*p) } _40: _rc = _whereLoopInsert(tls, _pBuilder, _pNew) - if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1) != 0 { - Xsqlite3_free(tls, (unsafe.Pointer)((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4)) - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(i32(0)) + if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1) != 0 { + Xsqlite3_free(tls, unsafe.Pointer((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X4)) + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = uint8(i32(0)) } return _rc } @@ -84947,25 +88631,29 @@ func init() { crt.Xstrncpy(nil, &_whereLoopAddVirtualOneØ00__func__Ø000[0], str(105346), 23) } -// The table object reference passed as the second argument to this function -// must represent a virtual table. This function invokes the xBestIndex() -// method of the virtual table with the sqlite3_index_info object that -// comes in as the 3rd argument to this function. -// -// If an error occurs, pParse is populated with an error message and a -// non-zero value is returned. Otherwise, 0 is returned and the output -// part of the sqlite3_index_info structure is left populated. -// -// Whether or not an error is returned, it is the responsibility of the -// caller to eventually free p->idxStr if p->needToFreeIdxStr indicates -// that this is required. +// C comment +// /* +// ** The table object reference passed as the second argument to this function +// ** must represent a virtual table. This function invokes the xBestIndex() +// ** method of the virtual table with the sqlite3_index_info object that +// ** comes in as the 3rd argument to this function. +// ** +// ** If an error occurs, pParse is populated with an error message and a +// ** non-zero value is returned. Otherwise, 0 is returned and the output +// ** part of the sqlite3_index_info structure is left populated. +// ** +// ** Whether or not an error is returned, it is the responsibility of the +// ** caller to eventually free p->idxStr if p->needToFreeIdxStr indicates +// ** that this is required. +// */ func _vtabBestIndex(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _p *Xsqlite3_index_info) (r0 int32) { var _rc int32 var _pVtab *Xsqlite3_vtab _pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.X0), _pTab).X2) - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32 - }{((*Xsqlite3_module)(_pVtab.X0).X3)})))(tls, _pVtab, _p) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32 { + v := (*Xsqlite3_module)(_pVtab.X0).X3 + return *(*func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32)(unsafe.Pointer(&v)) + }()(tls, _pVtab, _p) if _rc == i32(0) { goto _0 } @@ -84973,20 +88661,23 @@ func _vtabBestIndex(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _p *Xsqlite3_i _sqlite3OomFault(tls, (*Xsqlite3)(_pParse.X0)) goto _4 } - if (_pVtab.X2) == nil { + if _pVtab.X2 == nil { _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc))) goto _4 } _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_pVtab.X2)) _4: _0: - Xsqlite3_free(tls, (unsafe.Pointer)(_pVtab.X2)) - *(**int8)(unsafe.Pointer(&(_pVtab.X2))) = nil + Xsqlite3_free(tls, unsafe.Pointer(_pVtab.X2)) + *(**int8)(unsafe.Pointer(&_pVtab.X2)) = nil return _pParse.X16 } -// Convert a double into a LogEst -// In other words, compute an approximation for 10*log2(x). +// C comment +// /* +// ** Convert a double into a LogEst +// ** In other words, compute an approximation for 10*log2(x). +// */ func _sqlite3LogEstFromDouble(tls *crt.TLS, _x float64) (r0 int16) { var _e int16 var _a uint64 @@ -84997,33 +88688,36 @@ func _sqlite3LogEstFromDouble(tls *crt.TLS, _x float64) (r0 int16) { if _x <= float64(i32(2000000000)) { return _sqlite3LogEst(tls, uint64(_x)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(&_a), (unsafe.Pointer)(&_x), uint64(i32(8))) + crt.Xmemcpy(tls, unsafe.Pointer(&_a), unsafe.Pointer(&_x), uint64(i32(8))) _e = int16((_a >> uint(i32(52))) - uint64(i32(1022))) return int16(int32(_e) * i32(10)) } -// Insert or replace a WhereLoop entry using the template supplied. -// -// An existing WhereLoop entry might be overwritten if the new template -// is better and has fewer dependencies. Or the template will be ignored -// and no insert will occur if an existing WhereLoop is faster and has -// fewer dependencies than the template. Otherwise a new WhereLoop is -// added based on the template. -// -// If pBuilder->pOrSet is not NULL then we care about only the -// prerequisites and rRun and nOut costs of the N best loops. That -// information is gathered in the pBuilder->pOrSet object. This special -// processing mode is used only for OR clause processing. -// -// When accumulating multiple loops (when pBuilder->pOrSet is NULL) we -// still might overwrite similar loops with the new template if the -// new template is better. Loops may be overwritten if the following -// conditions are met: -// -// (1) They have the same iTab. -// (2) They have the same iSortIdx. -// (3) The template has same or fewer dependencies than the current loop -// (4) The template has the same or lower cost than the current loop +// C comment +// /* +// ** Insert or replace a WhereLoop entry using the template supplied. +// ** +// ** An existing WhereLoop entry might be overwritten if the new template +// ** is better and has fewer dependencies. Or the template will be ignored +// ** and no insert will occur if an existing WhereLoop is faster and has +// ** fewer dependencies than the template. Otherwise a new WhereLoop is +// ** added based on the template. +// ** +// ** If pBuilder->pOrSet is not NULL then we care about only the +// ** prerequisites and rRun and nOut costs of the N best loops. That +// ** information is gathered in the pBuilder->pOrSet object. This special +// ** processing mode is used only for OR clause processing. +// ** +// ** When accumulating multiple loops (when pBuilder->pOrSet is NULL) we +// ** still might overwrite similar loops with the new template if the +// ** new template is better. Loops may be overwritten if the following +// ** conditions are met: +// ** +// ** (1) They have the same iTab. +// ** (2) They have the same iSortIdx. +// ** (3) The template has same or fewer dependencies than the current loop +// ** (4) The template has the same or lower cost than the current loop +// */ func _whereLoopInsert(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pTemplate *XWhereLoop) (r0 int32) { var _rc int32 var _db *Xsqlite3 @@ -85036,14 +88730,14 @@ func _whereLoopInsert(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pTemplate *XW if (*XWhereOrSet)(_pBuilder.X4) == nil { goto _0 } - if (_pTemplate.X10) != 0 { + if _pTemplate.X10 != 0 { _whereOrInsert(tls, (*XWhereOrSet)(_pBuilder.X4), _pTemplate.X0, _pTemplate.X6, _pTemplate.X7) } return i32(0) _0: _whereLoopAdjustCost(tls, (*XWhereLoop)(_pWInfo.X19), _pTemplate) - _ppPrev = _whereLoopFindLesser(tls, (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X19))))), _pTemplate) + _ppPrev = _whereLoopFindLesser(tls, (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X19)))), _pTemplate) if _ppPrev == nil { return i32(0) } @@ -85056,10 +88750,10 @@ _0: return _sqlite3NomemError(tls, i32(132499)) } _whereLoopInit(tls, _p) - *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = nil + *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X14)))) = nil goto _6 _4: - _6_ppTail = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) + _6_ppTail = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X14)))) _7: if (*_6_ppTail) == nil { goto _8 @@ -85078,52 +88772,55 @@ _7: _8: _6: _rc = _whereLoopXfer(tls, _db, _p, _pTemplate) - if ((_p.X9) & uint32(i32(1024))) != uint32(i32(0)) { + if (_p.X9 & uint32(i32(1024))) != uint32(i32(0)) { goto _11 } - _8_pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4) - if (_8_pIndex != nil) && ((_8_pIndex.X11) == i32(0)) { - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))))) = nil + _8_pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4) + if (_8_pIndex != nil) && (_8_pIndex.X11 == i32(0)) { + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4))))) = nil } _11: return _rc } -// Try to insert a new prerequisite/cost entry into the WhereOrSet pSet. -// -// The new entry might overwrite an existing entry, or it might be -// appended, or it might be discarded. Do whatever is the right thing -// so that pSet keeps the N_OR_COST best entries seen so far. +// C comment +// /* +// ** Try to insert a new prerequisite/cost entry into the WhereOrSet pSet. +// ** +// ** The new entry might overwrite an existing entry, or it might be +// ** appended, or it might be discarded. Do whatever is the right thing +// ** so that pSet keeps the N_OR_COST best entries seen so far. +// */ func _whereOrInsert(tls *crt.TLS, _pSet *XWhereOrSet, _prereq uint64, _rRun int16, _nOut int16) (r0 int32) { var _i uint16 var _p *XWhereOrCost - *func() **XWhereOrCost { _i = _pSet.X0; return &_p }() = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))) + *func() **XWhereOrCost { _i = _pSet.X0; return &_p }() = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSet.X1)))) _0: if int32(_i) <= i32(0) { goto _3 } - if (int32(_rRun) <= int32(_p.X1)) && ((_prereq & (_p.X0)) == _prereq) { + if (int32(_rRun) <= int32(_p.X1)) && ((_prereq & _p.X0) == _prereq) { goto _whereOrInsert_done } - if (int32(_p.X1) <= int32(_rRun)) && (((_p.X0) & _prereq) == (_p.X0)) { + if (int32(_p.X1) <= int32(_rRun)) && ((_p.X0 & _prereq) == _p.X0) { return i32(0) } *(*uintptr)(unsafe.Pointer(func() **XWhereOrCost { _i -= 1; return &_p }())) += uintptr(16) goto _0 _3: if int32(_pSet.X0) < i32(3) { - _p = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))) + 16*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pSet.X0))), uint16(1))))) - *(*int16)(unsafe.Pointer(&(_p.X2))) = _nOut + _p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSet.X1)))) + 16*uintptr(postInc14((*uint16)(unsafe.Pointer(&_pSet.X0)), uint16(1))))) + *(*int16)(unsafe.Pointer(&_p.X2)) = _nOut goto _whereOrInsert_done } - _p = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))) + _p = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSet.X1)))) _i = uint16(i32(1)) _10: if int32(_i) >= int32(_pSet.X0) { goto _13 } - if int32(_p.X1) > int32((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1)))))+16*uintptr(_i))).X1) { - _p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))))) + uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(_i)*uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(16))))))))))) + if int32(_p.X1) > int32((*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSet.X1))))+16*uintptr(_i))).X1) { + _p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSet.X1)))))) + uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(_i)*uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(16))))))))))) } _i += 1 goto _10 @@ -85132,28 +88829,31 @@ _13: return i32(0) } _whereOrInsert_done: - *(*uint64)(unsafe.Pointer(&(_p.X0))) = _prereq - *(*int16)(unsafe.Pointer(&(_p.X1))) = _rRun + *(*uint64)(unsafe.Pointer(&_p.X0)) = _prereq + *(*int16)(unsafe.Pointer(&_p.X1)) = _rRun if int32(_p.X2) > int32(_nOut) { - *(*int16)(unsafe.Pointer(&(_p.X2))) = _nOut + *(*int16)(unsafe.Pointer(&_p.X2)) = _nOut } return i32(1) } -// Try to adjust the cost of WhereLoop pTemplate upwards or downwards so -// that: -// -// (1) pTemplate costs less than any other WhereLoops that are a proper -// subset of pTemplate -// -// (2) pTemplate costs more than any other WhereLoops for which pTemplate -// is a proper subset. -// -// To say "WhereLoop X is a proper subset of Y" means that X uses fewer -// WHERE clause terms than Y and that every WHERE clause term used by X is -// also used by Y. +// C comment +// /* +// ** Try to adjust the cost of WhereLoop pTemplate upwards or downwards so +// ** that: +// ** +// ** (1) pTemplate costs less than any other WhereLoops that are a proper +// ** subset of pTemplate +// ** +// ** (2) pTemplate costs more than any other WhereLoops for which pTemplate +// ** is a proper subset. +// ** +// ** To say "WhereLoop X is a proper subset of Y" means that X uses fewer +// ** WHERE clause terms than Y and that every WHERE clause term used by X is +// ** also used by Y. +// */ func _whereLoopAdjustCost(tls *crt.TLS, _p *XWhereLoop, _pTemplate *XWhereLoop) { - if ((_pTemplate.X9) & uint32(i32(512))) == uint32(i32(0)) { + if (_pTemplate.X9 & uint32(i32(512))) == uint32(i32(0)) { return } _0: @@ -85163,17 +88863,17 @@ _0: if int32(_p.X3) != int32(_pTemplate.X3) { goto _2 } - if ((_p.X9) & uint32(i32(512))) == uint32(i32(0)) { + if (_p.X9 & uint32(i32(512))) == uint32(i32(0)) { goto _2 } if _whereLoopCheaperProperSubset(tls, _p, _pTemplate) != 0 { - *(*int16)(unsafe.Pointer(&(_pTemplate.X6))) = _p.X6 - *(*int16)(unsafe.Pointer(&(_pTemplate.X7))) = int16(int32(_p.X7) - i32(1)) + *(*int16)(unsafe.Pointer(&_pTemplate.X6)) = _p.X6 + *(*int16)(unsafe.Pointer(&_pTemplate.X7)) = int16(int32(_p.X7) - i32(1)) goto _9 } if _whereLoopCheaperProperSubset(tls, _pTemplate, _p) != 0 { - *(*int16)(unsafe.Pointer(&(_pTemplate.X6))) = _p.X6 - *(*int16)(unsafe.Pointer(&(_pTemplate.X7))) = int16(int32(_p.X7) + i32(1)) + *(*int16)(unsafe.Pointer(&_pTemplate.X6)) = _p.X6 + *(*int16)(unsafe.Pointer(&_pTemplate.X7)) = int16(int32(_p.X7) + i32(1)) } _9: _2: @@ -85182,21 +88882,24 @@ _2: _4: } -// Return TRUE if all of the following are true: -// -// (1) X has the same or lower cost that Y -// (2) X is a proper subset of Y -// (3) X skips at least as many columns as Y -// -// By "proper subset" we mean that X uses fewer WHERE clause terms -// than Y and that every WHERE clause term used by X is also used -// by Y. -// -// If X is a proper subset of Y then Y is a better choice and ought -// to have a lower cost. This routine returns TRUE when that cost -// relationship is inverted and needs to be adjusted. The third rule -// was added because if X uses skip-scan less than Y it still might -// deserve a lower cost even if it is a proper subset of Y. +// C comment +// /* +// ** Return TRUE if all of the following are true: +// ** +// ** (1) X has the same or lower cost that Y +// ** (2) X is a proper subset of Y +// ** (3) X skips at least as many columns as Y +// ** +// ** By "proper subset" we mean that X uses fewer WHERE clause terms +// ** than Y and that every WHERE clause term used by X is also used +// ** by Y. +// ** +// ** If X is a proper subset of Y then Y is a better choice and ought +// ** to have a lower cost. This routine returns TRUE when that cost +// ** relationship is inverted and needs to be adjusted. The third rule +// ** was added because if X uses skip-scan less than Y it still might +// ** deserve a lower cost even if it is a proper subset of Y. +// */ func _whereLoopCheaperProperSubset(tls *crt.TLS, _pX *XWhereLoop, _pY *XWhereLoop) (r0 int32) { var _i, _j int32 if (int32(_pX.X10) - int32(_pX.X11)) >= (int32(_pY.X10) - int32(_pY.X11)) { @@ -85220,7 +88923,7 @@ _5: if _i < i32(0) { goto _8 } - if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pX.X13)) + 8*uintptr(_i)))) == nil { + if (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pX.X13)) + 8*uintptr(_i)))) == nil { goto _6 } _j = int32(_pY.X10) - i32(1) @@ -85228,7 +88931,7 @@ _10: if _j < i32(0) { goto _13 } - if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pY.X13)) + 8*uintptr(_j)))) == (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pX.X13)) + 8*uintptr(_i)))) { + if (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pY.X13)) + 8*uintptr(_j)))) == (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pX.X13)) + 8*uintptr(_i)))) { goto _13 } _j -= 1 @@ -85244,17 +88947,20 @@ _8: return i32(1) } -// Search the list of WhereLoops in *ppPrev looking for one that can be -// supplanted by pTemplate. -// -// Return NULL if the WhereLoop list contains an entry that can supplant -// pTemplate, in other words if pTemplate does not belong on the list. -// -// If pX is a WhereLoop that pTemplate can supplant, then return the -// link that points to pX. -// -// If pTemplate cannot supplant any existing element of the list but needs -// to be added to the list, then return a pointer to the tail of the list. +// C comment +// /* +// ** Search the list of WhereLoops in *ppPrev looking for one that can be +// ** supplanted by pTemplate. +// ** +// ** Return NULL if the WhereLoop list contains an entry that can supplant +// ** pTemplate, in other words if pTemplate does not belong on the list. +// ** +// ** If pX is a WhereLoop that pTemplate can supplant, then return the +// ** link that points to pX. +// ** +// ** If pTemplate cannot supplant any existing element of the list but needs +// ** to be added to the list, then return a pointer to the tail of the list. +// */ func _whereLoopFindLesser(tls *crt.TLS, _ppPrev **XWhereLoop, _pTemplate *XWhereLoop) (r0 **XWhereLoop) { var _p *XWhereLoop _p = *_ppPrev @@ -85277,13 +88983,13 @@ _0: crt.X__builtin_abort(tls) } }() - if ((((((_p.X9) & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pTemplate.X11) == i32(0))) && (((_pTemplate.X9) & uint32(i32(512))) != uint32(i32(0)))) && (((_pTemplate.X9) & uint32(i32(1))) != uint32(i32(0)))) && (((_p.X0) & (_pTemplate.X0)) == (_pTemplate.X0)) { + if (((((_p.X9 & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pTemplate.X11) == i32(0))) && ((_pTemplate.X9 & uint32(i32(512))) != uint32(i32(0)))) && ((_pTemplate.X9 & uint32(i32(1))) != uint32(i32(0)))) && ((_p.X0 & _pTemplate.X0) == _pTemplate.X0) { goto _3 } - if (((((_p.X0) & (_pTemplate.X0)) == (_p.X0)) && (int32(_p.X5) <= int32(_pTemplate.X5))) && (int32(_p.X6) <= int32(_pTemplate.X6))) && (int32(_p.X7) <= int32(_pTemplate.X7)) { + if ((((_p.X0 & _pTemplate.X0) == _p.X0) && (int32(_p.X5) <= int32(_pTemplate.X5))) && (int32(_p.X6) <= int32(_pTemplate.X6))) && (int32(_p.X7) <= int32(_pTemplate.X7)) { return nil } - if ((((_p.X0) & (_pTemplate.X0)) == (_pTemplate.X0)) && (int32(_p.X6) >= int32(_pTemplate.X6))) && (int32(_p.X7) >= int32(_pTemplate.X7)) { + if (((_p.X0 & _pTemplate.X0) == _pTemplate.X0) && (int32(_p.X6) >= int32(_pTemplate.X6))) && (int32(_p.X7) >= int32(_pTemplate.X7)) { func() { if int32(_p.X5) < int32(_pTemplate.X5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132405), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000))), unsafe.Pointer(str(105438))) @@ -85294,7 +89000,7 @@ _0: } _1: *func() **XWhereLoop { - _ppPrev = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) + _ppPrev = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X14)))) return &_p }() = *_ppPrev goto _0 @@ -85308,95 +89014,110 @@ func init() { crt.Xstrncpy(nil, &_whereLoopFindLesserØ00__func__Ø000[0], str(105467), 20) } -// Delete a WhereLoop object +// C comment +// /* +// ** Delete a WhereLoop object +// */ func _whereLoopDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) { _whereLoopClear(tls, _db, _p) - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p)) } -// Deallocate internal memory used by a WhereLoop object +// C comment +// /* +// ** Deallocate internal memory used by a WhereLoop object +// */ func _whereLoopClear(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) { - if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) { - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p.X13)) + if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&_p.X15)))) { + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_p.X13)) } _whereLoopClearUnion(tls, _db, _p) _whereLoopInit(tls, _p) } -// Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. +// C comment +// /* +// ** Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact. +// */ func _whereLoopClearUnion(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) { - if ((_p.X9) & uint32(i32(17408))) == 0 { + if (_p.X9 & uint32(i32(17408))) == 0 { goto _0 } - if (((_p.X9) & uint32(i32(1024))) != uint32(i32(0))) && (((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X1) != 0) { - Xsqlite3_free(tls, (unsafe.Pointer)((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4)) - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X1))) = uint8(i32(0)) - *(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))) = nil + if ((_p.X9 & uint32(i32(1024))) != uint32(i32(0))) && (((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X1) != 0) { + Xsqlite3_free(tls, unsafe.Pointer((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4)) + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X1))) = uint8(i32(0)) + *(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4))) = nil goto _5 } - if (((_p.X9) & uint32(i32(16384))) != uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4) != nil) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4).X4)) - _sqlite3DbFreeNN(tls, _db, (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4) - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))))) = nil + if ((_p.X9 & uint32(i32(16384))) != uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4) != nil) { + _sqlite3DbFree(tls, _db, unsafe.Pointer((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4).X4)) + _sqlite3DbFreeNN(tls, _db, (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_p.X8)))).X4))))) = nil } _5: _0: } -// Transfer content from the second pLoop into the first. +// C comment +// /* +// ** Transfer content from the second pLoop into the first. +// */ func _whereLoopXfer(tls *crt.TLS, _db *Xsqlite3, _pTo *XWhereLoop, _pFrom *XWhereLoop) (r0 int32) { _whereLoopClearUnion(tls, _db, _pTo) if _whereLoopResize(tls, _db, _pTo, int32(_pFrom.X10)) != 0 { - crt.Xmemset(tls, (unsafe.Pointer)((*t62)(unsafe.Pointer(&(_pTo.X8)))), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer((*t62)(unsafe.Pointer(&_pTo.X8))), i32(0), u64(16)) return _sqlite3NomemError(tls, i32(132216)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u64(56)) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo.X13), (unsafe.Pointer)(_pFrom.X13), uint64(_pTo.X10)*u64(8)) - if ((_pFrom.X9) & uint32(i32(1024))) != 0 { - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pFrom.X8))))).X1))) = uint8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTo), unsafe.Pointer(_pFrom), u64(56)) + crt.Xmemcpy(tls, unsafe.Pointer(_pTo.X13), unsafe.Pointer(_pFrom.X13), uint64(_pTo.X10)*u64(8)) + if (_pFrom.X9 & uint32(i32(1024))) != 0 { + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pFrom.X8)))).X1))) = uint8(i32(0)) goto _3 } - if ((_pFrom.X9) & uint32(i32(16384))) != uint32(i32(0)) { - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pFrom.X8))))).X4))))) = nil + if (_pFrom.X9 & uint32(i32(16384))) != uint32(i32(0)) { + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pFrom.X8)))).X4))))) = nil } _3: return i32(0) } -// Add all WhereLoop objects for a single table of the join where the table -// is identified by pBuilder->pNew->iTab. That table is guaranteed to be -// a b-tree table, not a virtual table. -// -// The costs (WhereLoop.rRun) of the b-tree loops added by this function -// are calculated as follows: -// -// For a full scan, assuming the table (or index) contains nRow rows: -// -// cost = nRow * 3.0 // full-table scan -// cost = nRow * K // scan of covering index -// cost = nRow * (K+3.0) // scan of non-covering index -// -// where K is a value between 1.1 and 3.0 set based on the relative -// estimated average size of the index and table records. -// -// For an index scan, where nVisit is the number of index rows visited -// by the scan, and nSeek is the number of seek operations required on -// the index b-tree: -// -// cost = nSeek * (log(nRow) + K * nVisit) // covering index -// cost = nSeek * (log(nRow) + (K+3.0) * nVisit) // non-covering index -// -// Normally, nSeek is 1. nSeek values greater than 1 come about if the -// WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when -// implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans. -// -// The estimated values (nRow, nVisit, nSeek) often contain a large amount -// of uncertainty. For this reason, scoring is designed to pick plans that -// "do the least harm" if the estimates are inaccurate. For example, a -// log(nRow) factor is omitted from a non-covering index scan in order to -// bias the scoring in favor of using an index, since the worst-case -// performance of using an index is far better than the worst-case performance -// of a full table scan. +// C comment +// /* +// ** Add all WhereLoop objects for a single table of the join where the table +// ** is identified by pBuilder->pNew->iTab. That table is guaranteed to be +// ** a b-tree table, not a virtual table. +// ** +// ** The costs (WhereLoop.rRun) of the b-tree loops added by this function +// ** are calculated as follows: +// ** +// ** For a full scan, assuming the table (or index) contains nRow rows: +// ** +// ** cost = nRow * 3.0 // full-table scan +// ** cost = nRow * K // scan of covering index +// ** cost = nRow * (K+3.0) // scan of non-covering index +// ** +// ** where K is a value between 1.1 and 3.0 set based on the relative +// ** estimated average size of the index and table records. +// ** +// ** For an index scan, where nVisit is the number of index rows visited +// ** by the scan, and nSeek is the number of seek operations required on +// ** the index b-tree: +// ** +// ** cost = nSeek * (log(nRow) + K * nVisit) // covering index +// ** cost = nSeek * (log(nRow) + (K+3.0) * nVisit) // non-covering index +// ** +// ** Normally, nSeek is 1. nSeek values greater than 1 come about if the +// ** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when +// ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans. +// ** +// ** The estimated values (nRow, nVisit, nSeek) often contain a large amount +// ** of uncertainty. For this reason, scoring is designed to pick plans that +// ** "do the least harm" if the estimates are inaccurate. For example, a +// ** log(nRow) factor is omitted from a non-covering index scan in order to +// ** bias the scoring in favor of using an index, since the worst-case +// ** performance of using an index is far better than the worst-case performance +// ** of a full table scan. +// */ func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64) (r0 int32) { var _aiColumnPk, _rSize, _rLogSize, _16_nLookup int16 var _rc, _iSortIdx, _b, _16_ii, _16_iCur int32 @@ -85417,7 +89138,7 @@ func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uin _pNew = (*XWhereLoop)(_pBuilder.X3) _pWInfo = (*XWhereInfo)(_pBuilder.X0) _pTabList = (*XSrcList)(_pWInfo.X1) - _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.X3)*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(112))))))))))) + _pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.X3)*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(112))))))))))) _pTab = (*XTable)(_pSrc.X4) _pWC = (*XWhereClause)(_pBuilder.X1) func() { @@ -85426,33 +89147,33 @@ func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uin crt.X__builtin_abort(tls) } }() - if (*XIndex)(_pSrc.X16) != nil { + if _pSrc.X16 != nil { _pProbe = (*XIndex)(_pSrc.X16) goto _5 } - if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { _pProbe = (*XIndex)(_pTab.X2) goto _5 } - crt.Xmemset(tls, (unsafe.Pointer)(&_sPk), i32(0), u64(104)) - *(*uint16)(unsafe.Pointer(&(_sPk.X13))) = uint16(i32(1)) - *(*uint16)(unsafe.Pointer(&(_sPk.X14))) = uint16(i32(1)) - *(**int16)(unsafe.Pointer(&(_sPk.X1))) = &_aiColumnPk - *(**int16)(unsafe.Pointer(&(_sPk.X2))) = (*int16)(unsafe.Pointer(&_aiRowEstPk)) - *(*uint8)(unsafe.Pointer(&(_sPk.X15))) = uint8(i32(5)) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sPk.X3))))) = _pTab - *(*int16)(unsafe.Pointer(&(_sPk.X12))) = _pTab.X13 - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiRowEstPk)) + 2*uintptr(i32(0)))) = _pTab.X12 - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiRowEstPk)) + 2*uintptr(i32(1)))) = int16(i32(0)) + crt.Xmemset(tls, unsafe.Pointer(&_sPk), i32(0), u64(104)) + *(*uint16)(unsafe.Pointer(&_sPk.X13)) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_sPk.X14)) = uint16(i32(1)) + *(**int16)(unsafe.Pointer(&_sPk.X1)) = &_aiColumnPk + *(**int16)(unsafe.Pointer(&_sPk.X2)) = (*int16)(unsafe.Pointer(&_aiRowEstPk)) + *(*uint8)(unsafe.Pointer(&_sPk.X15)) = uint8(i32(5)) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sPk.X3)))) = _pTab + *(*int16)(unsafe.Pointer(&_sPk.X12)) = _pTab.X13 + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiRowEstPk)) + 2*uintptr(i32(0)))) = _pTab.X12 + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiRowEstPk)) + 2*uintptr(i32(1)))) = int16(i32(0)) _3_pFirst = (*XIndex)((*XTable)(_pSrc.X4).X2) - if int32((uint32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)<<uint(i32(31)))>>uint(i32(31))) == i32(0) { - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sPk.X5))))) = _3_pFirst + if int32((uint32((*t28)(unsafe.Pointer(&_pSrc.X9)).X1)<<uint(i32(31)))>>uint(i32(31))) == i32(0) { + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sPk.X5)))) = _3_pFirst } _pProbe = &_sPk _5: _rSize = _pTab.X12 _rLogSize = _estLog(tls, _rSize) - if (*XWhereOrSet)(_pBuilder.X4) != nil || (int32(_pWInfo.X10)&i32(32)) != i32(0) || (((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X6)&i32(1048576)) == i32(0) || (*XIndex)(_pSrc.X16) != nil || ((uint32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)<<uint(i32(31)))>>uint(i32(31))) != 0 || ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) || ((uint32(((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) != 0 || ((uint32(((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)>>uint(i32(5)))<<uint(i32(31)))>>uint(i32(31))) != 0 { + if _pBuilder.X4 != nil || (int32(_pWInfo.X10)&i32(32)) != i32(0) || (((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X6)&i32(1048576)) == i32(0) || (*XIndex)(_pSrc.X16) != nil || ((uint32((*t28)(unsafe.Pointer(&_pSrc.X9)).X1)<<uint(i32(31)))>>uint(i32(31))) != 0 || (_pTab.X9&uint32(i32(32))) != uint32(i32(0)) || ((uint32(((*t28)(unsafe.Pointer(&_pSrc.X9)).X1)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) != 0 || ((uint32(((*t28)(unsafe.Pointer(&_pSrc.X9)).X1)>>uint(i32(5)))<<uint(i32(31)))>>uint(i32(31))) != 0 { goto _14 } _5_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X3)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64))))))))))) @@ -85461,38 +89182,38 @@ _15: if _rc != i32(0) || crt.P2U(unsafe.Pointer(_5_pTerm)) >= crt.P2U(unsafe.Pointer(_5_pWCEnd)) { goto _19 } - if ((_5_pTerm.X11) & (_pNew.X1)) != 0 { + if (_5_pTerm.X11 & _pNew.X1) != 0 { goto _16 } if _termCanDriveIndex(tls, _5_pTerm, _pSrc, uint64(i32(0))) == 0 { goto _21 } - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = uint16(i32(1)) - *(*uint16)(unsafe.Pointer(&(_pNew.X11))) = uint16(i32(0)) - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))))) = nil - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(1)) - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(i32(0)))) = _5_pTerm - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16((int32(_rLogSize) + int32(_rSize)) + i32(4)) - if ((*XSelect)(_pTab.X3) == nil) && (((_pTab.X9) & uint32(i32(2))) == uint32(i32(0))) { + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&_pNew.X11)) = uint16(i32(0)) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X4))))) = nil + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = uint16(i32(1)) + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(i32(0)))) = _5_pTerm + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16((int32(_rLogSize) + int32(_rSize)) + i32(4)) + if ((*XSelect)(_pTab.X3) == nil) && ((_pTab.X9 & uint32(i32(2))) == uint32(i32(0))) { { - p := (*int16)(unsafe.Pointer(&(_pNew.X5))) + p := (*int16)(unsafe.Pointer(&_pNew.X5)) *p = int16(int32(*p) + i32(24)) sink18(*p) } } if int32(_pNew.X5) < i32(0) { - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) } - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = int16(i32(43)) + *(*int16)(unsafe.Pointer(&_pNew.X7)) = int16(i32(43)) func() { if i32(43) != int32(_sqlite3LogEst(tls, uint64(i32(20)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133227), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000))), unsafe.Pointer(str(105510))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _rLogSize, _pNew.X7) - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(16384)) - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq | (_5_pTerm.X11) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = _sqlite3LogEstAdd(tls, _rLogSize, _pNew.X7) + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(i32(16384)) + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = _mPrereq | _5_pTerm.X11 _rc = _whereLoopInsert(tls, _pBuilder, _pNew) _21: _16: @@ -85506,17 +89227,17 @@ _14: if ((*XExpr)(_pProbe.X9) != nil) && (_whereUsablePartialIndex(tls, _pSrc.X11, _pWC, (*XExpr)(_pProbe.X9)) == 0) { goto _28 } - _rSize = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(i32(0)))) - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&(_pNew.X11))) = uint16(i32(0)) - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(i32(0)) - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))))) = _pProbe + _rSize = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(i32(0)))) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_pNew.X11)) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = uint16(i32(0)) + *(*uint8)(unsafe.Pointer(&_pNew.X4)) = uint8(i32(0)) + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = _mPrereq + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _rSize + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X4))))) = _pProbe _b = _indexMightHelpWithOrderBy(tls, _pBuilder, _pProbe, _pSrc.X11) func() { if (int32(_pWInfo.X10)&i32(4)) != i32(0) && _b != i32(0) { @@ -85524,57 +89245,57 @@ _14: crt.X__builtin_abort(tls) } }() - if (_pProbe.X11) > i32(0) { + if _pProbe.X11 > i32(0) { goto _37 } - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(256)) - *(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(func() int32 { + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(i32(256)) + *(*uint8)(unsafe.Pointer(&_pNew.X4)) = uint8(func() int32 { if _b != 0 { return _iSortIdx } return i32(0) }()) - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16(int32(_rSize) + i32(16)) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = int16(int32(_rSize) + i32(16)) _whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize) _rc = _whereLoopInsert(tls, _pBuilder, _pNew) - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _rSize if _rc != 0 { goto _31 } goto _41 _37: - if ((uint32((_pProbe.X16)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(576)) + if ((uint32(_pProbe.X16>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(i32(576)) _12_m = uint64(i32(0)) goto _43 } - _12_m = (_pSrc.X14) & (^_columnsInIndex(tls, _pProbe)) - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(func() int32 { + _12_m = _pSrc.X14 & (^_columnsInIndex(tls, _pProbe)) + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(func() int32 { if _12_m == uint64(i32(0)) { return i32(576) } return i32(512) }()) _43: - if _b == 0 && ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) && (*XExpr)(_pProbe.X9) == nil && (_12_m != uint64(i32(0)) || int32((uint32((_pProbe.X16)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) || int32(_pProbe.X12) >= int32(_pTab.X13) || (int32(_pWInfo.X10)&i32(4)) != i32(0) || (_sqlite3Config.X4) == 0 || (int32((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X13)&i32(64)) != i32(0)) { + if _b == 0 && (_pTab.X9&uint32(i32(32))) == uint32(i32(0)) && (*XExpr)(_pProbe.X9) == nil && (_12_m != uint64(i32(0)) || int32((uint32(_pProbe.X16>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) || int32(_pProbe.X12) >= int32(_pTab.X13) || (int32(_pWInfo.X10)&i32(4)) != i32(0) || _sqlite3Config.X4 == 0 || (int32((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X13)&i32(64)) != i32(0)) { goto _54 } - *(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pNew.X4)) = uint8(func() int32 { if _b != 0 { return _iSortIdx } return i32(0) }()) - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16((int32(_rSize) + i32(1)) + ((i32(15) * int32(_pProbe.X12)) / int32(_pTab.X13))) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = int16((int32(_rSize) + i32(1)) + ((i32(15) * int32(_pProbe.X12)) / int32(_pTab.X13))) if _12_m == uint64(i32(0)) { goto _57 } _16_nLookup = int16(int32(_rSize) + i32(16)) _16_iCur = _pSrc.X11 - _16_pWC2 = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))) + _16_pWC2 = (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)) _16_ii = i32(0) _58: - if _16_ii >= (_16_pWC2.X3) { + if _16_ii >= _16_pWC2.X3 { goto _61 } _17_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_16_pWC2.X5) + 64*uintptr(_16_ii))) @@ -85601,26 +89322,26 @@ _64: _16_ii += 1 goto _58 _61: - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _pNew.X6, _16_nLookup) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = _sqlite3LogEstAdd(tls, _pNew.X6, _16_nLookup) _57: _whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize) _rc = _whereLoopInsert(tls, _pBuilder, _pNew) - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _rSize if _rc != 0 { goto _31 } _54: _41: - *(*uint32)(unsafe.Pointer(&(_pBuilder.X5))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_pBuilder.X5)) = uint32(i32(0)) _rc = _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(i32(0))) - if (_pBuilder.X5) == uint32(i32(1)) { + if _pBuilder.X5 == uint32(i32(1)) { { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) *p = (*p) | uint32(i32(256)) sink5(*p) } } - if (*XIndex)(_pSrc.X16) != nil { + if _pSrc.X16 != nil { goto _31 } _28: @@ -85641,7 +89362,10 @@ func init() { crt.Xstrncpy(nil, &_whereLoopAddBtreeØ00__func__Ø000[0], str(105588), 18) } -// Estimate the logarithm of the input value to base 2. +// C comment +// /* +// ** Estimate the logarithm of the input value to base 2. +// */ func _estLog(tls *crt.TLS, _N int16) (r0 int16) { return int16(func() int32 { if int32(_N) <= i32(10) { @@ -85651,32 +89375,37 @@ func _estLog(tls *crt.TLS, _N int16) (r0 int16) { }()) } -// 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. +// C comment +// /* +// ** Return TRUE if the WHERE clause term pTerm is of a form where it +// ** could be used with an index to access pSrc, assuming an appropriate +// ** index existed. +// */ func _termCanDriveIndex(tls *crt.TLS, _pTerm *XWhereTerm, _pSrc *TSrcList_item, _notReady uint64) (r0 int32) { var _aff int8 - if (_pTerm.X8) != (_pSrc.X11) { + if _pTerm.X8 != _pSrc.X11 { return i32(0) } if (int32(_pTerm.X4) & i32(130)) == i32(0) { return i32(0) } - if ((_pTerm.X11) & _notReady) != uint64(i32(0)) { + if (_pTerm.X11 & _notReady) != uint64(i32(0)) { return i32(0) } - if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(0) { + if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))) < i32(0) { return i32(0) } - _aff = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pSrc.X4).X1) + 32*uintptr(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))))).X4 + _aff = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pSrc.X4).X1) + 32*uintptr(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))))).X4 if _sqlite3IndexAffinityOk(tls, (*XExpr)(_pTerm.X0), _aff) == 0 { return i32(0) } return i32(1) } -// Check to see if a partial index with pPartIndexWhere can be used -// in the current query. Return true if it can be and false if not. +// C comment +// /* Check to see if a partial index with pPartIndexWhere can be used +// ** in the current query. Return true if it can be and false if not. +// */ func _whereUsablePartialIndex(tls *crt.TLS, _iTab int32, _pWC *XWhereClause, _pWhere *XExpr) (r0 int32) { var _i int32 var _2_pExpr *XExpr @@ -85693,11 +89422,11 @@ _0: _1: *func() **XWhereTerm { _i = i32(0); return &_pTerm }() = (*XWhereTerm)(_pWC.X5) _3: - if _i >= (_pWC.X3) { + if _i >= _pWC.X3 { goto _6 } _2_pExpr = (*XExpr)(_pTerm.X0) - if _sqlite3ExprImpliesExpr(tls, _2_pExpr, _pWhere, _iTab) != 0 && ((((_2_pExpr.X2) & uint32(i32(1))) == uint32(i32(0))) || (int32(_2_pExpr.X11) == _iTab)) { + if _sqlite3ExprImpliesExpr(tls, _2_pExpr, _pWhere, _iTab) != 0 && (((_2_pExpr.X2 & uint32(i32(1))) == uint32(i32(0))) || (int32(_2_pExpr.X11) == _iTab)) { return i32(1) } *(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(64) @@ -85706,24 +89435,27 @@ _6: return i32(0) } -// Return true if we can prove the pE2 will always be true if pE1 is -// true. Return false if we cannot complete the proof or if pE2 might -// be false. Examples: -// -// pE1: x==5 pE2: x==5 Result: true -// pE1: x>0 pE2: x==5 Result: false -// pE1: x=21 pE2: x=21 OR y=43 Result: true -// pE1: x!=123 pE2: x IS NOT NULL Result: true -// pE1: x!=?1 pE2: x IS NOT NULL Result: true -// pE1: x IS NULL pE2: x IS NOT NULL Result: false -// pE1: x IS ?2 pE2: x IS NOT NULL Reuslt: false -// -// When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has -// Expr.iTable<0 then assume a table number given by iTab. -// -// When in doubt, return false. Returning true might give a performance -// improvement. Returning false might cause a performance reduction, but -// it will always give the correct answer and is hence always safe. +// C comment +// /* +// ** Return true if we can prove the pE2 will always be true if pE1 is +// ** true. Return false if we cannot complete the proof or if pE2 might +// ** be false. Examples: +// ** +// ** pE1: x==5 pE2: x==5 Result: true +// ** pE1: x>0 pE2: x==5 Result: false +// ** pE1: x=21 pE2: x=21 OR y=43 Result: true +// ** pE1: x!=123 pE2: x IS NOT NULL Result: true +// ** pE1: x!=?1 pE2: x IS NOT NULL Result: true +// ** pE1: x IS NULL pE2: x IS NOT NULL Result: false +// ** pE1: x IS ?2 pE2: x IS NOT NULL Reuslt: false +// ** +// ** When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has +// ** Expr.iTable<0 then assume a table number given by iTab. +// ** +// ** When in doubt, return false. Returning true might give a performance +// ** improvement. Returning false might cause a performance reduction, but +// ** it will always give the correct answer and is hence always safe. +// */ func _sqlite3ExprImpliesExpr(tls *crt.TLS, _pE1 *XExpr, _pE2 *XExpr, _iTab int32) (r0 int32) { var _3_pX *XExpr if _sqlite3ExprCompare(tls, _pE1, _pE2, _iTab) == i32(0) { @@ -85743,17 +89475,20 @@ _6: return i32(0) } -// Return True if it is possible that pIndex might be useful in -// implementing the ORDER BY clause in pBuilder. -// -// Return False if pBuilder does not contain an ORDER BY clause or -// if there is no way for pIndex to be useful in implementing that -// ORDER BY clause. +// C comment +// /* +// ** Return True if it is possible that pIndex might be useful in +// ** implementing the ORDER BY clause in pBuilder. +// ** +// ** Return False if pBuilder does not contain an ORDER BY clause or +// ** if there is no way for pIndex to be useful in implementing that +// ** ORDER BY clause. +// */ func _indexMightHelpWithOrderBy(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pIndex *XIndex, _iCursor int32) (r0 int32) { var _ii, _jj int32 var _pOB, _aColExpr *XExprList var _1_pExpr *XExpr - if ((uint32((_pIndex.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pIndex.X16>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { return i32(0) } if store42(&_pOB, (*XExprList)((*XWhereInfo)(_pBuilder.X0).X2)) == nil { @@ -85761,11 +89496,11 @@ func _indexMightHelpWithOrderBy(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pIn } _ii = i32(0) _2: - if _ii >= (_pOB.X0) { + if _ii >= _pOB.X0 { goto _5 } - _1_pExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOB.X2)))))+32*uintptr(_ii))).X0)) - if int32(_1_pExpr.X0) != i32(152) || (_1_pExpr.X8) != _iCursor { + _1_pExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOB.X2))))+32*uintptr(_ii))).X0)) + if int32(_1_pExpr.X0) != i32(152) || _1_pExpr.X8 != _iCursor { goto _7 } if int32(_1_pExpr.X9) < i32(0) { @@ -85776,7 +89511,7 @@ _9: if _jj >= int32(_pIndex.X13) { goto _12 } - if int32(_1_pExpr.X9) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_jj)))) { + if int32(_1_pExpr.X9) == int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_jj)))) { return i32(1) } _jj += 1 @@ -85792,10 +89527,10 @@ _16: if _jj >= int32(_pIndex.X13) { goto _19 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_jj)))) != i32(-2) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_jj)))) != i32(-2) { goto _17 } - if _sqlite3ExprCompare(tls, _1_pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2)))))+32*uintptr(_jj))).X0), _iCursor) == i32(0) { + if _sqlite3ExprCompare(tls, _1_pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_aColExpr.X2))))+32*uintptr(_jj))).X0), _iCursor) == i32(0) { return i32(1) } _17: @@ -85809,43 +89544,46 @@ _5: return i32(0) } -// Adjust the WhereLoop.nOut value downward to account for terms of the -// WHERE clause that reference the loop but which are not used by an -// index. -// * -// For every WHERE clause term that is not used by the index -// and which has a truth probability assigned by one of the likelihood(), -// likely(), or unlikely() SQL functions, reduce the estimated number -// of output rows by the probability specified. -// -// TUNING: For every WHERE clause term that is not used by the index -// and which does not have an assigned truth probability, heuristics -// described below are used to try to estimate the truth probability. -// TODO --> Perhaps this is something that could be improved by better -// table statistics. -// -// Heuristic 1: Estimate the truth probability as 93.75%. The 93.75% -// value corresponds to -1 in LogEst notation, so this means decrement -// the WhereLoop.nOut field for every such WHERE clause term. -// -// Heuristic 2: If there exists one or more WHERE clause terms of the -// form "x==EXPR" and EXPR is not a constant 0 or 1, then make sure the -// final output row estimate is no greater than 1/4 of the total number -// of rows in the table. In other words, assume that x==EXPR will filter -// out at least 3 out of 4 rows. If EXPR is -1 or 0 or 1, then maybe the -// "x" column is boolean or else -1 or 0 or 1 is a common default value -// on the "x" column and so in that case only cap the output row estimate -// at 1/2 instead of 1/4. +// C comment +// /* +// ** Adjust the WhereLoop.nOut value downward to account for terms of the +// ** WHERE clause that reference the loop but which are not used by an +// ** index. +// * +// ** For every WHERE clause term that is not used by the index +// ** and which has a truth probability assigned by one of the likelihood(), +// ** likely(), or unlikely() SQL functions, reduce the estimated number +// ** of output rows by the probability specified. +// ** +// ** TUNING: For every WHERE clause term that is not used by the index +// ** and which does not have an assigned truth probability, heuristics +// ** described below are used to try to estimate the truth probability. +// ** TODO --> Perhaps this is something that could be improved by better +// ** table statistics. +// ** +// ** Heuristic 1: Estimate the truth probability as 93.75%. The 93.75% +// ** value corresponds to -1 in LogEst notation, so this means decrement +// ** the WhereLoop.nOut field for every such WHERE clause term. +// ** +// ** Heuristic 2: If there exists one or more WHERE clause terms of the +// ** form "x==EXPR" and EXPR is not a constant 0 or 1, then make sure the +// ** final output row estimate is no greater than 1/4 of the total number +// ** of rows in the table. In other words, assume that x==EXPR will filter +// ** out at least 3 out of 4 rows. If EXPR is -1 or 0 or 1, then maybe the +// ** "x" column is boolean or else -1 or 0 or 1 is a common default value +// ** on the "x" column and so in that case only cap the output row estimate +// ** at 1/2 instead of 1/4. +// */ func _whereLoopOutputAdjust(tls *crt.TLS, _pWC *XWhereClause, _pLoop *XWhereLoop, _nRow int16) { var _iReduce int16 var _i, _j, _k int32 var _notAllowed uint64 var _6_pRight *XExpr var _pTerm, _pX *XWhereTerm - _notAllowed = ^((_pLoop.X0) | (_pLoop.X1)) + _notAllowed = ^(_pLoop.X0 | _pLoop.X1) _iReduce = i16(0) func() { - if ((_pLoop.X9) & uint32(i32(16384))) != uint32(i32(0)) { + if (_pLoop.X9 & uint32(i32(16384))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132572), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopOutputAdjustØ00__func__Ø000))), unsafe.Pointer(str(105606))) crt.X__builtin_abort(tls) } @@ -85858,10 +89596,10 @@ _2: if (int32(_pTerm.X3) & i32(2)) != i32(0) { goto _5 } - if ((_pTerm.X12) & (_pLoop.X1)) == uint64(i32(0)) { + if (_pTerm.X12 & _pLoop.X1) == uint64(i32(0)) { goto _3 } - if ((_pTerm.X12) & _notAllowed) != uint64(i32(0)) { + if (_pTerm.X12 & _notAllowed) != uint64(i32(0)) { goto _3 } _j = int32(_pLoop.X10) - i32(1) @@ -85869,14 +89607,14 @@ _9: if _j < i32(0) { goto _12 } - _pX = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j))) + _pX = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j))) if _pX == nil { goto _10 } if _pX == _pTerm { goto _12 } - if ((_pX.X7) >= i32(0)) && ((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+64*uintptr(_pX.X7))) == _pTerm) { + if (_pX.X7 >= i32(0)) && ((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+64*uintptr(_pX.X7))) == _pTerm) { goto _12 } _10: @@ -85888,13 +89626,13 @@ _12: } if int32(_pTerm.X2) <= i32(0) { { - p := (*int16)(unsafe.Pointer(&(_pLoop.X7))) + p := (*int16)(unsafe.Pointer(&_pLoop.X7)) *p = int16(int32(*p) + int32(_pTerm.X2)) sink18(*p) } goto _19 } - *(*int16)(unsafe.Pointer(&(_pLoop.X7))) -= 1 + *(*int16)(unsafe.Pointer(&_pLoop.X7)) -= 1 if (int32(_pTerm.X4) & i32(130)) == 0 { goto _20 } @@ -85916,7 +89654,7 @@ _3: goto _2 _5: if int32(_pLoop.X7) > (int32(_nRow) - int32(_iReduce)) { - *(*int16)(unsafe.Pointer(&(_pLoop.X7))) = int16(int32(_nRow) - int32(_iReduce)) + *(*int16)(unsafe.Pointer(&_pLoop.X7)) = int16(int32(_nRow) - int32(_iReduce)) } } @@ -85926,51 +89664,60 @@ func init() { crt.Xstrncpy(nil, &_whereLoopOutputAdjustØ00__func__Ø000[0], str(105645), 22) } -// Determine if an index pIdx on table with cursor iCur contains will -// the expression pExpr. Return true if the index does cover the -// expression and false if the pExpr expression references table columns -// that are not found in the index pIdx. -// -// An index covering an expression means that the expression can be -// evaluated using only the index and without having to lookup the -// corresponding table entry. +// C comment +// /* +// ** Determine if an index pIdx on table with cursor iCur contains will +// ** the expression pExpr. Return true if the index does cover the +// ** expression and false if the pExpr expression references table columns +// ** that are not found in the index pIdx. +// ** +// ** An index covering an expression means that the expression can be +// ** evaluated using only the index and without having to lookup the +// ** corresponding table entry. +// */ func _sqlite3ExprCoveredByIndex(tls *crt.TLS, _pExpr *XExpr, _iCur int32, _pIdx *XIndex) (r0 int32) { var _w XWalker var _xcov XIdList - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*int32)(unsafe.Pointer(&(_xcov.X1))) = _iCur - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_xcov.X0))))) = _pIdx - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprIdxCover - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_xcov + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*int32)(unsafe.Pointer(&_xcov.X1)) = _iCur + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_xcov.X0)))) = _pIdx + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _exprIdxCover + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = &_xcov _sqlite3WalkExpr(tls, &_w, _pExpr) - return bool2int((_w.X5) == 0) + return bool2int(_w.X5 == 0) _ = _w _ = _xcov panic(0) } -// Check to see if there are references to columns in table -// pWalker->u.pIdxCover->iCur can be satisfied using the index -// pWalker->u.pIdxCover->pIdx. +// C comment +// /* +// ** Check to see if there are references to columns in table +// ** pWalker->u.pIdxCover->iCur can be satisfied using the index +// ** pWalker->u.pIdxCover->pIdx. +// */ func _exprIdxCover(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { - if ((int32(_pExpr.X0) == i32(152)) && ((_pExpr.X8) == ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))).X1))) && (int32(_sqlite3ColumnOfIndex(tls, (*XIndex)((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))).X0), _pExpr.X9)) < i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(1)) + if ((int32(_pExpr.X0) == i32(152)) && (_pExpr.X8 == ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))).X1))) && (int32(_sqlite3ColumnOfIndex(tls, (*XIndex)((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))).X0), _pExpr.X9)) < i32(0)) { + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(1)) return i32(2) } return i32(0) } -// We have so far matched pBuilder->pNew->u.btree.nEq terms of the -// index pIndex. Try to match one more. -// -// When this function is called, pBuilder->pNew->nOut contains the -// number of rows expected to be visited by filtering using the nEq -// terms only. If it is modified, this value is restored before this -// function returns. -// -// If pProbe->tnum==0, that means pIndex is a fake index used for the -// INTEGER PRIMARY KEY. +// C comment +// /* +// ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the +// ** index pIndex. Try to match one more. +// ** +// ** When this function is called, pBuilder->pNew->nOut contains the +// ** number of rows expected to be visited by filtering using the nEq +// ** terms only. If it is modified, this value is restored before this +// ** function returns. +// ** +// ** If pProbe->tnum==0, that means pIndex is a fake index used for the +// ** INTEGER PRIMARY KEY. +// */ func _whereLoopAddBtreeIndex(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pSrc *TSrcList_item, _pProbe *XIndex, _nInMul int16) (r0 int32) { var _saved_nOut, _rSize, _rLogSize, _3_rCostIdx, _3_nOutUnadjusted, _30_nIter int16 var _opMask, _rc, _3_nIn, _9_i, _12_iCol, _21_nEq int32 @@ -85991,34 +89738,34 @@ func _whereLoopAddBtreeIndex(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pSrc * _pTop = nil _pBtm = nil _pNew = (*XWhereLoop)(_pBuilder.X3) - if (_db.X17) != 0 { + if _db.X17 != 0 { return _sqlite3NomemError(tls, i32(132723)) } func() { - if ((_pNew.X9) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pNew.X9 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132727), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105667))) crt.X__builtin_abort(tls) } }() func() { - if ((_pNew.X9) & uint32(i32(16))) != uint32(i32(0)) { + if (_pNew.X9 & uint32(i32(16))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132728), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105707))) crt.X__builtin_abort(tls) } }() - if ((_pNew.X9) & uint32(i32(32))) != 0 { + if (_pNew.X9 & uint32(i32(32))) != 0 { _opMask = i32(24) goto _6 } func() { - if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1) != i32(0) { + if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132732), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105744))) crt.X__builtin_abort(tls) } }() _opMask = i32(447) _6: - if ((uint32((_pProbe.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pProbe.X16>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 { { p := &_opMask *p = (*p) & i32(-61) @@ -86026,22 +89773,22 @@ _6: } } func() { - if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) >= int32(_pProbe.X14) { + if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0) >= int32(_pProbe.X14) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132737), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105766))) crt.X__builtin_abort(tls) } }() - _saved_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0 - _saved_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1 - _saved_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2 + _saved_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0 + _saved_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1 + _saved_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2 _saved_nSkip = _pNew.X11 _saved_nLTerm = _pNew.X10 _saved_wsFlags = _pNew.X9 _saved_prereq = _pNew.X0 _saved_nOut = _pNew.X7 _pTerm = _whereScanInit(tls, &_scan, (*XWhereClause)(_pBuilder.X1), _pSrc.X11, int32(_saved_nEq), uint32(_opMask), _pProbe) - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) - _rSize = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(i32(0)))) + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) + _rSize = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(i32(0)))) _rLogSize = _estLog(tls, _rSize) _12: if _rc != i32(0) || _pTerm == nil { @@ -86052,41 +89799,41 @@ _12: if ((int32(_3_eOp) == i32(256)) || ((int32(_pTerm.X3) & i32(0)) != i32(0))) && _indexColumnNotNull(tls, _pProbe, int32(_saved_nEq)) != 0 { goto _13 } - if ((_pTerm.X11) & (_pNew.X1)) != 0 { + if (_pTerm.X11 & _pNew.X1) != 0 { goto _13 } if (int32(_pTerm.X3)&i32(256)) != 0 && (int32(_pTerm.X4) == i32(16)) { goto _13 } - if (((int32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X0) & i32(8)) != i32(0)) && ((((*XExpr)(_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0)))) && ((int32(_3_eOp) & i32(384)) != i32(0)) { + if (((int32((*t28)(unsafe.Pointer(&_pSrc.X9)).X0) & i32(8)) != i32(0)) && ((((*XExpr)(_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0)))) && ((int32(_3_eOp) & i32(384)) != i32(0)) { goto _13 } if (int32(_pProbe.X15) != i32(0)) && (int32(_saved_nEq) == (int32(_pProbe.X13) - i32(1))) { { - p := (*uint32)(unsafe.Pointer(&(_pBuilder.X5))) + p := (*uint32)(unsafe.Pointer(&_pBuilder.X5)) *p = (*p) | uint32(i32(2)) sink5(*p) } goto _28 } { - p := (*uint32)(unsafe.Pointer(&(_pBuilder.X5))) + p := (*uint32)(unsafe.Pointer(&_pBuilder.X5)) *p = (*p) | uint32(i32(1)) sink5(*p) } _28: - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = _saved_nBtm - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = _saved_nTop - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = _saved_nLTerm + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = _saved_wsFlags + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = _saved_nEq + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = _saved_nBtm + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = _saved_nTop + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = _saved_nLTerm if _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1)) != 0 { goto _16 } - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = _pTerm - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = (_saved_prereq | (_pTerm.X11)) & (^(_pNew.X1)) + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&_pNew.X10)), uint16(1))))) = _pTerm + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = (_saved_prereq | _pTerm.X11) & (^_pNew.X1) func() { - if int32(_nInMul) != i32(0) && ((_pNew.X9)&uint32(i32(8))) == uint32(i32(0)) && ((_pNew.X9)&uint32(i32(4))) == uint32(i32(0)) && ((_pNew.X9)&uint32(i32(32768))) == uint32(i32(0)) { + if int32(_nInMul) != i32(0) && (_pNew.X9&uint32(i32(8))) == uint32(i32(0)) && (_pNew.X9&uint32(i32(4))) == uint32(i32(0)) && (_pNew.X9&uint32(i32(32768))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132797), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105800))) crt.X__builtin_abort(tls) } @@ -86096,11 +89843,11 @@ _28: } _8_pExpr = (*XExpr)(_pTerm.X0) { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(4)) sink5(*p) } - if ((_8_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_8_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { goto _36 } _3_nIn = i32(46) @@ -86115,7 +89862,7 @@ _39: if _9_i >= (int32(_pNew.X10) - i32(1)) { goto _42 } - if ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(_9_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(_9_i)))).X0) == _8_pExpr) { + if ((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(_9_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(_9_i)))).X0) == _8_pExpr) { _3_nIn = i32(0) } _9_i += 1 @@ -86124,7 +89871,7 @@ _42: goto _49 _36: if func() int32 { - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))) != nil) && ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))).X0) != 0 { + if ((*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_8_pExpr.X6))))) != nil) && ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_8_pExpr.X6))))).X0) != 0 { return i32(1) } return func() int32 { @@ -86133,7 +89880,7 @@ _36: return i32(0) }() }() != 0 { - _3_nIn = int32(_sqlite3LogEst(tls, uint64((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))).X0))) + _3_nIn = int32(_sqlite3LogEst(tls, uint64((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_8_pExpr.X6))))).X0))) func() { if _3_nIn <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132822), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105953))) @@ -86147,14 +89894,14 @@ _35: if (int32(_3_eOp) & i32(130)) == 0 { goto _53 } - _12_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X1)) + 2*uintptr(_saved_nEq)))) + _12_iCol = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X1)) + 2*uintptr(_saved_nEq)))) { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(1)) sink5(*p) } func() { - if int32(_saved_nEq) != int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) { + if int32(_saved_nEq) != int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132828), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105959))) crt.X__builtin_abort(tls) } @@ -86162,16 +89909,16 @@ _35: if _12_iCol != i32(-1) && (_12_iCol <= i32(0) || int32(_nInMul) != i32(0) || int32(_saved_nEq) != (int32(_pProbe.X13)-i32(1))) { goto _59 } - if (_12_iCol >= i32(0)) && (int32((uint32((_pProbe.X16)>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) { + if (_12_iCol >= i32(0)) && (int32((uint32(_pProbe.X16>>uint(i32(3)))<<uint(i32(31)))>>uint(i32(31))) == i32(0)) { { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(65536)) sink5(*p) } goto _62 } { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(4096)) sink5(*p) } @@ -86181,7 +89928,7 @@ _59: _53: if (int32(_3_eOp) & i32(256)) != 0 { { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(8)) sink5(*p) } @@ -86191,17 +89938,17 @@ _53: goto _66 } { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(34)) sink5(*p) } - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm)) _pBtm = _pTerm _pTop = nil if (int32(_pTerm.X3) & i32(256)) == 0 { goto _67 } - _pTop = (*XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTerm)) + 64*uintptr(i32(1)))) + _pTop = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTerm)) + 64*uintptr(i32(1)))) func() { if int64((uintptr(unsafe.Pointer(_pTop))-uintptr(unsafe.Pointer((*XWhereTerm)((*XWhereClause)(_pTerm.X1).X5))))/64) >= int64((*XWhereClause)(_pTerm.X1).X3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132853), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105988))) @@ -86223,13 +89970,13 @@ _53: if _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1)) != 0 { goto _16 } - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = _pTop + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&_pNew.X10)), uint16(1))))) = _pTop { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(16)) sink5(*p) } - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(i32(1)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = uint16(i32(1)) _67: goto _75 _66: @@ -86240,15 +89987,15 @@ _66: } }() { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(18)) sink5(*p) } - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm)) _pTop = _pTerm _pBtm = func() *XWhereTerm { - if ((_pNew.X9) & uint32(i32(32))) != uint32(i32(0)) { - return (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(int32(_pNew.X10)-i32(2))))) + if (_pNew.X9 & uint32(i32(32))) != uint32(i32(0)) { + return (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(int32(_pNew.X10)-i32(2))))) } return nil }() @@ -86259,11 +90006,11 @@ _75: crt.X__builtin_abort(tls) } }() - if ((_pNew.X9) & uint32(i32(2))) != 0 { + if (_pNew.X9 & uint32(i32(2))) != 0 { _whereRangeScanEst(tls, _pParse, _pBuilder, _pBtm, _pTop, _pNew) goto _83 } - _21_nEq = int32(preInc14((*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))), uint16(1))) + _21_nEq = int32(preInc14((*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))), uint16(1))) func() { if (int32(_3_eOp) & i32(387)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132886), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106124))) @@ -86276,7 +90023,7 @@ _75: crt.X__builtin_abort(tls) } }() - if (int32(_pTerm.X2) <= i32(0)) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X1)) + 2*uintptr(_saved_nEq)))) >= i32(0)) { + if (int32(_pTerm.X2) <= i32(0)) && (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X1)) + 2*uintptr(_saved_nEq)))) >= i32(0)) { func() { if (int32(_3_eOp)&i32(1)) == 0 && _3_nIn != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132890), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106160))) @@ -86284,25 +90031,25 @@ _75: } }() { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) *p = int16(int32(*p) + int32(_pTerm.X2)) sink18(*p) } { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) *p = int16(int32(*p) - _3_nIn) sink18(*p) } goto _93 } { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) - *p = int16(int32(*p) + (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_21_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_21_nEq-i32(1))))))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) + *p = int16(int32(*p) + (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(_21_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(_21_nEq-i32(1))))))) sink18(*p) } if (int32(_3_eOp) & i32(256)) != 0 { { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) *p = int16(int32(*p) + i32(10)) sink18(*p) } @@ -86310,63 +90057,63 @@ _75: _93: _83: _3_rCostIdx = int16((int32(_pNew.X7) + i32(1)) + ((i32(15) * int32(_pProbe.X12)) / int32((*XTable)(_pSrc.X4).X13))) - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _rLogSize, _3_rCostIdx) - if ((_pNew.X9) & uint32(i32(320))) == uint32(i32(0)) { - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _pNew.X6, int16(int32(_pNew.X7)+i32(16))) + *(*int16)(unsafe.Pointer(&_pNew.X6)) = _sqlite3LogEstAdd(tls, _rLogSize, _3_rCostIdx) + if (_pNew.X9 & uint32(i32(320))) == uint32(i32(0)) { + *(*int16)(unsafe.Pointer(&_pNew.X6)) = _sqlite3LogEstAdd(tls, _pNew.X6, int16(int32(_pNew.X7)+i32(16))) } _3_nOutUnadjusted = _pNew.X7 { - p := (*int16)(unsafe.Pointer(&(_pNew.X6))) + p := (*int16)(unsafe.Pointer(&_pNew.X6)) *p = int16(int32(*p) + (int32(_nInMul) + _3_nIn)) sink18(*p) } { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) *p = int16(int32(*p) + (int32(_nInMul) + _3_nIn)) sink18(*p) } _whereLoopOutputAdjust(tls, (*XWhereClause)(_pBuilder.X1), _pNew, _rSize) _rc = _whereLoopInsert(tls, _pBuilder, _pNew) - if ((_pNew.X9) & uint32(i32(2))) != 0 { - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut + if (_pNew.X9 & uint32(i32(2))) != 0 { + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _saved_nOut goto _97 } - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _3_nOutUnadjusted + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _3_nOutUnadjusted _97: - if (((_pNew.X9) & uint32(i32(16))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) < int32(_pProbe.X14)) { + if ((_pNew.X9 & uint32(i32(16))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0) < int32(_pProbe.X14)) { _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_nInMul)+_3_nIn)) } - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _saved_nOut _13: _pTerm = _whereScanNext(tls, &_scan) goto _12 _16: - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _saved_prereq - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = _saved_nBtm - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = _saved_nTop - *(*uint16)(unsafe.Pointer(&(_pNew.X11))) = _saved_nSkip - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = _saved_nLTerm + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = _saved_prereq + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = _saved_nEq + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X1))) = _saved_nBtm + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X2))) = _saved_nTop + *(*uint16)(unsafe.Pointer(&_pNew.X11)) = _saved_nSkip + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = _saved_wsFlags + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _saved_nOut + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = _saved_nLTerm func() { if i32(42) != int32(_sqlite3LogEst(tls, uint64(i32(18)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132985), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106184))) crt.X__builtin_abort(tls) } }() - if ((((int32(_saved_nEq) == int32(_saved_nSkip)) && ((int32(_saved_nEq) + i32(1)) < int32(_pProbe.X13))) && (int32((uint32((_pProbe.X16)>>uint(i32(6)))<<uint(i32(31)))>>uint(i32(31))) == i32(0))) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1))))) >= i32(42))) && (store1(&_rc, _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1))) == i32(0)) { - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) += 1 - *(*uint16)(unsafe.Pointer(&(_pNew.X11))) += 1 - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = nil + if ((((int32(_saved_nEq) == int32(_saved_nSkip)) && ((int32(_saved_nEq) + i32(1)) < int32(_pProbe.X13))) && (int32((uint32(_pProbe.X16>>uint(i32(6)))<<uint(i32(31)))>>uint(i32(31))) == i32(0))) && (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1))))) >= i32(42))) && (store1(&_rc, _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1))) == i32(0)) { + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) += 1 + *(*uint16)(unsafe.Pointer(&_pNew.X11)) += 1 + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(postInc14((*uint16)(unsafe.Pointer(&_pNew.X10)), uint16(1))))) = nil { - p := (*uint32)(unsafe.Pointer(&(_pNew.X9))) + p := (*uint32)(unsafe.Pointer(&_pNew.X9)) *p = (*p) | uint32(i32(32768)) sink5(*p) } - _30_nIter = int16(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_saved_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1)))))) + _30_nIter = int16(int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(_saved_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1)))))) { - p := (*int16)(unsafe.Pointer(&(_pNew.X7))) + p := (*int16)(unsafe.Pointer(&_pNew.X7)) *p = int16(int32(*p) - int32(_30_nIter)) sink18(*p) } @@ -86376,10 +90123,10 @@ _16: sink18(*p) } _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_30_nIter)+int32(_nInMul))) - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq - *(*uint16)(unsafe.Pointer(&(_pNew.X11))) = _saved_nSkip - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags + *(*int16)(unsafe.Pointer(&_pNew.X7)) = _saved_nOut + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8)))).X0))) = _saved_nEq + *(*uint16)(unsafe.Pointer(&_pNew.X11)) = _saved_nSkip + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = _saved_wsFlags } return _rc @@ -86393,21 +90140,24 @@ func init() { crt.Xstrncpy(nil, &_whereLoopAddBtreeIndexØ00__func__Ø000[0], str(106206), 23) } -// Term pTerm is a vector range comparison operation. The first comparison -// in the vector can be optimized using column nEq of the index. This -// function returns the total number of vector elements that can be used -// as part of the range comparison. -// -// For example, if the query is: -// -// WHERE a = ? AND (b, c, d) > (?, ?, ?) -// -// and the index: -// -// CREATE INDEX ... ON (a, b, c, d, e) -// -// then this function would be invoked with nEq=1. The value returned in -// this case is 3. +// C comment +// /* +// ** Term pTerm is a vector range comparison operation. The first comparison +// ** in the vector can be optimized using column nEq of the index. This +// ** function returns the total number of vector elements that can be used +// ** as part of the range comparison. +// ** +// ** For example, if the query is: +// ** +// ** WHERE a = ? AND (b, c, d) > (?, ?, ?) +// ** +// ** and the index: +// ** +// ** CREATE INDEX ... ON (a, b, c, d, e) +// ** +// ** then this function would be invoked with nEq=1. The value returned in +// ** this case is 3. +// */ func _whereRangeVectorLen(tls *crt.TLS, _pParse *XParse, _iCur int32, _pIdx *XIndex, _nEq int32, _pTerm *XWhereTerm) (r0 int32) { var _nCmp, _i int32 var _1_aff, _1_idxaff int8 @@ -86426,15 +90176,15 @@ _2: goto _5 } _1_idxaff = int8(i32(0)) - _1_pLhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExpr)(_pTerm.X0).X4).X6)))))).X2))))) + 32*uintptr(_i))).X0) + _1_pLhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExpr)(_pTerm.X0).X4).X6)))))).X2))))) + 32*uintptr(_i))).X0) _1_pRhs = (*XExpr)((*XExpr)(_pTerm.X0).X5) - if ((_1_pRhs.X2) & uint32(i32(2048))) != 0 { - _1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pRhs.X6)))))).X0).X2))))) + 32*uintptr(_i))).X0) + if (_1_pRhs.X2 & uint32(i32(2048))) != 0 { + _1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_1_pRhs.X6))))).X0).X2))))) + 32*uintptr(_i))).X0) goto _7 } - _1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pRhs.X6)))))).X2))))) + 32*uintptr(_i))).X0) + _1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_1_pRhs.X6))))).X2))))) + 32*uintptr(_i))).X0) _7: - if (((int32(_1_pLhs.X0) != i32(152)) || ((_1_pLhs.X8) != _iCur)) || (int32(_1_pLhs.X9) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i+_nEq)))))) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_i+_nEq)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_nEq))))) { + if (((int32(_1_pLhs.X0) != i32(152)) || (_1_pLhs.X8 != _iCur)) || (int32(_1_pLhs.X9) != int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i+_nEq)))))) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X7)) + 1*uintptr(_i+_nEq)))) != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X7)) + 1*uintptr(_nEq))))) { goto _5 } _1_aff = _sqlite3CompareAffinity(tls, _1_pRhs, _sqlite3ExprAffinity(tls, _1_pLhs)) @@ -86446,7 +90196,7 @@ _7: if _1_pColl == nil { goto _5 } - if _sqlite3StrICmp(tls, _1_pColl.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_i+_nEq)))) != 0 { + if _sqlite3StrICmp(tls, _1_pColl.X0, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_i+_nEq)))) != 0 { goto _5 } _i += 1 @@ -86455,44 +90205,47 @@ _5: return _i } -// This function is used to estimate the number of rows that will be visited -// by scanning an index for a range of values. The range may have an upper -// bound, a lower bound, or both. The WHERE clause terms that set the upper -// and lower bounds are represented by pLower and pUpper respectively. For -// example, assuming that index p is on t1(a): -// -// ... FROM t1 WHERE a > ? AND a < ? ... -// |_____| |_____| -// | | -// pLower pUpper -// -// If either of the upper or lower bound is not present, then NULL is passed in -// place of the corresponding WhereTerm. -// -// The value in (pBuilder->pNew->u.btree.nEq) is the number of the index -// column subject to the range constraint. Or, equivalently, the number of -// equality constraints optimized by the proposed index scan. For example, -// assuming index p is on t1(a, b), and the SQL query is: -// -// ... FROM t1 WHERE a = ? AND b > ? AND b < ? ... -// -// then nEq is set to 1 (as the range restricted column, b, is the second -// left-most column of the index). Or, if the query is: -// -// ... FROM t1 WHERE a > ? AND a < ? ... -// -// then nEq is set to 0. -// -// When this function is called, *pnOut is set to the sqlite3LogEst() of the -// number of rows that the index scan is expected to visit without -// considering the range constraints. If nEq is 0, then *pnOut is the number of -// rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) -// to account for the range constraints pLower and pUpper. -// -// In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be -// used, a single range inequality reduces the search space by a factor of 4. -// and a pair of constraints (x>? AND x<?) reduces the expected number of -// rows visited by a factor of 64. +// C comment +// /* +// ** This function is used to estimate the number of rows that will be visited +// ** by scanning an index for a range of values. The range may have an upper +// ** bound, a lower bound, or both. The WHERE clause terms that set the upper +// ** and lower bounds are represented by pLower and pUpper respectively. For +// ** example, assuming that index p is on t1(a): +// ** +// ** ... FROM t1 WHERE a > ? AND a < ? ... +// ** |_____| |_____| +// ** | | +// ** pLower pUpper +// ** +// ** If either of the upper or lower bound is not present, then NULL is passed in +// ** place of the corresponding WhereTerm. +// ** +// ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index +// ** column subject to the range constraint. Or, equivalently, the number of +// ** equality constraints optimized by the proposed index scan. For example, +// ** assuming index p is on t1(a, b), and the SQL query is: +// ** +// ** ... FROM t1 WHERE a = ? AND b > ? AND b < ? ... +// ** +// ** then nEq is set to 1 (as the range restricted column, b, is the second +// ** left-most column of the index). Or, if the query is: +// ** +// ** ... FROM t1 WHERE a > ? AND a < ? ... +// ** +// ** then nEq is set to 0. +// ** +// ** When this function is called, *pnOut is set to the sqlite3LogEst() of the +// ** number of rows that the index scan is expected to visit without +// ** considering the range constraints. If nEq is 0, then *pnOut is the number of +// ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) +// ** to account for the range constraints pLower and pUpper. +// ** +// ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be +// ** used, a single range inequality reduces the search space by a factor of 4. +// ** and a pair of constraints (x>? AND x<?) reduces the expected number of +// ** rows visited by a factor of 64. +// */ func _whereRangeScanEst(tls *crt.TLS, _pParse *XParse, _pBuilder *XWhereLoopBuilder, _pLower *XWhereTerm, _pUpper *XWhereTerm, _pLoop *XWhereLoop) (r0 int32) { var _nNew int16 var _rc, _nOut int32 @@ -86531,7 +90284,7 @@ func _whereRangeScanEst(tls *crt.TLS, _pParse *XParse, _pBuilder *XWhereLoopBuil if int32(_nNew) < _nOut { _nOut = int32(_nNew) } - *(*int16)(unsafe.Pointer(&(_pLoop.X7))) = int16(_nOut) + *(*int16)(unsafe.Pointer(&_pLoop.X7)) = int16(_nOut) return _rc } @@ -86541,15 +90294,18 @@ func init() { crt.Xstrncpy(nil, &_whereRangeScanEstØ00__func__Ø000[0], str(106293), 18) } -// If it is not NULL, pTerm is a term that provides an upper or lower -// bound on a range scan. Without considering pTerm, it is estimated -// that the scan will visit nNew rows. This function returns the number -// estimated to be visited after taking pTerm into account. -// -// If the user explicitly specified a likelihood() value for this term, -// then the return value is the likelihood multiplied by the number of -// input rows. Otherwise, this function assumes that an "IS NOT NULL" term -// has a likelihood of 0.50, and any other term a likelihood of 0.25. +// C comment +// /* +// ** If it is not NULL, pTerm is a term that provides an upper or lower +// ** bound on a range scan. Without considering pTerm, it is estimated +// ** that the scan will visit nNew rows. This function returns the number +// ** estimated to be visited after taking pTerm into account. +// ** +// ** If the user explicitly specified a likelihood() value for this term, +// ** then the return value is the likelihood multiplied by the number of +// ** input rows. Otherwise, this function assumes that an "IS NOT NULL" term +// ** has a likelihood of 0.50, and any other term a likelihood of 0.25. +// */ func _whereRangeAdjust(tls *crt.TLS, _pTerm *XWhereTerm, _nNew int16) (r0 int16) { var _nRet int16 _nRet = _nNew @@ -86588,8 +90344,11 @@ func init() { crt.Xstrncpy(nil, &_whereRangeAdjustØ00__func__Ø000[0], str(106332), 17) } -// Add WhereLoop entries to handle OR terms. This works for either -// btrees or virtual tables. +// C comment +// /* +// ** Add WhereLoop entries to handle OR terms. This works for either +// ** btrees or virtual tables. +// */ func _whereLoopAddOr(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) { var _rc, _iCur, _2_once, _2_i, _2_j int32 var _pItem *TSrcList_item @@ -86605,7 +90364,7 @@ func _whereLoopAddOr(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64 _pWC = (*XWhereClause)(_pBuilder.X1) _pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X3)*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(64))))))))))) _pNew = (*XWhereLoop)(_pBuilder.X3) - crt.Xmemset(tls, (unsafe.Pointer)(&_sSum), i32(0), u64(56)) + crt.Xmemset(tls, unsafe.Pointer(&_sSum), i32(0), u64(56)) _pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.X3)*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(112))))))))))) _iCur = _pItem.X11 _pTerm = (*XWhereTerm)(_pWC.X5) @@ -86613,36 +90372,36 @@ _0: if crt.P2U(unsafe.Pointer(_pTerm)) >= crt.P2U(unsafe.Pointer(_pWCEnd)) || _rc != i32(0) { goto _4 } - if (int32(_pTerm.X4)&i32(512)) == i32(0) || (((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X1)&(_pNew.X1)) == uint64(i32(0)) { + if (int32(_pTerm.X4)&i32(512)) == i32(0) || (((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))).X1)&_pNew.X1) == uint64(i32(0)) { goto _6 } - _2_pOrWC = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))) + _2_pOrWC = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))).X0))) _2_pOrWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_2_pOrWC.X5) + 64*uintptr(_2_pOrWC.X3))) _2_once = i32(1) _sSubBuild = *_pBuilder - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X2))))) = nil - *(**XWhereOrSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X4))))) = &_sCur + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSubBuild.X2)))) = nil + *(**XWhereOrSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSubBuild.X4)))) = &_sCur _2_pOrTerm = (*XWhereTerm)(_2_pOrWC.X5) _7: if crt.P2U(unsafe.Pointer(_2_pOrTerm)) >= crt.P2U(unsafe.Pointer(_2_pOrWCEnd)) { goto _10 } if (int32(_2_pOrTerm.X4) & i32(1024)) != i32(0) { - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X1))))) = (*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_2_pOrTerm.X10)))))).X0))) + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSubBuild.X1)))) = (*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_2_pOrTerm.X10))))).X0))) goto _14 } - if (_2_pOrTerm.X8) == _iCur { - *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X0))))) = (*XWhereInfo)(_pWC.X0) - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X1))))) = _pWC - *(*uint8)(unsafe.Pointer(&(_tempWC.X2))) = uint8(i32(71)) - *(*int32)(unsafe.Pointer(&(_tempWC.X3))) = i32(1) - *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X5))))) = _2_pOrTerm - *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X1))))) = &_tempWC + if _2_pOrTerm.X8 == _iCur { + *(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_tempWC.X0)))) = (*XWhereInfo)(_pWC.X0) + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_tempWC.X1)))) = _pWC + *(*uint8)(unsafe.Pointer(&_tempWC.X2)) = uint8(i32(71)) + *(*int32)(unsafe.Pointer(&_tempWC.X3)) = i32(1) + *(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_tempWC.X5)))) = _2_pOrTerm + *(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sSubBuild.X1)))) = &_tempWC goto _14 } goto _8 _14: - *(*uint16)(unsafe.Pointer(&(_sCur.X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_sCur.X0)) = uint16(i32(0)) if ((*XTable)(_pItem.X4).X16) != 0 { _rc = _whereLoopAddVirtual(tls, &_sSubBuild, _mPrereq, _mUnusable) goto _16 @@ -86659,7 +90418,7 @@ _16: } }() if int32(_sCur.X0) == i32(0) { - *(*uint16)(unsafe.Pointer(&(_sSum.X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_sSum.X0)) = uint16(i32(0)) goto _10 } if _2_once != 0 { @@ -86668,7 +90427,7 @@ _16: goto _24 } _whereOrMove(tls, &_12_sPrev, &_sSum) - *(*uint16)(unsafe.Pointer(&(_sSum.X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&_sSum.X0)) = uint16(i32(0)) _2_i = i32(0) _25: if _2_i >= int32(_12_sPrev.X0) { @@ -86679,7 +90438,7 @@ _29: if _2_j >= int32(_sCur.X0) { goto _32 } - _whereOrInsert(tls, &_sSum, ((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+16*uintptr(_2_i))).X0)|((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+16*uintptr(_2_j))).X0), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+16*uintptr(_2_i))).X1, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+16*uintptr(_2_j))).X1), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+16*uintptr(_2_i))).X2, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+16*uintptr(_2_j))).X2)) + _whereOrInsert(tls, &_sSum, ((*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_12_sPrev.X1))))+16*uintptr(_2_i))).X0)|((*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sCur.X1))))+16*uintptr(_2_j))).X0), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_12_sPrev.X1))))+16*uintptr(_2_i))).X1, (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sCur.X1))))+16*uintptr(_2_j))).X1), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_12_sPrev.X1))))+16*uintptr(_2_i))).X2, (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sCur.X1))))+16*uintptr(_2_j))).X2)) _2_j += 1 goto _29 _32: @@ -86691,20 +90450,20 @@ _8: *(*uintptr)(unsafe.Pointer(&_2_pOrTerm)) += uintptr(64) goto _7 _10: - *(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(1)) - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 8*uintptr(i32(0)))) = _pTerm - *(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(8192)) - *(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(i32(0)) - crt.Xmemset(tls, (unsafe.Pointer)((*t62)(unsafe.Pointer(&(_pNew.X8)))), i32(0), u64(16)) + *(*uint16)(unsafe.Pointer(&_pNew.X10)) = uint16(i32(1)) + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X13)) + 8*uintptr(i32(0)))) = _pTerm + *(*uint32)(unsafe.Pointer(&_pNew.X9)) = uint32(i32(8192)) + *(*int16)(unsafe.Pointer(&_pNew.X5)) = int16(i32(0)) + *(*uint8)(unsafe.Pointer(&_pNew.X4)) = uint8(i32(0)) + crt.Xmemset(tls, unsafe.Pointer((*t62)(unsafe.Pointer(&_pNew.X8))), i32(0), u64(16)) _2_i = i32(0) _33: if _rc != i32(0) || _2_i >= int32(_sSum.X0) { goto _37 } - *(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16(int32((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1)))))+16*uintptr(_2_i))).X1) + i32(1)) - *(*int16)(unsafe.Pointer(&(_pNew.X7))) = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1))))) + 16*uintptr(_2_i))).X2 - *(*uint64)(unsafe.Pointer(&(_pNew.X0))) = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1))))) + 16*uintptr(_2_i))).X0 + *(*int16)(unsafe.Pointer(&_pNew.X6)) = int16(int32((*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sSum.X1))))+16*uintptr(_2_i))).X1) + i32(1)) + *(*int16)(unsafe.Pointer(&_pNew.X7)) = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sSum.X1)))) + 16*uintptr(_2_i))).X2 + *(*uint64)(unsafe.Pointer(&_pNew.X0)) = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_sSum.X1)))) + 16*uintptr(_2_i))).X0 _rc = _whereLoopInsert(tls, _pBuilder, _pNew) _2_i += 1 goto _33 @@ -86729,22 +90488,28 @@ func init() { crt.Xstrncpy(nil, &_whereLoopAddOrØ00__func__Ø000[0], str(106376), 15) } -// Move the content of pSrc into pDest +// C comment +// /* +// ** Move the content of pSrc into pDest +// */ func _whereOrMove(tls *crt.TLS, _pDest *XWhereOrSet, _pSrc *XWhereOrSet) { - *(*uint16)(unsafe.Pointer(&(_pDest.X0))) = _pSrc.X0 - crt.Xmemcpy(tls, (unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pDest.X1)))), (unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSrc.X1)))), uint64(_pDest.X0)*u64(16)) -} - -// Given the list of WhereLoop objects at pWInfo->pLoops, this routine -// attempts to find the lowest cost path that visits each WhereLoop -// once. This path is then loaded into the pWInfo->a[].pWLoop fields. -// -// Assume that the total number of output rows that will need to be sorted -// will be nRowEst (in the 10*log2 representation). Or, ignore sorting -// costs if nRowEst==0. -// -// Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation -// error occurs. + *(*uint16)(unsafe.Pointer(&_pDest.X0)) = _pSrc.X0 + crt.Xmemcpy(tls, unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pDest.X1))), unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&_pSrc.X1))), uint64(_pDest.X0)*u64(16)) +} + +// C comment +// /* +// ** Given the list of WhereLoop objects at pWInfo->pLoops, this routine +// ** attempts to find the lowest cost path that visits each WhereLoop +// ** once. This path is then loaded into the pWInfo->a[].pWLoop fields. +// ** +// ** Assume that the total number of output rows that will need to be sorted +// ** will be nRowEst (in the 10*log2 representation). Or, ignore sorting +// ** costs if nRowEst==0. +// ** +// ** Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation +// ** error occurs. +// */ func _wherePathSolver(tls *crt.TLS, _pWInfo *XWhereInfo, _nRowEst int16) (r0 int32) { var _mxCost, _mxUnsorted, _8_nOut, _8_rCost, _8_rUnsorted int16 var _mxChoice, _nLoop, _iLoop, _ii, _jj, _mxI, _nOrderBy, _nTo, _nFrom, _nSpace, _29_rc, _37_rc, _39_nOrder int32 @@ -86801,43 +90566,43 @@ _8: } _aTo = (*XWherePath)(unsafe.Pointer(_pSpace)) _aFrom = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(32))))))))))) - crt.Xmemset(tls, (unsafe.Pointer)(_aFrom), i32(0), u64(32)) + crt.Xmemset(tls, unsafe.Pointer(_aFrom), i32(0), u64(32)) _pX = (**XWhereLoop)(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(32))))))))))))) *func() **XWherePath { _ii = _mxChoice * i32(2); return &_pFrom }() = _aTo _10: if _ii <= i32(0) { goto _13 } - *(***XWhereLoop)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X6))))) = _pX + *(***XWhereLoop)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_pFrom.X6)))) = _pX { p := func() ***XWhereLoop { *(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii -= 1; return &_pFrom }())) += uintptr(32) return &_pX }() - *p = (**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 8*uintptr(_nLoop))) + *p = (**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 8*uintptr(_nLoop))) sink68(*p) } goto _10 _13: if _nOrderBy != 0 { _aSortCost = (*int16)(unsafe.Pointer(_pX)) - crt.Xmemset(tls, (unsafe.Pointer)(_aSortCost), i32(0), u64(2)*uint64(_nOrderBy)) + crt.Xmemset(tls, unsafe.Pointer(_aSortCost), i32(0), u64(2)*uint64(_nOrderBy)) } func() { - if _aSortCost != nil && (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer((*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost))+2*uintptr(_nOrderBy))))) { + if _aSortCost != nil && (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer((*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSortCost))+2*uintptr(_nOrderBy))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134291), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106421))) crt.X__builtin_abort(tls) } }() func() { - if _aSortCost == nil && (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer(_pX)) { + if _aSortCost == nil && (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer(_pX)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134292), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106482))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 32*uintptr(i32(0)))).X2))) = int16(func() uint32 { - if (_pParse.X42) < uint32(i32(48)) { - return (_pParse.X42) + *(*int16)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + 32*uintptr(i32(0)))).X2))) = int16(func() uint32 { + if _pParse.X42 < uint32(i32(48)) { + return _pParse.X42 } return uint32(i32(48)) }()) @@ -86849,13 +90614,13 @@ _13: }() _nFrom = i32(1) func() { - if int32((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom))+32*uintptr(i32(0)))).X5) != i32(0) { + if int32((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom))+32*uintptr(i32(0)))).X5) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134301), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106547))) crt.X__builtin_abort(tls) } }() if _nOrderBy != 0 { - *(*int8)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 32*uintptr(i32(0)))).X5))) = int8(func() int32 { + *(*int8)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + 32*uintptr(i32(0)))).X5))) = int8(func() int32 { if _nLoop > i32(0) { return i32(-1) } @@ -86880,13 +90645,13 @@ _38: } _8_isOrdered = _pFrom.X5 _8_revMask = uint64(i32(0)) - if ((_pWLoop.X0) & (^(_pFrom.X0))) != uint64(i32(0)) { + if (_pWLoop.X0 & (^_pFrom.X0)) != uint64(i32(0)) { goto _39 } - if ((_pWLoop.X1) & (_pFrom.X0)) != uint64(i32(0)) { + if (_pWLoop.X1 & _pFrom.X0) != uint64(i32(0)) { goto _39 } - if (((_pWLoop.X9) & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pFrom.X2) < i32(10)) { + if ((_pWLoop.X9 & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pFrom.X2) < i32(10)) { func() { if i32(10) != int32(_sqlite3LogEst(tls, uint64(i32(2)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134331), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(60363))) @@ -86898,7 +90663,7 @@ _38: _8_rUnsorted = _sqlite3LogEstAdd(tls, _pWLoop.X5, int16(int32(_pWLoop.X6)+int32(_pFrom.X2))) _8_rUnsorted = _sqlite3LogEstAdd(tls, _8_rUnsorted, _pFrom.X4) _8_nOut = int16(int32(_pFrom.X2) + int32(_pWLoop.X7)) - _8_maskNew = (_pFrom.X0) | (_pWLoop.X1) + _8_maskNew = _pFrom.X0 | _pWLoop.X1 if int32(_8_isOrdered) < i32(0) { _8_isOrdered = _wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, _pWInfo.X10, uint16(_iLoop), _pWLoop, &_8_revMask) goto _49 @@ -86908,10 +90673,10 @@ _49: if int32(_8_isOrdered) < i32(0) || int32(_8_isOrdered) >= _nOrderBy { goto _51 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered)))) == i32(0) { - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered))) = _whereSortingCost(tls, _pWInfo, _nRowEst, _nOrderBy, int32(_8_isOrdered)) + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSortCost)) + 2*uintptr(_8_isOrdered)))) == i32(0) { + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSortCost)) + 2*uintptr(_8_isOrdered))) = _whereSortingCost(tls, _pWInfo, _nRowEst, _nOrderBy, int32(_8_isOrdered)) } - _8_rCost = _sqlite3LogEstAdd(tls, _8_rUnsorted, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered)))) + _8_rCost = _sqlite3LogEstAdd(tls, _8_rUnsorted, *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_aSortCost)) + 2*uintptr(_8_isOrdered)))) goto _53 _51: _8_rCost = _8_rUnsorted @@ -86921,7 +90686,7 @@ _54: if _jj >= _nTo { goto _57 } - if ((_pTo.X0) == _8_maskNew) && (((int32(_pTo.X5) ^ int32(_8_isOrdered)) & i32(128)) == i32(0)) { + if (_pTo.X0 == _8_maskNew) && (((int32(_pTo.X5) ^ int32(_8_isOrdered)) & i32(128)) == i32(0)) { goto _57 } *(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(32) @@ -86934,33 +90699,33 @@ _57: goto _39 } if _nTo < _mxChoice { - _jj = postInc1(&_nTo, int32(1)) + _jj = postInc1(&_nTo, 1) goto _66 } _jj = _mxI _66: - _pTo = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 32*uintptr(_jj))) + _pTo = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + 32*uintptr(_jj))) goto _67 _60: if (int32(_pTo.X3) < int32(_8_rCost)) || ((int32(_pTo.X3) == int32(_8_rCost)) && (int32(_pTo.X2) <= int32(_8_nOut))) { goto _39 } _67: - *(*uint64)(unsafe.Pointer(&(_pTo.X0))) = (_pFrom.X0) | (_pWLoop.X1) - *(*uint64)(unsafe.Pointer(&(_pTo.X1))) = _8_revMask - *(*int16)(unsafe.Pointer(&(_pTo.X2))) = _8_nOut - *(*int16)(unsafe.Pointer(&(_pTo.X3))) = _8_rCost - *(*int16)(unsafe.Pointer(&(_pTo.X4))) = _8_rUnsorted - *(*int8)(unsafe.Pointer(&(_pTo.X5))) = _8_isOrdered - crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo.X6), (unsafe.Pointer)(_pFrom.X6), u64(8)*uint64(_iLoop)) - *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTo.X6)) + 8*uintptr(_iLoop))) = _pWLoop + *(*uint64)(unsafe.Pointer(&_pTo.X0)) = _pFrom.X0 | _pWLoop.X1 + *(*uint64)(unsafe.Pointer(&_pTo.X1)) = _8_revMask + *(*int16)(unsafe.Pointer(&_pTo.X2)) = _8_nOut + *(*int16)(unsafe.Pointer(&_pTo.X3)) = _8_rCost + *(*int16)(unsafe.Pointer(&_pTo.X4)) = _8_rUnsorted + *(*int8)(unsafe.Pointer(&_pTo.X5)) = _8_isOrdered + crt.Xmemcpy(tls, unsafe.Pointer(_pTo.X6), unsafe.Pointer(_pFrom.X6), u64(8)*uint64(_iLoop)) + *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTo.X6)) + 8*uintptr(_iLoop))) = _pWLoop if _nTo < _mxChoice { goto _71 } _mxI = i32(0) - _mxCost = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 32*uintptr(i32(0)))).X3 - _mxUnsorted = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 32*uintptr(i32(0)))).X2 - *func() **XWherePath { _jj = i32(1); return &_pTo }() = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 32*uintptr(i32(1)))) + _mxCost = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + 32*uintptr(i32(0)))).X3 + _mxUnsorted = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + 32*uintptr(i32(0)))).X2 + *func() **XWherePath { _jj = i32(1); return &_pTo }() = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + 32*uintptr(i32(1)))) _72: if _jj >= _mxChoice { goto _75 @@ -86990,7 +90755,7 @@ _37: _33: if _nFrom == i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(106569)) - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pSpace)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace)) return i32(1) } _pFrom = _aFrom @@ -86999,8 +90764,8 @@ _80: if _ii >= _nFrom { goto _83 } - if int32(_pFrom.X3) > int32((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom))+32*uintptr(_ii))).X3) { - _pFrom = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 32*uintptr(_ii))) + if int32(_pFrom.X3) > int32((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom))+32*uintptr(_ii))).X3) { + _pFrom = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + 32*uintptr(_ii))) } _ii += 1 goto _80 @@ -87016,50 +90781,50 @@ _87: if _iLoop >= _nLoop { goto _90 } - _28_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))))) + uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(_iLoop)*uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(88))))))))))) - *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_28_pLevel.X18))))) = store67(&_pWLoop, *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 8*uintptr(_iLoop)))) - *(*uint8)(unsafe.Pointer(&(_28_pLevel.X11))) = _pWLoop.X3 - *(*int32)(unsafe.Pointer(&(_28_pLevel.X1))) = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_28_pLevel.X11))).X11 + _28_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))))) + uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(_iLoop)*uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(88))))))))))) + *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_28_pLevel.X18)))) = store67(&_pWLoop, *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFrom.X6)) + 8*uintptr(_iLoop)))) + *(*uint8)(unsafe.Pointer(&_28_pLevel.X11)) = _pWLoop.X3 + *(*int32)(unsafe.Pointer(&_28_pLevel.X1)) = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_28_pLevel.X11))).X11 _iLoop += 1 goto _87 _90: if (int32(_pWInfo.X10)&i32(256)) == i32(0) || (int32(_pWInfo.X10)&i32(128)) != i32(0) || int32(_pWInfo.X16) != i32(0) || _nRowEst == 0 { goto _94 } - _29_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X3), _pFrom, uint16(i32(128)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_29_notUsed)) + _29_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X3), _pFrom, uint16(i32(128)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_29_notUsed)) if _29_rc == ((*XExprList)(_pWInfo.X3).X0) { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pWInfo.X16)) = uint8(i32(2)) } _94: - if (*XExprList)(_pWInfo.X2) == nil { + if _pWInfo.X2 == nil { goto _96 } if (int32(_pWInfo.X10) & i32(128)) == 0 { goto _97 } if int32(_pFrom.X5) == ((*XExprList)(_pWInfo.X2).X0) { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(2)) + *(*uint8)(unsafe.Pointer(&_pWInfo.X16)) = uint8(i32(2)) } goto _99 _97: - *(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = _pFrom.X5 - *(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _pFrom.X1 + *(*int8)(unsafe.Pointer(&_pWInfo.X12)) = _pFrom.X5 + *(*uint64)(unsafe.Pointer(&_pWInfo.X20)) = _pFrom.X1 if int32(_pWInfo.X12) > i32(0) { goto _100 } - *(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(&_pWInfo.X12)) = int8(i32(0)) if _nLoop <= i32(0) { goto _101 } - _36_wsFlags = (*(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1))))).X9 + _36_wsFlags = (*(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1))))).X9 if (_36_wsFlags&uint32(i32(4096))) != uint32(i32(0)) || (_36_wsFlags&uint32(i32(260))) == uint32(i32(260)) { goto _103 } _37_m = u64(0) - _37_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(2048)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_37_m)) + _37_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(2048)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_37_m)) if _37_rc == ((*XExprList)(_pWInfo.X2).X0) { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X17))) = uint8(i32(1)) - *(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _37_m + *(*uint8)(unsafe.Pointer(&_pWInfo.X17)) = uint8(i32(1)) + *(*uint64)(unsafe.Pointer(&_pWInfo.X20)) = _37_m } _103: _101: @@ -87069,7 +90834,7 @@ _99: goto _107 } _39_revMask = u64(0) - _39_nOrder = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(0)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_39_revMask)) + _39_nOrder = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(0)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFrom.X6)) + 8*uintptr(_nLoop-i32(1)))), &_39_revMask)) func() { if int32(_pWInfo.X13) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134567), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106609))) @@ -87077,13 +90842,13 @@ _99: } }() if _39_nOrder == ((*XExprList)(_pWInfo.X2).X0) { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X13))) = uint8(i32(1)) - *(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _39_revMask + *(*uint8)(unsafe.Pointer(&_pWInfo.X13)) = uint8(i32(1)) + *(*uint64)(unsafe.Pointer(&_pWInfo.X20)) = _39_revMask } _107: _96: - *(*int16)(unsafe.Pointer(&(_pWInfo.X21))) = _pFrom.X2 - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pSpace)) + *(*int16)(unsafe.Pointer(&_pWInfo.X21)) = _pFrom.X2 + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pSpace)) return i32(0) _ = _29_notUsed @@ -87096,21 +90861,24 @@ func init() { crt.Xstrncpy(nil, &_wherePathSolverØ00__func__Ø000[0], str(106627), 16) } -// Examine a WherePath (with the addition of the extra WhereLoop of the 6th -// parameters) to see if it outputs rows in the requested ORDER BY -// (or GROUP BY) without requiring a separate sort operation. Return N: -// -// N>0: N terms of the ORDER BY clause are satisfied -// N==0: No terms of the ORDER BY clause are satisfied -// N<0: Unknown yet how many terms of ORDER BY might be satisfied. -// -// Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as -// strict. With GROUP BY and DISTINCT the only requirement is that -// equivalent rows appear immediately adjacent to one another. GROUP BY -// and DISTINCT do not require rows to appear in any particular order as long -// as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT -// the pOrderBy terms can be matched in any order. With ORDER BY, the -// pOrderBy terms must be matched in strict left-to-right order. +// C comment +// /* +// ** Examine a WherePath (with the addition of the extra WhereLoop of the 6th +// ** parameters) to see if it outputs rows in the requested ORDER BY +// ** (or GROUP BY) without requiring a separate sort operation. Return N: +// ** +// ** N>0: N terms of the ORDER BY clause are satisfied +// ** N==0: No terms of the ORDER BY clause are satisfied +// ** N<0: Unknown yet how many terms of ORDER BY might be satisfied. +// ** +// ** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as +// ** strict. With GROUP BY and DISTINCT the only requirement is that +// ** equivalent rows appear immediately adjacent to one another. GROUP BY +// ** and DISTINCT do not require rows to appear in any particular order as long +// ** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT +// ** the pOrderBy terms can be matched in any order. With ORDER BY, the +// ** pOrderBy terms must be matched in strict left-to-right order. +// */ func _wherePathSatisfiesOrderBy(tls *crt.TLS, _pWInfo *XWhereInfo, _pOrderBy *XExprList, _pPath *XWherePath, _wctrlFlags uint16, _nLoop uint16, _pLast *XWhereLoop, _pRevMask *uint64) (r0 int8) { var _iLoop, _i, _j, _iCur, _iColumn int32 var _obSat, _obDone, _orderDistinctMask, _ready, _38_mTerm, _41_m uint64 @@ -87159,14 +90927,14 @@ _6: if _iLoop > i32(0) { { p := &_ready - *p = (*p) | (_pLoop.X1) + *p = (*p) | _pLoop.X1 sink17(*p) } } if _iLoop >= int32(_nLoop) { goto _13 } - _pLoop = *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPath.X6)) + 8*uintptr(_iLoop))) + _pLoop = *(**XWhereLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPath.X6)) + 8*uintptr(_iLoop))) if (int32(_wctrlFlags) & i32(2048)) != 0 { goto _7 } @@ -87174,16 +90942,16 @@ _6: _13: _pLoop = _pLast _15: - if ((_pLoop.X9) & uint32(i32(1024))) == 0 { + if (_pLoop.X9 & uint32(i32(1024))) == 0 { goto _16 } - if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2) != 0 { + if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X2) != 0 { _obSat = _obDone } goto _11 _16: - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3))) = uint16(i32(0)) - _iCur = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLoop.X3))).X11 + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X3))) = uint16(i32(0)) + _iCur = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLoop.X3))).X11 _i = i32(0) _19: if _i >= int32(_nOrderBy) { @@ -87192,14 +90960,14 @@ _19: if ((u64(1) << uint(_i)) & _obSat) != 0 { goto _20 } - _pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X0)) + _pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X0)) if int32(_pOBExpr.X0) != i32(152) { goto _20 } - if (_pOBExpr.X8) != _iCur { + if _pOBExpr.X8 != _iCur { goto _20 } - _pTerm = _sqlite3WhereFindTerm(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _iCur, int32(_pOBExpr.X9), ^_ready, uint32(_eqOpMask), nil) + _pTerm = _sqlite3WhereFindTerm(tls, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)), _iCur, int32(_pOBExpr.X9), ^_ready, uint32(_eqOpMask), nil) if _pTerm == nil { goto _20 } @@ -87214,7 +90982,7 @@ _19: }() _j = i32(0) _30: - if _j >= int32(_pLoop.X10) || _pTerm == (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j)))) { + if _j >= int32(_pLoop.X10) || _pTerm == (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j)))) { goto _34 } _j += 1 @@ -87227,7 +90995,7 @@ _27: if (int32(_pTerm.X4)&i32(130)) == i32(0) || int32(_pOBExpr.X9) < i32(0) { goto _37 } - _pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X0)) + _pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X0)) if _pColl == nil { _pColl = (*XCollSeq)(_db.X2) } @@ -87250,16 +91018,16 @@ _20: _i += 1 goto _19 _22: - if ((_pLoop.X9) & uint32(i32(4096))) != uint32(i32(0)) { + if (_pLoop.X9 & uint32(i32(4096))) != uint32(i32(0)) { goto _41 } - if ((_pLoop.X9) & uint32(i32(256))) != 0 { + if (_pLoop.X9 & uint32(i32(256))) != 0 { _pIndex = nil _nKeyCol = uint16(i32(0)) _nColumn = uint16(i32(1)) goto _46 } - if (store69(&_pIndex, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)) == nil) || (((uint32((_pIndex.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) { + if (store69(&_pIndex, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4)) == nil) || (((uint32(_pIndex.X16>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) { return int8(i32(0)) } _nKeyCol = _pIndex.X13 @@ -87271,7 +91039,7 @@ _22: } }() func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(int32(_nColumn)-i32(1))))) != i32(-1) && (((*XTable)(_pIndex.X3).X9)&uint32(i32(32))) == uint32(i32(0)) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(int32(_nColumn)-i32(1))))) != i32(-1) && (((*XTable)(_pIndex.X3).X9)&uint32(i32(32))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133975), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106736))) crt.X__builtin_abort(tls) } @@ -87287,15 +91055,15 @@ _53: } _14_bOnce = uint8(i32(1)) func() { - if _j < int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) && ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j)))) == nil) != (_j < int32(_pLoop.X11)) { + if _j < int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) && ((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j)))) == nil) != (_j < int32(_pLoop.X11)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133988), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106803))) crt.X__builtin_abort(tls) } }() - if _j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) || _j < int32(_pLoop.X11) { + if _j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) || _j < int32(_pLoop.X11) { goto _61 } - _15_eOp = (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j)))).X4 + _15_eOp = (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j)))).X4 if (int32(_15_eOp) & int32(_eqOpMask)) == i32(0) { goto _62 } @@ -87316,15 +91084,15 @@ _62: }() == 0 { goto _67 } - _18_pX = (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j)))).X0) + _18_pX = (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j)))).X0) _i = _j + i32(1) _68: - if _i >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) { + if _i >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) { goto _71 } - if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_i)))).X0) == _18_pX { + if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_i)))).X0) == _18_pX { func() { - if (int32((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_i)))).X4) & i32(1)) == 0 { + if (int32((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_i)))).X4) & i32(1)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134016), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106868))) crt.X__builtin_abort(tls) } @@ -87340,8 +91108,8 @@ _61: if _pIndex == nil { goto _75 } - _iColumn = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_j)))) - _revIdx = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_j))) + _iColumn = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_j)))) + _revIdx = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X7)) + 1*uintptr(_j))) if _iColumn == int32((*XTable)(_pIndex.X3).X10) { _iColumn = i32(-1) } @@ -87350,7 +91118,7 @@ _75: _iColumn = i32(-1) _revIdx = uint8(i32(0)) _77: - if (((_isOrderDistinct != 0) && (_iColumn >= i32(0))) && (_j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIndex.X3).X1)+32*uintptr(_iColumn))).X3) == i32(0)) { + if (((_isOrderDistinct != 0) && (_iColumn >= i32(0))) && (_j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0))) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIndex.X3).X1)+32*uintptr(_iColumn))).X3) == i32(0)) { _isOrderDistinct = uint8(i32(0)) } _isMatch = uint8(i32(0)) @@ -87362,7 +91130,7 @@ _82: if ((u64(1) << uint(_i)) & _obSat) != 0 { goto _83 } - _pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X0)) + _pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X0)) if (int32(_wctrlFlags) & i32(192)) == i32(0) { _14_bOnce = uint8(i32(0)) } @@ -87372,7 +91140,7 @@ _82: if int32(_pOBExpr.X0) != i32(152) { goto _83 } - if (_pOBExpr.X8) != _iCur { + if _pOBExpr.X8 != _iCur { goto _83 } if int32(_pOBExpr.X9) != _iColumn { @@ -87380,22 +91148,22 @@ _82: } goto _93 _89: - if _sqlite3ExprCompare(tls, _pOBExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIndex.X10).X2)))))+32*uintptr(_j))).X0), _iCur) != 0 { + if _sqlite3ExprCompare(tls, _pOBExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIndex.X10).X2)))))+32*uintptr(_j))).X0), _iCur) != 0 { goto _83 } _93: if _iColumn < i32(0) { goto _95 } - _pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X0)) + _pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X0)) if _pColl == nil { _pColl = (*XCollSeq)(_db.X2) } - if _sqlite3StrICmp(tls, _pColl.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_j)))) != i32(0) { + if _sqlite3StrICmp(tls, _pColl.X0, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_j)))) != i32(0) { goto _83 } _95: - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3))) = uint16(_j + i32(1)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X3))) = uint16(_j + i32(1)) _isMatch = uint8(i32(1)) goto _86 _83: @@ -87408,12 +91176,12 @@ _86: if _revSet == 0 { goto _100 } - if (int32(_rev) ^ int32(_revIdx)) != int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X3) { + if (int32(_rev) ^ int32(_revIdx)) != int32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X3) { _isMatch = uint8(i32(0)) } goto _102 _100: - _rev = uint8(int32(_revIdx) ^ int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+32*uintptr(_i))).X3)) + _rev = uint8(int32(_revIdx) ^ int32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2))))+32*uintptr(_i))).X3)) if _rev != 0 { { p := _pRevMask @@ -87455,7 +91223,7 @@ _41: } { p := &_orderDistinctMask - *p = (*p) | (_pLoop.X1) + *p = (*p) | _pLoop.X1 sink17(*p) } _i = i32(0) @@ -87466,8 +91234,8 @@ _111: if ((u64(1) << uint(_i)) & _obSat) != 0 { goto _112 } - _38_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 32*uintptr(_i))).X0) - _38_mTerm = _sqlite3WhereExprUsage(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _38_p) + _38_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pOrderBy.X2)))) + 32*uintptr(_i))).X0) + _38_mTerm = _sqlite3WhereExprUsage(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _38_p) if (_38_mTerm == uint64(i32(0))) && (_sqlite3ExprIsConstant(tls, _38_p) == 0) { goto _112 } @@ -87517,9 +91285,12 @@ func init() { crt.Xstrncpy(nil, &_wherePathSatisfiesOrderByØ00__func__Ø000[0], str(106906), 26) } -// Return the cost of sorting nRow rows, assuming that the keys have -// nOrderby columns and that the first nSorted columns are already in -// order. +// C comment +// /* +// ** Return the cost of sorting nRow rows, assuming that the keys have +// ** nOrderby columns and that the first nSorted columns are already in +// ** order. +// */ func _whereSortingCost(tls *crt.TLS, _pWInfo *XWhereInfo, _nRow int16, _nOrderBy int32, _nSorted int32) (r0 int16) { var _rScale, _rSortCost int16 func() { @@ -87547,9 +91318,12 @@ func init() { crt.Xstrncpy(nil, &_whereSortingCostØ00__func__Ø000[0], str(106969), 17) } -// Generate code to construct the Index object for an automatic index -// and to set up the WhereLevel object pLevel so that the code generator -// makes use of the automatic index. +// C comment +// /* +// ** Generate code to construct the Index object for an automatic index +// ** and to set up the WhereLevel object pLevel so that the code generator +// ** makes use of the automatic index. +// */ func _constructAutomaticIndex(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _pSrc *TSrcList_item, _notReady uint64, _pLevel *XWhereLevel) { var _nKeyCol, _addrInit, _addrTop, _regRecord, _n, _i, _mxBitCol, _iContinue, _addrCounter, _regBase, _3_iCol, _10_iCol, _16_regYield int32 var _idxCols, _extraCols, _3_cMask, _10_cMask uint64 @@ -87587,18 +91361,18 @@ _2: } _1_pExpr = (*XExpr)(_pTerm.X0) func() { - if ((_1_pExpr.X2)&uint32(i32(1))) != uint32(i32(0)) && int32(_1_pExpr.X11) == (_pSrc.X11) && (_pLoop.X0) == uint64(i32(0)) { + if (_1_pExpr.X2&uint32(i32(1))) != uint32(i32(0)) && int32(_1_pExpr.X11) == _pSrc.X11 && _pLoop.X0 == uint64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131062), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(106986))) crt.X__builtin_abort(tls) } }() - if ((((_pLoop.X0) == uint64(i32(0))) && ((int32(_pTerm.X3) & i32(2)) == i32(0))) && (((_1_pExpr.X2) & uint32(i32(1))) == uint32(i32(0)))) && _sqlite3ExprIsTableConstant(tls, _1_pExpr, _pSrc.X11) != 0 { + if (((_pLoop.X0 == uint64(i32(0))) && ((int32(_pTerm.X3) & i32(2)) == i32(0))) && ((_1_pExpr.X2 & uint32(i32(1))) == uint32(i32(0)))) && _sqlite3ExprIsTableConstant(tls, _1_pExpr, _pSrc.X11) != 0 { _pPartial = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), _pPartial, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _1_pExpr, i32(0))) } if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 { goto _14 } - _3_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))) + _3_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))) _3_cMask = func() uint64 { if _3_iCol >= i32(64) { return u64(9223372036854775808) @@ -87615,7 +91389,7 @@ _2: if _whereLoopResize(tls, (*Xsqlite3)(_pParse.X0), _pLoop, _nKeyCol+i32(1)) != 0 { goto _end_auto_index_create } - *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(postInc1(&_nKeyCol, int32(1))))) = _pTerm + *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(postInc1(&_nKeyCol, 1)))) = _pTerm { p := &_idxCols *p = (*p) | _3_cMask @@ -87632,9 +91406,9 @@ _5: crt.X__builtin_abort(tls) } }() - *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = store14((*uint16)(unsafe.Pointer(&(_pLoop.X10))), uint16(_nKeyCol)) - *(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(16961)) - _extraCols = (_pSrc.X14) & ((^_idxCols) | u64(9223372036854775808)) + *(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0))) = store14((*uint16)(unsafe.Pointer(&_pLoop.X10)), uint16(_nKeyCol)) + *(*uint32)(unsafe.Pointer(&_pLoop.X9)) = uint32(i32(16961)) + _extraCols = _pSrc.X14 & ((^_idxCols) | u64(9223372036854775808)) _mxBitCol = func() int32 { if i32(63) < int32(_pTable.X11) { return i32(63) @@ -87652,7 +91426,7 @@ _24: _i += 1 goto _24 _27: - if ((_pSrc.X14) & u64(9223372036854775808)) != 0 { + if (_pSrc.X14 & u64(9223372036854775808)) != 0 { { p := &_nKeyCol *p = (*p) + ((int32(_pTable.X11) - i32(64)) + i32(1)) @@ -87663,9 +91437,9 @@ _27: if _pIdx == nil { goto _end_auto_index_create } - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4))))) = _pIdx - *(**int8)(unsafe.Pointer(&(_pIdx.X0))) = str(107120) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdx.X3))))) = _pTable + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4))))) = _pIdx + *(**int8)(unsafe.Pointer(&_pIdx.X0)) = str(107120) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIdx.X3)))) = _pTable _n = i32(0) _idxCols = uint64(i32(0)) _pTerm = (*XWhereTerm)(_pWC.X5) @@ -87676,7 +91450,7 @@ _31: if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 { goto _35 } - _10_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))) + _10_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))) _10_cMask = func() uint64 { if _10_iCol >= i32(64) { return u64(9223372036854775808) @@ -87690,11 +91464,11 @@ _31: *p = (*p) | _10_cMask sink17(*p) } - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_n))) = int16(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))) _pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_11_pX.X4), (*XExpr)(_11_pX.X5)) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_n))) = func() *int8 { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_n))) = func() *int8 { if _pColl != nil { - return (_pColl.X0) + return _pColl.X0 } return (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) }() @@ -87705,7 +91479,7 @@ _35: goto _31 _34: func() { - if uint32(_n) != uint32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) { + if uint32(_n) != uint32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131140), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107131))) crt.X__builtin_abort(tls) } @@ -87716,14 +91490,14 @@ _43: goto _46 } if (_extraCols & (u64(1) << uint(_i))) != 0 { - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) _n += 1 } _i += 1 goto _43 _46: - if ((_pSrc.X14) & u64(9223372036854775808)) == 0 { + if (_pSrc.X14 & u64(9223372036854775808)) == 0 { goto _48 } _i = i32(63) @@ -87731,8 +91505,8 @@ _49: if _i >= int32(_pTable.X11) { goto _52 } - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) _n += 1 _i += 1 goto _49 @@ -87744,21 +91518,21 @@ _48: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(i32(-1)) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_n))) = int16(i32(-1)) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) func() { - if (_pLevel.X2) < i32(0) { + if _pLevel.X2 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131163), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107169))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pLevel.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + *(*int32)(unsafe.Pointer(&_pLevel.X2)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(109), _pLevel.X2, _nKeyCol+i32(1)) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx) _sqlite3VdbeComment(tls, _v, str(107188), unsafe.Pointer(_pTable.X0)) _sqlite3ExprCachePush(tls, _pParse) - _pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pWC.X0).X1).X2))))) + 112*uintptr(_pLevel.X11))) - if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pWC.X0).X1).X2))))) + 112*uintptr(_pLevel.X11))) + if ((uint32(((*t28)(unsafe.Pointer(&_pTabItem.X9)).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { _16_regYield = _pTabItem.X7 _addrCounter = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), i32(0)) _sqlite3VdbeAddOp3(tls, _v, i32(15), _16_regYield, i32(0), _pTabItem.X6) @@ -87772,7 +91546,7 @@ _58: _iContinue = _sqlite3VdbeMakeLabel(tls, _v) _sqlite3ExprIfFalse(tls, _pParse, _pPartial, _iContinue, i32(16)) { - p := (*uint32)(unsafe.Pointer(&(_pLoop.X9))) + p := (*uint32)(unsafe.Pointer(&_pLoop.X9)) *p = (*p) | uint32(i32(131072)) sink5(*p) } @@ -87784,11 +91558,11 @@ _58: if _pPartial != nil { _sqlite3VdbeResolveLabel(tls, _v, _iContinue) } - if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_pTabItem.X9)).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { _sqlite3VdbeChangeP2(tls, _v, uint32(_addrCounter), _regBase+_n) _translateColumnToCopy(tls, _pParse, _addrTop, _pLevel.X1, _pTabItem.X8, i32(1)) _sqlite3VdbeGoto(tls, _v, _addrTop) - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1))), int8(i32(0)), 16, 4) + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_pTabItem.X9)).X1))), int8(i32(0)), 16, 4) goto _62 } _sqlite3VdbeAddOp2(tls, _v, i32(7), _pLevel.X1, _addrTop+i32(1)) @@ -87809,11 +91583,14 @@ func init() { crt.Xstrncpy(nil, &_constructAutomaticIndexØ00__func__Ø000[0], str(107212), 24) } -// Allocate heap space to hold an Index object with nCol columns. -// -// Increase the allocation size to provide an extra nExtra bytes -// of 8-byte aligned space after the Index object and return a -// pointer to this extra space in *ppExtra. +// C comment +// /* +// ** Allocate heap space to hold an Index object with nCol columns. +// ** +// ** Increase the allocation size to provide an extra nExtra bytes +// ** of 8-byte aligned space after the Index object and return a +// ** pointer to this extra space in *ppExtra. +// */ func _sqlite3AllocateIndexObject(tls *crt.TLS, _db *Xsqlite3, _nCol int16, _nExtra int32, _ppExtra **int8) (r0 *XIndex) { var _nByte int32 var _1_pExtra *int8 @@ -87822,61 +91599,64 @@ func _sqlite3AllocateIndexObject(tls *crt.TLS, _db *Xsqlite3, _nCol int16, _nExt _p = (*XIndex)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte+_nExtra))) if _p != nil { _1_pExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))) + uintptr(u64(104)))) - *(***int8)(unsafe.Pointer(&(_p.X8))) = (**int8)(unsafe.Pointer(_1_pExtra)) + *(***int8)(unsafe.Pointer(&_p.X8)) = (**int8)(unsafe.Pointer(_1_pExtra)) { p := &_1_pExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(((u64(8)*uint64(_nCol))+uint64(i32(7)))&uint64(i32(-8))))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(((u64(8)*uint64(_nCol))+uint64(i32(7)))&uint64(i32(-8))))) sink0(*p) } - *(**int16)(unsafe.Pointer(&(_p.X2))) = (*int16)(unsafe.Pointer(_1_pExtra)) + *(**int16)(unsafe.Pointer(&_p.X2)) = (*int16)(unsafe.Pointer(_1_pExtra)) { p := &_1_pExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u64(2)*uint64(int32(_nCol)+i32(1))))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(u64(2)*uint64(int32(_nCol)+i32(1))))) sink0(*p) } - *(**int16)(unsafe.Pointer(&(_p.X1))) = (*int16)(unsafe.Pointer(_1_pExtra)) + *(**int16)(unsafe.Pointer(&_p.X1)) = (*int16)(unsafe.Pointer(_1_pExtra)) { p := &_1_pExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u64(2)*uint64(_nCol)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(u64(2)*uint64(_nCol)))) sink0(*p) } - *(**uint8)(unsafe.Pointer(&(_p.X7))) = (*uint8)(unsafe.Pointer(_1_pExtra)) - *(*uint16)(unsafe.Pointer(&(_p.X14))) = uint16(_nCol) - *(*uint16)(unsafe.Pointer(&(_p.X13))) = uint16(int32(_nCol) - i32(1)) + *(**uint8)(unsafe.Pointer(&_p.X7)) = (*uint8)(unsafe.Pointer(_1_pExtra)) + *(*uint16)(unsafe.Pointer(&_p.X14)) = uint16(_nCol) + *(*uint16)(unsafe.Pointer(&_p.X13)) = uint16(int32(_nCol) - i32(1)) *_ppExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))) + uintptr(_nByte))) } return _p } -// Generate code that will assemble an index key and stores it in register -// regOut. The key with be for index pIdx which is an index on pTab. -// iCur is the index of a cursor open on the pTab table and pointing to -// the entry that needs indexing. If pTab is a WITHOUT ROWID table, then -// iCur must be the cursor of the PRIMARY KEY index. -// -// Return a register number which is the first in a block of -// registers that holds the elements of the index key. The -// block of registers has already been deallocated by the time -// this routine returns. -// -// If *piPartIdxLabel is not NULL, fill it in with a label and jump -// to that label if pIdx is a partial index that should be skipped. -// The label should be resolved using sqlite3ResolvePartIdxLabel(). -// A partial index should be skipped if its WHERE clause evaluates -// to false or null. If pIdx is not a partial index, *piPartIdxLabel -// will be set to zero which is an empty label that is ignored by -// sqlite3ResolvePartIdxLabel(). -// -// The pPrior and regPrior parameters are used to implement a cache to -// avoid unnecessary register loads. If pPrior is not NULL, then it is -// a pointer to a different index for which an index key has just been -// computed into register regPrior. If the current pIdx index is generating -// its key into the same sequence of registers and if pPrior and pIdx share -// a column in common, then the register corresponding to that column already -// holds the correct value and the loading of that register is skipped. -// This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK -// on a table with multiple indices, and especially with the ROWID or -// PRIMARY KEY columns of the index. +// C comment +// /* +// ** Generate code that will assemble an index key and stores it in register +// ** regOut. The key with be for index pIdx which is an index on pTab. +// ** iCur is the index of a cursor open on the pTab table and pointing to +// ** the entry that needs indexing. If pTab is a WITHOUT ROWID table, then +// ** iCur must be the cursor of the PRIMARY KEY index. +// ** +// ** Return a register number which is the first in a block of +// ** registers that holds the elements of the index key. The +// ** block of registers has already been deallocated by the time +// ** this routine returns. +// ** +// ** If *piPartIdxLabel is not NULL, fill it in with a label and jump +// ** to that label if pIdx is a partial index that should be skipped. +// ** The label should be resolved using sqlite3ResolvePartIdxLabel(). +// ** A partial index should be skipped if its WHERE clause evaluates +// ** to false or null. If pIdx is not a partial index, *piPartIdxLabel +// ** will be set to zero which is an empty label that is ignored by +// ** sqlite3ResolvePartIdxLabel(). +// ** +// ** The pPrior and regPrior parameters are used to implement a cache to +// ** avoid unnecessary register loads. If pPrior is not NULL, then it is +// ** a pointer to a different index for which an index key has just been +// ** computed into register regPrior. If the current pIdx index is generating +// ** its key into the same sequence of registers and if pPrior and pIdx share +// ** a column in common, then the register corresponding to that column already +// ** holds the correct value and the loading of that register is skipped. +// ** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK +// ** on a table with multiple indices, and especially with the ROWID or +// ** PRIMARY KEY columns of the index. +// */ func _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDataCur int32, _regOut int32, _prefixOnly int32, _piPartIdxLabel *int32, _pPrior *XIndex, _regPrior int32) (r0 int32) { var _j, _regBase, _nCol int32 var _7_zAff *int8 @@ -87885,9 +91665,9 @@ func _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDa if _piPartIdxLabel == nil { goto _0 } - if (*XExpr)(_pIdx.X9) != nil { + if _pIdx.X9 != nil { *_piPartIdxLabel = _sqlite3VdbeMakeLabel(tls, _v) - *(*int32)(unsafe.Pointer(&(_pParse.X22))) = _iDataCur + *(*int32)(unsafe.Pointer(&_pParse.X22)) = _iDataCur _sqlite3ExprCachePush(tls, _pParse) _sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.X9), *_piPartIdxLabel, i32(16)) goto _2 @@ -87896,13 +91676,13 @@ func _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDa _2: _0: _nCol = int32(func() uint16 { - if _prefixOnly != 0 && (((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0) { - return (_pIdx.X13) + if _prefixOnly != 0 && (((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0) { + return _pIdx.X13 } - return (_pIdx.X14) + return _pIdx.X14 }()) _regBase = _sqlite3GetTempRange(tls, _pParse, _nCol) - if (_pPrior != nil) && ((_regBase != _regPrior) || ((*XExpr)(_pPrior.X9) != nil)) { + if (_pPrior != nil) && ((_regBase != _regPrior) || (_pPrior.X9 != nil)) { _pPrior = nil } _j = i32(0) @@ -87910,7 +91690,7 @@ _9: if _j >= _nCol { goto _12 } - if ((_pPrior != nil) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrior.X1)) + 2*uintptr(_j)))) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))))) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrior.X1)) + 2*uintptr(_j)))) != i32(-2)) { + if ((_pPrior != nil) && (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPrior.X1)) + 2*uintptr(_j)))) == int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_j)))))) && (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPrior.X1)) + 2*uintptr(_j)))) != i32(-2)) { goto _10 } _sqlite3ExprCodeLoadIndexColumn(tls, _pParse, _pIdx, _iDataCur, _j, _regBase+_j) @@ -87923,7 +91703,7 @@ _12: goto _16 } _sqlite3VdbeAddOp3(tls, _v, i32(101), _regBase, _nCol, _regOut) - if (*XSelect)((*XTable)(_pIdx.X3).X3) != nil { + if ((*XTable)(_pIdx.X3).X3) != nil { _7_zAff = _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pIdx) _sqlite3VdbeChangeP4(tls, _v, i32(-1), _7_zAff, i32(0)) } @@ -87932,9 +91712,12 @@ _16: return _regBase } -// Like sqlite3ExprIfFalse() except that a copy is made of pExpr before -// code generation, and that copy is deleted after code generation. This -// ensures that the original pExpr is unchanged. +// C comment +// /* +// ** Like sqlite3ExprIfFalse() except that a copy is made of pExpr before +// ** code generation, and that copy is deleted after code generation. This +// ** ensures that the original pExpr is unchanged. +// */ func _sqlite3ExprIfFalseDup(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) { var _db *Xsqlite3 var _pCopy *XExpr @@ -87946,14 +91729,16 @@ func _sqlite3ExprIfFalseDup(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest _sqlite3ExprDelete(tls, _db, _pCopy) } -// Generate code that will load into register regOut a value that is -// appropriate for the iIdxCol-th column of index pIdx. +// C comment +// /* Generate code that will load into register regOut a value that is +// ** appropriate for the iIdxCol-th column of index pIdx. +// */ func _sqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iTabCur int32, _iIdxCol int32, _regOut int32) { var _iTabCol int16 - _iTabCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iIdxCol))) + _iTabCol = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_iIdxCol))) if int32(_iTabCol) == i32(-2) { func() { - if (*XExprList)(_pIdx.X10) == nil { + if _pIdx.X10 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94130), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000))), unsafe.Pointer(str(107236))) crt.X__builtin_abort(tls) } @@ -87964,8 +91749,8 @@ func _sqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, _pParse *XParse, _pIdx *XInde crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pParse.X22))) = _iTabCur - _sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_iIdxCol))).X0), _regOut) + *(*int32)(unsafe.Pointer(&_pParse.X22)) = _iTabCur + _sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_iIdxCol))).X0), _regOut) goto _5 } _sqlite3ExprCodeGetColumnOfTable(tls, (*TVdbe)(_pParse.X2), (*XTable)(_pIdx.X3), _iTabCur, int32(_iTabCol), _regOut) @@ -87978,57 +91763,66 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000[0], str(107281), 31) } -// Make a transient copy of expression pExpr and then code it using -// sqlite3ExprCode(). This routine works just like sqlite3ExprCode() -// except that the input expression is guaranteed to be unchanged. +// C comment +// /* +// ** Make a transient copy of expression pExpr and then code it using +// ** sqlite3ExprCode(). This routine works just like sqlite3ExprCode() +// ** except that the input expression is guaranteed to be unchanged. +// */ func _sqlite3ExprCodeCopy(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) { var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) _pExpr = _sqlite3ExprDup(tls, _db, _pExpr, i32(0)) - if (_db.X17) == 0 { + if _db.X17 == 0 { _sqlite3ExprCode(tls, _pParse, _pExpr, _target) } _sqlite3ExprDelete(tls, _db, _pExpr) } -// If the last opcode is "op" and it is not a jump destination, -// then remove it. Return true if and only if an opcode was removed. +// C comment +// /* +// ** If the last opcode is "op" and it is not a jump destination, +// ** then remove it. Return true if and only if an opcode was removed. +// */ func _sqlite3VdbeDeletePriorOpcode(tls *crt.TLS, _p *TVdbe, _op uint8) (r0 int32) { - if ((_p.X27) > i32(0)) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr((_p.X27)-i32(1)))).X0) == int32(_op)) { - return _sqlite3VdbeChangeToNoop(tls, _p, (_p.X27)-i32(1)) + if (_p.X27 > i32(0)) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+32*uintptr(_p.X27-i32(1)))).X0) == int32(_op)) { + return _sqlite3VdbeChangeToNoop(tls, _p, _p.X27-i32(1)) } return i32(0) } -// Return a pointer to the column affinity string associated with index -// pIdx. A column affinity string has one character for each column in -// the table, according to the affinity of the column: -// -// Character Column affinity -// ------------------------------ -// 'A' BLOB -// 'B' TEXT -// 'C' NUMERIC -// 'D' INTEGER -// 'F' REAL -// -// An extra 'D' is appended to the end of the string to cover the -// rowid that appears as the last column in every index. -// -// Memory for the buffer containing the column index affinity string -// is managed along with the rest of the Index structure. It will be -// released when sqlite3DeleteIndex() is called. +// C comment +// /* +// ** Return a pointer to the column affinity string associated with index +// ** pIdx. A column affinity string has one character for each column in +// ** the table, according to the affinity of the column: +// ** +// ** Character Column affinity +// ** ------------------------------ +// ** 'A' BLOB +// ** 'B' TEXT +// ** 'C' NUMERIC +// ** 'D' INTEGER +// ** 'F' REAL +// ** +// ** An extra 'D' is appended to the end of the string to cover the +// ** rowid that appears as the last column in every index. +// ** +// ** Memory for the buffer containing the column index affinity string +// ** is managed along with the rest of the Index structure. It will be +// ** released when sqlite3DeleteIndex() is called. +// */ func _sqlite3IndexAffinityStr(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) (r0 *int8) { var _3_x int16 var _1_n int32 var _6_aff int8 var _1_pTab *XTable - if (_pIdx.X4) != nil { + if _pIdx.X4 != nil { goto _0 } _1_pTab = (*XTable)(_pIdx.X3) - *(**int8)(unsafe.Pointer(&(_pIdx.X4))) = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pIdx.X14)+i32(1)))) - if (_pIdx.X4) == nil { + *(**int8)(unsafe.Pointer(&_pIdx.X4)) = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pIdx.X14)+i32(1)))) + if _pIdx.X4 == nil { _sqlite3OomFault(tls, _db) return nil } @@ -88037,13 +91831,13 @@ _2: if _1_n >= int32(_pIdx.X14) { goto _5 } - _3_x = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_n))) + _3_x = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_1_n))) if int32(_3_x) >= i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = (*XColumn)(unsafe.Pointer(uintptr(_1_pTab.X1) + 32*uintptr(_3_x))).X4 + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X4)) + 1*uintptr(_1_n))) = (*XColumn)(unsafe.Pointer(uintptr(_1_pTab.X1) + 32*uintptr(_3_x))).X4 goto _9 } if int32(_3_x) == i32(-1) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(68)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(68)) goto _9 } func() { @@ -88058,16 +91852,16 @@ _2: crt.X__builtin_abort(tls) } }() - _6_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_1_n))).X0)) + _6_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_1_n))).X0)) if int32(_6_aff) == i32(0) { _6_aff = int8(i32(65)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = _6_aff + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X4)) + 1*uintptr(_1_n))) = _6_aff _9: _1_n += 1 goto _2 _5: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(0)) _0: return _pIdx.X4 } @@ -88078,16 +91872,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3IndexAffinityStrØ00__func__Ø000[0], str(107341), 24) } -// Convert OP_Column opcodes to OP_Copy in previously generated code. -// -// This routine runs over generated VDBE code and translates OP_Column -// opcodes into OP_Copy when the table is being accessed via co-routine -// instead of via table lookup. -// -// If the bIncrRowid parameter is 0, then any OP_Rowid instructions on -// cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero, -// then each OP_Rowid is transformed into an instruction to increment the -// value stored in its output register. +// C comment +// /* +// ** Convert OP_Column opcodes to OP_Copy in previously generated code. +// ** +// ** This routine runs over generated VDBE code and translates OP_Column +// ** opcodes into OP_Copy when the table is being accessed via co-routine +// ** instead of via table lookup. +// ** +// ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on +// ** cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero, +// ** then each OP_Rowid is transformed into an instruction to increment the +// ** value stored in its output register. +// */ func _translateColumnToCopy(tls *crt.TLS, _pParse *XParse, _iStart int32, _iTabCur int32, _iRegister int32, _bIncrRowid int32) { var _iEnd int32 var _v *TVdbe @@ -88102,28 +91899,28 @@ _0: if _iStart >= _iEnd { goto _4 } - if (_pOp.X3) != _iTabCur { + if _pOp.X3 != _iTabCur { goto _2 } if int32(_pOp.X0) == i32(99) { - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(64)) - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = (_pOp.X4) + _iRegister - *(*int32)(unsafe.Pointer(&(_pOp.X4))) = _pOp.X5 - *(*int32)(unsafe.Pointer(&(_pOp.X5))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(64)) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = _pOp.X4 + _iRegister + *(*int32)(unsafe.Pointer(&_pOp.X4)) = _pOp.X5 + *(*int32)(unsafe.Pointer(&_pOp.X5)) = i32(0) goto _8 } if int32(_pOp.X0) != i32(125) { goto _8 } if _bIncrRowid != 0 { - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(73)) - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = _pOp.X4 - *(*int32)(unsafe.Pointer(&(_pOp.X4))) = i32(1) + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(73)) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = _pOp.X4 + *(*int32)(unsafe.Pointer(&_pOp.X4)) = i32(1) goto _10 } - *(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(59)) - *(*int32)(unsafe.Pointer(&(_pOp.X3))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pOp.X5))) = i32(0) + *(*uint8)(unsafe.Pointer(&_pOp.X0)) = uint8(i32(59)) + *(*int32)(unsafe.Pointer(&_pOp.X3)) = i32(0) + *(*int32)(unsafe.Pointer(&_pOp.X5)) = i32(0) _10: _8: _2: @@ -88132,13 +91929,16 @@ _2: _4: } -// This function is a no-op unless currently processing an EXPLAIN QUERY PLAN -// command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was -// defined at compile-time. If it is not a no-op, a single OP_Explain opcode -// is added to the output to describe the table scan strategy in pLevel. -// -// If an OP_Explain opcode is added to the VM, its address is returned. -// Otherwise, if no OP_Explain is coded, zero is returned. +// C comment +// /* +// ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN +// ** command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was +// ** defined at compile-time. If it is not a no-op, a single OP_Explain opcode +// ** is added to the output to describe the table scan strategy in pLevel. +// ** +// ** If an OP_Explain opcode is added to the VM, its address is returned. +// ** Otherwise, if no OP_Explain is coded, zero is returned. +// */ func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pLevel *XWhereLevel, _iLevel int32, _iFrom int32, _wctrlFlags uint16) (r0 int32) { var _ret, _1_iId, _1_isSearch int32 var _1_flags uint32 @@ -88151,7 +91951,7 @@ func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcL var _5_pIdx *XIndex var _1_pLoop *XWhereLoop _ret = i32(0) - _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_pLevel.X11))) + _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_pLevel.X11))) _1_v = (*TVdbe)(_pParse.X2) _1_db = (*Xsqlite3)(_pParse.X0) _1_iId = _pParse.X58 @@ -88160,7 +91960,7 @@ func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcL if ((_1_flags & uint32(i32(8192))) != 0) || (int32(_wctrlFlags)&i32(32)) != 0 { return i32(0) } - _1_isSearch = bool2int((((_1_flags & uint32(i32(48))) != uint32(i32(0))) || (((_1_flags & uint32(i32(1024))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X0) > i32(0)))) || (int32(_wctrlFlags)&i32(3)) != 0) + _1_isSearch = bool2int((((_1_flags & uint32(i32(48))) != uint32(i32(0))) || (((_1_flags & uint32(i32(1024))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_1_pLoop.X8)))).X0) > i32(0)))) || (int32(_wctrlFlags)&i32(3)) != 0) _sqlite3StrAccumInit(tls, &_1_str, _1_db, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(u64(100)), i32(1000000000)) _sqlite3StrAccumAppendAll(tls, &_1_str, func() *int8 { if _1_isSearch != 0 { @@ -88168,13 +91968,13 @@ func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcL } return str(107372) }()) - if (*XSelect)(_1_pItem.X5) != nil { + if _1_pItem.X5 != nil { _sqlite3XPrintf(tls, &_1_str, str(107377), int32(_1_pItem.X10)) goto _8 } _sqlite3XPrintf(tls, &_1_str, str(107390), unsafe.Pointer(_1_pItem.X2)) _8: - if (_1_pItem.X3) != nil { + if _1_pItem.X3 != nil { _sqlite3XPrintf(tls, &_1_str, str(107400), unsafe.Pointer(_1_pItem.X3)) } if (_1_flags & uint32(i32(1280))) != uint32(i32(0)) { @@ -88182,12 +91982,12 @@ _8: } _5_zFmt = nil func() { - if (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4) == nil { + if (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_1_pLoop.X8)))).X4) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126959), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000))), unsafe.Pointer(str(107407))) crt.X__builtin_abort(tls) } }() - _5_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4) + _5_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_1_pLoop.X8)))).X4) func() { if (_1_flags&uint32(i32(16384))) != 0 && (_1_flags&uint32(i32(64))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126961), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000))), unsafe.Pointer(str(107432))) @@ -88250,7 +92050,7 @@ _35: goto _39 _29: if (_1_flags & uint32(i32(1024))) != uint32(i32(0)) { - _sqlite3XPrintf(tls, &_1_str, str(107669), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X0, unsafe.Pointer((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4)) + _sqlite3XPrintf(tls, &_1_str, str(107669), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_1_pLoop.X8)))).X0, unsafe.Pointer((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_1_pLoop.X8)))).X4)) } _39: _1_zMsg = _sqlite3StrAccumFinish(tls, &_1_str) @@ -88268,27 +92068,30 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereExplainOneScanØ00__func__Ø000[0], str(107696), 27) } -// Argument pLevel describes a strategy for scanning table pTab. This -// function appends text to pStr that describes the subset of table -// rows scanned by the strategy in the form of an SQL expression. -// -// For example, if the query: -// -// SELECT * FROM t1 WHERE a=1 AND b>2; -// -// is run and there is an index on (a, b), then this function returns a -// string similar to: -// -// "a=? AND b>?" +// C comment +// /* +// ** Argument pLevel describes a strategy for scanning table pTab. This +// ** function appends text to pStr that describes the subset of table +// ** rows scanned by the strategy in the form of an SQL expression. +// ** +// ** For example, if the query: +// ** +// ** SELECT * FROM t1 WHERE a=1 AND b>2; +// ** +// ** is run and there is an index on (a, b), then this function returns a +// ** string similar to: +// ** +// ** "a=? AND b>?" +// */ func _explainIndexRange(tls *crt.TLS, _pStr *XStrAccum, _pLoop *XWhereLoop) { var _i, _j int32 var _1_z *int8 var _nEq, _nSkip uint16 var _pIndex *XIndex - _pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4) - _nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0 + _pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4) + _nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0 _nSkip = _pLoop.X11 - if (int32(_nEq) == i32(0)) && (((_pLoop.X9) & uint32(i32(48))) == uint32(i32(0))) { + if (int32(_nEq) == i32(0)) && ((_pLoop.X9 & uint32(i32(48))) == uint32(i32(0))) { return } _sqlite3StrAccumAppend(tls, _pStr, str(107723), i32(2)) @@ -88311,19 +92114,22 @@ _2: goto _2 _5: _j = _i - if ((_pLoop.X9) & uint32(i32(32))) != 0 { - _explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1), _j, _i, str(107605)) + if (_pLoop.X9 & uint32(i32(32))) != 0 { + _explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1), _j, _i, str(107605)) _i = i32(1) } - if ((_pLoop.X9) & uint32(i32(16))) != 0 { - _explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2), _j, _i, str(107629)) + if (_pLoop.X9 & uint32(i32(16))) != 0 { + _explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X2), _j, _i, str(107629)) } _sqlite3StrAccumAppend(tls, _pStr, str(37898), i32(1)) } -// Return the name of the i-th column of the pIdx index. +// C comment +// /* +// ** Return the name of the i-th column of the pIdx index. +// */ func _explainIndexColumnName(tls *crt.TLS, _pIdx *XIndex, _i int32) (r0 *int8) { - _i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) + _i = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) if _i == i32(-2) { return str(107745) } @@ -88333,12 +92139,15 @@ func _explainIndexColumnName(tls *crt.TLS, _pIdx *XIndex, _i int32) (r0 *int8) { return (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 32*uintptr(_i))).X0 } -// This routine is a helper for explainIndexRange() below -// -// pStr holds the text of an expression that we are building up one term -// at a time. This routine adds a new term to the end of the expression. -// Terms are separated by AND so add the "AND" text for second and subsequent -// terms only. +// C comment +// /* +// ** This routine is a helper for explainIndexRange() below +// ** +// ** pStr holds the text of an expression that we are building up one term +// ** at a time. This routine adds a new term to the end of the expression. +// ** Terms are separated by AND so add the "AND" text for second and subsequent +// ** terms only. +// */ func _explainAppendTerm(tls *crt.TLS, _pStr *XStrAccum, _pIdx *XIndex, _nTerm int32, _iTerm int32, _bAnd int32, _zOp *int8) { var _i int32 func() { @@ -88395,8 +92204,11 @@ func init() { crt.Xstrncpy(nil, &_explainAppendTermØ00__func__Ø000[0], str(107765), 18) } -// Generate code for the start of the iLevel-th loop in the WHERE clause -// implementation described by pWInfo. +// C comment +// /* +// ** Generate code for the start of the iLevel-th loop in the WHERE clause +// ** implementation described by pWInfo. +// */ func _sqlite3WhereCodeOneLoopStart(tls *crt.TLS, _pWInfo *XWhereInfo, _iLevel int32, _notReady uint64) (r0 uint64) { var _j, _k, _iCur, _addrNxt, _omitTable, _bRev, _addrBrk, _addrHalt, _addrCont, _iRowidReg, _iReleaseReg, _loopAgain, _3_regYield, _4_iReg, _4_addrNotFound, _4_nConstraint, _4_iIn, _5_iTarget, _15_testOp, _15_start, _15_memEndValue, _17_r1, _17_rTemp, _17_op, _26_regBase, _26_startEq, _26_endEq, _26_start_constraints, _26_nConstraint, _26_iIdxCur, _26_nExtraReg, _26_op, _65_iCovCur, _65_regReturn, _65_regRowset, _65_regRowid, _65_iLoopBody, _65_iRetInit, _65_untestedTerms, _65_ii, _66_nNotReady, _72_iTerm, _76_jmp1, _78_addrExplain, _79_r, _79_iSet, _81_nPk, _81_iPk, _82_iCol, _92_skipLikeAddr int32 var _96_x uint32 @@ -88424,40 +92236,40 @@ func _sqlite3WhereCodeOneLoopStart(tls *crt.TLS, _pWInfo *XWhereInfo, _iLevel in _pIdx = nil _pParse = (*XParse)(_pWInfo.X0) _v = (*TVdbe)(_pParse.X2) - _pWC = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))) + _pWC = (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22)) _db = (*Xsqlite3)(_pParse.X0) - _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(_iLevel))) + _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(_iLevel))) _pLoop = (*XWhereLoop)(_pLevel.X18) - _pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLevel.X11))) + _pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 112*uintptr(_pLevel.X11))) _iCur = _pTabItem.X11 - *(*uint64)(unsafe.Pointer(&(_pLevel.X19))) = _notReady & (^_sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _iCur)) - _bRev = int32(((_pWInfo.X20) >> uint(_iLevel)) & uint64(i32(1))) - _omitTable = bool2int((((_pLoop.X9) & uint32(i32(64))) != uint32(i32(0))) && ((int32(_pWInfo.X10) & i32(32)) == i32(0))) - _addrBrk = store1((*int32)(unsafe.Pointer(&(_pLevel.X3))), store1((*int32)(unsafe.Pointer(&(_pLevel.X4))), _sqlite3VdbeMakeLabel(tls, _v))) - _addrCont = store1((*int32)(unsafe.Pointer(&(_pLevel.X6))), _sqlite3VdbeMakeLabel(tls, _v)) - if (int32(_pLevel.X11) > i32(0)) && ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTabItem)) + 112*uintptr(i32(0)))).X9))).X0) & i32(8)) != i32(0)) { - *(*int32)(unsafe.Pointer(&(_pLevel.X0))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(*uint64)(unsafe.Pointer(&_pLevel.X19)) = _notReady & (^_sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&_pWInfo.X23)), _iCur)) + _bRev = int32((_pWInfo.X20 >> uint(_iLevel)) & uint64(i32(1))) + _omitTable = bool2int(((_pLoop.X9 & uint32(i32(64))) != uint32(i32(0))) && ((int32(_pWInfo.X10) & i32(32)) == i32(0))) + _addrBrk = store1((*int32)(unsafe.Pointer(&_pLevel.X3)), store1((*int32)(unsafe.Pointer(&_pLevel.X4)), _sqlite3VdbeMakeLabel(tls, _v))) + _addrCont = store1((*int32)(unsafe.Pointer(&_pLevel.X6)), _sqlite3VdbeMakeLabel(tls, _v)) + if (int32(_pLevel.X11) > i32(0)) && ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTabItem)) + 112*uintptr(i32(0)))).X9))).X0) & i32(8)) != i32(0)) { + *(*int32)(unsafe.Pointer(&_pLevel.X0)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _pLevel.X0) _sqlite3VdbeComment(tls, _v, str(107783)) } _j = _iLevel _3: - if _j <= i32(0) || ((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))+88*uintptr(_j))).X0) != i32(0) { + if _j <= i32(0) || ((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24))))+88*uintptr(_j))).X0) != i32(0) { goto _7 } _j -= 1 goto _3 _7: - _addrHalt = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(_j))).X3 - if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + _addrHalt = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(_j))).X3 + if ((uint32(((*t28)(unsafe.Pointer(&_pTabItem.X9)).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { _3_regYield = _pTabItem.X7 _sqlite3VdbeAddOp3(tls, _v, i32(15), _3_regYield, i32(0), _pTabItem.X6) - *(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _sqlite3VdbeAddOp2(tls, _v, i32(16), _3_regYield, _addrBrk) + *(*int32)(unsafe.Pointer(&_pLevel.X16)) = _sqlite3VdbeAddOp2(tls, _v, i32(16), _3_regYield, _addrBrk) _sqlite3VdbeComment(tls, _v, str(107195), unsafe.Pointer((*XTable)(_pTabItem.X4).X0)) - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(13)) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(13)) goto _270 } - if ((_pLoop.X9) & uint32(i32(1024))) == uint32(i32(0)) { + if (_pLoop.X9 & uint32(i32(1024))) == uint32(i32(0)) { goto _10 } _4_nConstraint = int32(_pLoop.X10) @@ -88470,7 +92282,7 @@ _11: goto _14 } _5_iTarget = (_4_iReg + _j) + i32(2) - _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j))) + _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j))) if func() int32 { if _pTerm == nil { return func() int32 { @@ -88495,31 +92307,31 @@ _12: _j += 1 goto _11 _14: - _sqlite3VdbeAddOp2(tls, _v, i32(56), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0, _4_iReg) + _sqlite3VdbeAddOp2(tls, _v, i32(56), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0, _4_iReg) _sqlite3VdbeAddOp2(tls, _v, i32(56), _4_nConstraint, _4_iReg+i32(1)) - _sqlite3VdbeAddOp4(tls, _v, i32(11), _iCur, _4_addrNotFound, _4_iReg, (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4, func() int32 { - if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1) != 0 { + _sqlite3VdbeAddOp4(tls, _v, i32(11), _iCur, _4_addrNotFound, _4_iReg, (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4, func() int32 { + if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1) != 0 { return i32(-1) } return i32(-2) }()) - *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1))) = uint8(i32(0)) - *(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(func() int32 { - if (_pWInfo.X14) != 0 { + *(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1))) = uint8(i32(0)) + *(*int32)(unsafe.Pointer(&_pLevel.X15)) = _iCur + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(func() int32 { + if _pWInfo.X14 != 0 { return i32(164) } return i32(50) }()) - *(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _sqlite3VdbeCurrentAddr(tls, _v) - _4_iIn = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0 + *(*int32)(unsafe.Pointer(&_pLevel.X16)) = _sqlite3VdbeCurrentAddr(tls, _v) + _4_iIn = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0 _j = _4_nConstraint - i32(1) _24: if _j < i32(0) { goto _27 } - _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j))) - if (_j < i32(16)) && ((int32((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3)>>uint(_j))&i32(1)) != 0 { + _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j))) + if (_j < i32(16)) && ((int32((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X3)>>uint(_j))&i32(1)) != 0 { _disableTerm(tls, _pLevel, _pTerm) goto _31 } @@ -88527,19 +92339,19 @@ _24: goto _31 } func() { - if (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1) == nil && (_db.X17) == 0 { + if (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1) == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107812))) crt.X__builtin_abort(tls) } }() - if (_db.X17) == 0 { + if _db.X17 == 0 { func() { if _4_iIn <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128029), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107856))) crt.X__builtin_abort(tls) } }() - _10_pOp = _sqlite3VdbeGetOp(tls, _v, (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1)+12*uintptr(preInc1(&_4_iIn, -1)))).X1) + _10_pOp = _sqlite3VdbeGetOp(tls, _v, (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1)+12*uintptr(preInc1(&_4_iIn, -1)))).X1) func() { if int32(_10_pOp.X0) != i32(99) && int32(_10_pOp.X0) != i32(125) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128031), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107862))) @@ -88547,13 +92359,13 @@ _24: } }() func() { - if int32(_10_pOp.X0) == i32(99) && (_10_pOp.X5) != ((_4_iReg+_j)+i32(2)) { + if int32(_10_pOp.X0) == i32(99) && _10_pOp.X5 != ((_4_iReg+_j)+i32(2)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128032), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107910))) crt.X__builtin_abort(tls) } }() func() { - if int32(_10_pOp.X0) == i32(125) && (_10_pOp.X4) != ((_4_iReg+_j)+i32(2)) { + if int32(_10_pOp.X0) == i32(125) && _10_pOp.X4 != ((_4_iReg+_j)+i32(2)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128033), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107954))) crt.X__builtin_abort(tls) } @@ -88562,7 +92374,7 @@ _24: } _10_pCompare = _sqlite3PExpr(tls, _pParse, i32(78), nil, nil) func() { - if _10_pCompare == nil && (_db.X17) == 0 { + if _10_pCompare == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128041), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107997))) crt.X__builtin_abort(tls) } @@ -88570,13 +92382,13 @@ _24: if _10_pCompare == nil { goto _50 } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X4))))) = (*XExpr)((*XExpr)(_pTerm.X0).X4) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X5))))) = store36(&_10_pRight, _sqlite3Expr(tls, _db, i32(157), nil)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_10_pCompare.X4)))) = (*XExpr)((*XExpr)(_pTerm.X0).X4) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_10_pCompare.X5)))) = store36(&_10_pRight, _sqlite3Expr(tls, _db, i32(157), nil)) if _10_pRight != nil { - *(*int32)(unsafe.Pointer(&(_10_pRight.X8))) = (_4_iReg + _j) + i32(2) + *(*int32)(unsafe.Pointer(&_10_pRight.X8)) = (_4_iReg + _j) + i32(2) _sqlite3ExprIfFalse(tls, _pParse, _10_pCompare, _pLevel.X6, i32(0)) } - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X4))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_10_pCompare.X4)))) = nil _sqlite3ExprDelete(tls, _db, _10_pCompare) _50: _31: @@ -88586,16 +92398,16 @@ _27: _sqlite3ExprCachePop(tls, _pParse) goto _270 _10: - if ((_pLoop.X9)&uint32(i32(256))) == uint32(i32(0)) || ((_pLoop.X9)&uint32(i32(5))) == uint32(i32(0)) { + if (_pLoop.X9&uint32(i32(256))) == uint32(i32(0)) || (_pLoop.X9&uint32(i32(5))) == uint32(i32(0)) { goto _54 } func() { - if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) != i32(1) { + if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128073), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108029))) crt.X__builtin_abort(tls) } }() - _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(i32(0)))) + _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(i32(0)))) func() { if _pTerm == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128075), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108051))) @@ -88614,7 +92426,7 @@ _10: crt.X__builtin_abort(tls) } }() - _iReleaseReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iReleaseReg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _iRowidReg = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, i32(0), _bRev, _iReleaseReg) if _iRowidReg != _iReleaseReg { _sqlite3ReleaseTempReg(tls, _pParse, _iReleaseReg) @@ -88624,10 +92436,10 @@ _10: _sqlite3ExprCacheAffinityChange(tls, _pParse, _iRowidReg, i32(1)) _sqlite3ExprCacheStore(tls, _pParse, _iCur, i32(-1), _iRowidReg) _sqlite3VdbeComment(tls, _v, str(61650)) - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164)) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(164)) goto _270 _54: - if ((_pLoop.X9)&uint32(i32(256))) == uint32(i32(0)) || ((_pLoop.X9)&uint32(i32(2))) == uint32(i32(0)) { + if (_pLoop.X9&uint32(i32(256))) == uint32(i32(0)) || (_pLoop.X9&uint32(i32(2))) == uint32(i32(0)) { goto _66 } _15_testOp = i32(164) @@ -88640,11 +92452,11 @@ _54: }() _j = i32(0) _15_pStart = store65(&_15_pEnd, nil) - if ((_pLoop.X9) & uint32(i32(32))) != 0 { - _15_pStart = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(postInc1(&_j, int32(1))))) + if (_pLoop.X9 & uint32(i32(32))) != 0 { + _15_pStart = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(postInc1(&_j, 1)))) } - if ((_pLoop.X9) & uint32(i32(16))) != 0 { - _15_pEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(postInc1(&_j, int32(1))))) + if (_pLoop.X9 & uint32(i32(16))) != 0 { + _15_pEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(postInc1(&_j, 1)))) } func() { if _15_pStart == nil && _15_pEnd == nil { @@ -88680,12 +92492,12 @@ _54: if _sqlite3ExprIsVector(tls, (*XExpr)(_17_pX.X5)) != 0 { _17_r1 = store1(&_17_rTemp, _sqlite3GetTempReg(tls, _pParse)) _codeExprOrVector(tls, _pParse, (*XExpr)(_17_pX.X5), _17_r1, i32(1)) - _17_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_17_aMoveOp)) + 1*uintptr((int32(_17_pX.X0)-i32(79))|i32(1))))) + _17_op = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_17_aMoveOp)) + 1*uintptr((int32(_17_pX.X0)-i32(79))|i32(1))))) goto _81 } _17_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_17_pX.X5), &_17_rTemp) _disableTerm(tls, _pLevel, _15_pStart) - _17_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_17_aMoveOp)) + 1*uintptr(int32(_17_pX.X0)-i32(79))))) + _17_op = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_17_aMoveOp)) + 1*uintptr(int32(_17_pX.X0)-i32(79))))) _81: _sqlite3VdbeAddOp3(tls, _v, _17_op, _iCur, _addrBrk, _17_r1) _sqlite3VdbeComment(tls, _v, str(61650)) @@ -88716,7 +92528,7 @@ _82: crt.X__builtin_abort(tls) } }() - _15_memEndValue = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _15_memEndValue = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _codeExprOrVector(tls, _pParse, (*XExpr)(_21_pX.X5), _15_memEndValue, i32(1)) if (i32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.X5))) && ((int32(_21_pX.X0) == i32(81)) || (int32(_21_pX.X0) == i32(79))) { _15_testOp = func() int32 { @@ -88739,14 +92551,14 @@ _95: } _85: _15_start = _sqlite3VdbeCurrentAddr(tls, _v) - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(func() int32 { if _bRev != 0 { return i32(6) } return i32(7) }()) - *(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur - *(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _15_start + *(*int32)(unsafe.Pointer(&_pLevel.X15)) = _iCur + *(*int32)(unsafe.Pointer(&_pLevel.X16)) = _15_start func() { if int32(_pLevel.X14) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128180), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108176))) @@ -88754,7 +92566,7 @@ _85: } }() if _15_testOp != i32(164) { - _iRowidReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iRowidReg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(125), _iCur, _iRowidReg) _sqlite3ExprCacheStore(tls, _pParse, _iCur, i32(-1), _iRowidReg) _sqlite3VdbeAddOp3(tls, _v, _15_testOp, _15_memEndValue, _addrBrk, _iRowidReg) @@ -88762,19 +92574,19 @@ _85: } goto _270 _66: - if ((_pLoop.X9) & uint32(i32(512))) == 0 { + if (_pLoop.X9 & uint32(i32(512))) == 0 { goto _105 } - _26_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0 - _26_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1 - _26_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2 + _26_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0 + _26_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1 + _26_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X2 _26_pRangeStart = nil _26_pRangeEnd = nil _26_nExtraReg = i32(0) _26_zEndAff = nil _26_bSeekPastNull = u8(0) _26_bStopAtNull = u8(0) - _pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4) + _pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4) _26_iIdxCur = _pLevel.X2 func() { if int32(_26_nEq) < int32(_pLoop.X11) { @@ -88799,30 +92611,30 @@ _66: _26_nExtraReg = i32(1) } _j = int32(_26_nEq) - if ((_pLoop.X9) & uint32(i32(32))) != 0 { - _26_pRangeStart = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(postInc1(&_j, int32(1))))) + if (_pLoop.X9 & uint32(i32(32))) != 0 { + _26_pRangeStart = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(postInc1(&_j, 1)))) _26_nExtraReg = func() int32 { - if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1) { + if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1) { return _26_nExtraReg } - return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1) + return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X1) }() func() { - if (int32(_26_pRangeStart.X3)&i32(256)) != i32(0) && ((_pLoop.X9)&uint32(i32(16))) == uint32(i32(0)) { + if (int32(_26_pRangeStart.X3)&i32(256)) != i32(0) && (_pLoop.X9&uint32(i32(16))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128290), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108319))) crt.X__builtin_abort(tls) } }() } - if ((_pLoop.X9) & uint32(i32(16))) == 0 { + if (_pLoop.X9 & uint32(i32(16))) == 0 { goto _123 } - _26_pRangeEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(postInc1(&_j, int32(1))))) + _26_pRangeEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(postInc1(&_j, 1)))) _26_nExtraReg = func() int32 { - if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2) { + if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X2) { return _26_nExtraReg } - return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2) + return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X2) }() if (int32(_26_pRangeEnd.X3) & i32(256)) != i32(0) { func() { @@ -88837,10 +92649,10 @@ _66: crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pLevel.X9))) = uint32(preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) + *(*uint32)(unsafe.Pointer(&_pLevel.X9)) = uint32(preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), int32(_pLevel.X9)) _sqlite3VdbeComment(tls, _v, str(108452)) - *(*int32)(unsafe.Pointer(&(_pLevel.X10))) = _sqlite3VdbeCurrentAddr(tls, _v) + *(*int32)(unsafe.Pointer(&_pLevel.X10)) = _sqlite3VdbeCurrentAddr(tls, _v) func() { if (_bRev & i32(-2)) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108470))) @@ -88848,20 +92660,20 @@ _66: } }() { - p := (*uint32)(unsafe.Pointer(&(_pLevel.X9))) + p := (*uint32)(unsafe.Pointer(&_pLevel.X9)) *p = (*p) << uint(i32(1)) sink5(*p) } { - p := (*uint32)(unsafe.Pointer(&(_pLevel.X9))) - *p = (*p) | uint32(_bRev^bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(1))) + p := (*uint32)(unsafe.Pointer(&_pLevel.X9)) + *p = (*p) | uint32(_bRev^bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(1))) sink5(*p) } } if _26_pRangeStart != nil { goto _133 } - _j = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_26_nEq)))) + _j = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_26_nEq)))) if ((_j >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1)+32*uintptr(_j))).X3) == i32(0))) || (_j == i32(-2)) { _26_bSeekPastNull = uint8(i32(1)) } @@ -88873,7 +92685,7 @@ _123: crt.X__builtin_abort(tls) } }() - if ((int32(_26_nEq) < int32(_pIdx.X13)) && (_bRev == bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(0)))) || (_bRev != 0 && (int32(_pIdx.X13) == int32(_26_nEq))) { + if ((int32(_26_nEq) < int32(_pIdx.X13)) && (_bRev == bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(0)))) || (_bRev != 0 && (int32(_pIdx.X13) == int32(_26_nEq))) { _34_t = _26_pRangeEnd _26_pRangeEnd = _26_pRangeStart _26_pRangeStart = _34_t @@ -88892,7 +92704,7 @@ _123: } }() if (_26_zStartAff != nil) && (_26_nTop != 0) { - _26_zEndAff = _sqlite3DbStrDup(tls, _db, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_26_zStartAff))+1*uintptr(_26_nEq)))) + _26_zEndAff = _sqlite3DbStrDup(tls, _db, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_26_zStartAff))+1*uintptr(_26_nEq)))) } _addrNxt = _pLevel.X4 _26_startEq = bool2int((_26_pRangeStart == nil) || (int32(_26_pRangeStart.X4)&i32(40)) != 0) @@ -88909,7 +92721,7 @@ _123: _sqlite3VdbeAddOp2(tls, _v, i32(75), _26_regBase+int32(_26_nEq), _addrNxt) } if _26_zStartAff != nil { - _updateRangeAffinityStr(tls, _38_pRight, int32(_26_nBtm), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_26_zStartAff))+1*uintptr(_26_nEq)))) + _updateRangeAffinityStr(tls, _38_pRight, int32(_26_nBtm), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_26_zStartAff))+1*uintptr(_26_nEq)))) } { p := &_26_nConstraint @@ -88936,7 +92748,7 @@ _159: if (int32(_pLoop.X11) > i32(0)) && (_26_nConstraint == int32(_pLoop.X11)) { goto _162 } - _26_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001)) + 1*uintptr(((_26_start_constraints<<uint(i32(2)))+(_26_startEq<<uint(i32(1))))+_bRev)))) + _26_op = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001)) + 1*uintptr(((_26_start_constraints<<uint(i32(2)))+(_26_startEq<<uint(i32(1))))+_bRev)))) func() { if _26_op == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128390), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108586))) @@ -88987,11 +92799,11 @@ _165: _26_nConstraint += 1 } _175: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_26_zStartAff)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_26_zEndAff)) - *(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _sqlite3VdbeCurrentAddr(tls, _v) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zStartAff)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_26_zEndAff)) + *(*int32)(unsafe.Pointer(&_pLevel.X16)) = _sqlite3VdbeCurrentAddr(tls, _v) if _26_nConstraint != 0 { - _26_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002)) + 1*uintptr((_bRev*i32(2))+_26_endEq)))) + _26_op = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002)) + 1*uintptr((_bRev*i32(2))+_26_endEq)))) _sqlite3VdbeAddOp4Int(tls, _v, _26_op, _26_iIdxCur, _addrNxt, _26_regBase, _26_nConstraint) } if _omitTable != 0 { @@ -89001,7 +92813,7 @@ _175: goto _179 } if (int32(_pWInfo.X10)&i32(1024)) != 0 || ((int32(_pWInfo.X10)&i32(4096)) != 0 && (int32(_pWInfo.X14) == i32(1))) { - _iRowidReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iRowidReg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(131), _26_iIdxCur, _iRowidReg) _sqlite3ExprCacheStore(tls, _pParse, _iCur, i32(-1), _iRowidReg) _sqlite3VdbeAddOp3(tls, _v, i32(32), _iCur, i32(0), _iRowidReg) @@ -89021,7 +92833,7 @@ _186: if _j >= int32(_58_pPk.X13) { goto _189 } - _k = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_58_pPk.X1)) + 2*uintptr(_j))))) + _k = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_58_pPk.X1)) + 2*uintptr(_j))))) _sqlite3VdbeAddOp3(tls, _v, i32(99), _26_iIdxCur, _k, _iRowidReg+_j) _j += 1 goto _186 @@ -89029,25 +92841,25 @@ _189: _sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iCur, _addrCont, _iRowidReg, int32(_58_pPk.X13)) _185: _whereIndexExprTrans(tls, _pIdx, _iCur, _26_iIdxCur, _pWInfo) - if ((_pLoop.X9) & uint32(i32(4096))) != 0 { - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164)) + if (_pLoop.X9 & uint32(i32(4096))) != 0 { + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(164)) goto _193 } if _bRev != 0 { - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(6)) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(6)) goto _193 } - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(7)) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(7)) _193: - *(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _26_iIdxCur - *(*uint8)(unsafe.Pointer(&(_pLevel.X13))) = uint8(func() int32 { - if ((_pLoop.X9) & uint32(i32(65536))) != uint32(i32(0)) { + *(*int32)(unsafe.Pointer(&_pLevel.X15)) = _26_iIdxCur + *(*uint8)(unsafe.Pointer(&_pLevel.X13)) = uint8(func() int32 { + if (_pLoop.X9 & uint32(i32(65536))) != uint32(i32(0)) { return i32(1) } return i32(0) }()) - if ((_pLoop.X9) & uint32(i32(15))) == uint32(i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pLevel.X14))) = uint8(i32(1)) + if (_pLoop.X9 & uint32(i32(15))) == uint32(i32(0)) { + *(*uint8)(unsafe.Pointer(&_pLevel.X14)) = uint8(i32(1)) goto _197 } func() { @@ -89062,19 +92874,19 @@ _197: } goto _270 _105: - if ((_pLoop.X9) & uint32(i32(8192))) == 0 { + if (_pLoop.X9 & uint32(i32(8192))) == 0 { goto _202 } _65_pCov = nil - _65_iCovCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - _65_regReturn = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _65_iCovCur = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + _65_regReturn = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _65_regRowset = i32(0) _65_regRowid = i32(0) _65_iLoopBody = _sqlite3VdbeMakeLabel(tls, _v) _65_untestedTerms = i32(0) _65_pAndExpr = nil _65_pTab = (*XTable)(_pTabItem.X4) - _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(i32(0)))) + _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(i32(0)))) func() { if _pTerm == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128565), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108051))) @@ -89093,9 +92905,9 @@ _105: crt.X__builtin_abort(tls) } }() - _65_pOrWc = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))) - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(52)) - *(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _65_regReturn + _65_pOrWc = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10))))).X0))) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(52)) + *(*int32)(unsafe.Pointer(&_pLevel.X15)) = _65_regReturn if int32(_pWInfo.X11) <= i32(1) { goto _209 } @@ -89104,16 +92916,16 @@ _105: if _65_pOrTab == nil { return _notReady } - *(*uint32)(unsafe.Pointer(&(_65_pOrTab.X1))) = uint32(uint8(_66_nNotReady + i32(1))) - *(*int32)(unsafe.Pointer(&(_65_pOrTab.X0))) = int32(_65_pOrTab.X1) - crt.Xmemcpy(tls, (unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_65_pOrTab.X2)))), (unsafe.Pointer)(_pTabItem), u64(112)) + *(*uint32)(unsafe.Pointer(&_65_pOrTab.X1)) = uint32(uint8(_66_nNotReady + i32(1))) + *(*int32)(unsafe.Pointer(&_65_pOrTab.X0)) = int32(_65_pOrTab.X1) + crt.Xmemcpy(tls, unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_65_pOrTab.X2))), unsafe.Pointer(_pTabItem), u64(112)) _66_origSrc = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) _k = i32(1) _211: if _k > _66_nNotReady { goto _214 } - crt.Xmemcpy(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_65_pOrTab.X2)))))+112*uintptr(_k)))), (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_origSrc))+112*uintptr((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLevel))+88*uintptr(_k))).X11)))), u64(112)) + crt.Xmemcpy(tls, unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_65_pOrTab.X2))))+112*uintptr(_k)))), unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_66_origSrc))+112*uintptr((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLevel))+88*uintptr(_k))).X11)))), u64(112)) _k += 1 goto _211 _214: @@ -89124,32 +92936,32 @@ _215: if (int32(_pWInfo.X10) & i32(16)) != i32(0) { goto _216 } - if ((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { - _65_regRowset = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (_65_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { + _65_regRowset = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _65_regRowset) goto _218 } _71_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab) - _65_regRowset = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _65_regRowset = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(110), _65_regRowset, int32(_71_pPk.X13)) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _71_pPk) _218: - _65_regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _65_regRowid = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _216: _65_iRetInit = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _65_regReturn) - if (_pWC.X3) <= i32(1) { + if _pWC.X3 <= i32(1) { goto _219 } _72_iTerm = i32(0) _220: - if _72_iTerm >= (_pWC.X3) { + if _72_iTerm >= _pWC.X3 { goto _223 } _73_pExpr = (*XExpr)((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 64*uintptr(_72_iTerm))).X0) if (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+64*uintptr(_72_iTerm))) == _pTerm { goto _221 } - if ((_73_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_73_pExpr.X2 & uint32(i32(1))) != uint32(i32(0)) { goto _221 } if (int32((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+64*uintptr(_72_iTerm))).X3) & i32(6)) != i32(0) { @@ -89171,22 +92983,22 @@ _219: _65_wctrlFlags = uint16(i32(32) | (int32(_pWInfo.X10) & i32(1024))) _65_ii = i32(0) _229: - if _65_ii >= (_65_pOrWc.X3) { + if _65_ii >= _65_pOrWc.X3 { goto _232 } _75_pOrTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_65_pOrWc.X5) + 64*uintptr(_65_ii))) - if (_75_pOrTerm.X8) != _iCur && (int32(_75_pOrTerm.X4)&i32(1024)) == i32(0) { + if _75_pOrTerm.X8 != _iCur && (int32(_75_pOrTerm.X4)&i32(1024)) == i32(0) { goto _234 } _76_pOrExpr = (*XExpr)(_75_pOrTerm.X0) _76_jmp1 = i32(0) - if (_65_pAndExpr != nil) && (((_76_pOrExpr.X2) & uint32(i32(1))) == uint32(i32(0))) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_65_pAndExpr.X4))))) = _76_pOrExpr + if (_65_pAndExpr != nil) && ((_76_pOrExpr.X2 & uint32(i32(1))) == uint32(i32(0))) { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_65_pAndExpr.X4)))) = _76_pOrExpr _76_pOrExpr = _65_pAndExpr } _76_pSubWInfo = _sqlite3WhereBegin(tls, _pParse, _65_pOrTab, _76_pOrExpr, nil, nil, _65_wctrlFlags, _65_iCovCur) func() { - if _76_pSubWInfo == nil && (_pParse.X16) == 0 && (_db.X17) == 0 { + if _76_pSubWInfo == nil && _pParse.X16 == 0 && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128672), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108651))) crt.X__builtin_abort(tls) } @@ -89194,18 +93006,18 @@ _229: if _76_pSubWInfo == nil { goto _241 } - _78_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _65_pOrTab, (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24)))))+88*uintptr(i32(0)))), _iLevel, int32(_pLevel.X11), uint16(i32(0))) + _78_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _65_pOrTab, (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.X24))))+88*uintptr(i32(0)))), _iLevel, int32(_pLevel.X11), uint16(i32(0))) if (int32(_pWInfo.X10) & i32(16)) != i32(0) { goto _242 } _79_iSet = func() int32 { - if _65_ii == ((_65_pOrWc.X3) - i32(1)) { + if _65_ii == (_65_pOrWc.X3 - i32(1)) { return i32(-1) } return _65_ii }() - if ((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_65_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _79_r = _sqlite3ExprCodeGetColumn(tls, _pParse, _65_pTab, i32(-1), _iCur, _65_regRowid, uint8(i32(0))) _76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, i32(43), _65_regRowset, i32(0), _79_r, _79_iSet) goto _246 @@ -89218,7 +93030,7 @@ _247: if _81_iPk >= _81_nPk { goto _250 } - _82_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_pPk.X1)) + 2*uintptr(_81_iPk)))) + _82_iCol = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_81_pPk.X1)) + 2*uintptr(_81_iPk)))) _sqlite3ExprCodeGetColumnToReg(tls, _pParse, _65_pTab, _82_iCol, _iCur, _79_r+_81_iPk) _81_iPk += 1 goto _247 @@ -89242,24 +93054,24 @@ _242: if _76_jmp1 != 0 { _sqlite3VdbeJumpHere(tls, _v, _76_jmp1) } - if (_76_pSubWInfo.X15) != 0 { + if _76_pSubWInfo.X15 != 0 { _65_untestedTerms = i32(1) } - _78_pSubLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24))))) + 88*uintptr(i32(0)))).X18) + _78_pSubLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.X24)))) + 88*uintptr(i32(0)))).X18) func() { - if ((_78_pSubLoop.X9) & uint32(i32(16384))) != uint32(i32(0)) { + if (_78_pSubLoop.X9 & uint32(i32(16384))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128759), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108697))) crt.X__builtin_abort(tls) } }() - if ((((_78_pSubLoop.X9) & uint32(i32(512))) != uint32(i32(0))) && ((_65_ii == i32(0)) || ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4) == _65_pCov))) && ((((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4).X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2))) { + if (((_78_pSubLoop.X9 & uint32(i32(512))) != uint32(i32(0))) && ((_65_ii == i32(0)) || ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_78_pSubLoop.X8)))).X4) == _65_pCov))) && (((_65_pTab.X9 & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_78_pSubLoop.X8)))).X4).X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2))) { func() { - if ((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24))))) + 88*uintptr(i32(0)))).X2) != _65_iCovCur { + if ((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_76_pSubWInfo.X24)))) + 88*uintptr(i32(0)))).X2) != _65_iCovCur { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128764), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108739))) crt.X__builtin_abort(tls) } }() - _65_pCov = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4) + _65_pCov = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_78_pSubLoop.X8)))).X4) goto _265 } _65_pCov = nil @@ -89270,19 +93082,19 @@ _234: _65_ii += 1 goto _229 _232: - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))))) = _65_pCov + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))))) = _65_pCov if _65_pCov != nil { - *(*int32)(unsafe.Pointer(&(_pLevel.X2))) = _65_iCovCur + *(*int32)(unsafe.Pointer(&_pLevel.X2)) = _65_iCovCur } if _65_pAndExpr != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_65_pAndExpr.X4))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_65_pAndExpr.X4)))) = nil _sqlite3ExprDelete(tls, _db, _65_pAndExpr) } _sqlite3VdbeChangeP1(tls, _v, uint32(_65_iRetInit), _sqlite3VdbeCurrentAddr(tls, _v)) _sqlite3VdbeGoto(tls, _v, _pLevel.X3) _sqlite3VdbeResolveLabel(tls, _v, _65_iLoopBody) if int32(_pWInfo.X11) > i32(1) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_65_pOrTab)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_65_pOrTab)) } if _65_untestedTerms == 0 { _disableTerm(tls, _pLevel, _pTerm) @@ -89295,14 +93107,14 @@ _202: crt.X__builtin_abort(tls) } }() - if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164)) + if ((uint32(((*t28)(unsafe.Pointer(&_pTabItem.X9)).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 { + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = uint8(i32(164)) goto _275 } - *(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStepØ003)) + 1*uintptr(_bRev))) - *(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur - *(*int32)(unsafe.Pointer(&(_pLevel.X16))) = i32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStartØ004)) + 1*uintptr(_bRev)))), _iCur, _addrHalt) - *(*uint8)(unsafe.Pointer(&(_pLevel.X14))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pLevel.X12)) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStepØ003)) + 1*uintptr(_bRev))) + *(*int32)(unsafe.Pointer(&_pLevel.X15)) = _iCur + *(*int32)(unsafe.Pointer(&_pLevel.X16)) = i32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00aStartØ004)) + 1*uintptr(_bRev)))), _iCur, _addrHalt) + *(*uint8)(unsafe.Pointer(&_pLevel.X14)) = uint8(i32(1)) _275: _270: _loopAgain = i32(0) @@ -89315,8 +93127,8 @@ _277: if (int32(_pTerm.X3) & i32(6)) != 0 { goto _278 } - if ((_pTerm.X12) & (_pLevel.X19)) != uint64(i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pWInfo.X15))) = uint8(i32(1)) + if (_pTerm.X12 & _pLevel.X19) != uint64(i32(0)) { + *(*uint8)(unsafe.Pointer(&_pWInfo.X15)) = uint8(i32(1)) goto _278 } _92_pE = (*XExpr)(_pTerm.X0) @@ -89326,7 +93138,7 @@ _277: crt.X__builtin_abort(tls) } }() - if (_pLevel.X0) != 0 && (((_92_pE.X2) & uint32(i32(1))) == uint32(i32(0))) { + if _pLevel.X0 != 0 && ((_92_pE.X2 & uint32(i32(1))) == uint32(i32(0))) { goto _278 } if (_pIdx != nil) && (_sqlite3ExprCoveredByIndex(tls, _92_pE, _pLevel.X1, _pIdx) == 0) { @@ -89353,7 +93165,7 @@ _277: _sqlite3VdbeJumpHere(tls, _v, _92_skipLikeAddr) } { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(4)) sink14(*p) } @@ -89379,26 +93191,26 @@ _295: if (int32(_pTerm.X4) & i32(2048)) == i32(0) { goto _296 } - if (_pTerm.X8) != _iCur { + if _pTerm.X8 != _iCur { goto _296 } - if (_pLevel.X0) != 0 { + if _pLevel.X0 != 0 { goto _296 } _97_pE = (*XExpr)(_pTerm.X0) func() { - if ((_97_pE.X2) & uint32(i32(1))) != uint32(i32(0)) { + if (_97_pE.X2 & uint32(i32(1))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108801))) crt.X__builtin_abort(tls) } }() func() { - if ((_pTerm.X11) & (_pLevel.X19)) == uint64(i32(0)) { + if (_pTerm.X11 & _pLevel.X19) == uint64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108835))) crt.X__builtin_abort(tls) } }() - _97_pAlt = _sqlite3WhereFindTerm(tls, _pWC, _iCur, *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))), _notReady, uint32(i32(131)), nil) + _97_pAlt = _sqlite3WhereFindTerm(tls, _pWC, _iCur, *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&_pTerm.X10)))), _notReady, uint32(i32(131)), nil) if _97_pAlt == nil { goto _296 } @@ -89406,30 +93218,30 @@ _295: goto _296 } _97_sEAlt = *(*XExpr)(_97_pAlt.X0) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_97_sEAlt.X4))))) = (*XExpr)(_97_pE.X4) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_97_sEAlt.X4)))) = (*XExpr)(_97_pE.X4) _sqlite3ExprIfFalse(tls, _pParse, &_97_sEAlt, _addrCont, i32(16)) _296: *(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(64) goto _295 _298: - if (_pLevel.X0) == 0 { + if _pLevel.X0 == 0 { goto _310 } - *(*int32)(unsafe.Pointer(&(_pLevel.X7))) = _sqlite3VdbeCurrentAddr(tls, _v) + *(*int32)(unsafe.Pointer(&_pLevel.X7)) = _sqlite3VdbeCurrentAddr(tls, _v) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _pLevel.X0) _sqlite3VdbeComment(tls, _v, str(108878)) _sqlite3ExprCacheClear(tls, _pParse) *func() *int32 { _pTerm = (*XWhereTerm)(_pWC.X5); return &_j }() = i32(0) _311: - if _j >= (_pWC.X3) { + if _j >= _pWC.X3 { goto _314 } if (int32(_pTerm.X3) & i32(6)) != 0 { goto _312 } - if ((_pTerm.X12) & (_pLevel.X19)) != uint64(i32(0)) { + if (_pTerm.X12 & _pLevel.X19) != uint64(i32(0)) { func() { - if (_pWInfo.X15) == 0 { + if _pWInfo.X15 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108899))) crt.X__builtin_abort(tls) } @@ -89437,14 +93249,14 @@ _311: goto _312 } func() { - if (*XExpr)(_pTerm.X0) == nil { + if _pTerm.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128917), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108921))) crt.X__builtin_abort(tls) } }() _sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pTerm.X0), _addrCont, i32(16)) { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(4)) sink14(*p) } @@ -89467,19 +93279,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereCodeOneLoopStartØ00__func__Ø000[0], str(108934), 29) } -// Generate code for a single equality term of the WHERE clause. An equality -// term can be either X=expr or X IN (...). pTerm is the term to be -// coded. -// -// The current value for the constraint is left in a register, the index -// of which is returned. An attempt is made store the result in iTarget but -// this is only guaranteed for TK_ISNULL and TK_IN constraints. If the -// constraint is a TK_EQ or TK_IS, then the current value might be left in -// some other register and it is the caller's responsibility to compensate. -// -// For a constraint of the form X=expr, the expression is evaluated in -// straight-line code. For constraints of the form X IN (...) -// this routine sets up a loop that will iterate over all values of X. +// C comment +// /* +// ** Generate code for a single equality term of the WHERE clause. An equality +// ** term can be either X=expr or X IN (...). pTerm is the term to be +// ** coded. +// ** +// ** The current value for the constraint is left in a register, the index +// ** of which is returned. An attempt is made store the result in iTarget but +// ** this is only guaranteed for TK_ISNULL and TK_IN constraints. If the +// ** constraint is a TK_EQ or TK_IS, then the current value might be left in +// ** some other register and it is the caller's responsibility to compensate. +// ** +// ** For a constraint of the form X=expr, the expression is evaluated in +// ** straight-line code. For constraints of the form X IN (...) +// ** this routine sets up a loop that will iterate over all values of X. +// */ func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLevel *XWhereLevel, _iEq int32, _bRev int32, _iTarget int32) (r0 int32) { var _iReg, _3_eType, _3_iTab, _3_i, _3_nEq, _11_iField, _19_iMap, _21_iOut, _23_iCol int32 var _3_aiMap *int32 @@ -89494,7 +93309,7 @@ func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLeve _pX = (*XExpr)(_pTerm.X0) _v = (*TVdbe)(_pParse.X2) func() { - if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XWhereLoop)(_pLevel.X18).X13)) + 8*uintptr(_iEq)))) != _pTerm { + if (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereLoop)(_pLevel.X18).X13)) + 8*uintptr(_iEq)))) != _pTerm { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127197), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(108963))) crt.X__builtin_abort(tls) } @@ -89518,7 +93333,7 @@ func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLeve _3_pLoop = (*XWhereLoop)(_pLevel.X18) _3_nEq = i32(0) _3_aiMap = nil - if ((((_3_pLoop.X9) & uint32(i32(1024))) == uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_3_pLoop.X8))))).X4) != nil)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_3_pLoop.X8))))).X4).X7)) + 1*uintptr(_iEq)))) != 0) { + if (((_3_pLoop.X9 & uint32(i32(1024))) == uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_3_pLoop.X8)))).X4) != nil)) && ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_3_pLoop.X8)))).X4).X7)) + 1*uintptr(_iEq)))) != 0) { _bRev = bool2int(_bRev == 0) } func() { @@ -89533,7 +93348,7 @@ _14: if _3_i >= _iEq { goto _17 } - if ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX) { + if ((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX) { _disableTerm(tls, _pLevel, _pTerm) return _iTarget } @@ -89546,7 +93361,7 @@ _20: goto _23 } if func() int32 { - if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))) != nil { + if (*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))) != nil { return i32(1) } return func() int32 { @@ -89554,17 +93369,17 @@ _20: crt.X__builtin_abort(tls) return i32(0) }() - }() != 0 && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX) { + }() != 0 && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX) { _3_nEq += 1 } _3_i += 1 goto _20 _23: - if (((_pX.X2) & uint32(i32(2048))) == uint32(i32(0))) || (((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))).X0).X0) == i32(1)) { + if ((_pX.X2 & uint32(i32(2048))) == uint32(i32(0))) || (((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pX.X6))))).X0).X0) == i32(1)) { _3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(i32(4)), nil, nil) goto _30 } - _9_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))) + _9_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pX.X6))))) _9_db = (*Xsqlite3)(_pParse.X0) _9_savedDbOptFlags = _9_db.X13 _9_pOrigRhs = (*XExprList)(_9_pSelect.X0) @@ -89576,52 +93391,52 @@ _31: if _3_i >= int32(_3_pLoop.X10) { goto _34 } - if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX { - _11_iField = ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X9) - i32(1) - _11_pNewRhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pOrigRhs.X2)))))+32*uintptr(_11_iField))).X0), i32(0)) - _11_pNewLhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pOrigLhs.X2)))))+32*uintptr(_11_iField))).X0), i32(0)) + if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) == _pX { + _11_iField = ((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X9) - i32(1) + _11_pNewRhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pOrigRhs.X2))))+32*uintptr(_11_iField))).X0), i32(0)) + _11_pNewLhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pOrigLhs.X2))))+32*uintptr(_11_iField))).X0), i32(0)) _9_pRhs = _sqlite3ExprListAppend(tls, _pParse, _9_pRhs, _11_pNewRhs) _9_pLhs = _sqlite3ExprListAppend(tls, _pParse, _9_pLhs, _11_pNewLhs) } _3_i += 1 goto _31 _34: - if (_9_db.X17) != 0 { + if _9_db.X17 != 0 { goto _36 } _12_pLeft = (*XExpr)(_pX.X4) - if (*XExprList)(_9_pSelect.X12) == nil { + if _9_pSelect.X12 == nil { goto _37 } _13_pOrderBy = (*XExprList)(_9_pSelect.X12) _3_i = i32(0) _38: - if _3_i >= (_13_pOrderBy.X0) { + if _3_i >= _13_pOrderBy.X0 { goto _41 } - *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pOrderBy.X2))))) + 32*uintptr(_3_i))).X5))))).X0))) = uint16(i32(0)) + *(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_13_pOrderBy.X2)))) + 32*uintptr(_3_i))).X5))))).X0))) = uint16(i32(0)) _3_i += 1 goto _38 _41: _37: - if (_9_pLhs.X0) == i32(1) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X4))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pLhs.X2))))) + 32*uintptr(i32(0)))).X0) + if _9_pLhs.X0 == i32(1) { + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pX.X4)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pLhs.X2)))) + 32*uintptr(i32(0)))).X0) goto _43 } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_12_pLeft.X6))))))) = _9_pLhs + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_12_pLeft.X6)))))) = _9_pLhs _3_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), u64(4)*uint64(_3_nEq))) _43: - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_9_pSelect.X0))))) = _9_pRhs + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_9_pSelect.X0)))) = _9_pRhs { - p := (*uint16)(unsafe.Pointer(&(_9_db.X13))) + p := (*uint16)(unsafe.Pointer(&_9_db.X13)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } _3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(i32(4)), nil, _3_aiMap) - *(*uint16)(unsafe.Pointer(&(_9_db.X13))) = _9_savedDbOptFlags - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_9_pSelect.X0))))) = _9_pOrigRhs - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_12_pLeft.X6))))))) = _9_pOrigLhs - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X4))))) = _12_pLeft + *(*uint16)(unsafe.Pointer(&_9_db.X13)) = _9_savedDbOptFlags + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_9_pSelect.X0)))) = _9_pOrigRhs + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_12_pLeft.X6)))))) = _9_pOrigLhs + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pX.X4)))) = _12_pLeft _36: _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _9_pLhs) _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _9_pRhs) @@ -89637,34 +93452,34 @@ _30: return i32(37) }(), _3_iTab, i32(0)) func() { - if ((_3_pLoop.X9) & uint32(i32(8192))) != uint32(i32(0)) { + if (_3_pLoop.X9 & uint32(i32(8192))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127304), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(109008))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_3_pLoop.X9))) + p := (*uint32)(unsafe.Pointer(&_3_pLoop.X9)) *p = (*p) | uint32(i32(2048)) sink5(*p) } - if ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pLevel.X4))) = _sqlite3VdbeMakeLabel(tls, _v) + if ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0) == i32(0) { + *(*int32)(unsafe.Pointer(&_pLevel.X4)) = _sqlite3VdbeMakeLabel(tls, _v) } - _3_i = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0 + _3_i = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0 { - p := (*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0))) + p := (*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0))) *p = (*p) + _3_nEq sink1(*p) } - *(**TInLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1))))) = (*TInLoop)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pParse.X0), (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1, u64(12)*uint64((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0))) - _3_pIn = (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1) + *(**TInLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1))))) = (*TInLoop)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pParse.X0), (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1, u64(12)*uint64((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0))) + _3_pIn = (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1) if _3_pIn == nil { goto _50 } _19_iMap = i32(0) { p := &_3_pIn - *p = (*TInLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 12*uintptr(_3_i))) + *p = (*TInLoop)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 12*uintptr(_3_i))) sink71(*p) } _3_i = _iEq @@ -89672,26 +93487,26 @@ _51: if _3_i >= int32(_3_pLoop.X10) { goto _54 } - if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) != _pX { + if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pLoop.X13)) + 8*uintptr(_3_i)))).X0) != _pX { goto _55 } _21_iOut = (_iReg + _3_i) - _iEq if _3_eType == i32(1) { - *(*int32)(unsafe.Pointer(&(_3_pIn.X1))) = _sqlite3VdbeAddOp2(tls, _v, i32(125), _3_iTab, _21_iOut) + *(*int32)(unsafe.Pointer(&_3_pIn.X1)) = _sqlite3VdbeAddOp2(tls, _v, i32(125), _3_iTab, _21_iOut) goto _57 } _23_iCol = func() int32 { if _3_aiMap != nil { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_aiMap)) + 4*uintptr(postInc1(&_19_iMap, int32(1)))))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_aiMap)) + 4*uintptr(postInc1(&_19_iMap, 1))))) } return i32(0) }() - *(*int32)(unsafe.Pointer(&(_3_pIn.X1))) = _sqlite3VdbeAddOp3(tls, _v, i32(99), _3_iTab, _23_iCol, _21_iOut) + *(*int32)(unsafe.Pointer(&_3_pIn.X1)) = _sqlite3VdbeAddOp3(tls, _v, i32(99), _3_iTab, _23_iCol, _21_iOut) _57: _sqlite3VdbeAddOp1(tls, _v, i32(75), _21_iOut) if _3_i == _iEq { - *(*int32)(unsafe.Pointer(&(_3_pIn.X0))) = _3_iTab - *(*uint8)(unsafe.Pointer(&(_3_pIn.X2))) = uint8(func() int32 { + *(*int32)(unsafe.Pointer(&_3_pIn.X0)) = _3_iTab + *(*uint8)(unsafe.Pointer(&_3_pIn.X2)) = uint8(func() int32 { if _bRev != 0 { return i32(4) } @@ -89699,7 +93514,7 @@ _57: }()) goto _63 } - *(*uint8)(unsafe.Pointer(&(_3_pIn.X2))) = uint8(i32(164)) + *(*uint8)(unsafe.Pointer(&_3_pIn.X2)) = uint8(i32(164)) _63: *(*uintptr)(unsafe.Pointer(&_3_pIn)) += uintptr(12) _55: @@ -89708,9 +93523,9 @@ _55: _54: goto _64 _50: - *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0))) = i32(0) + *(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0))) = i32(0) _64: - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_3_aiMap)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_3_aiMap)) _8: _disableTerm(tls, _pLevel, _pTerm) return _iReg @@ -89725,46 +93540,49 @@ func init() { crt.Xstrncpy(nil, &_codeEqualityTermØ00__func__Ø000[0], str(109045), 17) } -// Disable a term in the WHERE clause. Except, do not disable the term -// if it controls a LEFT OUTER JOIN and it did not originate in the ON -// or USING clause of that join. -// -// Consider the term t2.z='ok' in the following queries: -// -// (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok' -// (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok' -// (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok' -// -// The t2.z='ok' is disabled in the in (2) because it originates -// in the ON clause. The term is disabled in (3) because it is not part -// of a LEFT OUTER JOIN. In (1), the term is not disabled. -// -// Disabling a term causes that term to not be tested in the inner loop -// of the join. Disabling is an optimization. When terms are satisfied -// by indices, we disable them to prevent redundant tests in the inner -// loop. We would get the correct results if nothing were ever disabled, -// but joins might run a little slower. The trick is to disable as much -// as we can without disabling too much. If we disabled in (1), we'd get -// the wrong answer. See ticket #813. -// -// If all the children of a term are disabled, then that term is also -// automatically disabled. In this way, terms get disabled if derived -// virtual terms are tested first. For example: -// -// x GLOB 'abc*' AND x>='abc' AND x<'acd' -// \___________/ \______/ \_____/ -// parent child1 child2 -// -// Only the parent term was in the original WHERE clause. The child1 -// and child2 terms were added by the LIKE optimization. If both of -// the virtual child terms are valid, then testing of the parent can be -// skipped. -// -// Usually the parent term is marked as TERM_CODED. But if the parent -// term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead. -// The TERM_LIKECOND marking indicates that the term should be coded inside -// a conditional such that is only evaluated on the second pass of a -// LIKE-optimization loop, when scanning BLOBs instead of strings. +// C comment +// /* +// ** Disable a term in the WHERE clause. Except, do not disable the term +// ** if it controls a LEFT OUTER JOIN and it did not originate in the ON +// ** or USING clause of that join. +// ** +// ** Consider the term t2.z='ok' in the following queries: +// ** +// ** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok' +// ** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok' +// ** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok' +// ** +// ** The t2.z='ok' is disabled in the in (2) because it originates +// ** in the ON clause. The term is disabled in (3) because it is not part +// ** of a LEFT OUTER JOIN. In (1), the term is not disabled. +// ** +// ** Disabling a term causes that term to not be tested in the inner loop +// ** of the join. Disabling is an optimization. When terms are satisfied +// ** by indices, we disable them to prevent redundant tests in the inner +// ** loop. We would get the correct results if nothing were ever disabled, +// ** but joins might run a little slower. The trick is to disable as much +// ** as we can without disabling too much. If we disabled in (1), we'd get +// ** the wrong answer. See ticket #813. +// ** +// ** If all the children of a term are disabled, then that term is also +// ** automatically disabled. In this way, terms get disabled if derived +// ** virtual terms are tested first. For example: +// ** +// ** x GLOB 'abc*' AND x>='abc' AND x<'acd' +// ** \___________/ \______/ \_____/ +// ** parent child1 child2 +// ** +// ** Only the parent term was in the original WHERE clause. The child1 +// ** and child2 terms were added by the LIKE optimization. If both of +// ** the virtual child terms are valid, then testing of the parent can be +// ** skipped. +// ** +// ** Usually the parent term is marked as TERM_CODED. But if the parent +// ** term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead. +// ** The TERM_LIKECOND marking indicates that the term should be coded inside +// ** a conditional such that is only evaluated on the second pass of a +// ** LIKE-optimization loop, when scanning BLOBs instead of strings. +// */ func _disableTerm(tls *crt.TLS, _pLevel *XWhereLevel, _pTerm *XWhereTerm) { var _nLoop int32 _nLoop = i32(0) @@ -89778,28 +93596,28 @@ _0: crt.X__builtin_abort(tls) return i32(0) }() - }() == 0 || (int32(_pTerm.X3)&i32(4)) != i32(0) || (_pLevel.X0) != i32(0) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) == uint32(i32(0)) || ((_pLevel.X19)&(_pTerm.X12)) != uint64(i32(0)) { + }() == 0 || (int32(_pTerm.X3)&i32(4)) != i32(0) || _pLevel.X0 != i32(0) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) == uint32(i32(0)) || (_pLevel.X19&_pTerm.X12) != uint64(i32(0)) { goto _1 } if _nLoop != 0 && ((int32(_pTerm.X3) & i32(1024)) != i32(0)) { { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(512)) sink14(*p) } goto _10 } { - p := (*uint16)(unsafe.Pointer(&(_pTerm.X3))) + p := (*uint16)(unsafe.Pointer(&_pTerm.X3)) *p = uint16(int32(*p) | i32(4)) sink14(*p) } _10: - if (_pTerm.X7) < i32(0) { + if _pTerm.X7 < i32(0) { goto _1 } _pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_pTerm.X1).X5) + 64*uintptr(_pTerm.X7))) - *(*uint8)(unsafe.Pointer(&(_pTerm.X5))) -= 1 + *(*uint8)(unsafe.Pointer(&_pTerm.X5)) -= 1 if int32(_pTerm.X5) != i32(0) { goto _1 } @@ -89814,13 +93632,16 @@ func init() { crt.Xstrncpy(nil, &_disableTermØ00__func__Ø000[0], str(109062), 12) } -// If the expression passed as the second argument is a vector, generate -// code to write the first nReg elements of the vector into an array -// of registers starting with iReg. -// -// If the expression is not a vector, then nReg must be passed 1. In -// this case, generate code to evaluate the expression and leave the -// result in register iReg. +// C comment +// /* +// ** If the expression passed as the second argument is a vector, generate +// ** code to write the first nReg elements of the vector into an array +// ** of registers starting with iReg. +// ** +// ** If the expression is not a vector, then nReg must be passed 1. In +// ** this case, generate code to evaluate the expression and leave the +// ** result in register iReg. +// */ func _codeExprOrVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _iReg int32, _nReg int32) { var _2_iSelect, _3_i int32 var _2_v *TVdbe @@ -89834,15 +93655,15 @@ func _codeExprOrVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _iReg int32, _n if _sqlite3ExprIsVector(tls, _p) == 0 { goto _2 } - if ((_p.X2) & uint32(i32(2048))) != 0 { + if (_p.X2 & uint32(i32(2048))) != 0 { _2_v = (*TVdbe)(_pParse.X2) _2_iSelect = _sqlite3CodeSubselect(tls, _pParse, _p, i32(0), i32(0)) _sqlite3VdbeAddOp3(tls, _2_v, i32(64), _2_iSelect, _iReg, _nReg-i32(1)) goto _4 } - _3_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) + _3_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_p.X6))))) func() { - if _nReg > (_3_pList.X0) { + if _nReg > _3_pList.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127822), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000))), unsafe.Pointer(str(109081))) crt.X__builtin_abort(tls) } @@ -89852,7 +93673,7 @@ _7: if _3_i >= _nReg { goto _10 } - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_3_pList.X2)))))+32*uintptr(_3_i))).X0), _iReg+_3_i) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_3_pList.X2))))+32*uintptr(_3_i))).X0), _iReg+_3_i) _3_i += 1 goto _7 _10: @@ -89875,49 +93696,52 @@ func init() { crt.Xstrncpy(nil, &_codeExprOrVectorØ00__func__Ø000[0], str(109108), 17) } -// Generate code that will evaluate all == and IN constraints for an -// index scan. -// -// For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). -// Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 -// The index has as many as three equality constraints, but in this -// example, the third "c" value is an inequality. So only two -// constraints are coded. This routine will generate code to evaluate -// a==5 and b IN (1,2,3). The current values for a and b will be stored -// in consecutive registers and the index of the first register is returned. -// -// In the example above nEq==2. But this subroutine works for any value -// of nEq including 0. If nEq==0, this routine is nearly a no-op. -// The only thing it does is allocate the pLevel->iMem memory cell and -// compute the affinity string. -// -// The nExtraReg parameter is 0 or 1. It is 0 if all WHERE clause constraints -// are == or IN and are covered by the nEq. nExtraReg is 1 if there is -// an inequality constraint (such as the "c>=5 AND c<10" in the example) that -// occurs after the nEq quality constraints. -// -// This routine allocates a range of nEq+nExtraReg memory cells and returns -// the index of the first memory cell in that range. The code that -// calls this routine will use that memory range to store keys for -// start and termination conditions of the loop. -// key value of the loop. If one or more IN operators appear, then -// this routine allocates an additional nEq memory cells for internal -// use. -// -// Before returning, *pzAff is set to point to a buffer containing a -// copy of the column affinity string of the index allocated using -// sqlite3DbMalloc(). Except, entries in the copy of the string associated -// with equality constraints that use BLOB or NONE affinity are set to -// SQLITE_AFF_BLOB. This is to deal with SQL such as the following: -// -// CREATE TABLE t1(a TEXT PRIMARY KEY, b); -// SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b; -// -// In the example above, the index on t1(a) has TEXT affinity. But since -// the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity, -// no conversion should be attempted before using a t2.b value as part of -// a key to search the index. Hence the first byte in the returned affinity -// string in this example would be set to SQLITE_AFF_BLOB. +// C comment +// /* +// ** Generate code that will evaluate all == and IN constraints for an +// ** index scan. +// ** +// ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). +// ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 +// ** The index has as many as three equality constraints, but in this +// ** example, the third "c" value is an inequality. So only two +// ** constraints are coded. This routine will generate code to evaluate +// ** a==5 and b IN (1,2,3). The current values for a and b will be stored +// ** in consecutive registers and the index of the first register is returned. +// ** +// ** In the example above nEq==2. But this subroutine works for any value +// ** of nEq including 0. If nEq==0, this routine is nearly a no-op. +// ** The only thing it does is allocate the pLevel->iMem memory cell and +// ** compute the affinity string. +// ** +// ** The nExtraReg parameter is 0 or 1. It is 0 if all WHERE clause constraints +// ** are == or IN and are covered by the nEq. nExtraReg is 1 if there is +// ** an inequality constraint (such as the "c>=5 AND c<10" in the example) that +// ** occurs after the nEq quality constraints. +// ** +// ** This routine allocates a range of nEq+nExtraReg memory cells and returns +// ** the index of the first memory cell in that range. The code that +// ** calls this routine will use that memory range to store keys for +// ** start and termination conditions of the loop. +// ** key value of the loop. If one or more IN operators appear, then +// ** this routine allocates an additional nEq memory cells for internal +// ** use. +// ** +// ** Before returning, *pzAff is set to point to a buffer containing a +// ** copy of the column affinity string of the index allocated using +// ** sqlite3DbMalloc(). Except, entries in the copy of the string associated +// ** with equality constraints that use BLOB or NONE affinity are set to +// ** SQLITE_AFF_BLOB. This is to deal with SQL such as the following: +// ** +// ** CREATE TABLE t1(a TEXT PRIMARY KEY, b); +// ** SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b; +// ** +// ** In the example above, the index on t1(a) has TEXT affinity. But since +// ** the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity, +// ** no conversion should be attempted before using a t2.b value as part of +// ** a key to search the index. Hence the first byte in the returned affinity +// ** string in this example would be set to SQLITE_AFF_BLOB. +// */ func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, _bRev int32, _nExtraReg int32, _pzAff **int8) (r0 int32) { var _j, _regBase, _nReg, _1_iIdxCur, _3_r1 int32 var _zAff *int8 @@ -89930,24 +93754,24 @@ func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, _v = (*TVdbe)(_pParse.X2) _pLoop = (*XWhereLoop)(_pLevel.X18) func() { - if ((_pLoop.X9) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pLoop.X9 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127415), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(109125))) crt.X__builtin_abort(tls) } }() - _nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0 + _nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0 _nSkip = _pLoop.X11 - _pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4) + _pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4) func() { if _pIdx == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127419), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(42069))) crt.X__builtin_abort(tls) } }() - _regBase = (_pParse.X18) + i32(1) - _nReg = int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) + _nExtraReg + _regBase = _pParse.X18 + i32(1) + _nReg = int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X0) + _nExtraReg { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nReg sink1(*p) } @@ -89970,7 +93794,7 @@ func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, }(), _1_iIdxCur) _sqlite3VdbeComment(tls, _v, str(109202), unsafe.Pointer(_pIdx.X0)) _j = _sqlite3VdbeAddOp0(tls, _v, i32(13)) - *(*int32)(unsafe.Pointer(&(_pLevel.X5))) = _sqlite3VdbeAddOp4Int(tls, _v, func() int32 { + *(*int32)(unsafe.Pointer(&_pLevel.X5)) = _sqlite3VdbeAddOp4Int(tls, _v, func() int32 { if _bRev != 0 { return i32(24) } @@ -89999,7 +93823,7 @@ _19: if _j >= int32(_nEq) { goto _22 } - _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 8*uintptr(_j))) + _pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer(_pLoop.X13)) + 8*uintptr(_j))) func() { if _pTerm == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127455), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(108051))) @@ -90025,7 +93849,7 @@ _25: goto _29 } if _zAff != nil { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) } _29: goto _32 @@ -90040,11 +93864,11 @@ _28: if _zAff == nil { goto _35 } - if int32(_sqlite3CompareAffinity(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))))) == i32(65) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) + if int32(_sqlite3CompareAffinity(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_j))))) == i32(65) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) } - if _sqlite3ExprNeedsNoAffinityChange(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j)))) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) + if _sqlite3ExprNeedsNoAffinityChange(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_j)))) != 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_j))) = int8(i32(65)) } _35: _32: @@ -90061,14 +93885,17 @@ func init() { crt.Xstrncpy(nil, &_codeAllEqualityTermsØ00__func__Ø000[0], str(109258), 21) } -// Return TRUE if the given expression is a constant which would be -// unchanged by OP_Affinity with the affinity given in the second -// argument. -// -// This routine is used to determine if the OP_Affinity operation -// can be omitted. When in doubt return FALSE. A false negative -// is harmless. A false positive, however, can result in the wrong -// answer. +// C comment +// /* +// ** Return TRUE if the given expression is a constant which would be +// ** unchanged by OP_Affinity with the affinity given in the second +// ** argument. +// ** +// ** This routine is used to determine if the OP_Affinity operation +// ** can be omitted. When in doubt return FALSE. A false negative +// ** is harmless. A false positive, however, can result in the wrong +// ** answer. +// */ func _sqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, _p *XExpr, _aff int8) (r0 int32) { var _op uint8 if int32(_aff) == i32(65) { @@ -90112,7 +93939,7 @@ _9: _10: func() { - if (_p.X8) < i32(0) { + if _p.X8 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92905), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000))), unsafe.Pointer(str(109279))) crt.X__builtin_abort(tls) } @@ -90129,26 +93956,29 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000[0], str(109292), 33) } -// If the most recently coded instruction is a constant range constraint -// (a string literal) that originated from the LIKE optimization, then -// set P3 and P5 on the OP_String opcode so that the string will be cast -// to a BLOB at appropriate times. -// -// The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range -// expression: "x>='ABC' AND x<'abd'". But this requires that the range -// scan loop run twice, once for strings and a second time for BLOBs. -// The OP_String opcodes on the second pass convert the upper and lower -// bound string constants to blobs. This routine makes the necessary changes -// to the OP_String opcodes for that to happen. -// -// Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then -// only the one pass through the string space is required, so this routine -// becomes a no-op. +// C comment +// /* +// ** If the most recently coded instruction is a constant range constraint +// ** (a string literal) that originated from the LIKE optimization, then +// ** set P3 and P5 on the OP_String opcode so that the string will be cast +// ** to a BLOB at appropriate times. +// ** +// ** The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range +// ** expression: "x>='ABC' AND x<'abd'". But this requires that the range +// ** scan loop run twice, once for strings and a second time for BLOBs. +// ** The OP_String opcodes on the second pass convert the upper and lower +// ** bound string constants to blobs. This routine makes the necessary changes +// ** to the OP_String opcodes for that to happen. +// ** +// ** Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then +// ** only the one pass through the string space is required, so this routine +// ** becomes a no-op. +// */ func _whereLikeOptimizationStringFixup(tls *crt.TLS, _v *TVdbe, _pLevel *XWhereLevel, _pTerm *XWhereTerm) { var _1_pOp *XVdbeOp if (int32(_pTerm.X3) & i32(256)) != 0 { func() { - if (_pLevel.X9) <= uint32(i32(0)) { + if _pLevel.X9 <= uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127522), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000))), unsafe.Pointer(str(109325))) crt.X__builtin_abort(tls) } @@ -90166,8 +93996,8 @@ func _whereLikeOptimizationStringFixup(tls *crt.TLS, _v *TVdbe, _pLevel *XWhereL crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_1_pOp.X5))) = int32((_pLevel.X9) >> uint(i32(1))) - *(*uint16)(unsafe.Pointer(&(_1_pOp.X2))) = uint16(uint8((_pLevel.X9) & uint32(i32(1)))) + *(*int32)(unsafe.Pointer(&_1_pOp.X5)) = int32(_pLevel.X9 >> uint(i32(1))) + *(*uint16)(unsafe.Pointer(&_1_pOp.X2)) = uint16(uint8(_pLevel.X9 & uint32(i32(1)))) } } @@ -90177,14 +94007,17 @@ func init() { crt.Xstrncpy(nil, &_whereLikeOptimizationStringFixupØ00__func__Ø000[0], str(109427), 33) } -// Expression pRight, which is the RHS of a comparison operation, is -// either a vector of n elements or, if n==1, a scalar expression. -// Before the comparison operation, affinity zAff is to be applied -// to the pRight values. This function modifies characters within the -// affinity string to SQLITE_AFF_BLOB if either: -// -// * the comparison will be performed with no affinity, or -// * the affinity change in zAff is guaranteed not to change the value. +// C comment +// /* +// ** Expression pRight, which is the RHS of a comparison operation, is +// ** either a vector of n elements or, if n==1, a scalar expression. +// ** Before the comparison operation, affinity zAff is to be applied +// ** to the pRight values. This function modifies characters within the +// ** affinity string to SQLITE_AFF_BLOB if either: +// ** +// ** * the comparison will be performed with no affinity, or +// ** * the affinity change in zAff is guaranteed not to change the value. +// */ func _updateRangeAffinityStr(tls *crt.TLS, _pRight *XExpr, _n int32, _zAff *int8) { var _i int32 var _1_p *XExpr @@ -90194,23 +94027,26 @@ _0: goto _3 } _1_p = _sqlite3VectorFieldSubexpr(tls, _pRight, _i) - if (int32(_sqlite3CompareAffinity(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i))))) == i32(65)) || _sqlite3ExprNeedsNoAffinityChange(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i)))) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i))) = int8(i32(65)) + if (int32(_sqlite3CompareAffinity(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_i))))) == i32(65)) || _sqlite3ExprNeedsNoAffinityChange(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_i)))) != 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_i))) = int8(i32(65)) } _i += 1 goto _0 _3: } -// Code an OP_Affinity opcode to apply the column affinity string zAff -// to the n registers starting at base. -// -// As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the -// beginning and end of zAff are ignored. If all entries in zAff are -// SQLITE_AFF_BLOB, then no code gets generated. -// -// This routine makes its own copy of zAff so that the caller is free -// to modify zAff after this routine returns. +// C comment +// /* +// ** Code an OP_Affinity opcode to apply the column affinity string zAff +// ** to the n registers starting at base. +// ** +// ** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the +// ** beginning and end of zAff are ignored. If all entries in zAff are +// ** SQLITE_AFF_BLOB, then no code gets generated. +// ** +// ** This routine makes its own copy of zAff so that the caller is free +// ** to modify zAff after this routine returns. +// */ func _codeApplyAffinity(tls *crt.TLS, _pParse *XParse, _base int32, _n int32, _zAff *int8) { var _v *TVdbe _v = (*TVdbe)(_pParse.X2) @@ -90230,14 +94066,14 @@ func _codeApplyAffinity(tls *crt.TLS, _pParse *XParse, _base int32, _n int32, _z } }() _5: - if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0))))) == i32(65)) { + if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(i32(0))))) == i32(65)) { _n -= 1 _base += 1 *(*uintptr)(unsafe.Pointer(&_zAff)) += uintptr(1) goto _5 } _6: - if (_n > i32(1)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_n-i32(1))))) == i32(65)) { + if (_n > i32(1)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAff)) + 1*uintptr(_n-i32(1))))) == i32(65)) { _n -= 1 goto _6 } @@ -90265,22 +94101,25 @@ func init() { _sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 = [4]uint8{41, 39, 38, 40} } -// Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains -// a rowid value just read from cursor iIdxCur, open on index pIdx. This -// function generates code to do a deferred seek of cursor iCur to the -// rowid stored in register iRowid. -// -// Normally, this is just: -// -// OP_Seek $iCur $iRowid -// -// However, if the scan currently being coded is a branch of an OR-loop and -// the statement currently being coded is a SELECT, then P3 of the OP_Seek -// is set to iIdxCur and P4 is set to point to an array of integers -// containing one entry for each column of the table cursor iCur is open -// on. For each table column, if the column is the i'th column of the -// index, then the corresponding array entry is set to (i+1). If the column -// does not appear in the index at all, the array entry is set to 0. +// C comment +// /* +// ** Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains +// ** a rowid value just read from cursor iIdxCur, open on index pIdx. This +// ** function generates code to do a deferred seek of cursor iCur to the +// ** rowid stored in register iRowid. +// ** +// ** Normally, this is just: +// ** +// ** OP_Seek $iCur $iRowid +// ** +// ** However, if the scan currently being coded is a branch of an OR-loop and +// ** the statement currently being coded is a SELECT, then P3 of the OP_Seek +// ** is set to iIdxCur and P4 is set to point to an array of integers +// ** containing one entry for each column of the table cursor iCur is open +// ** on. For each table column, if the column is the i'th column of the +// ** index, then the corresponding array entry is set to (i+1). If the column +// ** does not appear in the index at all, the array entry is set to 0. +// */ func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur int32, _iIdxCur int32) { var _1_i int32 var _1_ai *int32 @@ -90296,14 +94135,14 @@ func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur i } }() func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(int32(_pIdx.X14)-i32(1))))) != i32(-1) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(int32(_pIdx.X14)-i32(1))))) != i32(-1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127780), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000))), unsafe.Pointer(str(109488))) crt.X__builtin_abort(tls) } }() _sqlite3VdbeAddOp3(tls, _v, i32(130), _iIdxCur, i32(0), _iCur) if (int32(_pWInfo.X10)&i32(32)) == 0 || (func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse @@ -90315,20 +94154,20 @@ func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur i if _1_ai == nil { goto _8 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ai)) + 4*uintptr(i32(0)))) = int32(_1_pTab.X11) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_ai)) + 4*uintptr(i32(0)))) = int32(_1_pTab.X11) _1_i = i32(0) _9: if _1_i >= (int32(_pIdx.X14) - i32(1)) { goto _12 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i)))) >= int32(_1_pTab.X11) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_1_i)))) >= int32(_1_pTab.X11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127792), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000))), unsafe.Pointer(str(109524))) crt.X__builtin_abort(tls) } }() - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i)))) >= i32(0) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ai)) + 4*uintptr(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i))))+i32(1)))) = _1_i + i32(1) + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_1_i)))) >= i32(0) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_ai)) + 4*uintptr(int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_1_i))))+i32(1)))) = _1_i + i32(1) } _1_i += 1 goto _9 @@ -90344,9 +94183,12 @@ func init() { crt.Xstrncpy(nil, &_codeDeferredSeekØ00__func__Ø000[0], str(109553), 17) } -// For an indexes on expression X, locate every instance of expression X in pExpr -// and change that subexpression into a reference to the appropriate column of -// the index. +// C comment +// /* +// ** For an indexes on expression X, locate every instance of expression X in pExpr +// ** and change that subexpression into a reference to the appropriate column of +// ** the index. +// */ func _whereIndexExprTrans(tls *crt.TLS, _pIdx *XIndex, _iTabCur int32, _iIdxCur int32, _pWInfo *XWhereInfo) { var _iIdxCol int32 var _aColExpr *XExprList @@ -90356,27 +94198,27 @@ func _whereIndexExprTrans(tls *crt.TLS, _pIdx *XIndex, _iTabCur int32, _iIdxCur if _aColExpr == nil { return } - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _whereIndexExprTransNode - *(**XIdxExprTrans)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_x - *(*int32)(unsafe.Pointer(&(_x.X1))) = _iTabCur - *(*int32)(unsafe.Pointer(&(_x.X2))) = _iIdxCur + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _whereIndexExprTransNode + *(**XIdxExprTrans)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = &_x + *(*int32)(unsafe.Pointer(&_x.X1)) = _iTabCur + *(*int32)(unsafe.Pointer(&_x.X2)) = _iIdxCur _iIdxCol = i32(0) _1: - if _iIdxCol >= (_aColExpr.X0) { + if _iIdxCol >= _aColExpr.X0 { goto _4 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iIdxCol)))) != i32(-2) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_iIdxCol)))) != i32(-2) { goto _2 } func() { - if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2)))))+32*uintptr(_iIdxCol))).X0) == nil { + if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_aColExpr.X2))))+32*uintptr(_iIdxCol))).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127887), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereIndexExprTransØ00__func__Ø000))), unsafe.Pointer(str(109570))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_x.X3))) = _iIdxCol - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_x.X0))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2))))) + 32*uintptr(_iIdxCol))).X0) + *(*int32)(unsafe.Pointer(&_x.X3)) = _iIdxCol + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_x.X0)))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_aColExpr.X2)))) + 32*uintptr(_iIdxCol))).X0) _sqlite3WalkExpr(tls, &_w, (*XExpr)(_pWInfo.X4)) _sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.X2)) _sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.X3)) @@ -90388,19 +94230,21 @@ _4: _ = _x } -// The walker node callback used to transform matching expressions into -// a reference to an index column for an index on an expression. -// -// If pExpr matches, then transform it into a reference to the index column -// that contains the value of pExpr. +// C comment +// /* The walker node callback used to transform matching expressions into +// ** a reference to an index column for an index on an expression. +// ** +// ** If pExpr matches, then transform it into a reference to the index column +// ** that contains the value of pExpr. +// */ func _whereIndexExprTransNode(tls *crt.TLS, _p *XWalker, _pExpr *XExpr) (r0 int32) { var _pX *XIdxExprTrans - _pX = (*XIdxExprTrans)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_p.X6)))))) + _pX = (*XIdxExprTrans)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_p.X6))))) if _sqlite3ExprCompare(tls, _pExpr, (*XExpr)(_pX.X0), _pX.X1) == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(152)) - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pX.X2 - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_pX.X3) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(152)) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _pX.X2 + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = int16(_pX.X3) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = nil return i32(1) } return i32(0) @@ -90420,8 +94264,11 @@ func _sqlite3ExprCodeGetColumnToReg(tls *crt.TLS, _pParse *XParse, _pTab *XTable } } -// Generate the end of the WHERE loop. See comments on -// sqlite3WhereBegin() for additional information. +// C comment +// /* +// ** Generate the end of the WHERE loop. See comments on +// ** sqlite3WhereBegin() for additional information. +// */ func _sqlite3WhereEnd(tls *crt.TLS, _pWInfo *XWhereInfo) { var _i, _1_addr, _2_addrSeek, _2_n, _3_r1, _3_j, _3_op, _6_j, _11_ws, _16_k, _16_last, _22_x int32 var _db *Xsqlite3 @@ -90445,16 +94292,16 @@ _0: if _i < i32(0) { goto _3 } - _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(_i))) + _pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(_i))) _pLoop = (*XWhereLoop)(_pLevel.X18) if int32(_pLevel.X12) == i32(164) { goto _4 } _2_addrSeek = i32(0) - if int32(_pWInfo.X16) != i32(2) || ((_pLoop.X9)&uint32(i32(512))) == uint32(i32(0)) || ((uint32((store69(&_2_pIdx, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)).X16)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == 0 || store1(&_2_n, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3)) <= i32(0) || int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X2)) + 2*uintptr(_2_n)))) < i32(36) { + if int32(_pWInfo.X16) != i32(2) || (_pLoop.X9&uint32(i32(512))) == uint32(i32(0)) || ((uint32((store69(&_2_pIdx, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4)).X16)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) == 0 || store1(&_2_n, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X3)) <= i32(0) || int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pIdx.X2)) + 2*uintptr(_2_n)))) < i32(36) { goto _9 } - _3_r1 = (_pParse.X18) + i32(1) + _3_r1 = _pParse.X18 + i32(1) _3_j = i32(0) _10: if _3_j >= _2_n { @@ -90465,7 +94312,7 @@ _10: goto _10 _13: { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + (_2_n + i32(1)) sink1(*p) } @@ -90488,38 +94335,38 @@ _9: _4: _sqlite3VdbeResolveLabel(tls, _v, _pLevel.X6) _17: - if ((_pLoop.X9)&uint32(i32(2048))) == 0 || ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0) <= i32(0) { + if (_pLoop.X9&uint32(i32(2048))) == 0 || ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0) <= i32(0) { goto _19 } _sqlite3VdbeResolveLabel(tls, _v, _pLevel.X4) *func() **TInLoop { - _6_j = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0 + _6_j = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X0 return &_6_pIn - }() = (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1) + 12*uintptr(_6_j-i32(1)))) + }() = (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17)))).X1) + 12*uintptr(_6_j-i32(1)))) _20: if _6_j <= i32(0) { goto _23 } - _sqlite3VdbeJumpHere(tls, _v, (_6_pIn.X1)+i32(1)) + _sqlite3VdbeJumpHere(tls, _v, _6_pIn.X1+i32(1)) if int32(_6_pIn.X2) != i32(164) { _sqlite3VdbeAddOp2(tls, _v, int32(_6_pIn.X2), _6_pIn.X0, _6_pIn.X1) } - _sqlite3VdbeJumpHere(tls, _v, (_6_pIn.X1)-i32(1)) + _sqlite3VdbeJumpHere(tls, _v, _6_pIn.X1-i32(1)) *(*uintptr)(unsafe.Pointer(func() **TInLoop { _6_j -= 1; return &_6_pIn }())) += uintptr(18446744073709551604) goto _20 _23: _19: _sqlite3VdbeResolveLabel(tls, _v, _pLevel.X3) - if (_pLevel.X5) != 0 { + if _pLevel.X5 != 0 { _sqlite3VdbeGoto(tls, _v, _pLevel.X5) - _sqlite3VdbeComment(tls, _v, str(109620), unsafe.Pointer((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4).X0)) + _sqlite3VdbeComment(tls, _v, str(109620), unsafe.Pointer((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4).X0)) _sqlite3VdbeJumpHere(tls, _v, _pLevel.X5) - _sqlite3VdbeJumpHere(tls, _v, (_pLevel.X5)-i32(2)) + _sqlite3VdbeJumpHere(tls, _v, _pLevel.X5-i32(2)) } - if (_pLevel.X10) != 0 { - _sqlite3VdbeAddOp2(tls, _v, i32(48), int32((_pLevel.X9)>>uint(i32(1))), _pLevel.X10) + if _pLevel.X10 != 0 { + _sqlite3VdbeAddOp2(tls, _v, i32(48), int32(_pLevel.X9>>uint(i32(1))), _pLevel.X10) } - if (_pLevel.X0) == 0 { + if _pLevel.X0 == 0 { goto _27 } _11_ws = int32(_pLoop.X9) @@ -90531,9 +94378,9 @@ _19: } }() if (_11_ws & i32(64)) == i32(0) { - _sqlite3VdbeAddOp1(tls, _v, i32(126), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+112*uintptr(_i))).X11) + _sqlite3VdbeAddOp1(tls, _v, i32(126), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2))))+112*uintptr(_i))).X11) } - if (_11_ws&i32(512)) != 0 || ((_11_ws&i32(8192)) != 0 && ((*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17)))))) != nil)) { + if (_11_ws&i32(512)) != 0 || ((_11_ws&i32(8192)) != 0 && ((*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17))))) != nil)) { _sqlite3VdbeAddOp1(tls, _v, i32(126), _pLevel.X2) } if int32(_pLevel.X12) == i32(52) { @@ -90549,18 +94396,18 @@ _27: _3: _sqlite3VdbeResolveLabel(tls, _v, _pWInfo.X8) func() { - if int32(_pWInfo.X11) > (_pTabList.X0) { + if int32(_pWInfo.X11) > _pTabList.X0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109693))) crt.X__builtin_abort(tls) } }() - *func() **XWhereLevel { _i = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + *func() **XWhereLevel { _i = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) _39: if _i >= int32(_pWInfo.X11) { goto _42 } _16_pIdx = nil - _16_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(_pLevel.X11))) + _16_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(_pLevel.X11))) _16_pTab = (*XTable)(_16_pTabItem.X4) func() { if _16_pTab == nil { @@ -90569,19 +94416,19 @@ _39: } }() _pLoop = (*XWhereLoop)(_pLevel.X18) - if ((uint32(((*t28)(unsafe.Pointer(&(_16_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(((*t28)(unsafe.Pointer(&_16_pTabItem.X9)).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 { _translateColumnToCopy(tls, _pParse, _pLevel.X8, _pLevel.X1, _16_pTabItem.X8, i32(0)) goto _40 } - if ((_pLoop.X9) & uint32(i32(576))) != 0 { - _16_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4) + if (_pLoop.X9 & uint32(i32(576))) != 0 { + _16_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&_pLoop.X8)))).X4) goto _48 } - if ((_pLoop.X9) & uint32(i32(8192))) != 0 { - _16_pIdx = (*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17)))))) + if (_pLoop.X9 & uint32(i32(8192))) != 0 { + _16_pIdx = (*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&_pLevel.X17))))) } _48: - if _16_pIdx == nil || int32(_pWInfo.X14) != i32(0) && (((*XTable)(_16_pIdx.X3).X9)&uint32(i32(32))) == uint32(i32(0)) || (_db.X17) != 0 { + if _16_pIdx == nil || int32(_pWInfo.X14) != i32(0) && (((*XTable)(_16_pIdx.X3).X9)&uint32(i32(32))) == uint32(i32(0)) || _db.X17 != 0 { goto _52 } _16_last = _sqlite3VdbeCurrentAddr(tls, _v) @@ -90591,7 +94438,7 @@ _53: if _16_k >= _16_last { goto _56 } - if (_16_pOp.X3) != (_pLevel.X1) { + if _16_pOp.X3 != _pLevel.X1 { goto _54 } if int32(_16_pOp.X0) != i32(99) { @@ -90604,9 +94451,9 @@ _53: crt.X__builtin_abort(tls) } }() - if ((_16_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_16_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { _23_pPk = _sqlite3PrimaryKeyIndex(tls, _16_pTab) - _22_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_23_pPk.X1)) + 2*uintptr(_22_x)))) + _22_x = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pPk.X1)) + 2*uintptr(_22_x)))) func() { if _22_x < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109743))) @@ -90616,11 +94463,11 @@ _53: } _22_x = int32(_sqlite3ColumnOfIndex(tls, _16_pIdx, int16(_22_x))) if _22_x >= i32(0) { - *(*int32)(unsafe.Pointer(&(_16_pOp.X4))) = _22_x - *(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2 + *(*int32)(unsafe.Pointer(&_16_pOp.X4)) = _22_x + *(*int32)(unsafe.Pointer(&_16_pOp.X3)) = _pLevel.X2 } func() { - if ((_pLoop.X9)&uint32(i32(64))) != uint32(i32(0)) && _22_x < i32(0) && (_pWInfo.X14) == 0 { + if (_pLoop.X9&uint32(i32(64))) != uint32(i32(0)) && _22_x < i32(0) && _pWInfo.X14 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109748))) crt.X__builtin_abort(tls) } @@ -90628,12 +94475,12 @@ _53: goto _72 _58: if int32(_16_pOp.X0) == i32(125) { - *(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2 - *(*uint8)(unsafe.Pointer(&(_16_pOp.X0))) = uint8(i32(131)) + *(*int32)(unsafe.Pointer(&_16_pOp.X3)) = _pLevel.X2 + *(*uint8)(unsafe.Pointer(&_16_pOp.X0)) = uint8(i32(131)) goto _72 } if int32(_16_pOp.X0) == i32(23) { - *(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2 + *(*int32)(unsafe.Pointer(&_16_pOp.X3)) = _pLevel.X2 } _72: _54: @@ -90645,7 +94492,7 @@ _40: *(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _i += 1; return &_pLevel }())) += uintptr(88) goto _39 _42: - *(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(_pWInfo.X9) + *(*uint32)(unsafe.Pointer(&_pParse.X42)) = uint32(_pWInfo.X9) _whereInfoFree(tls, _db, _pWInfo) } @@ -90655,7 +94502,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereEndØ00__func__Ø000[0], str(109813), 16) } -// Free a WhereInfo structure +// C comment +// /* +// ** Free a WhereInfo structure +// */ func _whereInfoFree(tls *crt.TLS, _db *Xsqlite3, _pWInfo *XWhereInfo) { var _1_i int32 var _4_p *XWhereLoop @@ -90677,22 +94527,22 @@ _3: if _1_i >= int32(_pWInfo.X11) { goto _6 } - _2_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 88*uintptr(_1_i))) - if ((*XWhereLoop)(_2_pLevel.X18) != nil) && ((((*XWhereLoop)(_2_pLevel.X18).X9) & uint32(i32(2048))) != 0) { - _sqlite3DbFree(tls, _db, (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_2_pLevel.X17))))).X1) + _2_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&_pWInfo.X24)))) + 88*uintptr(_1_i))) + if (_2_pLevel.X18 != nil) && ((((*XWhereLoop)(_2_pLevel.X18).X9) & uint32(i32(2048))) != 0) { + _sqlite3DbFree(tls, _db, (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&_2_pLevel.X17)))).X1) } _1_i += 1 goto _3 _6: - _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))) + _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&_pWInfo.X22))) _9: - if (*XWhereLoop)(_pWInfo.X19) != nil { + if _pWInfo.X19 != nil { _4_p = (*XWhereLoop)(_pWInfo.X19) - *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X19))))) = (*XWhereLoop)(_4_p.X14) + *(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pWInfo.X19)))) = (*XWhereLoop)(_4_p.X14) _whereLoopDelete(tls, _db, _4_p) goto _9 } - _sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pWInfo)) + _sqlite3DbFreeNN(tls, _db, unsafe.Pointer(_pWInfo)) _2: } @@ -90702,15 +94552,18 @@ func init() { crt.Xstrncpy(nil, &_whereInfoFreeØ00__func__Ø000[0], str(109829), 14) } -// Deallocate a WhereClause structure. The WhereClause structure -// itself is not freed. This routine is the inverse of -// sqlite3WhereClauseInit(). +// C comment +// /* +// ** Deallocate a WhereClause structure. The WhereClause structure +// ** itself is not freed. This routine is the inverse of +// ** sqlite3WhereClauseInit(). +// */ func _sqlite3WhereClauseClear(tls *crt.TLS, _pWC *XWhereClause) { var _i int32 var _db *Xsqlite3 var _a *XWhereTerm _db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.X0).X0).X0) - *func() **XWhereTerm { _i = (_pWC.X3) - i32(1); return &_a }() = (*XWhereTerm)(_pWC.X5) + *func() **XWhereTerm { _i = _pWC.X3 - i32(1); return &_a }() = (*XWhereTerm)(_pWC.X5) _0: if _i < i32(0) { goto _3 @@ -90719,31 +94572,37 @@ _0: _sqlite3ExprDelete(tls, _db, (*XExpr)(_a.X0)) } if (int32(_a.X3) & i32(16)) != 0 { - _whereOrInfoDelete(tls, _db, (*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_a.X10))))))) + _whereOrInfoDelete(tls, _db, (*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_a.X10)))))) goto _7 } if (int32(_a.X3) & i32(32)) != 0 { - _whereAndInfoDelete(tls, _db, (*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_a.X10))))))) + _whereAndInfoDelete(tls, _db, (*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&_a.X10)))))) } _7: *(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_a }())) += uintptr(64) goto _0 _3: - if (*XWhereTerm)(_pWC.X5) != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6))))) { + if (*XWhereTerm)(_pWC.X5) != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&_pWC.X6)))) { _sqlite3DbFree(tls, _db, _pWC.X5) } } -// Deallocate all memory associated with a WhereOrInfo object. +// C comment +// /* +// ** Deallocate all memory associated with a WhereOrInfo object. +// */ func _whereOrInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereOrInfo) { - _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_p.X0)))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&_p.X0))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p)) } -// Deallocate all memory associated with a WhereAndInfo object. +// C comment +// /* +// ** Deallocate all memory associated with a WhereAndInfo object. +// */ func _whereAndInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereAndInfo) { - _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_p.X0)))) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&_p.X0))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p)) } var _sqlite3WhereCodeOneLoopStartØ00aStepØ003 [2]uint8 @@ -90758,38 +94617,53 @@ func init() { _sqlite3WhereCodeOneLoopStartØ00aStartØ004 = [2]uint8{37, 33} } -// Return the estimated number of output rows from a WHERE clause +// C comment +// /* +// ** Return the estimated number of output rows from a WHERE clause +// */ func _sqlite3WhereOutputRowCount(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int16) { return _pWInfo.X21 } -// Return one of the WHERE_DISTINCT_xxxxx values to indicate how this -// WHERE clause returns outputs for DISTINCT processing. +// C comment +// /* +// ** Return one of the WHERE_DISTINCT_xxxxx values to indicate how this +// ** WHERE clause returns outputs for DISTINCT processing. +// */ func _sqlite3WhereIsDistinct(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { return int32(_pWInfo.X16) } -// Return TRUE if the WHERE clause returns rows in ORDER BY order. -// Return FALSE if the output needs to be sorted. +// C comment +// /* +// ** Return TRUE if the WHERE clause returns rows in ORDER BY order. +// ** Return FALSE if the output needs to be sorted. +// */ func _sqlite3WhereIsOrdered(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { return int32(_pWInfo.X12) } -// Return TRUE if the innermost loop of the WHERE clause implementation -// returns rows in ORDER BY order for complete run of the inner loop. -// -// Across multiple iterations of outer loops, the output rows need not be -// sorted. As long as rows are sorted for just the innermost loop, this -// routine can return TRUE. +// C comment +// /* +// ** Return TRUE if the innermost loop of the WHERE clause implementation +// ** returns rows in ORDER BY order for complete run of the inner loop. +// ** +// ** Across multiple iterations of outer loops, the output rows need not be +// ** sorted. As long as rows are sorted for just the innermost loop, this +// ** routine can return TRUE. +// */ func _sqlite3WhereOrderedInnerLoop(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { return int32(_pWInfo.X17) } -// Return the VDBE address or label to jump to in order to continue -// immediately with the next row of a WHERE clause. +// C comment +// /* +// ** Return the VDBE address or label to jump to in order to continue +// ** immediately with the next row of a WHERE clause. +// */ func _sqlite3WhereContinueLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { func() { - if (_pWInfo.X7) == i32(0) { + if _pWInfo.X7 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130460), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereContinueLabelØ00__func__Ø000))), unsafe.Pointer(str(109843))) crt.X__builtin_abort(tls) } @@ -90803,16 +94677,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereContinueLabelØ00__func__Ø000[0], str(109864), 26) } -// Return the VDBE address or label to jump to in order to break -// out of a WHERE loop. +// C comment +// /* +// ** Return the VDBE address or label to jump to in order to break +// ** out of a WHERE loop. +// */ func _sqlite3WhereBreakLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { return _pWInfo.X8 } -// Call sqlite3ExprAnalyzeAggregates() for every expression in an -// expression list. Return the number of errors. -// -// If an error is found, the analysis is cut short. +// C comment +// /* +// ** Call sqlite3ExprAnalyzeAggregates() for every expression in an +// ** expression list. Return the number of errors. +// ** +// ** If an error is found, the analysis is cut short. +// */ func _sqlite3ExprAnalyzeAggList(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) { var _i int32 var _pItem *TExprList_item @@ -90820,11 +94700,11 @@ func _sqlite3ExprAnalyzeAggList(tls *crt.TLS, _pNC *XNameContext, _pList *XExprL goto _0 } *func() *int32 { - _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + _pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) return &_i }() = i32(0) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } _sqlite3ExprAnalyzeAggregates(tls, _pNC, (*XExpr)(_pItem.X0)) @@ -90834,19 +94714,22 @@ _4: _0: } -// Analyze the pExpr expression looking for aggregate functions and -// for variables that need to be added to AggInfo object that pNC->pAggInfo -// points to. Additional entries are made on the AggInfo object as -// necessary. -// -// This routine should only be called after the expression has been -// analyzed by sqlite3ResolveExprNames(). +// C comment +// /* +// ** Analyze the pExpr expression looking for aggregate functions and +// ** for variables that need to be added to AggInfo object that pNC->pAggInfo +// ** points to. Additional entries are made on the AggInfo object as +// ** necessary. +// ** +// ** This routine should only be called after the expression has been +// ** analyzed by sqlite3ResolveExprNames(). +// */ func _sqlite3ExprAnalyzeAggregates(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _analyzeAggregate - *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _analyzeAggregatesInSelect - *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pNC + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _analyzeAggregate + *(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X2)))) = _analyzeAggregatesInSelect + *(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = _pNC func() { if (*XSrcList)(_pNC.X1) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000))), unsafe.Pointer(str(94459))) @@ -90857,9 +94740,12 @@ func _sqlite3ExprAnalyzeAggregates(tls *crt.TLS, _pNC *XNameContext, _pExpr *XEx _ = _w } -// This is the xExprCallback for a tree walker. It is used to -// implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates -// for additional information. +// C comment +// /* +// ** This is the xExprCallback for a tree walker. It is used to +// ** implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates +// ** for additional information. +// */ func _analyzeAggregate(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _i, _5_k, _9_j, _9_n int32 var _17_enc uint8 @@ -90873,7 +94759,7 @@ func _analyzeAggregate(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32 var _pAggInfo *XAggInfo var _4_pCol *TAggInfo_col var _14_pItem *TAggInfo_func - _pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) _pParse = (*XParse)(_pNC.X0) _pSrcList = (*XSrcList)(_pNC.X1) _pAggInfo = (*XAggInfo)(_pNC.X3) @@ -90901,48 +94787,48 @@ _1: }() == 0 { goto _7 } - _3_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrcList.X2))))) + _3_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrcList.X2)))) _i = i32(0) _8: - if _i >= (_pSrcList.X0) { + if _i >= _pSrcList.X0 { goto _11 } func() { - if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95867), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(96005))) crt.X__builtin_abort(tls) } }() - if (_pExpr.X8) != (_3_pItem.X11) { + if _pExpr.X8 != _3_pItem.X11 { goto _14 } _4_pCol = (*TAggInfo_col)(_pAggInfo.X8) _5_k = i32(0) _15: - if _5_k >= (_pAggInfo.X9) { + if _5_k >= _pAggInfo.X9 { goto _18 } - if ((_4_pCol.X1) == (_pExpr.X8)) && ((_4_pCol.X2) == int32(_pExpr.X9)) { + if (_4_pCol.X1 == _pExpr.X8) && (_4_pCol.X2 == int32(_pExpr.X9)) { goto _18 } *(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _5_k += 1; return &_4_pCol }())) += uintptr(32) goto _15 _18: - if _5_k < (_pAggInfo.X9) || store1(&_5_k, _addAggInfoColumn(tls, (*Xsqlite3)(_pParse.X0), _pAggInfo)) < i32(0) { + if _5_k < _pAggInfo.X9 || store1(&_5_k, _addAggInfoColumn(tls, (*Xsqlite3)(_pParse.X0), _pAggInfo)) < i32(0) { goto _22 } _4_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8) + 32*uintptr(_5_k))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pCol.X0))))) = (*XTable)(_pExpr.X14) - *(*int32)(unsafe.Pointer(&(_4_pCol.X1))) = _pExpr.X8 - *(*int32)(unsafe.Pointer(&(_4_pCol.X2))) = int32(_pExpr.X9) - *(*int32)(unsafe.Pointer(&(_4_pCol.X4))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - *(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = i32(-1) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pCol.X5))))) = _pExpr - if (*XExprList)(_pAggInfo.X7) == nil { + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pCol.X0)))) = (*XTable)(_pExpr.X14) + *(*int32)(unsafe.Pointer(&_4_pCol.X1)) = _pExpr.X8 + *(*int32)(unsafe.Pointer(&_4_pCol.X2)) = int32(_pExpr.X9) + *(*int32)(unsafe.Pointer(&_4_pCol.X4)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + *(*int32)(unsafe.Pointer(&_4_pCol.X3)) = i32(-1) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pCol.X5)))) = _pExpr + if _pAggInfo.X7 == nil { goto _23 } _9_pGB = (*XExprList)(_pAggInfo.X7) - _9_pTerm = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_9_pGB.X2))))) + _9_pTerm = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_9_pGB.X2)))) _9_n = _9_pGB.X0 _9_j = i32(0) _24: @@ -90950,26 +94836,26 @@ _24: goto _27 } _10_pE = (*XExpr)(_9_pTerm.X0) - if ((int32(_10_pE.X0) == i32(152)) && ((_10_pE.X8) == (_pExpr.X8))) && (int32(_10_pE.X9) == int32(_pExpr.X9)) { - *(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = _9_j + if ((int32(_10_pE.X0) == i32(152)) && (_10_pE.X8 == _pExpr.X8)) && (int32(_10_pE.X9) == int32(_pExpr.X9)) { + *(*int32)(unsafe.Pointer(&_4_pCol.X3)) = _9_j goto _27 } *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_j += 1; return &_9_pTerm }())) += uintptr(32) goto _24 _27: _23: - if (_4_pCol.X3) < i32(0) { - *(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = postInc1((*int32)(unsafe.Pointer(&(_pAggInfo.X4))), int32(1)) + if _4_pCol.X3 < i32(0) { + *(*int32)(unsafe.Pointer(&_4_pCol.X3)) = postInc1((*int32)(unsafe.Pointer(&_pAggInfo.X4)), 1) } _22: { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } - *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X13))))) = _pAggInfo - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(154)) - *(*int16)(unsafe.Pointer(&(_pExpr.X10))) = int16(_5_k) + *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X13)))) = _pAggInfo + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(154)) + *(*int16)(unsafe.Pointer(&_pExpr.X10)) = int16(_5_k) goto _11 _14: *(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_3_pItem }())) += uintptr(112) @@ -90979,13 +94865,13 @@ _7: return i32(1) _3: - if (int32(_pNC.X7)&i32(8)) != i32(0) || (_pWalker.X4) != int32(_pExpr.X12) { + if (int32(_pNC.X7)&i32(8)) != i32(0) || _pWalker.X4 != int32(_pExpr.X12) { goto _33 } _14_pItem = (*TAggInfo_func)(_pAggInfo.X11) _i = i32(0) _34: - if _i >= (_pAggInfo.X12) { + if _i >= _pAggInfo.X12 { goto _37 } if _sqlite3ExprCompare(tls, (*XExpr)(_14_pItem.X0), _pExpr, i32(-1)) == i32(0) { @@ -90994,7 +94880,7 @@ _34: *(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_14_pItem }())) += uintptr(24) goto _34 _37: - if _i < (_pAggInfo.X12) { + if _i < _pAggInfo.X12 { goto _39 } _17_enc = (*Xsqlite3)(_pParse.X0).X14 @@ -91003,47 +94889,47 @@ _37: goto _40 } func() { - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95945), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(42778))) crt.X__builtin_abort(tls) } }() _14_pItem = (*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11) + 24*uintptr(_i))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_14_pItem.X0))))) = _pExpr - *(*int32)(unsafe.Pointer(&(_14_pItem.X2))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_14_pItem.X0)))) = _pExpr + *(*int32)(unsafe.Pointer(&_14_pItem.X2)) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) func() { - if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(1024))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95949), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(42524))) crt.X__builtin_abort(tls) } }() - *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_14_pItem.X1))))) = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), func() int32 { - if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil { - return ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) + *(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_14_pItem.X1)))) = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))), func() int32 { + if (*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))) != nil { + return ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6))))).X0) } return i32(0) }(), _17_enc, uint8(i32(0))) - if ((_pExpr.X2) & uint32(i32(16))) != 0 { - *(*int32)(unsafe.Pointer(&(_14_pItem.X3))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + if (_pExpr.X2 & uint32(i32(16))) != 0 { + *(*int32)(unsafe.Pointer(&_14_pItem.X3)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) goto _48 } - *(*int32)(unsafe.Pointer(&(_14_pItem.X3))) = i32(-1) + *(*int32)(unsafe.Pointer(&_14_pItem.X3)) = i32(-1) _48: _40: _39: func() { - if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(24576))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95962), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(96005))) crt.X__builtin_abort(tls) } }() { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(131072)) sink5(*p) } - *(*int16)(unsafe.Pointer(&(_pExpr.X10))) = int16(_i) - *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X13))))) = _pAggInfo + *(*int16)(unsafe.Pointer(&_pExpr.X10)) = int16(_i) + *(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X13)))) = _pAggInfo return i32(1) _33: @@ -91059,29 +94945,35 @@ func init() { crt.Xstrncpy(nil, &_analyzeAggregateØ00__func__Ø000[0], str(109890), 17) } -// Add a new element to the pAggInfo->aCol[] array. Return the index of -// the new element. Return a negative number if malloc fails. +// C comment +// /* +// ** Add a new element to the pAggInfo->aCol[] array. Return the index of +// ** the new element. Return a negative number if malloc fails. +// */ func _addAggInfoColumn(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) { var _i int32 - *(**TAggInfo_col)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X8))))) = (*TAggInfo_col)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X8, int32(u64(32)), (*int32)(unsafe.Pointer(&(_pInfo.X9))), &_i)) + *(**TAggInfo_col)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInfo.X8)))) = (*TAggInfo_col)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X8, int32(u64(32)), (*int32)(unsafe.Pointer(&_pInfo.X9)), &_i)) return _i } -// pArray is a pointer to an array of objects. Each object in the -// array is szEntry bytes in size. This routine uses sqlite3DbRealloc() -// to extend the array so that there is space for a new object at the end. -// -// When this function is called, *pnEntry contains the current size of -// the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes -// in total). -// -// If the realloc() is successful (i.e. if no OOM condition occurs), the -// space allocated for the new object is zeroed, *pnEntry updated to -// reflect the new size of the array and a pointer to the new allocation -// returned. *pIdx is set to the index of the new array entry in this case. -// -// Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains -// unchanged and a copy of pArray returned. +// C comment +// /* +// ** pArray is a pointer to an array of objects. Each object in the +// ** array is szEntry bytes in size. This routine uses sqlite3DbRealloc() +// ** to extend the array so that there is space for a new object at the end. +// ** +// ** When this function is called, *pnEntry contains the current size of +// ** the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes +// ** in total). +// ** +// ** If the realloc() is successful (i.e. if no OOM condition occurs), the +// ** space allocated for the new object is zeroed, *pnEntry updated to +// ** reflect the new size of the array and a pointer to the new allocation +// ** returned. *pIdx is set to the index of the new array entry in this case. +// ** +// ** Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains +// ** unchanged and a copy of pArray returned. +// */ func _sqlite3ArrayAllocate(tls *crt.TLS, _db *Xsqlite3, _pArray unsafe.Pointer, _szEntry int32, _pnEntry *int32, _pIdx *int32) (r0 unsafe.Pointer) { var _n, _1_sz int32 var _z *int8 @@ -91104,17 +94996,20 @@ func _sqlite3ArrayAllocate(tls *crt.TLS, _db *Xsqlite3, _pArray unsafe.Pointer, _pArray = _1_pNew _0: _z = (*int8)(_pArray) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_n*_szEntry)))), i32(0), uint64(_szEntry)) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_n*_szEntry)))), i32(0), uint64(_szEntry)) *_pIdx = _n *_pnEntry += 1 return _pArray } -// Add a new element to the pAggInfo->aFunc[] array. Return the index of -// the new element. Return a negative number if malloc fails. +// C comment +// /* +// ** Add a new element to the pAggInfo->aFunc[] array. Return the index of +// ** the new element. Return a negative number if malloc fails. +// */ func _addAggInfoFunc(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) { var _i int32 - *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X11))))) = (*TAggInfo_func)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X11, int32(u64(24)), (*int32)(unsafe.Pointer(&(_pInfo.X12))), &_i)) + *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInfo.X11)))) = (*TAggInfo_func)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X11, int32(u64(24)), (*int32)(unsafe.Pointer(&_pInfo.X12)), &_i)) return _i } @@ -91128,42 +95023,48 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000[0], str(109907), 29) } -// Transfer eligible terms from the HAVING clause of a query, which is -// processed after grouping, to the WHERE clause, which is processed before -// grouping. For example, the query: -// -// SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=? -// -// can be rewritten as: -// -// SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=? -// -// A term of the HAVING expression is eligible for transfer if it consists -// entirely of constants and expressions that are also GROUP BY terms that -// use the "BINARY" collation sequence. +// C comment +// /* +// ** Transfer eligible terms from the HAVING clause of a query, which is +// ** processed after grouping, to the WHERE clause, which is processed before +// ** grouping. For example, the query: +// ** +// ** SELECT * FROM <tables> WHERE a=? GROUP BY b HAVING b=? AND c=? +// ** +// ** can be rewritten as: +// ** +// ** SELECT * FROM <tables> WHERE a=? AND b=? GROUP BY b HAVING c=? +// ** +// ** A term of the HAVING expression is eligible for transfer if it consists +// ** entirely of constants and expressions that are also GROUP BY terms that +// ** use the "BINARY" collation sequence. +// */ func _havingToWhere(tls *crt.TLS, _pParse *XParse, _pGroupBy *XExprList, _pHaving *XExpr, _ppWhere **XExpr) { var _sWalker XWalker var _sCtx THavingToWhereCtx - *(***XExpr)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X0))))) = _ppWhere - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X1))))) = _pGroupBy - crt.Xmemset(tls, (unsafe.Pointer)(&_sWalker), i32(0), u64(48)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWalker.X0))))) = _pParse - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_sWalker.X1))))) = _havingToWhereExprCb - *(**THavingToWhereCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_sWalker.X6))))))) = &_sCtx + *(***XExpr)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_sCtx.X0)))) = _ppWhere + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sCtx.X1)))) = _pGroupBy + crt.Xmemset(tls, unsafe.Pointer(&_sWalker), i32(0), u64(48)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sWalker.X0)))) = _pParse + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_sWalker.X1)))) = _havingToWhereExprCb + *(**THavingToWhereCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_sWalker.X6)))))) = &_sCtx _sqlite3WalkExpr(tls, &_sWalker, _pHaving) _ = _sCtx _ = _sWalker } -// sqlite3WalkExpr() callback used by havingToWhere(). -// -// If the node passed to the callback is a TK_AND node, return -// WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes. -// -// Otherwise, return WRC_Prune. In this case, also check if the -// sub-expression matches the criteria for being moved to the WHERE -// clause. If so, add it to the WHERE clause and replace the sub-expression -// within the HAVING expression with a constant "1". +// C comment +// /* +// ** sqlite3WalkExpr() callback used by havingToWhere(). +// ** +// ** If the node passed to the callback is a TK_AND node, return +// ** WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes. +// ** +// ** Otherwise, return WRC_Prune. In this case, also check if the +// ** sub-expression matches the criteria for being moved to the WHERE +// ** clause. If so, add it to the WHERE clause and replace the sub-expression +// ** within the HAVING expression with a constant "1". +// */ func _havingToWhereExprCb(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _2_db *Xsqlite3 var _2_pNew, _3_pWhere *XExpr @@ -91172,12 +95073,12 @@ func _havingToWhereExprCb(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 in if int32(_pExpr.X0) == i32(71) { goto _0 } - _1_p = (*THavingToWhereCtx)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _1_p = (*THavingToWhereCtx)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) if _sqlite3ExprIsConstantOrGroupBy(tls, (*XParse)(_pWalker.X0), _pExpr, (*XExprList)(_1_p.X1)) == 0 { goto _1 } _2_db = (*Xsqlite3)((*XParse)(_pWalker.X0).X0) - _2_pNew = _sqlite3ExprAlloc(tls, _2_db, i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+16*uintptr(i32(1)))), i32(0)) + _2_pNew = _sqlite3ExprAlloc(tls, _2_db, i32(134), (*XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3IntTokens))+16*uintptr(i32(1)))), i32(0)) if _2_pNew != nil { _3_pWhere = *(**XExpr)(unsafe.Pointer(_1_p.X0)) _4_t = *_2_pNew @@ -91193,30 +95094,33 @@ _0: return i32(0) } -// Walk the expression tree passed as the first argument. Return non-zero -// if the expression consists entirely of constants or copies of terms -// in pGroupBy that sort with the BINARY collation sequence. -// -// This routine is used to determine if a term of the HAVING clause can -// be promoted into the WHERE clause. In order for such a promotion to work, -// the value of the HAVING clause term must be the same for all members of -// a "group". The requirement that the GROUP BY term must be BINARY -// assumes that no other collating sequence will have a finer-grained -// grouping than binary. In other words (A=B COLLATE binary) implies -// A=B in every other collating sequence. The requirement that the -// GROUP BY be BINARY is stricter than necessary. It would also work -// to promote HAVING clauses that use the same alternative collating -// sequence as the GROUP BY term, but that is much harder to check, -// alternative collating sequences are uncommon, and this is only an -// optimization, so we take the easy way out and simply require the -// GROUP BY to use the BINARY collating sequence. +// C comment +// /* +// ** Walk the expression tree passed as the first argument. Return non-zero +// ** if the expression consists entirely of constants or copies of terms +// ** in pGroupBy that sort with the BINARY collation sequence. +// ** +// ** This routine is used to determine if a term of the HAVING clause can +// ** be promoted into the WHERE clause. In order for such a promotion to work, +// ** the value of the HAVING clause term must be the same for all members of +// ** a "group". The requirement that the GROUP BY term must be BINARY +// ** assumes that no other collating sequence will have a finer-grained +// ** grouping than binary. In other words (A=B COLLATE binary) implies +// ** A=B in every other collating sequence. The requirement that the +// ** GROUP BY be BINARY is stricter than necessary. It would also work +// ** to promote HAVING clauses that use the same alternative collating +// ** sequence as the GROUP BY term, but that is much harder to check, +// ** alternative collating sequences are uncommon, and this is only an +// ** optimization, so we take the easy way out and simply require the +// ** GROUP BY to use the BINARY collating sequence. +// */ func _sqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pGroupBy *XExprList) (r0 int32) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(1)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprNodeIsConstantOrGroupBy - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pGroupBy - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*uint8)(unsafe.Pointer(&_w.X5)) = uint8(i32(1)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _exprNodeIsConstantOrGroupBy + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))))) = _pGroupBy + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_w.X0)))) = _pParse _sqlite3WalkExpr(tls, &_w, _p) return int32(_w.X5) @@ -91224,19 +95128,22 @@ func _sqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, _pParse *XParse, _p *XExpr, _ panic(0) } -// sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy(). +// C comment +// /* +// ** sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy(). +// */ func _exprNodeIsConstantOrGroupBy(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { var _i int32 var _pGroupBy *XExprList var _1_p *XExpr var _2_pColl *XCollSeq - _pGroupBy = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))) + _pGroupBy = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6))))) _i = i32(0) _0: - if _i >= (_pGroupBy.X0) { + if _i >= _pGroupBy.X0 { goto _3 } - _1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2))))) + 32*uintptr(_i))).X0) + _1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pGroupBy.X2)))) + 32*uintptr(_i))).X0) if _sqlite3ExprCompare(tls, _pExpr, _1_p, i32(-1)) >= i32(2) { goto _4 } @@ -91248,21 +95155,24 @@ _4: _i += 1 goto _0 _3: - if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0)) + if (_pExpr.X2 & uint32(i32(2048))) != uint32(i32(0)) { + *(*uint8)(unsafe.Pointer(&_pWalker.X5)) = uint8(i32(0)) return i32(2) } return _exprNodeIsConstant(tls, _pWalker, _pExpr) } -// Unless an "EXPLAIN QUERY PLAN" command is being processed, this function -// is a no-op. Otherwise, it adds a single row of output to the EQP result, -// where the caption is of the form: -// -// "USE TEMP B-TREE FOR xxx" -// -// where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which -// is determined by the zUsage argument. +// C comment +// /* +// ** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function +// ** is a no-op. Otherwise, it adds a single row of output to the EQP result, +// ** where the caption is of the form: +// ** +// ** "USE TEMP B-TREE FOR xxx" +// ** +// ** where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which +// ** is determined by the zUsage argument. +// */ func _explainTempTable(tls *crt.TLS, _pParse *XParse, _zUsage *int8) { var _1_zMsg *int8 var _1_v *TVdbe @@ -91273,27 +95183,30 @@ func _explainTempTable(tls *crt.TLS, _pParse *XParse, _zUsage *int8) { } } -// If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(), -// the planner assumes that the specified pOrderBy list is actually a GROUP -// BY clause - and so any order that groups rows as required satisfies the -// request. -// -// Normally, in this case it is not possible for the caller to determine -// whether or not the rows are really being delivered in sorted order, or -// just in some other order that provides the required grouping. However, -// if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then -// this function may be called on the returned WhereInfo object. It returns -// true if the rows really will be sorted in the specified order, or false -// otherwise. -// -// For example, assuming: -// -// CREATE INDEX i1 ON t1(x, Y); -// -// then -// -// SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1 -// SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0 +// C comment +// /* +// ** If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(), +// ** the planner assumes that the specified pOrderBy list is actually a GROUP +// ** BY clause - and so any order that groups rows as required satisfies the +// ** request. +// ** +// ** Normally, in this case it is not possible for the caller to determine +// ** whether or not the rows are really being delivered in sorted order, or +// ** just in some other order that provides the required grouping. However, +// ** if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then +// ** this function may be called on the returned WhereInfo object. It returns +// ** true if the rows really will be sorted in the specified order, or false +// ** otherwise. +// ** +// ** For example, assuming: +// ** +// ** CREATE INDEX i1 ON t1(x, Y); +// ** +// ** then +// ** +// ** SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1 +// ** SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0 +// */ func _sqlite3WhereIsSorted(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) { func() { if (int32(_pWInfo.X10) & i32(64)) == 0 { @@ -91316,8 +95229,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WhereIsSortedØ00__func__Ø000[0], str(110033), 21) } -// Update the accumulator memory cells for an aggregate based on -// the current cursor position. +// C comment +// /* +// ** Update the accumulator memory cells for an aggregate based on +// ** the current cursor position. +// */ func _updateAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { var _i, _regHit, _addrHitTest, _1_nArg, _1_addrNext, _1_regAgg, _5_j int32 var _v *TVdbe @@ -91329,10 +95245,10 @@ func _updateAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { _v = (*TVdbe)(_pParse.X2) _regHit = i32(0) _addrHitTest = i32(0) - *(*uint8)(unsafe.Pointer(&(_pAggInfo.X0))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pAggInfo.X0)) = uint8(i32(1)) *func() **TAggInfo_func { _i = i32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.X11) _0: - if _i >= (_pAggInfo.X12) { + if _i >= _pAggInfo.X12 { goto _3 } _1_addrNext = i32(0) @@ -91352,7 +95268,7 @@ _0: _1_nArg = i32(0) _1_regAgg = i32(0) _7: - if (_pF.X3) >= i32(0) { + if _pF.X3 >= i32(0) { _1_addrNext = _sqlite3VdbeMakeLabel(tls, _v) _codeDistinct(tls, _pParse, _pF.X3, _1_addrNext, i32(1), _1_regAgg) } @@ -91366,7 +95282,7 @@ _7: crt.X__builtin_abort(tls) } }() - *func() **TExprList_item { _5_j = i32(0); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_1_pList.X2))))) + *func() **TExprList_item { _5_j = i32(0); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_1_pList.X2)))) _12: if _5_pColl != nil || _5_j >= _1_nArg { goto _16 @@ -91378,8 +95294,8 @@ _16: if _5_pColl == nil { _5_pColl = (*XCollSeq)((*Xsqlite3)(_pParse.X0).X2) } - if (_regHit == i32(0)) && (_pAggInfo.X10) != 0 { - _regHit = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (_regHit == i32(0)) && _pAggInfo.X10 != 0 { + _regHit = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) } _sqlite3VdbeAddOp4(tls, _v, i32(68), _regHit, i32(0), i32(0), (*int8)(unsafe.Pointer(_5_pColl)), i32(-3)) _9: @@ -91401,14 +95317,14 @@ _3: _sqlite3ExprCacheClear(tls, _pParse) *func() **TAggInfo_col { _i = i32(0); return &_pC }() = (*TAggInfo_col)(_pAggInfo.X8) _22: - if _i >= (_pAggInfo.X10) { + if _i >= _pAggInfo.X10 { goto _25 } _sqlite3ExprCode(tls, _pParse, (*XExpr)(_pC.X5), _pC.X4) *(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _i += 1; return &_pC }())) += uintptr(32) goto _22 _25: - *(*uint8)(unsafe.Pointer(&(_pAggInfo.X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pAggInfo.X0)) = uint8(i32(0)) _sqlite3ExprCacheClear(tls, _pParse) if _addrHitTest != 0 { _sqlite3VdbeJumpHere(tls, _v, _addrHitTest) @@ -91421,8 +95337,11 @@ func init() { crt.Xstrncpy(nil, &_updateAccumulatorØ00__func__Ø000[0], str(110096), 18) } -// Invoke the OP_AggFinalize opcode for every aggregate function -// in the AggInfo structure. +// C comment +// /* +// ** Invoke the OP_AggFinalize opcode for every aggregate function +// ** in the AggInfo structure. +// */ func _finalizeAggFunctions(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { var _i int32 var _v *TVdbe @@ -91431,7 +95350,7 @@ func _finalizeAggFunctions(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { _v = (*TVdbe)(_pParse.X2) *func() **TAggInfo_func { _i = i32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.X11) _0: - if _i >= (_pAggInfo.X12) { + if _i >= _pAggInfo.X12 { goto _3 } _1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pF.X0).X6)))))) @@ -91443,7 +95362,7 @@ _0: }() _sqlite3VdbeAddOp2(tls, _v, i32(152), _pF.X2, func() int32 { if _1_pList != nil { - return (_1_pList.X0) + return _1_pList.X0 } return i32(0) }()) @@ -91459,12 +95378,15 @@ func init() { crt.Xstrncpy(nil, &_finalizeAggFunctionsØ00__func__Ø000[0], str(110114), 21) } -// Reset the aggregate accumulator. -// -// The aggregate accumulator is a set of memory cells that hold -// intermediate results while calculating an aggregate. This -// routine generates code that stores NULLs in all of those memory -// cells. +// C comment +// /* +// ** Reset the aggregate accumulator. +// ** +// ** The aggregate accumulator is a set of memory cells that hold +// ** intermediate results while calculating an aggregate. This +// ** routine generates code that stores NULLs in all of those memory +// ** cells. +// */ func _resetAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { var _i, _nReg int32 var _v *TVdbe @@ -91472,23 +95394,23 @@ func _resetAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) { var _6_pKeyInfo *XKeyInfo var _pFunc *TAggInfo_func _v = (*TVdbe)(_pParse.X2) - _nReg = (_pAggInfo.X12) + (_pAggInfo.X9) + _nReg = _pAggInfo.X12 + _pAggInfo.X9 if _nReg == i32(0) { return } func() { - if _nReg != (((_pAggInfo.X6) - (_pAggInfo.X5)) + i32(1)) { + if _nReg != ((_pAggInfo.X6 - _pAggInfo.X5) + i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121268), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110135))) crt.X__builtin_abort(tls) } }() _i = i32(0) _3: - if _i >= (_pAggInfo.X9) { + if _i >= _pAggInfo.X9 { goto _6 } func() { - if ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+32*uintptr(_i))).X4) < (_pAggInfo.X5) || ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+32*uintptr(_i))).X4) > (_pAggInfo.X6) { + if ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+32*uintptr(_i))).X4) < _pAggInfo.X5 || ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+32*uintptr(_i))).X4) > _pAggInfo.X6 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121270), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110175))) crt.X__builtin_abort(tls) } @@ -91498,11 +95420,11 @@ _3: _6: _i = i32(0) _10: - if _i >= (_pAggInfo.X12) { + if _i >= _pAggInfo.X12 { goto _13 } func() { - if ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+24*uintptr(_i))).X2) < (_pAggInfo.X5) || ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+24*uintptr(_i))).X2) > (_pAggInfo.X6) { + if ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+24*uintptr(_i))).X2) < _pAggInfo.X5 || ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+24*uintptr(_i))).X2) > _pAggInfo.X6 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121274), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110258))) crt.X__builtin_abort(tls) } @@ -91513,25 +95435,25 @@ _13: _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _pAggInfo.X5, _pAggInfo.X6) *func() *int32 { _pFunc = (*TAggInfo_func)(_pAggInfo.X11); return &_i }() = i32(0) _17: - if _i >= (_pAggInfo.X12) { + if _i >= _pAggInfo.X12 { goto _20 } - if (_pFunc.X3) < i32(0) { + if _pFunc.X3 < i32(0) { goto _21 } _4_pE = (*XExpr)(_pFunc.X0) func() { - if ((_4_pE.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_4_pE.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121282), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110343))) crt.X__builtin_abort(tls) } }() - if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))) == nil) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))).X0) != i32(1)) { + if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_4_pE.X6))))) == nil) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_4_pE.X6))))).X0) != i32(1)) { _sqlite3ErrorMsg(tls, _pParse, str(110378)) - *(*int32)(unsafe.Pointer(&(_pFunc.X3))) = i32(-1) + *(*int32)(unsafe.Pointer(&_pFunc.X3)) = i32(-1) goto _26 } - _6_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))), i32(0), i32(0)) + _6_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_4_pE.X6))))), i32(0), i32(0)) _sqlite3VdbeAddOp4(tls, _v, i32(110), _pFunc.X3, i32(0), i32(0), (*int8)(unsafe.Pointer(_6_pKeyInfo)), i32(-5)) _26: _21: @@ -91546,43 +95468,46 @@ func init() { crt.Xstrncpy(nil, &_resetAccumulatorØ00__func__Ø000[0], str(110429), 17) } -// The select statement passed as the first argument is an aggregate query. -// The second argument is the associated aggregate-info object. This -// function tests if the SELECT is of the form: -// -// SELECT count(*) FROM <tbl> -// -// 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. +// C comment +// /* +// ** The select statement passed as the first argument is an aggregate query. +// ** The second argument is the associated aggregate-info object. This +// ** function tests if the SELECT is of the form: +// ** +// ** SELECT count(*) FROM <tbl> +// ** +// ** 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 *crt.TLS, _p *XSelect, _pAggInfo *XAggInfo) (r0 *XTable) { var _pTab *XTable var _pExpr *XExpr func() { - if (*XExprList)(_p.X10) != nil { + if _p.X10 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120492), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(110446))) crt.X__builtin_abort(tls) } }() - if ((((*XExpr)(_p.X9) != nil) || (((*XExprList)(_p.X0).X0) != i32(1))) || (((*XSrcList)(_p.X8).X0) != i32(1))) || ((*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2)))))+112*uintptr(i32(0)))).X5) != nil) { + if (((_p.X9 != nil) || (((*XExprList)(_p.X0).X0) != i32(1))) || (((*XSrcList)(_p.X8).X0) != i32(1))) || (((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X5) != nil) { return nil } - _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X4) - _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2))))) + 32*uintptr(i32(0)))).X0) + _pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 112*uintptr(i32(0)))).X4) + _pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2))))) + 32*uintptr(i32(0)))).X0) func() { - if _pTab == nil || (*XSelect)(_pTab.X3) != nil || _pExpr == nil { + if _pTab == nil || _pTab.X3 != nil || _pExpr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120501), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(110459))) crt.X__builtin_abort(tls) } }() - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return nil } if int32(_pExpr.X0) != i32(153) { return nil } if func() int32 { - if (_pAggInfo.X12) == i32(0) { + if _pAggInfo.X12 == i32(0) { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120505), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -91596,7 +95521,7 @@ func _isSimpleCount(tls *crt.TLS, _p *XSelect, _pAggInfo *XAggInfo) (r0 *XTable) if (int32((*XFuncDef)((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+24*uintptr(i32(0)))).X1).X1) & i32(256)) == i32(0) { return nil } - if ((_pExpr.X2) & uint32(i32(16))) != 0 { + if (_pExpr.X2 & uint32(i32(16))) != 0 { return nil } return _pTab @@ -91612,7 +95537,7 @@ func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XI var _1_bCover int32 var _1_zEqp *int8 if int32(_pParse.X54) == i32(2) { - _1_bCover = bool2int((_pIdx != nil) && ((((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2)))) + _1_bCover = bool2int((_pIdx != nil) && (((_pTab.X9 & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2)))) _1_zEqp = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(110505), unsafe.Pointer(_pTab.X0), unsafe.Pointer(func() *int8 { if _1_bCover != 0 { return str(110523) @@ -91620,7 +95545,7 @@ func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XI return str(0) }()), unsafe.Pointer(func() *int8 { if _1_bCover != 0 { - return (_pIdx.X0) + return _pIdx.X0 } return str(0) }())) @@ -91628,19 +95553,22 @@ func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XI } } -// Based on the contents of the AggInfo structure indicated by the first -// argument, this function checks if the following are true: -// -// * the query contains just a single aggregate function, -// * the aggregate function is either min() or max(), and -// * the argument to the aggregate function is a column value. -// -// If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX -// is returned as appropriate. Also, *ppMinMax is set to point to the -// list of arguments passed to the aggregate before returning. -// -// Or, if the conditions above are not met, *ppMinMax is set to 0 and -// WHERE_ORDERBY_NORMAL is returned. +// C comment +// /* +// ** Based on the contents of the AggInfo structure indicated by the first +// ** argument, this function checks if the following are true: +// ** +// ** * the query contains just a single aggregate function, +// ** * the aggregate function is either min() or max(), and +// ** * the argument to the aggregate function is a column value. +// ** +// ** If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX +// ** is returned as appropriate. Also, *ppMinMax is set to point to the +// ** list of arguments passed to the aggregate before returning. +// ** +// ** Or, if the conditions above are not met, *ppMinMax is set to 0 and +// ** WHERE_ORDERBY_NORMAL is returned. +// */ func _minMaxQuery(tls *crt.TLS, _pAggInfo *XAggInfo, _ppMinMax **XExprList) (r0 uint8) { var _eRet int32 var _2_zFunc *int8 @@ -91648,21 +95576,21 @@ func _minMaxQuery(tls *crt.TLS, _pAggInfo *XAggInfo, _ppMinMax **XExprList) (r0 var _1_pExpr *XExpr _eRet = i32(0) *_ppMinMax = nil - if (_pAggInfo.X12) != i32(1) { + if _pAggInfo.X12 != i32(1) { goto _0 } _1_pExpr = (*XExpr)((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11) + 24*uintptr(i32(0)))).X0) - _1_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pExpr.X6)))))) + _1_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_1_pExpr.X6))))) func() { if int32(_1_pExpr.X0) != i32(153) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120460), unsafe.Pointer((*int8)(unsafe.Pointer(&_minMaxQueryØ00__func__Ø000))), unsafe.Pointer(str(96778))) crt.X__builtin_abort(tls) } }() - if _1_pEList == nil || (_1_pEList.X0) != i32(1) || int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_1_pEList.X2)))))+32*uintptr(i32(0)))).X0).X0) != i32(154) { + if _1_pEList == nil || _1_pEList.X0 != i32(1) || int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_1_pEList.X2))))+32*uintptr(i32(0)))).X0).X0) != i32(154) { goto _5 } - _2_zFunc = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_1_pExpr.X3))))) + _2_zFunc = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_1_pExpr.X3)))) if _sqlite3StrICmp(tls, _2_zFunc, str(7709)) == i32(0) { _eRet = i32(1) *_ppMinMax = _1_pEList @@ -91690,10 +95618,13 @@ func init() { crt.Xstrncpy(nil, &_minMaxQueryØ00__func__Ø000[0], str(110584), 12) } -// If the inner loop was generated using a non-null pOrderBy argument, -// then the results were placed in a sorter. After the loop is terminated -// we need to run the sorter and output the results. The following -// routine generates the code needed to do that. +// C comment +// /* +// ** If the inner loop was generated using a non-null pOrderBy argument, +// ** then the results were placed in a sorter. After the loop is terminated +// ** we need to run the sorter and output the results. The following +// ** routine generates the code needed to do that. +// */ func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSortCtx, _nColumn int32, _pDest *XSelectDest) { var _addrBreak, _addrContinue, _addr, _addrOnce, _iTab, _eDest, _iParm, _regRow, _regRowid, _iCol, _nKey, _iSortTab, _nSortData, _i, _bSeq, _4_regSortOut, _7_iRead int32 var _v *TVdbe @@ -91713,7 +95644,7 @@ func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSort crt.X__builtin_abort(tls) } }() - if (_pSort.X4) != 0 { + if _pSort.X4 != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(14), _pSort.X3, _pSort.X4) _sqlite3VdbeGoto(tls, _v, _addrBreak) _sqlite3VdbeResolveLabel(tls, _v, _pSort.X4) @@ -91729,13 +95660,13 @@ func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSort _regRow = _sqlite3GetTempRange(tls, _pParse, _nColumn) _nSortData = _nColumn _6: - _nKey = (_pOrderBy.X0) - (_pSort.X1) + _nKey = _pOrderBy.X0 - _pSort.X1 if (int32(_pSort.X7) & i32(1)) == 0 { goto _7 } - _4_regSortOut = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _iSortTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - if (_pSort.X4) != 0 { + _4_regSortOut = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _iSortTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + if _pSort.X4 != 0 { _addrOnce = _sqlite3VdbeAddOp0(tls, _v, i32(20)) } _sqlite3VdbeAddOp3(tls, _v, i32(113), _iSortTab, _4_regSortOut, (_nKey+i32(1))+_nSortData) @@ -91758,18 +95689,18 @@ _11: if _i >= _nSortData { goto _14 } - if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 32*uintptr(_i))).X5))))).X0) != 0 { - _7_iRead = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 32*uintptr(_i))).X5))))).X0) - i32(1) + if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOutEx)) + 32*uintptr(_i))).X5))))).X0) != 0 { + _7_iRead = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOutEx)) + 32*uintptr(_i))).X5))))).X0) - i32(1) goto _16 } - _7_iRead = postInc1(&_iCol, int32(1)) + _7_iRead = postInc1(&_iCol, 1) _16: _sqlite3VdbeAddOp3(tls, _v, i32(99), _iSortTab, _7_iRead, _regRow+_i) _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(func() *int8 { - if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 32*uintptr(_i))).X1) != nil { - return ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 32*uintptr(_i))).X1) + if ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOutEx)) + 32*uintptr(_i))).X1) != nil { + return ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOutEx)) + 32*uintptr(_i))).X1) } - return ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 32*uintptr(_i))).X2) + return ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOutEx)) + 32*uintptr(_i))).X2) }())) _i += 1 goto _11 @@ -91839,7 +95770,7 @@ _33: } _sqlite3VdbeAddOp2(tls, _v, i32(7), _iTab, _addr) _37: - if (_pSort.X3) != 0 { + if _pSort.X3 != 0 { _sqlite3VdbeAddOp1(tls, _v, i32(52), _pSort.X3) } _sqlite3VdbeResolveLabel(tls, _v, _addrBreak) @@ -91852,22 +95783,25 @@ func init() { crt.Xstrncpy(nil, &_generateSortTailØ00__func__Ø000[0], str(110692), 17) } -// Argument pVector points to a vector expression - either a TK_VECTOR -// or TK_SELECT that returns more than one column. This function returns -// the register number of a register that contains the value of -// element iField of the vector. -// -// If pVector is a TK_SELECT expression, then code for it must have -// already been generated using the exprCodeSubselect() routine. In this -// case parameter regSelect should be the first in an array of registers -// containing the results of the sub-select. -// -// If pVector is of type TK_VECTOR, then code for the requested field -// is generated. In this case (*pRegFree) may be set to the number of -// a temporary register to be freed by the caller before returning. -// -// Before returning, output parameter (*ppExpr) is set to point to the -// Expr object corresponding to element iElem of the vector. +// C comment +// /* +// ** Argument pVector points to a vector expression - either a TK_VECTOR +// ** or TK_SELECT that returns more than one column. This function returns +// ** the register number of a register that contains the value of +// ** element iField of the vector. +// ** +// ** If pVector is a TK_SELECT expression, then code for it must have +// ** already been generated using the exprCodeSubselect() routine. In this +// ** case parameter regSelect should be the first in an array of registers +// ** containing the results of the sub-select. +// ** +// ** If pVector is of type TK_VECTOR, then code for the requested field +// ** is generated. In this case (*pRegFree) may be set to the number of +// ** a temporary register to be freed by the caller before returning. +// ** +// ** Before returning, output parameter (*ppExpr) is set to point to the +// ** Expr object corresponding to element iElem of the vector. +// */ func _exprVectorRegister(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32, _regSelect int32, _ppExpr **XExpr, _pRegFree *int32) (r0 int32) { var _op uint8 _op = _pVector.X0 @@ -91879,13 +95813,13 @@ func _exprVectorRegister(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField }() if int32(_op) == i32(157) { *_ppExpr = _sqlite3VectorFieldSubexpr(tls, _pVector, _iField) - return (_pVector.X8) + _iField + return _pVector.X8 + _iField } if int32(_op) == i32(119) { - *_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X0).X2))))) + 32*uintptr(_iField))).X0) + *_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pVector.X6))))).X0).X2))))) + 32*uintptr(_iField))).X0) return _regSelect + _iField } - *_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 32*uintptr(_iField))).X0) + *_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pVector.X6))))).X2))))) + 32*uintptr(_iField))).X0) return _sqlite3ExprCodeTemp(tls, _pParse, *_ppExpr, _pRegFree) } @@ -91895,17 +95829,20 @@ func init() { crt.Xstrncpy(nil, &_exprVectorRegisterØ00__func__Ø000[0], str(110759), 19) } -// The first parameter (pDef) is a function implementation. The -// second parameter (pExpr) is the first argument to this function. -// If pExpr is a column in a virtual table, then let the virtual -// table implementation have an opportunity to overload the function. -// -// This routine is used to allow virtual table implementations to -// overload MATCH, LIKE, GLOB, and REGEXP operators. -// -// Return either the pDef argument (indicating no change) or a -// new FuncDef structure that is marked as ephemeral using the -// SQLITE_FUNC_EPHEM flag. +// C comment +// /* +// ** The first parameter (pDef) is a function implementation. The +// ** second parameter (pExpr) is the first argument to this function. +// ** If pExpr is a column in a virtual table, then let the virtual +// ** table implementation have an opportunity to overload the function. +// ** +// ** This routine is used to allow virtual table implementations to +// ** overload MATCH, LIKE, GLOB, and REGEXP operators. +// ** +// ** Return either the pDef argument (indicating no change) or a +// ** new FuncDef structure that is marked as ephemeral using the +// ** SQLITE_FUNC_EPHEM flag. +// */ func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, _nArg int32, _pExpr *XExpr) (r0 *XFuncDef) { var _rc int32 var _zLowerName *int8 @@ -91938,7 +95875,7 @@ func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, if _pTab == nil { return _pDef } - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { return _pDef } _pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, _db, _pTab).X2) @@ -91957,9 +95894,10 @@ func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, _pMod = (*Xsqlite3_module)(_pVtab.X0) if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 - }{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32 - }{(_pMod.X18)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 { + v := _pMod.X18 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 }{nil})) { return _pDef @@ -91973,14 +95911,15 @@ _12: if (*_z) == 0 { goto _15 } - *_z = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_z))) + *_z = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(*_z))) *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _12 _15: - _rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32 - }{(_pMod.X18)})))(tls, _pVtab, _nArg, _zLowerName, &_xSFunc, &_pArg) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zLowerName)) + _rc = func() func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32 { + v := _pMod.X18 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _pVtab, _nArg, _zLowerName, &_xSFunc, &_pArg) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zLowerName)) _11: if _rc == i32(0) { return _pDef @@ -91990,12 +95929,12 @@ _11: return _pDef } *_pNew = *_pDef - *(**int8)(unsafe.Pointer(&(_pNew.X6))) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 56*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew))+56*uintptr(i32(1))))), (unsafe.Pointer)(_pDef.X6), uint64(_sqlite3Strlen30(tls, _pDef.X6)+i32(1))) - *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&(_pNew.X4))))) = _xSFunc - *(*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2))) = _pArg + *(**int8)(unsafe.Pointer(&_pNew.X6)) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew)) + 56*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew))+56*uintptr(i32(1))))), unsafe.Pointer(_pDef.X6), uint64(_sqlite3Strlen30(tls, _pDef.X6)+i32(1))) + *(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&_pNew.X4)))) = _xSFunc + *(*unsafe.Pointer)(unsafe.Pointer(&_pNew.X2)) = _pArg { - p := (*uint16)(unsafe.Pointer(&(_pNew.X1))) + p := (*uint16)(unsafe.Pointer(&_pNew.X1)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } @@ -92008,34 +95947,40 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabOverloadFunctionØ00__func__Ø000[0], str(110805), 28) } -// The code generator calls this routine if is discovers that it is -// possible to abort a statement prior to completion. In order to -// perform this abort without corrupting the database, we need to make -// sure that the statement is protected by a statement transaction. -// -// Technically, we only need to set the mayAbort flag if the -// isMultiWrite flag was previously set. There is a time dependency -// such that the abort must occur after the multiwrite. This makes -// some statements involving the REPLACE conflict resolution algorithm -// go a little faster. But taking advantage of this time dependency -// makes it more difficult to prove that the code is correct (in -// particular, it prevents us from writing an effective -// implementation of sqlite3AssertMayAbort()) and so we have chosen -// to take the safe route and skip the optimization. +// C comment +// /* +// ** The code generator calls this routine if is discovers that it is +// ** possible to abort a statement prior to completion. In order to +// ** perform this abort without corrupting the database, we need to make +// ** sure that the statement is protected by a statement transaction. +// ** +// ** Technically, we only need to set the mayAbort flag if the +// ** isMultiWrite flag was previously set. There is a time dependency +// ** such that the abort must occur after the multiwrite. This makes +// ** some statements involving the REPLACE conflict resolution algorithm +// ** go a little faster. But taking advantage of this time dependency +// ** makes it more difficult to prove that the code is correct (in +// ** particular, it prevents us from writing an effective +// ** implementation of sqlite3AssertMayAbort()) and so we have chosen +// ** to take the safe route and skip the optimization. +// */ func _sqlite3MayAbort(tls *crt.TLS, _pParse *XParse) { var _pToplevel *XParse _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() - *(*uint8)(unsafe.Pointer(&(_pToplevel.X9))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pToplevel.X9)) = uint8(i32(1)) } -// Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT -// error. The onError parameter determines which (if any) of the statement -// and/or current transaction is rolled back. +// C comment +// /* +// ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT +// ** error. The onError parameter determines which (if any) of the statement +// ** and/or current transaction is rolled back. +// */ func _sqlite3HaltConstraint(tls *crt.TLS, _pParse *XParse, _errCode int32, _onError int32, _p4 *int8, _p4type int8, _p5Errmsg uint8) { var _v *TVdbe _v = _sqlite3GetVdbe(tls, _pParse) @@ -92058,22 +96003,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3HaltConstraintØ00__func__Ø000[0], str(110867), 22) } -// Prepare a virtual machine for execution for the first time after -// creating the virtual machine. This involves things such -// as allocating registers and initializing the program counter. -// After the VDBE has be prepped, it can be executed by one or more -// calls to sqlite3VdbeExec(). -// -// This function may be called exactly once on each virtual machine. -// After this routine is called the VM has been "packaged" and is ready -// to run. After this routine is called, further calls to -// sqlite3VdbeAddOp() functions are prohibited. This routine disconnects -// the Vdbe from the Parse object that helped generate it so that the -// the Vdbe becomes an independent entity and the Parse object can be -// destroyed. -// -// Use the sqlite3VdbeRewind() procedure to restore a virtual machine back -// to its initial state after it has been run. +// C comment +// /* +// ** Prepare a virtual machine for execution for the first time after +// ** creating the virtual machine. This involves things such +// ** as allocating registers and initializing the program counter. +// ** After the VDBE has be prepped, it can be executed by one or more +// ** calls to sqlite3VdbeExec(). +// ** +// ** This function may be called exactly once on each virtual machine. +// ** After this routine is called the VM has been "packaged" and is ready +// ** to run. After this routine is called, further calls to +// ** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects +// ** the Vdbe from the Parse object that helped generate it so that the +// ** the Vdbe becomes an independent entity and the Parse object can be +// ** destroyed. +// ** +// ** Use the sqlite3VdbeRewind() procedure to restore a virtual machine back +// ** to its initial state after it has been run. +// */ func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) { var _nVar, _nMem, _nCursor, _nArg, _n int32 var _db *Xsqlite3 @@ -92085,7 +96033,7 @@ func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) { } }() func() { - if (_p.X27) <= i32(0) { + if _p.X27 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73361), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(41716))) crt.X__builtin_abort(tls) } @@ -92097,7 +96045,7 @@ func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) { } }() func() { - if (_p.X5) != uint32(i32(381479589)) { + if _p.X5 != uint32(i32(381479589)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73363), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(37642))) crt.X__builtin_abort(tls) } @@ -92128,62 +96076,62 @@ func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) { _nMem += 1 } _n = int32(((u64(32) * uint64(_p.X27)) + uint64(i32(7))) & uint64(i32(-8))) - *(**uint8)(unsafe.Pointer(&(_x.X0))) = (*uint8)(unsafe.Pointer(uintptr(_p.X17) + 1*uintptr(_n))) + *(**uint8)(unsafe.Pointer(&_x.X0)) = (*uint8)(unsafe.Pointer(uintptr(_p.X17) + 1*uintptr(_n))) func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_x.X0))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73386), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110917))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_x.X1))) = ((_pParse.X20) - _n) & i32(-8) + *(*int32)(unsafe.Pointer(&_x.X1)) = (_pParse.X20 - _n) & i32(-8) func() { - if (_x.X1) < i32(0) { + if _x.X1 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73388), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110948))) crt.X__builtin_abort(tls) } }() func() { - if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_x.X0))+1*uintptr(_x.X1)))))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { + if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_x.X0))+1*uintptr(_x.X1)))))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110959))) crt.X__builtin_abort(tls) } }() _resolveP2Values(tls, _p, &_nArg) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(uint8(bool2int(((_pParse.X8) != 0) && ((_pParse.X9) != 0)))), 64, 6) - if ((_pParse.X54) != 0) && (_nMem < i32(10)) { + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(uint8(bool2int((_pParse.X8 != 0) && (_pParse.X9 != 0)))), 64, 6) + if (_pParse.X54 != 0) && (_nMem < i32(10)) { _nMem = i32(10) } - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 1, 0) _23: - *(*int32)(unsafe.Pointer(&(_x.X2))) = i32(0) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = (*XMem)(_allocSpace(tls, &_x, _p.X18, int32(uint64(_nMem)*u64(72)))) - *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X24))))) = (*XMem)(_allocSpace(tls, &_x, _p.X24, int32(uint64(_nVar)*u64(72)))) - *(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) = (**XMem)(_allocSpace(tls, &_x, (unsafe.Pointer)(_p.X19), int32(uint64(_nArg)*u64(8)))) - *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X23))))) = (**XVdbeCursor)(_allocSpace(tls, &_x, (unsafe.Pointer)(_p.X23), int32(uint64(_nCursor)*u64(8)))) - if (_x.X2) == i32(0) { + *(*int32)(unsafe.Pointer(&_x.X2)) = i32(0) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X18)))) = (*XMem)(_allocSpace(tls, &_x, _p.X18, int32(uint64(_nMem)*u64(72)))) + *(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X24)))) = (*XMem)(_allocSpace(tls, &_x, _p.X24, int32(uint64(_nVar)*u64(72)))) + *(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X19)))) = (**XMem)(_allocSpace(tls, &_x, unsafe.Pointer(_p.X19), int32(uint64(_nArg)*u64(8)))) + *(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_p.X23)))) = (**XVdbeCursor)(_allocSpace(tls, &_x, unsafe.Pointer(_p.X23), int32(uint64(_nCursor)*u64(8)))) + if _x.X2 == i32(0) { goto _25 } - *(**uint8)(unsafe.Pointer(&(_x.X0))) = (*uint8)(store11((*unsafe.Pointer)(unsafe.Pointer(&(_p.X37))), _sqlite3DbMallocRawNN(tls, _db, uint64(_x.X2)))) - *(*int32)(unsafe.Pointer(&(_x.X1))) = _x.X2 - if (_db.X17) == 0 { + *(**uint8)(unsafe.Pointer(&_x.X0)) = (*uint8)(store11((*unsafe.Pointer)(unsafe.Pointer(&_p.X37)), _sqlite3DbMallocRawNN(tls, _db, uint64(_x.X2)))) + *(*int32)(unsafe.Pointer(&_x.X1)) = _x.X2 + if _db.X17 == 0 { goto _23 } _25: - *(**int32)(unsafe.Pointer(&(_p.X25))) = _pParse.X60 - *(**int32)(unsafe.Pointer(&(_pParse.X60))) = nil - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(_pParse.X54), 12, 2) - if (_db.X17) != 0 { - *(*int16)(unsafe.Pointer(&(_p.X4))) = int16(i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0) - *(*int32)(unsafe.Pointer(&(_p.X6))) = i32(0) + *(**int32)(unsafe.Pointer(&_p.X25)) = _pParse.X60 + *(**int32)(unsafe.Pointer(&_pParse.X60)) = nil + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(_pParse.X54), 12, 2) + if _db.X17 != 0 { + *(*int16)(unsafe.Pointer(&_p.X4)) = int16(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X7)) = i32(0) + *(*int32)(unsafe.Pointer(&_p.X6)) = i32(0) goto _27 } - *(*int32)(unsafe.Pointer(&(_p.X7))) = _nCursor - *(*int16)(unsafe.Pointer(&(_p.X4))) = int16(_nVar) + *(*int32)(unsafe.Pointer(&_p.X7)) = _nCursor + *(*int16)(unsafe.Pointer(&_p.X4)) = int16(_nVar) _initMemArray(tls, (*XMem)(_p.X24), _nVar, _db, uint16(i32(1))) - *(*int32)(unsafe.Pointer(&(_p.X6))) = _nMem + *(*int32)(unsafe.Pointer(&_p.X6)) = _nMem _initMemArray(tls, (*XMem)(_p.X18), _nMem, _db, uint16(i32(128))) - crt.Xmemset(tls, (unsafe.Pointer)(_p.X23), i32(0), uint64(_nCursor)*u64(8)) + crt.Xmemset(tls, unsafe.Pointer(_p.X23), i32(0), uint64(_nCursor)*u64(8)) _27: _sqlite3VdbeRewind(tls, _p) _ = _x @@ -92195,25 +96143,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeMakeReadyØ00__func__Ø000[0], str(111000), 21) } -// This routine is called after all opcodes have been inserted. It loops -// through all the opcodes and fixes up some details. -// -// (1) For each jump instruction with a negative P2 value (a label) -// resolve the P2 value to an actual address. -// -// (2) Compute the maximum number of arguments used by any SQL function -// and store that value in *pMaxFuncArgs. -// -// (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately -// indicate what the prepared statement actually does. -// -// (4) Initialize the p4.xAdvance pointer on opcodes that use it. -// -// (5) Reclaim the memory allocated for storing labels. -// -// This routine will only function correctly if the mkopcodeh.tcl generator -// script numbers the opcodes correctly. Changes to this routine must be -// coordinated with changes to mkopcodeh.tcl. +// C comment +// /* +// ** This routine is called after all opcodes have been inserted. It loops +// ** through all the opcodes and fixes up some details. +// ** +// ** (1) For each jump instruction with a negative P2 value (a label) +// ** resolve the P2 value to an actual address. +// ** +// ** (2) Compute the maximum number of arguments used by any SQL function +// ** and store that value in *pMaxFuncArgs. +// ** +// ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately +// ** indicate what the prepared statement actually does. +// ** +// ** (4) Initialize the p4.xAdvance pointer on opcodes that use it. +// ** +// ** (5) Reclaim the memory allocated for storing labels. +// ** +// ** This routine will only function correctly if the mkopcodeh.tcl generator +// ** script numbers the opcodes correctly. Changes to this routine must be +// ** coordinated with changes to mkopcodeh.tcl. +// */ func _resolveP2Values(tls *crt.TLS, _p *TVdbe, _pMaxFuncArgs *int32) { var _nMaxArgs, _8_n int32 var _aLabel *int32 @@ -92222,9 +96173,9 @@ func _resolveP2Values(tls *crt.TLS, _p *TVdbe, _pMaxFuncArgs *int32) { _nMaxArgs = *_pMaxFuncArgs _pParse = (*XParse)(_p.X3) _aLabel = _pParse.X26 - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 128, 7) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 256, 8) - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr((_p.X27)-i32(1)))) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 128, 7) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 256, 8) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 32*uintptr(_p.X27-i32(1)))) _0: if int32(_pOp.X0) > i32(83) { goto _2 @@ -92261,18 +96212,18 @@ _0: } _4: - if (_pOp.X4) != i32(0) { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 128, 7) + if _pOp.X4 != i32(0) { + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 128, 7) } _5: - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 256, 8) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 256, 8) goto _17 _7: - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 128, 7) - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 256, 8) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 128, 7) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 256, 8) goto _17 _10: - if (_pOp.X4) > _nMaxArgs { + if _pOp.X4 > _nMaxArgs { _nMaxArgs = _pOp.X4 } goto _17 @@ -92284,33 +96235,33 @@ _11: } }() func() { - if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+32*uintptr(i32(-1)))).X0) != i32(56) { + if int32((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp))+32*uintptr(i32(-1)))).X0) != i32(56) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72022), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111041))) crt.X__builtin_abort(tls) } }() - _8_n = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 32*uintptr(i32(-1)))).X3 + _8_n = (*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOp)) + 32*uintptr(i32(-1)))).X3 if _8_n > _nMaxArgs { _nMaxArgs = _8_n } goto _17 _12: - *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _sqlite3BtreeNext - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-14)) + *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) = _sqlite3BtreeNext + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-14)) goto _17 _15: - *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _sqlite3BtreePrevious - *(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-14)) + *(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6)))))) = _sqlite3BtreePrevious + *(*int8)(unsafe.Pointer(&_pOp.X1)) = int8(i32(-14)) goto _17 _17: - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0)))) & i32(1)) != i32(0)) && ((_pOp.X4) < i32(0)) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0)))) & i32(1)) != i32(0)) && (_pOp.X4 < i32(0)) { func() { - if (i32(-1) - (_pOp.X4)) >= (_pParse.X25) { + if (i32(-1) - _pOp.X4) >= _pParse.X25 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72043), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111068))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pOp.X4))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLabel)) + 4*uintptr(i32(-1)-(_pOp.X4)))) + *(*int32)(unsafe.Pointer(&_pOp.X4)) = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLabel)) + 4*uintptr(i32(-1)-_pOp.X4))) } _2: if _pOp == (*XVdbeOp)(_p.X17) { @@ -92319,12 +96270,12 @@ _2: *(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(18446744073709551584) goto _0 _1: - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_pParse.X26)) - *(**int32)(unsafe.Pointer(&(_pParse.X26))) = nil - *(*int32)(unsafe.Pointer(&(_pParse.X25))) = i32(0) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), unsafe.Pointer(_pParse.X26)) + *(**int32)(unsafe.Pointer(&_pParse.X26)) = nil + *(*int32)(unsafe.Pointer(&_pParse.X25)) = i32(0) *_pMaxFuncArgs = _nMaxArgs func() { - if int32((uint32((_p.X32)>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) && (_p.X33) != uint32(i32(0)) { + if int32((uint32(_p.X32>>uint(i32(8)))<<uint(i32(31)))>>uint(i32(31))) == i32(0) && _p.X33 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72054), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111097))) crt.X__builtin_abort(tls) } @@ -92337,19 +96288,21 @@ func init() { crt.Xstrncpy(nil, &_resolveP2ValuesØ00__func__Ø000[0], str(111144), 16) } -// Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf -// from the ReusableSpace object. Return a pointer to the allocated -// memory on success. If insufficient memory is available in the -// ReusableSpace object, increase the ReusableSpace.nNeeded -// value by the amount needed and return NULL. -// -// If pBuf is not initially NULL, that means that the memory has already -// been allocated by a prior call to this routine, so just return a copy -// of pBuf and leave ReusableSpace unchanged. -// -// This allocator is employed to repurpose unused slots at the end of the -// opcode array of prepared state for other memory needs of the prepared -// statement. +// C comment +// /* Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf +// ** from the ReusableSpace object. Return a pointer to the allocated +// ** memory on success. If insufficient memory is available in the +// ** ReusableSpace object, increase the ReusableSpace.nNeeded +// ** value by the amount needed and return NULL. +// ** +// ** If pBuf is not initially NULL, that means that the memory has already +// ** been allocated by a prior call to this routine, so just return a copy +// ** of pBuf and leave ReusableSpace unchanged. +// ** +// ** This allocator is employed to repurpose unused slots at the end of the +// ** opcode array of prepared state for other memory needs of the prepared +// ** statement. +// */ func _allocSpace(tls *crt.TLS, _p *TReusableSpace, _pBuf unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) { func() { if (int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p.X0))))-uintptr(unsafe.Pointer(nil)))/1) & int64(i32(7))) != int64(i32(0)) { @@ -92361,17 +96314,17 @@ func _allocSpace(tls *crt.TLS, _p *TReusableSpace, _pBuf unsafe.Pointer, _nByte goto _2 } _nByte = (_nByte + i32(7)) & i32(-8) - if _nByte <= (_p.X1) { + if _nByte <= _p.X1 { { - p := (*int32)(unsafe.Pointer(&(_p.X1))) + p := (*int32)(unsafe.Pointer(&_p.X1)) *p = (*p) - _nByte sink1(*p) } - _pBuf = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 1*uintptr(_p.X1)))) + _pBuf = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0)) + 1*uintptr(_p.X1)))) goto _4 } { - p := (*int32)(unsafe.Pointer(&(_p.X2))) + p := (*int32)(unsafe.Pointer(&_p.X2)) *p = (*p) + _nByte sink1(*p) } @@ -92392,7 +96345,10 @@ func init() { crt.Xstrncpy(nil, &_allocSpaceØ00__func__Ø000[0], str(111219), 11) } -// Generate VDBE code for a BEGIN statement. +// C comment +// /* +// ** Generate VDBE code for a BEGIN statement. +// */ func _sqlite3BeginTransaction(tls *crt.TLS, _pParse *XParse, _type int32) { var _i int32 var _db *Xsqlite3 @@ -92422,7 +96378,7 @@ func _sqlite3BeginTransaction(tls *crt.TLS, _pParse *XParse, _type int32) { } _i = i32(0) _7: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _10 } _sqlite3VdbeAddOp2(tls, _v, i32(2), _i, bool2int(_type == i32(9))+i32(1)) @@ -92440,7 +96396,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BeginTransactionØ00__func__Ø000[0], str(111230), 24) } -// Generate VDBE code for a COMMIT statement. +// C comment +// /* +// ** Generate VDBE code for a COMMIT statement. +// */ func _sqlite3CommitTransaction(tls *crt.TLS, _pParse *XParse) { var _v *TVdbe func() { @@ -92470,7 +96429,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CommitTransactionØ00__func__Ø000[0], str(111268), 25) } -// Generate VDBE code for a ROLLBACK statement. +// C comment +// /* +// ** Generate VDBE code for a ROLLBACK statement. +// */ func _sqlite3RollbackTransaction(tls *crt.TLS, _pParse *XParse) { var _v *TVdbe func() { @@ -92500,8 +96462,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RollbackTransactionØ00__func__Ø000[0], str(111293), 27) } -// This function is called by the parser when it parses a command to create, -// release or rollback an SQL savepoint. +// C comment +// /* +// ** This function is called by the parser when it parses a command to create, +// ** release or rollback an SQL savepoint. +// */ func _sqlite3Savepoint(tls *crt.TLS, _pParse *XParse, _op int32, _pName *XToken) { var _zName *int8 var _1_v *TVdbe @@ -92511,8 +96476,8 @@ func _sqlite3Savepoint(tls *crt.TLS, _pParse *XParse, _op int32, _pName *XToken) } _1_v = _sqlite3GetVdbe(tls, _pParse) i32(0) - if (_1_v == nil) || _sqlite3AuthCheck(tls, _pParse, i32(32), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SavepointØ00azØ001)) + 8*uintptr(_op))), _zName, nil) != 0 { - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zName)) + if (_1_v == nil) || _sqlite3AuthCheck(tls, _pParse, i32(32), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3SavepointØ00azØ001)) + 8*uintptr(_op))), _zName, nil) != 0 { + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_zName)) return } _sqlite3VdbeAddOp4(tls, _1_v, i32(0), _op, i32(0), i32(0), _zName, i32(-1)) @@ -92525,20 +96490,23 @@ func init() { _sqlite3SavepointØ00azØ001 = [3]*int8{str(24983), str(25060), str(25041)} } -// Begin constructing a new table representation in memory. This is -// the first of several action routines that get called in response -// to a CREATE TABLE statement. In particular, this routine is called -// after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp -// flag is true if the table should be stored in the auxiliary database -// file instead of in the main database file. This is normally the case -// when the "TEMP" or "TEMPORARY" keyword occurs in between -// CREATE and TABLE. -// -// The new table record is initialized and put in pParse->pNewTable. -// As more of the CREATE TABLE statement is parsed, additional action -// routines will be called to add more information to this record. -// At the end of the CREATE TABLE statement, the sqlite3EndTable() routine -// is called to complete the construction of the new table record. +// C comment +// /* +// ** Begin constructing a new table representation in memory. This is +// ** the first of several action routines that get called in response +// ** to a CREATE TABLE statement. In particular, this routine is called +// ** after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp +// ** flag is true if the table should be stored in the auxiliary database +// ** file instead of in the main database file. This is normally the case +// ** when the "TEMP" or "TEMPORARY" keyword occurs in between +// ** CREATE and TABLE. +// ** +// ** The new table record is initialized and put in pParse->pNewTable. +// ** As more of the CREATE TABLE statement is parsed, additional action +// ** routines will be called to add more information to this record. +// ** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine +// ** is called to complete the construction of the new table record. +// */ func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _isTemp int32, _isView int32, _isVirtual int32, _noErr int32) { var _iDb, _16_addr1, _16_fileFormat, _16_reg1, _16_reg2, _16_reg3 int32 var _zName, _5_zDb, _8_zDb *int8 @@ -92548,8 +96516,8 @@ func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 var _pName *XToken _zName = nil _db = (*Xsqlite3)(_pParse.X0) - if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) && (((*t21)(unsafe.Pointer(&(_db.X33))).X0) == i32(1)) { - _iDb = int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) + if (((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0) && (((*t21)(unsafe.Pointer(&_db.X33)).X0) == i32(1)) { + _iDb = int32((*t21)(unsafe.Pointer(&_db.X33)).X1) _zName = _sqlite3DbStrDup(tls, _db, func() *int8 { if i32(1) != 0 && (_iDb == i32(1)) { return str(50007) @@ -92563,7 +96531,7 @@ func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 if _iDb < i32(0) { return } - if ((i32(1) != 0 && _isTemp != 0) && ((_pName2.X1) > uint32(i32(0)))) && (_iDb != i32(1)) { + if ((i32(1) != 0 && _isTemp != 0) && (_pName2.X1 > uint32(i32(0)))) && (_iDb != i32(1)) { _sqlite3ErrorMsg(tls, _pParse, str(111320)) return } @@ -92572,14 +96540,14 @@ func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 } _zName = _sqlite3NameFromToken(tls, _db, _pName) _5: - *(*XToken)(unsafe.Pointer(&(_pParse.X50))) = *_pName + *(*XToken)(unsafe.Pointer(&_pParse.X50)) = *_pName if _zName == nil { return } if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) { goto _begin_table_error } - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) == i32(1) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X1) == i32(1) { _isTemp = i32(1) } func() { @@ -92603,10 +96571,10 @@ _5: }(), nil, _5_zDb) != 0 { goto _begin_table_error } - if (_isVirtual == 0) && _sqlite3AuthCheck(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3StartTableØ00aCodeØ001)) + 1*uintptr(_isTemp+(i32(2)*_isView))))), _zName, nil, _5_zDb) != 0 { + if (_isVirtual == 0) && _sqlite3AuthCheck(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3StartTableØ00aCodeØ001)) + 1*uintptr(_isTemp+(i32(2)*_isView))))), _zName, nil, _5_zDb) != 0 { goto _begin_table_error } - if (_pParse.X55) != 0 { + if _pParse.X55 != 0 { goto _28 } _8_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 @@ -92622,7 +96590,7 @@ _5: goto _32 } func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 && (_sqlite3Config.X6) != i32(0) { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 && _sqlite3Config.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(111431))) crt.X__builtin_abort(tls) } @@ -92639,20 +96607,20 @@ _28: _pTable = (*XTable)(_sqlite3DbMallocZero(tls, _db, u64(128))) if _pTable == nil { func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100629), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _sqlite3NomemError(tls, i32(100630)) - *(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _sqlite3NomemError(tls, i32(100630)) + *(*int32)(unsafe.Pointer(&_pParse.X16)) += 1 goto _begin_table_error } - *(**int8)(unsafe.Pointer(&(_pTable.X0))) = _zName - *(*int16)(unsafe.Pointer(&(_pTable.X10))) = int16(i32(-1)) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - *(*uint32)(unsafe.Pointer(&(_pTable.X8))) = uint32(i32(1)) - *(*int16)(unsafe.Pointer(&(_pTable.X12))) = int16(i32(200)) + *(**int8)(unsafe.Pointer(&_pTable.X0)) = _zName + *(*int16)(unsafe.Pointer(&_pTable.X10)) = int16(i32(-1)) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTable.X20)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) + *(*uint32)(unsafe.Pointer(&_pTable.X8)) = uint32(i32(1)) + *(*int16)(unsafe.Pointer(&_pTable.X12)) = int16(i32(200)) func() { if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(48127))) @@ -92665,8 +96633,8 @@ _28: crt.X__builtin_abort(tls) } }() - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = _pTable - if ((_pParse.X6) == 0) && (crt.Xstrcmp(tls, _zName, str(111495)) == i32(0)) { + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X63)))) = _pTable + if (_pParse.X6 == 0) && (crt.Xstrcmp(tls, _zName, str(111495)) == i32(0)) { func() { if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100648), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(51150))) @@ -92675,21 +96643,21 @@ _28: }() *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSchema)(_pTable.X20).X6))))) = _pTable } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 || store38(&_v, _sqlite3GetVdbe(tls, _pParse)) == nil { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 || store38(&_v, _sqlite3GetVdbe(tls, _pParse)) == nil { goto _49 } _sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb) if _isVirtual != 0 { _sqlite3VdbeAddOp0(tls, _v, i32(155)) } - _16_reg1 = store1((*int32)(unsafe.Pointer(&(_pParse.X31))), preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) - _16_reg2 = store1((*int32)(unsafe.Pointer(&(_pParse.X32))), preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) - _16_reg3 = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _16_reg1 = store1((*int32)(unsafe.Pointer(&_pParse.X31)), preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) + _16_reg2 = store1((*int32)(unsafe.Pointer(&_pParse.X32)), preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) + _16_reg3 = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp3(tls, _v, i32(103), _iDb, _16_reg3, i32(2)) _sqlite3VdbeUsesBtree(tls, _v, _iDb) _16_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(21), _16_reg3) _16_fileFormat = func() int32 { - if ((_db.X6) & i32(32768)) != i32(0) { + if (_db.X6 & i32(32768)) != i32(0) { return i32(1) } return i32(4) @@ -92701,7 +96669,7 @@ _28: _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _16_reg2) goto _55 } - *(*int32)(unsafe.Pointer(&(_pParse.X41))) = _sqlite3VdbeAddOp2(tls, _v, i32(137), _iDb, _16_reg2) + *(*int32)(unsafe.Pointer(&_pParse.X41)) = _sqlite3VdbeAddOp2(tls, _v, i32(137), _iDb, _16_reg2) _55: _sqlite3OpenMasterTable(tls, _pParse, _iDb) _sqlite3VdbeAddOp2(tls, _v, i32(117), i32(0), _16_reg1) @@ -92712,24 +96680,26 @@ _55: _49: return _begin_table_error: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) -} - -// The table or view or trigger name is passed to this routine via tokens -// pName1 and pName2. If the table name was fully qualified, for example: -// -// CREATE TABLE xxx.yyy (...); -// -// Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if -// the table name is not fully qualified, i.e.: -// -// CREATE TABLE yyy(...); -// -// Then pName1 is set to "yyy" and pName2 is "". -// -// This routine sets the *ppUnqual pointer to point at the token (pName1 or -// pName2) that stores the unqualified table name. The index of the -// database "xxx" is returned. + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) +} + +// C comment +// /* The table or view or trigger name is passed to this routine via tokens +// ** pName1 and pName2. If the table name was fully qualified, for example: +// ** +// ** CREATE TABLE xxx.yyy (...); +// ** +// ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if +// ** the table name is not fully qualified, i.e.: +// ** +// ** CREATE TABLE yyy(...); +// ** +// ** Then pName1 is set to "yyy" and pName2 is "". +// ** +// ** This routine sets the *ppUnqual pointer to point at the token (pName1 or +// ** pName2) that stores the unqualified table name. The index of the +// ** database "xxx" is returned. +// */ func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pUnqual **XToken) (r0 int32) { var _iDb int32 var _db *Xsqlite3 @@ -92740,10 +96710,10 @@ func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 crt.X__builtin_abort(tls) } }() - if (_pName2.X1) <= uint32(i32(0)) { + if _pName2.X1 <= uint32(i32(0)) { goto _2 } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(111521)) return i32(-1) } @@ -92756,12 +96726,12 @@ func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 goto _5 _2: func() { - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) != i32(0) && ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 && ((_db.X6)&i32(268435456)) == i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X1) != i32(0) && ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 && (_db.X6&i32(268435456)) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000))), unsafe.Pointer(str(111558))) crt.X__builtin_abort(tls) } }() - _iDb = int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) + _iDb = int32((*t21)(unsafe.Pointer(&_db.X33)).X1) *_pUnqual = _pName1 _5: return _iDb @@ -92773,24 +96743,30 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TwoPartNameØ00__func__Ø000[0], str(111625), 19) } -// The token *pName contains the name of a database (either "main" or -// "temp" or the name of an attached db). This routine returns the -// index of the named database in db->aDb[], or -1 if the named db -// does not exist. +// C comment +// /* +// ** The token *pName contains the name of a database (either "main" or +// ** "temp" or the name of an attached db). This routine returns the +// ** index of the named database in db->aDb[], or -1 if the named db +// ** does not exist. +// */ func _sqlite3FindDb(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 int32) { var _i int32 var _zName *int8 _zName = _sqlite3NameFromToken(tls, _db, _pName) _i = _sqlite3FindDbName(tls, _db, _zName) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) return _i } -// This routine is used to check if the UTF-8 string zName is a legal -// unqualified name for a new schema object (table, index, view or -// trigger). All names are legal except those that begin with the string -// "sqlite_" (in upper, lower or mixed case). This portion of the namespace -// is reserved for internal use. +// C comment +// /* +// ** This routine is used to check if the UTF-8 string zName is a legal +// ** unqualified name for a new schema object (table, index, view or +// ** trigger). All names are legal except those that begin with the string +// ** "sqlite_" (in upper, lower or mixed case). This portion of the namespace +// ** is reserved for internal use. +// */ func _sqlite3CheckObjectName(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) { if (((((*t21)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X33))).X2) == 0) && (int32(_pParse.X6) == i32(0))) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(2048)) == i32(0))) && (i32(0) == Xsqlite3_strnicmp(tls, _zName, str(111644), i32(7))) { _sqlite3ErrorMsg(tls, _pParse, str(111652), unsafe.Pointer(_zName)) @@ -92811,47 +96787,53 @@ func init() { _sqlite3StartTableØ00aCodeØ001 = [4]uint8{2, 4, 8, 6} } -// Generate VDBE code that prepares for doing an operation that -// might change the database. -// -// This routine starts a new transaction if we are not already within -// a transaction. If we are already within a transaction, then a checkpoint -// is set if the setStatement parameter is true. A checkpoint should -// be set for operations that might fail (due to a constraint) part of -// the way through and which will need to undo some writes without having to -// rollback the whole transaction. For operations where all constraints -// can be checked before any changes are made to the database, it is never -// necessary to undo a write and the checkpoint should not be set. +// C comment +// /* +// ** Generate VDBE code that prepares for doing an operation that +// ** might change the database. +// ** +// ** This routine starts a new transaction if we are not already within +// ** a transaction. If we are already within a transaction, then a checkpoint +// ** is set if the setStatement parameter is true. A checkpoint should +// ** be set for operations that might fail (due to a constraint) part of +// ** the way through and which will need to undo some writes without having to +// ** rollback the whole transaction. For operations where all constraints +// ** can be checked before any changes are made to the database, it is never +// ** necessary to undo a write and the checkpoint should not be set. +// */ func _sqlite3BeginWriteOperation(tls *crt.TLS, _pParse *XParse, _setStatement int32, _iDb int32) { var _pToplevel *XParse _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() _sqlite3CodeVerifySchema(tls, _pParse, _iDb) { - p := (*uint32)(unsafe.Pointer(&(_pToplevel.X29))) + p := (*uint32)(unsafe.Pointer(&_pToplevel.X29)) *p = (*p) | (u32(1) << uint(_iDb)) sink5(*p) } { - p := (*uint8)(unsafe.Pointer(&(_pToplevel.X8))) + p := (*uint8)(unsafe.Pointer(&_pToplevel.X8)) *p = uint8(int32(*p) | _setStatement) sink2(*p) } } -// Open the sqlite_master table stored in database number iDb for -// writing. The table is opened using cursor 0. +// C comment +// /* +// ** Open the sqlite_master table stored in database number iDb for +// ** writing. The table is opened using cursor 0. +// */ func _sqlite3OpenMasterTable(tls *crt.TLS, _p *XParse, _iDb int32) { var _v *TVdbe _v = _sqlite3GetVdbe(tls, _p) _sqlite3TableLock(tls, _p, _iDb, i32(1), uint8(i32(1)), str(50026)) _sqlite3VdbeAddOp4Int(tls, _v, i32(107), i32(0), i32(1), _iDb, i32(5)) - if (_p.X17) == i32(0) { - *(*int32)(unsafe.Pointer(&(_p.X17))) = i32(1) + if _p.X17 == i32(0) { + *(*int32)(unsafe.Pointer(&_p.X17)) = i32(1) } } @@ -92861,31 +96843,37 @@ func init() { _sqlite3StartTableØ00nullRowØ002 = [6]int8{6, 0, 0, 0, 0, 0} } -// Disable lookaside memory allocation for objects that might be -// shared across database connections. +// C comment +// /* +// ** Disable lookaside memory allocation for objects that might be +// ** shared across database connections. +// */ func _disableLookaside(tls *crt.TLS, _pParse *XParse) { - *(*uint8)(unsafe.Pointer(&(_pParse.X12))) += 1 + *(*uint8)(unsafe.Pointer(&_pParse.X12)) += 1 *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X58))).X0))) += 1 } -// This routine is called to report the final ")" that terminates -// a CREATE TABLE statement. -// -// The table structure that other action routines have been building -// is added to the internal hash tables, assuming no errors have -// occurred. -// -// An entry for the table is made in the master table on disk, unless -// this is a temporary table or db->init.busy==1. When db->init.busy==1 -// it means we are reading the sqlite_master table because we just -// connected to the database or because the sqlite_master table has -// recently changed, so the entry for this table already exists in -// the sqlite_master table. We do not want to create it again. -// -// If the pSelect argument is not NULL, it means that this routine -// was called to create a table generated from a -// "CREATE TABLE ... AS SELECT ..." statement. The column names of -// the new table will match the result set of the SELECT. +// C comment +// /* +// ** This routine is called to report the final ")" that terminates +// ** a CREATE TABLE statement. +// ** +// ** The table structure that other action routines have been building +// ** is added to the internal hash tables, assuming no errors have +// ** occurred. +// ** +// ** An entry for the table is made in the master table on disk, unless +// ** this is a temporary table or db->init.busy==1. When db->init.busy==1 +// ** it means we are reading the sqlite_master table because we just +// ** connected to the database or because the sqlite_master table has +// ** recently changed, so the entry for this table already exists in +// ** the sqlite_master table. We do not want to create it again. +// ** +// ** If the pSelect argument is not NULL, it means that this routine +// ** was called to create a table generated from a +// ** "CREATE TABLE ... AS SELECT ..." statement. The column names of +// ** the new table will match the result set of the SELECT. +// */ func _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XToken, _tabOpts uint8, _pSelect *XSelect) { var _iDb, _9_n, _12_regYield, _12_addrTop, _12_regRec, _12_regRowid, _12_addrInsLoop, _19_nName int32 var _9_zType, _9_zType2, _9_zStmt, _19_zName *int8 @@ -92902,7 +96890,7 @@ func _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XTok return } func() { - if (_db.X17) != 0 { + if _db.X17 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101544), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(23869))) crt.X__builtin_abort(tls) } @@ -92912,18 +96900,18 @@ func _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XTok return } func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 && _pSelect != nil { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 && _pSelect != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101548), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(111712))) crt.X__builtin_abort(tls) } }() - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { goto _8 } - *(*int32)(unsafe.Pointer(&(_p.X7))) = (*t21)(unsafe.Pointer(&(_db.X33))).X0 - if (_p.X7) == i32(1) { + *(*int32)(unsafe.Pointer(&_p.X7)) = (*t21)(unsafe.Pointer(&_db.X33)).X0 + if _p.X7 == i32(1) { { - p := (*uint32)(unsafe.Pointer(&(_p.X9))) + p := (*uint32)(unsafe.Pointer(&_p.X9)) *p = (*p) | uint32(i32(1)) sink5(*p) } @@ -92932,16 +96920,16 @@ _8: if (int32(_tabOpts) & i32(32)) == 0 { goto _10 } - if ((_p.X9) & uint32(i32(8))) != 0 { + if (_p.X9 & uint32(i32(8))) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(111739)) return } - if ((_p.X9) & uint32(i32(4))) == uint32(i32(0)) { + if (_p.X9 & uint32(i32(4))) == uint32(i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(111789), unsafe.Pointer(_p.X0)) goto _13 } { - p := (*uint32)(unsafe.Pointer(&(_p.X9))) + p := (*uint32)(unsafe.Pointer(&_p.X9)) *p = (*p) | uint32(i32(96)) sink5(*p) } @@ -92949,7 +96937,7 @@ _8: _13: _10: _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.X20)) - if (*XExprList)(_p.X6) != nil { + if _p.X6 != nil { _sqlite3ResolveSelfReference(tls, _pParse, _p, i32(4), nil, (*XExprList)(_p.X6)) } _estimateTableWidth(tls, _p) @@ -92962,7 +96950,7 @@ _15: _pIdx = (*XIndex)(_pIdx.X5) goto _15 _18: - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { goto _19 } _9_v = _sqlite3GetVdbe(tls, _pParse) @@ -92990,11 +96978,11 @@ _24: if _pSelect == nil { goto _25 } - _12_regYield = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _12_regRec = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _12_regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _12_regYield = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _12_regRec = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _12_regRowid = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) func() { - if (_pParse.X17) != i32(1) { + if _pParse.X17 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101653), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(111826))) crt.X__builtin_abort(tls) } @@ -93002,14 +96990,14 @@ _24: _sqlite3MayAbort(tls, _pParse) _sqlite3VdbeAddOp3(tls, _9_v, i32(107), i32(1), _pParse.X32, _iDb) _sqlite3VdbeChangeP5(tls, _9_v, uint16(i32(16))) - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(2) + *(*int32)(unsafe.Pointer(&_pParse.X17)) = i32(2) _12_addrTop = _sqlite3VdbeCurrentAddr(tls, _9_v) + i32(1) _sqlite3VdbeAddOp3(tls, _9_v, i32(15), _12_regYield, i32(0), _12_addrTop) _sqlite3SelectDestInit(tls, &_12_dest, i32(13), _12_regYield) _sqlite3Select(tls, _pParse, _pSelect, &_12_dest) _sqlite3VdbeEndCoroutine(tls, _9_v, _12_regYield) _sqlite3VdbeJumpHere(tls, _9_v, _12_addrTop-i32(1)) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return } _12_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSelect) @@ -93022,10 +97010,10 @@ _24: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_p.X11))) = _12_pSelTab.X11 - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XColumn)(_12_pSelTab.X1) - *(*int16)(unsafe.Pointer(&(_12_pSelTab.X11))) = int16(i32(0)) - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_pSelTab.X1))))) = nil + *(*int16)(unsafe.Pointer(&_p.X11)) = _12_pSelTab.X11 + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = (*XColumn)(_12_pSelTab.X1) + *(*int16)(unsafe.Pointer(&_12_pSelTab.X11)) = int16(i32(0)) + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_12_pSelTab.X1)))) = nil _sqlite3DeleteTable(tls, _db, _12_pSelTab) _12_addrInsLoop = _sqlite3VdbeAddOp1(tls, _9_v, i32(16), _12_dest.X2) _sqlite3VdbeAddOp3(tls, _9_v, i32(101), _12_dest.X3, _12_dest.X4, _12_regRec) @@ -93042,24 +97030,24 @@ _25: } _14_pEnd2 = func() *XToken { if _tabOpts != 0 { - return (*XToken)(unsafe.Pointer(&(_pParse.X51))) + return (*XToken)(unsafe.Pointer(&_pParse.X51)) } return _pEnd }() - _9_n = int32(int64((uintptr(unsafe.Pointer(_14_pEnd2.X0)) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0))) / 1)) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_14_pEnd2.X0)) + 1*uintptr(i32(0))))) != i32(59) { + _9_n = int32(int64((uintptr(unsafe.Pointer(_14_pEnd2.X0)) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X50)).X0))) / 1)) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_14_pEnd2.X0)) + 1*uintptr(i32(0))))) != i32(59) { { p := &_9_n - *p = int32(uint32(*p) + (_14_pEnd2.X1)) + *p = int32(uint32(*p) + _14_pEnd2.X1) sink1(*p) } } - _9_zStmt = _sqlite3MPrintf(tls, _db, str(111853), unsafe.Pointer(_9_zType2), _9_n, unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0)) + _9_zStmt = _sqlite3MPrintf(tls, _db, str(111853), unsafe.Pointer(_9_zType2), _9_n, unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X50)).X0)) _33: _sqlite3NestedParse(tls, _pParse, str(111868), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_9_zType), unsafe.Pointer(_p.X0), unsafe.Pointer(_p.X0), _pParse.X32, unsafe.Pointer(_9_zStmt), _pParse.X31) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_9_zStmt)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_9_zStmt)) _sqlite3ChangeCookie(tls, _pParse, _iDb) - if ((_p.X9) & uint32(i32(8))) == uint32(i32(0)) { + if (_p.X9 & uint32(i32(8))) == uint32(i32(0)) { goto _37 } _15_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))) @@ -93075,7 +97063,7 @@ _33: _37: _sqlite3VdbeAddParseSchemaOp(tls, _9_v, _iDb, _sqlite3MPrintf(tls, _db, str(111997), unsafe.Pointer(_p.X0))) _19: - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { goto _41 } _17_pSchema = (*XSchema)(_p.X20) @@ -93085,7 +97073,7 @@ _19: crt.X__builtin_abort(tls) } }() - _17_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_17_pSchema.X2))), _p.X0, (unsafe.Pointer)(_p))) + _17_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&_17_pSchema.X2)), _p.X0, unsafe.Pointer(_p))) if _17_pOld != nil { func() { if _p != _17_pOld { @@ -93096,27 +97084,27 @@ _19: _sqlite3OomFault(tls, _db) return } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X63)))) = nil { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } - if (*XSelect)(_p.X3) != nil { + if _p.X3 != nil { goto _47 } - _19_zName = (*XToken)(unsafe.Pointer(&(_pParse.X50))).X0 + _19_zName = (*XToken)(unsafe.Pointer(&_pParse.X50)).X0 func() { if _pSelect != nil || _pCons == nil || _pEnd == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101756), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(112039))) crt.X__builtin_abort(tls) } }() - if (_pCons.X0) == nil { + if _pCons.X0 == nil { _pCons = _pEnd } _19_nName = int32(int64((uintptr(unsafe.Pointer(_pCons.X0)) - uintptr(unsafe.Pointer(_19_zName))) / 1)) - *(*int32)(unsafe.Pointer(&(_p.X15))) = i32(13) + _sqlite3Utf8CharLen(tls, _19_zName, _19_nName) + *(*int32)(unsafe.Pointer(&_p.X15)) = i32(13) + _sqlite3Utf8CharLen(tls, _19_zName, _19_nName) _47: _41: _ = _12_dest @@ -93128,29 +97116,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3EndTableØ00__func__Ø000[0], str(112065), 16) } -// This routine runs at the end of parsing a CREATE TABLE statement that -// has a WITHOUT ROWID clause. The job of this routine is to convert both -// internal schema data structures and the generated VDBE code so that they -// are appropriate for a WITHOUT ROWID table instead of a rowid table. -// Changes include: -// -// (1) Set all columns of the PRIMARY KEY schema object to be NOT NULL. -// (2) Convert the OP_CreateTable into an OP_CreateIndex. There is -// no rowid btree for a WITHOUT ROWID. Instead, the canonical -// data storage is a covering index btree. -// (3) Bypass the creation of the sqlite_master table entry -// for the PRIMARY KEY as the primary key index is now -// identified by the sqlite_master table entry of the table itself. -// (4) Set the Index.tnum of the PRIMARY KEY Index object in the -// schema to the rootpage from the main table. -// (5) Add all table columns to the PRIMARY KEY Index object -// so that the PRIMARY KEY is a covering index. The surplus -// columns are part of KeyInfo.nXField and are not used for -// sorting or lookup or uniqueness checks. -// (6) Replace the rowid tail on all automatically generated UNIQUE -// indices with the PRIMARY KEY columns. -// -// For virtual tables, only (1) is performed. +// C comment +// /* +// ** This routine runs at the end of parsing a CREATE TABLE statement that +// ** has a WITHOUT ROWID clause. The job of this routine is to convert both +// ** internal schema data structures and the generated VDBE code so that they +// ** are appropriate for a WITHOUT ROWID table instead of a rowid table. +// ** Changes include: +// ** +// ** (1) Set all columns of the PRIMARY KEY schema object to be NOT NULL. +// ** (2) Convert the OP_CreateTable into an OP_CreateIndex. There is +// ** no rowid btree for a WITHOUT ROWID. Instead, the canonical +// ** data storage is a covering index btree. +// ** (3) Bypass the creation of the sqlite_master table entry +// ** for the PRIMARY KEY as the primary key index is now +// ** identified by the sqlite_master table entry of the table itself. +// ** (4) Set the Index.tnum of the PRIMARY KEY Index object in the +// ** schema to the rootpage from the main table. +// ** (5) Add all table columns to the PRIMARY KEY Index object +// ** so that the PRIMARY KEY is a covering index. The surplus +// ** columns are part of KeyInfo.nXField and are not used for +// ** sorting or lookup or uniqueness checks. +// ** (6) Replace the rowid tail on all automatically generated UNIQUE +// ** indices with the PRIMARY KEY columns. +// ** +// ** For virtual tables, only (1) is performed. +// */ func _convertToWithoutRowidTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) { var _nPk, _i, _j, _11_n int32 var _5_ipkToken XToken @@ -93160,7 +97151,7 @@ func _convertToWithoutRowidTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) { var _pIdx, _pPk *XIndex _db = (*Xsqlite3)(_pParse.X0) _v = (*TVdbe)(_pParse.X2) - if ((*t21)(unsafe.Pointer(&(_db.X33))).X4) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X4) != 0 { goto _0 } _i = i32(0) @@ -93175,10 +97166,10 @@ _1: goto _1 _4: _0: - if (_pParse.X55) != 0 { + if _pParse.X55 != 0 { return } - if (_pParse.X41) != 0 { + if _pParse.X41 != 0 { func() { if _v == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101409), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(41861))) @@ -93195,7 +97186,7 @@ _0: if _5_pList == nil { return } - *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_5_pList.X2))))) + 32*uintptr(i32(0)))).X3))) = _pParse.X53 + *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_5_pList.X2)))) + 32*uintptr(i32(0)))).X3))) = _pParse.X53 func() { if (*XTable)(_pParse.X63) != _pTab { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101424), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112081))) @@ -93203,17 +97194,17 @@ _0: } }() _sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _5_pList, int32(_pTab.X14), nil, nil, i32(0), i32(0), uint8(i32(2))) - if (_db.X17) != 0 { + if _db.X17 != 0 { return } _pPk = _sqlite3PrimaryKeyIndex(tls, _pTab) - *(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1)) + *(*int16)(unsafe.Pointer(&_pTab.X10)) = int16(i32(-1)) goto _15 _10: _pPk = _sqlite3PrimaryKeyIndex(tls, _pTab) if _v != nil { func() { - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) { + if int32((*t21)(unsafe.Pointer(&_db.X33)).X2) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101438), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(49896))) crt.X__builtin_abort(tls) } @@ -93225,16 +97216,16 @@ _19: if _i >= int32(_pPk.X13) { goto _22 } - if _hasColumn(tls, _pPk.X1, _j, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) != 0 { - *(*uint16)(unsafe.Pointer(&(_pPk.X14))) -= 1 + if _hasColumn(tls, _pPk.X1, _j, int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))))) != 0 { + *(*uint16)(unsafe.Pointer(&_pPk.X14)) -= 1 goto _24 } - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(postInc1(&_j, int32(1))))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(postInc1(&_j, 1)))) = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))) _24: _i += 1 goto _19 _22: - *(*uint16)(unsafe.Pointer(&(_pPk.X13))) = uint16(_j) + *(*uint16)(unsafe.Pointer(&_pPk.X13)) = uint16(_j) _15: func() { if _pPk == nil { @@ -93242,12 +97233,12 @@ _15: crt.X__builtin_abort(tls) } }() - storebits3((*int8)(unsafe.Pointer(&(_pPk.X16))), int8(i32(1)), 32, 5) - if ((*t21)(unsafe.Pointer(&(_db.X33))).X4) == 0 { - storebits3((*int8)(unsafe.Pointer(&(_pPk.X16))), int8(i32(1)), 8, 3) + storebits3((*int8)(unsafe.Pointer(&_pPk.X16)), int8(i32(1)), 32, 5) + if ((*t21)(unsafe.Pointer(&_db.X33)).X4) == 0 { + storebits3((*int8)(unsafe.Pointer(&_pPk.X16)), int8(i32(1)), 8, 3) } _nPk = int32(_pPk.X13) - *(*int32)(unsafe.Pointer(&(_pPk.X11))) = _pTab.X7 + *(*int32)(unsafe.Pointer(&_pPk.X11)) = _pTab.X7 _pIdx = (*XIndex)(_pTab.X2) _28: if _pIdx == nil { @@ -93261,14 +97252,14 @@ _33: if _i >= _nPk { goto _36 } - if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) == 0 { + if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))))) == 0 { _11_n += 1 } _i += 1 goto _33 _36: if _11_n == i32(0) { - *(*uint16)(unsafe.Pointer(&(_pIdx.X14))) = _pIdx.X13 + *(*uint16)(unsafe.Pointer(&_pIdx.X14)) = _pIdx.X13 goto _29 } if _resizeIndexObject(tls, _db, _pIdx, int32(_pIdx.X13)+_11_n) != 0 { @@ -93279,9 +97270,9 @@ _40: if _i >= _nPk { goto _43 } - if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) == 0 { - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_j))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 8*uintptr(_i))) + if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))))) == 0 { + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_j))) = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_j))) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X8)) + 8*uintptr(_i))) _j += 1 } _i += 1 @@ -93321,8 +97312,8 @@ _51: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_j))) = int16(_i) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 8*uintptr(_j))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_j))) = int16(_i) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X8)) + 8*uintptr(_j))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) _j += 1 } _i += 1 @@ -93342,7 +97333,7 @@ _54: }() goto _62 _49: - *(*uint16)(unsafe.Pointer(&(_pPk.X14))) = uint16(_pTab.X11) + *(*uint16)(unsafe.Pointer(&_pPk.X14)) = uint16(_pTab.X11) _62: _ = _5_ipkToken } @@ -93353,16 +97344,19 @@ func init() { crt.Xstrncpy(nil, &_convertToWithoutRowidTableØ00__func__Ø000[0], str(112198), 27) } -// Create a new index for an SQL table. pName1.pName2 is the name of the index -// and pTblList is the name of the table that is to be indexed. Both will -// be NULL for a primary key or an index that is created to satisfy a -// UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable -// as the table to be indexed. pParse->pNewTable is a table that is -// currently being constructed by a CREATE TABLE statement. -// -// pList is a list of columns to be indexed. pList will be NULL if this -// is a primary key or unique-constraint on the most recent column added -// to the table currently under construction. +// C comment +// /* +// ** Create a new index for an SQL table. pName1.pName2 is the name of the index +// ** and pTblList is the name of the table that is to be indexed. Both will +// ** be NULL for a primary key or an index that is created to satisfy a +// ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable +// ** as the table to be indexed. pParse->pNewTable is a table that is +// ** currently being constructed by a CREATE TABLE statement. +// ** +// ** pList is a list of columns to be indexed. pList will be NULL if this +// ** is a primary key or unique-constraint on the most recent column added +// ** to the table currently under construction. +// */ func _sqlite3CreateIndex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pTblName *XSrcList, _pList *XExprList, _onError int32, _pStart *XToken, _pPIWhere *XExpr, _sortOrder int32, _ifNotExist int32, _idxType uint8) { var _nName, _i, _j, _sortOrderMask, _iDb, _nExtra, _nExtraCol, _20_n, _34_requestedSortOrder, _42_nColl, _46_x, _53_k, _62_iMem, _63_n int32 var _zName, _zExtra, _23_zDb, _34_zColl, _54_z1, _54_z2, _62_zStmt *int8 @@ -93385,10 +97379,10 @@ func _sqlite3CreateIndex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 _nExtra = i32(0) _zExtra = nil _pPk = nil - if ((_db.X17) != 0) || ((_pParse.X16) > i32(0)) { + if (_db.X17 != 0) || (_pParse.X16 > i32(0)) { goto _exit_create_index } - if ((_pParse.X55) != 0) && (int32(_idxType) != i32(2)) { + if (_pParse.X55 != 0) && (int32(_idxType) != i32(2)) { goto _exit_create_index } if i32(0) != _sqlite3ReadSchema(tls, _pParse) { @@ -93408,16 +97402,16 @@ func _sqlite3CreateIndex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 goto _exit_create_index } func() { - if _pName == nil || (_pName.X0) == nil { + if _pName == nil || _pName.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102641), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112242))) crt.X__builtin_abort(tls) } }() - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { goto _13 } _pTab = _sqlite3SrcListLookup(tls, _pParse, _pTblName) - if (((_pName2.X1) == uint32(i32(0))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4)) { + if ((_pName2.X1 == uint32(i32(0))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4)) { _iDb = i32(1) } _13: @@ -93426,7 +97420,7 @@ _13: crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102660), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) } - _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTblName.X2)))))+112*uintptr(i32(0))))) + _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTblName.X2))))+112*uintptr(i32(0))))) func() { if int32(_db.X17) != i32(0) && _pTab != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102663), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112266))) @@ -93440,7 +97434,7 @@ _13: _sqlite3ErrorMsg(tls, _pParse, str(112297), unsafe.Pointer(_pTab.X0)) goto _exit_create_index } - if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { _pPk = _sqlite3PrimaryKeyIndex(tls, _pTab) } goto _25 @@ -93471,20 +97465,20 @@ _25: } }() func() { - if (_pParse.X16) != i32(0) { + if _pParse.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102682), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112366))) crt.X__builtin_abort(tls) } }() - if ((Xsqlite3_strnicmp(tls, _pTab.X0, str(111644), i32(7)) == i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0))) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X0))+1*uintptr(i32(7)))), str(112382), i32(9)) != i32(0)) { + if ((Xsqlite3_strnicmp(tls, _pTab.X0, str(111644), i32(7)) == i32(0)) && (int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0))) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTab.X0))+1*uintptr(i32(7)))), str(112382), i32(9)) != i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(112392), unsafe.Pointer(_pTab.X0)) goto _exit_create_index } - if (*XSelect)(_pTab.X3) != nil { + if _pTab.X3 != nil { _sqlite3ErrorMsg(tls, _pParse, str(112420)) goto _exit_create_index } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3ErrorMsg(tls, _pParse, str(112445)) goto _exit_create_index } @@ -93496,7 +97490,7 @@ _25: goto _exit_create_index } func() { - if (_pName.X0) == nil { + if _pName.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102721), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112479))) crt.X__builtin_abort(tls) } @@ -93504,7 +97498,7 @@ _25: if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) { goto _exit_create_index } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { goto _45 } if _sqlite3FindTable(tls, _db, _zName, nil) != nil { @@ -93520,7 +97514,7 @@ _45: goto _49 } func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102735), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112549))) crt.X__builtin_abort(tls) } @@ -93543,8 +97537,8 @@ _56: if _zName == nil { goto _exit_create_index } - if (_pParse.X55) != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(i32(7)))) += 1 + if _pParse.X55 != 0 { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(i32(7)))) += 1 } _52: _23_zDb = _pDb.X0 @@ -93572,7 +97566,7 @@ _52: goto _exit_create_index } func() { - if (_pList.X0) != i32(1) { + if _pList.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102783), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112587))) crt.X__builtin_abort(tls) } @@ -93584,10 +97578,10 @@ _66: _70: _i = i32(0) _71: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _74 } - _28_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_i))).X0) + _28_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_i))).X0) func() { if _28_pExpr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102794), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(43636))) @@ -93597,7 +97591,7 @@ _71: if int32(_28_pExpr.X0) == i32(94) { { p := &_nExtra - *p = (*p) + (i32(1) + _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_28_pExpr.X3))))))) + *p = (*p) + (i32(1) + _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_28_pExpr.X3)))))) sink1(*p) } } @@ -93611,8 +97605,8 @@ _74: } return i32(1) }() - _pIndex = _sqlite3AllocateIndexObject(tls, _db, int16((_pList.X0)+_nExtraCol), (_nName+_nExtra)+i32(1), &_zExtra) - if (_db.X17) != 0 { + _pIndex = _sqlite3AllocateIndexObject(tls, _db, int16(_pList.X0+_nExtraCol), (_nName+_nExtra)+i32(1), &_zExtra) + if _db.X17 != 0 { goto _exit_create_index } func() { @@ -93627,22 +97621,22 @@ _74: crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&(_pIndex.X0))) = _zExtra + *(**int8)(unsafe.Pointer(&_pIndex.X0)) = _zExtra { p := &_zExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nName+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_nName+i32(1)))) sink0(*p) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_pIndex.X0), (unsafe.Pointer)(_zName), uint64(_nName+i32(1))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X3))))) = _pTab - *(*uint8)(unsafe.Pointer(&(_pIndex.X15))) = uint8(_onError) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(bool2int(_onError != i32(0))), 8, 3) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(_idxType), 3, 0) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X6))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - *(*uint16)(unsafe.Pointer(&(_pIndex.X13))) = uint16(_pList.X0) + crt.Xmemcpy(tls, unsafe.Pointer(_pIndex.X0), unsafe.Pointer(_zName), uint64(_nName+i32(1))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X3)))) = _pTab + *(*uint8)(unsafe.Pointer(&_pIndex.X15)) = uint8(_onError) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(bool2int(_onError != i32(0))), 8, 3) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(_idxType), 3, 0) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X6)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) + *(*uint16)(unsafe.Pointer(&_pIndex.X13)) = uint16(_pList.X0) if _pPIWhere != nil { _sqlite3ResolveSelfReference(tls, _pParse, _pTab, i32(2), _pPIWhere, nil) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X9))))) = _pPIWhere + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X9)))) = _pPIWhere _pPIWhere = nil } func() { @@ -93657,14 +97651,14 @@ _74: } _sortOrderMask = i32(0) _89: - *func() **TExprList_item { _i = i32(0); return &_pListItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + *func() **TExprList_item { _i = i32(0); return &_pListItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) _90: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _93 } _sqlite3StringToId(tls, (*XExpr)(_pListItem.X0)) _sqlite3ResolveSelfReference(tls, _pParse, _pTab, i32(32), (*XExpr)(_pListItem.X0), nil) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { goto _exit_create_index } _34_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pListItem.X0)) @@ -93679,20 +97673,20 @@ _90: goto _97 } _37_pCopy = _sqlite3ExprListDup(tls, _db, _pList, i32(0)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X10))))) = _37_pCopy - if (_db.X17) == 0 { + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X10)))) = _37_pCopy + if _db.X17 == 0 { func() { if _37_pCopy == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112743))) crt.X__builtin_abort(tls) } }() - _pListItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_37_pCopy.X2))))) + 32*uintptr(_i))) + _pListItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_37_pCopy.X2)))) + 32*uintptr(_i))) } _97: _j = i32(-2) - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-2)) - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 8, 3) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-2)) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 8, 3) goto _101 _95: _j = int32(_34_pCExpr.X9) @@ -93707,10 +97701,10 @@ _95: goto _106 } if int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_j))).X3) == i32(0) { - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 8, 3) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 8, 3) } _106: - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(_j) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i))) = int16(_j) _101: _34_zColl = nil if int32((*XExpr)(_pListItem.X0).X0) == i32(94) { @@ -93722,11 +97716,11 @@ _101: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_34_zColl), uint64(_42_nColl)) + crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_34_zColl), uint64(_42_nColl)) _34_zColl = _zExtra { p := &_zExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_42_nColl))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_42_nColl))) sink0(*p) } { @@ -93743,12 +97737,12 @@ _111: if _34_zColl == nil { _34_zColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) } - if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0) && (_sqlite3LocateCollSeq(tls, _pParse, _34_zColl) == nil) { + if (((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0) && (_sqlite3LocateCollSeq(tls, _pParse, _34_zColl) == nil) { goto _exit_create_index } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_i))) = _34_zColl + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_i))) = _34_zColl _34_requestedSortOrder = int32(_pListItem.X3) & _sortOrderMask - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_i))) = uint8(_34_requestedSortOrder) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X7)) + 1*uintptr(_i))) = uint8(_34_requestedSortOrder) *(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pListItem }())) += uintptr(32) goto _90 _93: @@ -93760,7 +97754,7 @@ _116: if _j >= int32(_pPk.X13) { goto _119 } - _46_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_j)))) + _46_x = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_j)))) func() { if _46_x < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102910), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(109743))) @@ -93768,12 +97762,12 @@ _116: } }() if _hasColumn(tls, _pIndex.X1, int32(_pIndex.X13), _46_x) != 0 { - *(*uint16)(unsafe.Pointer(&(_pIndex.X14))) -= 1 + *(*uint16)(unsafe.Pointer(&_pIndex.X14)) -= 1 goto _123 } - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(_46_x) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_i))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 8*uintptr(_j))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X7)) + 1*uintptr(_j))) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i))) = int16(_46_x) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_i))) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X8)) + 8*uintptr(_j))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X7)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X7)) + 1*uintptr(_j))) _i += 1 _123: _j += 1 @@ -93787,15 +97781,15 @@ _119: }() goto _126 _115: - *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-1)) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_i))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) + *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-1)) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_i))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) _126: _sqlite3DefaultRowEst(tls, _pIndex) if (*XTable)(_pParse.X63) == nil { _estimateIndexWidth(tls, _pIndex) } func() { - if ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) && int32(_pTab.X10) >= i32(0) && int32(_sqlite3ColumnOfIndex(tls, _pIndex, _pTab.X10)) < i32(0) { + if (_pTab.X9&uint32(i32(32))) != uint32(i32(0)) && int32(_pTab.X10) >= i32(0) && int32(_sqlite3ColumnOfIndex(tls, _pIndex, _pTab.X10)) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112795))) crt.X__builtin_abort(tls) } @@ -93803,7 +97797,7 @@ _126: if _pTblName == nil || int32(_pIndex.X14) < int32(_pTab.X11) { goto _133 } - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 32, 5) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(1)), 32, 5) _j = i32(0) _134: if _j >= int32(_pTab.X11) { @@ -93815,7 +97809,7 @@ _134: if int32(_sqlite3ColumnOfIndex(tls, _pIndex, int16(_j))) >= i32(0) { goto _135 } - storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 32, 5) + storebits3((*int8)(unsafe.Pointer(&_pIndex.X16)), int8(i32(0)), 32, 5) goto _137 _135: _j += 1 @@ -93857,16 +97851,16 @@ _152: goto _155 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X1)) + 2*uintptr(_53_k)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_52_pIdx.X1)) + 2*uintptr(_53_k)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112954))) crt.X__builtin_abort(tls) } }() - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X1)) + 2*uintptr(_53_k)))) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_53_k)))) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_52_pIdx.X1)) + 2*uintptr(_53_k)))) != int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_53_k)))) { goto _155 } - _54_z1 = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X8)) + 8*uintptr(_53_k))) - _54_z2 = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_53_k))) + _54_z1 = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_52_pIdx.X8)) + 8*uintptr(_53_k))) + _54_z2 = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_53_k))) if _sqlite3StrICmp(tls, _54_z1, _54_z2) != 0 { goto _155 } @@ -93883,11 +97877,11 @@ _155: _sqlite3ErrorMsg(tls, _pParse, str(112975), i32(0)) } if int32(_52_pIdx.X15) == i32(10) { - *(*uint8)(unsafe.Pointer(&(_52_pIdx.X15))) = _pIndex.X15 + *(*uint8)(unsafe.Pointer(&_52_pIdx.X15)) = _pIndex.X15 } _161: if int32(_idxType) == i32(2) { - storebits3((*int8)(unsafe.Pointer(&(_52_pIdx.X16))), int8(_idxType), 3, 0) + storebits3((*int8)(unsafe.Pointer(&_52_pIdx.X16)), int8(_idxType), 3, 0) } goto _exit_create_index _160: @@ -93897,16 +97891,16 @@ _142: _144: _140: func() { - if (_pParse.X16) != i32(0) { + if _pParse.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103007), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112366))) crt.X__builtin_abort(tls) } }() - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { goto _168 } func() { - if (_pParse.X55) != 0 { + if _pParse.X55 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103010), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(113017))) crt.X__builtin_abort(tls) } @@ -93917,7 +97911,7 @@ _140: crt.X__builtin_abort(tls) } }() - _59_p = (*XIndex)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pIndex.X6).X3))), _pIndex.X0, (unsafe.Pointer)(_pIndex))) + _59_p = (*XIndex)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pIndex.X6).X3))), _pIndex.X0, unsafe.Pointer(_pIndex))) if _59_p != nil { func() { if _59_p != _pIndex { @@ -93929,31 +97923,31 @@ _140: goto _exit_create_index } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2) sink1(*p) } if _pTblName != nil { - *(*int32)(unsafe.Pointer(&(_pIndex.X11))) = (*t21)(unsafe.Pointer(&(_db.X33))).X0 + *(*int32)(unsafe.Pointer(&_pIndex.X11)) = (*t21)(unsafe.Pointer(&_db.X33)).X0 } goto _179 _168: - if ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) && _pTblName == nil { + if (_pTab.X9&uint32(i32(32))) != uint32(i32(0)) && _pTblName == nil { goto _179 } - _62_iMem = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _62_iMem = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _62_v = _sqlite3GetVdbe(tls, _pParse) if _62_v == nil { goto _exit_create_index } _sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb) - *(*int32)(unsafe.Pointer(&(_pIndex.X11))) = _sqlite3VdbeAddOp0(tls, _62_v, i32(164)) + *(*int32)(unsafe.Pointer(&_pIndex.X11)) = _sqlite3VdbeAddOp0(tls, _62_v, i32(164)) _sqlite3VdbeAddOp2(tls, _62_v, i32(136), _iDb, _62_iMem) if _pStart == nil { goto _181 } - _63_n = int32(uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))-uintptr(unsafe.Pointer(_pName.X0)))/1))) + ((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1)) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pName.X0)) + 1*uintptr(_63_n-i32(1))))) == i32(59) { + _63_n = int32(uint32(int32(int64((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X51)).X0))-uintptr(unsafe.Pointer(_pName.X0)))/1))) + ((*XToken)(unsafe.Pointer(&_pParse.X51)).X1)) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pName.X0)) + 1*uintptr(_63_n-i32(1))))) == i32(59) { _63_n -= 1 } _62_zStmt = _sqlite3MPrintf(tls, _db, str(113091), unsafe.Pointer(func() *int8 { @@ -93967,7 +97961,7 @@ _181: _62_zStmt = nil _185: _sqlite3NestedParse(tls, _pParse, str(113119), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pIndex.X0), unsafe.Pointer(_pTab.X0), _62_iMem, unsafe.Pointer(_62_zStmt)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_62_zStmt)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_62_zStmt)) if _pTblName != nil { _sqlite3RefillIndex(tls, _pParse, _pIndex, _62_iMem) _sqlite3ChangeCookie(tls, _pParse, _iDb) @@ -93976,22 +97970,22 @@ _185: } _sqlite3VdbeJumpHere(tls, _62_v, _pIndex.X11) _179: - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 && _pTblName != nil { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 && _pTblName != nil { goto _exit_create_index } if ((_onError != i32(5)) || ((*XIndex)(_pTab.X2) == nil)) || (int32((*XIndex)(_pTab.X2).X15) == i32(5)) { - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X5))))) = (*XIndex)(_pTab.X2) - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _pIndex + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X5)))) = (*XIndex)(_pTab.X2) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X2)))) = _pIndex goto _192 } _68_pOther = (*XIndex)(_pTab.X2) _193: - if ((*XIndex)(_68_pOther.X5) != nil) && (int32((*XIndex)(_68_pOther.X5).X15) != i32(5)) { + if (_68_pOther.X5 != nil) && (int32((*XIndex)(_68_pOther.X5).X15) != i32(5)) { _68_pOther = (*XIndex)(_68_pOther.X5) goto _193 } - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X5))))) = (*XIndex)(_68_pOther.X5) - *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_68_pOther.X5))))) = _pIndex + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pIndex.X5)))) = (*XIndex)(_68_pOther.X5) + *(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_68_pOther.X5)))) = _pIndex _192: _pIndex = nil _exit_create_index: @@ -94001,7 +97995,7 @@ _exit_create_index: _sqlite3ExprDelete(tls, _db, _pPIWhere) _sqlite3ExprListDelete(tls, _db, _pList) _sqlite3SrcListDelete(tls, _db, _pTblName) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) _ = _sFix _ = _26_prevCol } @@ -94012,33 +98006,36 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CreateIndexØ00__func__Ø000[0], str(113194), 19) } -// While a SrcList can in general represent multiple tables and subqueries -// (as in the FROM clause of a SELECT statement) in this case it contains -// the name of a single table, as one might find in an INSERT, DELETE, -// or UPDATE statement. Look up that table in the symbol table and -// return a pointer. Set an error message and return NULL if the table -// name is not found or if any other error occurs. -// -// The following fields are initialized appropriate in pSrc: -// -// pSrc->a[0].pTab Pointer to the Table object -// pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one -// +// C comment +// /* +// ** While a SrcList can in general represent multiple tables and subqueries +// ** (as in the FROM clause of a SELECT statement) in this case it contains +// ** the name of a single table, as one might find in an INSERT, DELETE, +// ** or UPDATE statement. Look up that table in the symbol table and +// ** return a pointer. Set an error message and return NULL if the table +// ** name is not found or if any other error occurs. +// ** +// ** The following fields are initialized appropriate in pSrc: +// ** +// ** pSrc->a[0].pTab Pointer to the Table object +// ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one +// ** +// */ func _sqlite3SrcListLookup(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) (r0 *XTable) { var _pTab *XTable var _pItem *TSrcList_item - _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) func() { - if _pItem == nil || (_pSrc.X0) != i32(1) { + if _pItem == nil || _pSrc.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListLookupØ00__func__Ø000))), unsafe.Pointer(str(113213))) crt.X__builtin_abort(tls) } }() _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pItem) _sqlite3DeleteTable(tls, (*Xsqlite3)(_pParse.X0), (*XTable)(_pItem.X4)) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X4))))) = _pTab + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X4)))) = _pTab if _pTab != nil { - *(*uint32)(unsafe.Pointer(&(_pTab.X8))) += 1 + *(*uint32)(unsafe.Pointer(&_pTab.X8)) += 1 } if _sqlite3IndexedByLookup(tls, _pParse, _pItem) != 0 { _pTab = nil @@ -94052,23 +98049,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListLookupØ00__func__Ø000[0], str(113236), 21) } -// Initialize a DbFixer structure. This routine must be called prior -// to passing the structure to one of the sqliteFixAAAA() routines below. +// C comment +// /* +// ** Initialize a DbFixer structure. This routine must be called prior +// ** to passing the structure to one of the sqliteFixAAAA() routines below. +// */ func _sqlite3FixInit(tls *crt.TLS, _pFix *XDbFixer, _pParse *XParse, _iDb int32, _zType *int8, _pName *XToken) { var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) func() { - if (_db.X5) <= _iDb { + if _db.X5 <= _iDb { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FixInitØ00__func__Ø000))), unsafe.Pointer(str(113257))) crt.X__builtin_abort(tls) } }() - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X0))))) = _pParse - *(**int8)(unsafe.Pointer(&(_pFix.X3))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X1))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - *(**int8)(unsafe.Pointer(&(_pFix.X4))) = _zType - *(**XToken)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X5))))) = _pName - *(*int32)(unsafe.Pointer(&(_pFix.X2))) = bool2int(_iDb == i32(1)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFix.X0)))) = _pParse + *(**int8)(unsafe.Pointer(&_pFix.X3)) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFix.X1)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) + *(**int8)(unsafe.Pointer(&_pFix.X4)) = _zType + *(**XToken)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFix.X5)))) = _pName + *(*int32)(unsafe.Pointer(&_pFix.X2)) = bool2int(_iDb == i32(1)) } var _sqlite3FixInitØ00__func__Ø000 [15]int8 @@ -94077,18 +98077,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FixInitØ00__func__Ø000[0], str(113269), 15) } -// The following set of routines walk through the parse tree and assign -// a specific database to all table references where the database name -// was left unspecified in the original SQL statement. The pFix structure -// must have been initialized by a prior call to sqlite3FixInit(). -// -// These routines are used to make sure that an index, trigger, or -// view in one database does not refer to objects in a different database. -// (Exception: indices, triggers, and views in the TEMP database are -// allowed to refer to anything.) If a reference is explicitly made -// to an object in a different database, an error message is added to -// pParse->zErrMsg and these routines return non-zero. If everything -// checks out, these routines return 0. +// C comment +// /* +// ** The following set of routines walk through the parse tree and assign +// ** a specific database to all table references where the database name +// ** was left unspecified in the original SQL statement. The pFix structure +// ** must have been initialized by a prior call to sqlite3FixInit(). +// ** +// ** These routines are used to make sure that an index, trigger, or +// ** view in one database does not refer to objects in a different database. +// ** (Exception: indices, triggers, and views in the TEMP database are +// ** allowed to refer to anything.) If a reference is explicitly made +// ** to an object in a different database, an error message is added to +// ** pParse->zErrMsg and these routines return non-zero. If everything +// ** checks out, these routines return 0. +// */ func _sqlite3FixSrcList(tls *crt.TLS, _pFix *XDbFixer, _pList *XSrcList) (r0 int32) { var _i int32 var _zDb *int8 @@ -94106,21 +98109,21 @@ func _sqlite3FixSrcList(tls *crt.TLS, _pFix *XDbFixer, _pList *XSrcList) (r0 int return i32(0) } _zDb = _pFix.X3 - *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + *func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pList.X2)))) _3: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _6 } - if (_pFix.X2) != i32(0) { + if _pFix.X2 != i32(0) { goto _7 } - if ((_pItem.X1) != nil) && _sqlite3StrICmp(tls, _pItem.X1, _zDb) != 0 { + if (_pItem.X1 != nil) && _sqlite3StrICmp(tls, _pItem.X1, _zDb) != 0 { _sqlite3ErrorMsg(tls, (*XParse)(_pFix.X0), str(113284), unsafe.Pointer(_pFix.X4), unsafe.Pointer((*XToken)(_pFix.X5)), unsafe.Pointer(_pItem.X1)) return i32(1) } - _sqlite3DbFree(tls, (*Xsqlite3)((*XParse)(_pFix.X0).X0), (unsafe.Pointer)(_pItem.X1)) - *(**int8)(unsafe.Pointer(&(_pItem.X1))) = nil - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = (*XSchema)(_pFix.X1) + _sqlite3DbFree(tls, (*Xsqlite3)((*XParse)(_pFix.X0).X0), unsafe.Pointer(_pItem.X1)) + *(**int8)(unsafe.Pointer(&_pItem.X1)) = nil + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pItem.X0)))) = (*XSchema)(_pFix.X1) _7: if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pItem.X5)) != 0 { return i32(1) @@ -94181,9 +98184,9 @@ func _sqlite3FixExprList(tls *crt.TLS, _pFix *XDbFixer, _pList *XExprList) (r0 i if _pList == nil { return i32(0) } - *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + *func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) _1: - if _i >= (_pList.X0) { + if _i >= _pList.X0 { goto _4 } if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.X0)) != 0 { @@ -94204,7 +98207,7 @@ _0: goto _2 } if ((*t21)(unsafe.Pointer(&((*Xsqlite3)((*XParse)(_pFix.X0).X0).X33))).X2) != 0 { - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(101)) goto _4 } _sqlite3ErrorMsg(tls, (*XParse)(_pFix.X0), str(113348), unsafe.Pointer(_pFix.X4)) @@ -94212,18 +98215,18 @@ _0: _4: _2: - if ((_pExpr.X2) & uint32(i32(8404992))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(8404992))) != uint32(i32(0)) { goto _1 } - if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(2048))) == uint32(i32(0)) { goto _6 } - if _sqlite3FixSelect(tls, _pFix, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 { + if _sqlite3FixSelect(tls, _pFix, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) != 0 { return i32(1) } goto _8 _6: - if _sqlite3FixExprList(tls, _pFix, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 { + if _sqlite3FixExprList(tls, _pFix, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) != 0 { return i32(1) } _8: @@ -94236,28 +98239,31 @@ _1: return i32(0) } -// Set the sort order for the last element on the given ExprList. +// C comment +// /* +// ** Set the sort order for the last element on the given ExprList. +// */ func _sqlite3ExprListSetSortOrder(tls *crt.TLS, _p *XExprList, _iSortOrder int32) { if _p == nil { return } i32(0) func() { - if (_p.X0) <= i32(0) { + if _p.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92474), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000))), unsafe.Pointer(str(113372))) crt.X__builtin_abort(tls) } }() if _iSortOrder < i32(0) { func() { - if int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))+32*uintptr((_p.X0)-i32(1)))).X3) != i32(0) { + if int32((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2))))+32*uintptr(_p.X0-i32(1)))).X3) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92476), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000))), unsafe.Pointer(str(113383))) crt.X__builtin_abort(tls) } }() return } - *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + 32*uintptr((_p.X0)-i32(1)))).X3))) = uint8(_iSortOrder) + *(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_p.X2)))) + 32*uintptr(_p.X0-i32(1)))).X3))) = uint8(_iSortOrder) } var _sqlite3ExprListSetSortOrderØ00__func__Ø000 [28]int8 @@ -94266,25 +98272,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListSetSortOrderØ00__func__Ø000[0], str(113425), 28) } -// If the expression list pEList contains more than iLimit elements, -// leave an error message in pParse. +// C comment +// /* +// ** If the expression list pEList contains more than iLimit elements, +// ** leave an error message in pParse. +// */ func _sqlite3ExprListCheckLength(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _zObject *int8) { var _mx int32 - _mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(2)))) - if (_pEList != nil) && ((_pEList.X0) > _mx) { + _mx = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(2)))) + if (_pEList != nil) && (_pEList.X0 > _mx) { _sqlite3ErrorMsg(tls, _pParse, str(113453), unsafe.Pointer(_zObject)) } } -// Resolve names in expressions that can only reference a single table: -// -// * CHECK constraints -// * WHERE clauses on partial indices -// -// The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression -// is set to -1 and the Expr.iColumn value is set to the column number. -// -// Any errors cause an error message to be set in pParse. +// C comment +// /* +// ** Resolve names in expressions that can only reference a single table: +// ** +// ** * CHECK constraints +// ** * WHERE clauses on partial indices +// ** +// ** The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression +// ** is set to -1 and the Expr.iColumn value is set to the column number. +// ** +// ** Any errors cause an error message to be set in pParse. +// */ func _sqlite3ResolveSelfReference(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _type int32, _pExpr *XExpr, _pList *XExprList) { var _sSrc XSrcList var _sNC XNameContext @@ -94294,15 +98306,15 @@ func _sqlite3ResolveSelfReference(tls *crt.TLS, _pParse *XParse, _pTab *XTable, crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - crt.Xmemset(tls, (unsafe.Pointer)(&_sSrc), i32(0), u64(120)) - *(*int32)(unsafe.Pointer(&(_sSrc.X0))) = i32(1) - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 112*uintptr(i32(0)))).X2))) = _pTab.X0 - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 112*uintptr(i32(0)))).X4))))) = _pTab - *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 112*uintptr(i32(0)))).X11))) = i32(-1) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = &_sSrc - *(*uint16)(unsafe.Pointer(&(_sNC.X7))) = uint16(_type) + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + crt.Xmemset(tls, unsafe.Pointer(&_sSrc), i32(0), u64(120)) + *(*int32)(unsafe.Pointer(&_sSrc.X0)) = i32(1) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_sSrc.X2)))) + 112*uintptr(i32(0)))).X2))) = _pTab.X0 + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_sSrc.X2)))) + 112*uintptr(i32(0)))).X4))))) = _pTab + *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_sSrc.X2)))) + 112*uintptr(i32(0)))).X11))) = i32(-1) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = &_sSrc + *(*uint16)(unsafe.Pointer(&_sNC.X7)) = uint16(_type) if _sqlite3ResolveExprNames(tls, &_sNC, _pExpr) != 0 { return } @@ -94319,23 +98331,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ResolveSelfReferenceØ00__func__Ø000[0], str(113533), 28) } -// Backwards Compatibility Hack: -// -// Historical versions of SQLite accepted strings as column names in -// indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example: -// -// CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim) -// CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC); -// -// This is goofy. But to preserve backwards compatibility we continue to -// accept it. This routine does the necessary conversion. It converts -// the expression given in its argument from a TK_STRING into a TK_ID -// if the expression is just a TK_STRING with an optional COLLATE clause. -// If the epxression is anything other than TK_STRING, the expression is -// unchanged. +// C comment +// /* +// ** Backwards Compatibility Hack: +// ** +// ** Historical versions of SQLite accepted strings as column names in +// ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example: +// ** +// ** CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim) +// ** CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC); +// ** +// ** This is goofy. But to preserve backwards compatibility we continue to +// ** accept it. This routine does the necessary conversion. It converts +// ** the expression given in its argument from a TK_STRING into a TK_ID +// ** if the expression is just a TK_STRING with an optional COLLATE clause. +// ** If the epxression is anything other than TK_STRING, the expression is +// ** unchanged. +// */ func _sqlite3StringToId(tls *crt.TLS, _p *XExpr) { if int32(_p.X0) == i32(97) { - *(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(i32(27)) + *(*uint8)(unsafe.Pointer(&_p.X0)) = uint8(i32(27)) goto _3 } if (int32(_p.X0) == i32(94)) && (int32((*XExpr)(_p.X4).X0) == i32(97)) { @@ -94344,10 +98359,12 @@ func _sqlite3StringToId(tls *crt.TLS, _p *XExpr) { _3: } -// Return true if value x is found any of the first nCol entries of aiCol[] +// C comment +// /* Return true if value x is found any of the first nCol entries of aiCol[] +// */ func _hasColumn(tls *crt.TLS, _aiCol *int16, _nCol int32, _x int32) (r0 int32) { _0: - if postInc1(&_nCol, int32(-1)) <= i32(0) { + if postInc1(&_nCol, -1) <= i32(0) { goto _1 } if _x == int32(*postInc72(&_aiCol, 2)) { @@ -94358,7 +98375,10 @@ _1: return i32(0) } -// Estimate the average size of a row for an index. +// C comment +// /* +// ** Estimate the average size of a row for an index. +// */ func _estimateIndexWidth(tls *crt.TLS, _pIdx *XIndex) { var _1_x int16 var _i int32 @@ -94371,7 +98391,7 @@ _0: if _i >= int32(_pIdx.X14) { goto _3 } - _1_x = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))) + _1_x = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i))) func() { if int32(_1_x) >= int32((*XTable)(_pIdx.X3).X11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101344), unsafe.Pointer((*int8)(unsafe.Pointer(&_estimateIndexWidthØ00__func__Ø000))), unsafe.Pointer(str(113561))) @@ -94384,14 +98404,14 @@ _0: if int32(_1_x) < i32(0) { return i32(1) } - return int32((*XColumn)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCol)) + 32*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))))).X5) + return int32((*XColumn)(unsafe.Pointer(uintptr(unsafe.Pointer(_aCol)) + 32*uintptr(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))))).X5) }()) sink5(*p) } _i += 1 goto _0 _3: - *(*int16)(unsafe.Pointer(&(_pIdx.X12))) = _sqlite3LogEst(tls, uint64(_wIndex*uint32(i32(4)))) + *(*int16)(unsafe.Pointer(&_pIdx.X12)) = _sqlite3LogEst(tls, uint64(_wIndex*uint32(i32(4)))) } var _estimateIndexWidthØ00__func__Ø000 [19]int8 @@ -94400,16 +98420,19 @@ func init() { crt.Xstrncpy(nil, &_estimateIndexWidthØ00__func__Ø000[0], str(113582), 19) } -// Run the parser and code generator recursively in order to generate -// code for the SQL statement given onto the end of the pParse context -// currently under construction. When the parser is run recursively -// this way, the final OP_Halt is not appended and other initialization -// and finalization steps are omitted because those are handling by the -// outermost parser. -// -// Not everything is nestable. This facility is designed to permit -// INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use -// care if you decide to try to use this routine for some other purposes. +// C comment +// /* +// ** Run the parser and code generator recursively in order to generate +// ** code for the SQL statement given onto the end of the pParse context +// ** currently under construction. When the parser is run recursively +// ** this way, the final OP_Halt is not appended and other initialization +// ** and finalization steps are omitted because those are handling by the +// ** outermost parser. +// ** +// ** Not everything is nestable. This facility is designed to permit +// ** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use +// ** care if you decide to try to use this routine for some other purposes. +// */ func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) { var _zSql, _zErrMsg *int8 var _ap []interface{} @@ -94417,7 +98440,7 @@ func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ... var _saveBuf [144]int8 _zErrMsg = nil _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return } func() { @@ -94432,14 +98455,14 @@ func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ... if _zSql == nil { return } - *(*uint8)(unsafe.Pointer(&(_pParse.X6))) += 1 - crt.Xmemcpy(tls, (unsafe.Pointer)(&_saveBuf), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), u64(144)) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), i32(0), u64(144)) + *(*uint8)(unsafe.Pointer(&_pParse.X6)) += 1 + crt.Xmemcpy(tls, unsafe.Pointer(&_saveBuf), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), u64(144)) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), i32(0), u64(144)) _sqlite3RunParser(tls, _pParse, _zSql, &_zErrMsg) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), (unsafe.Pointer)(&_saveBuf), u64(144)) - *(*uint8)(unsafe.Pointer(&(_pParse.X6))) -= 1 + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(u64(456))))), unsafe.Pointer(&_saveBuf), u64(144)) + *(*uint8)(unsafe.Pointer(&_pParse.X6)) -= 1 _ = _saveBuf } @@ -94449,15 +98472,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3NestedParseØ00__func__Ø000[0], str(113619), 19) } -// Generate code that will erase and refill index *pIdx. This is -// used to initialize a newly created index or to recompute the -// content of an index in response to a REINDEX command. -// -// if memRootPage is not negative, it means that the index is newly -// created. The register specified by memRootPage contains the -// root page number of the index. If memRootPage is negative, then -// the index already exists and must be cleared before being refilled and -// the root page number of the index is taken from pIndex->tnum. +// C comment +// /* +// ** Generate code that will erase and refill index *pIdx. This is +// ** used to initialize a newly created index or to recompute the +// ** content of an index in response to a REINDEX command. +// ** +// ** if memRootPage is not negative, it means that the index is newly +// ** created. The register specified by memRootPage contains the +// ** root page number of the index. If memRootPage is negative, then +// ** the index already exists and must be cleared before being refilled and +// ** the root page number of the index is taken from pIndex->tnum. +// */ func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRootPage int32) { var _iTab, _iIdx, _iSorter, _addr1, _addr2, _tnum, _iPartIdxLabel, _regRecord, _iDb, _4_j2 int32 var _db *Xsqlite3 @@ -94465,8 +98491,8 @@ func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRoo var _v *TVdbe var _pKey *XKeyInfo _pTab = (*XTable)(_pIndex.X3) - _iTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - _iIdx = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + _iIdx = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _db = (*Xsqlite3)(_pParse.X0) _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.X6)) if _sqlite3AuthCheck(tls, _pParse, i32(27), _pIndex.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) != 0 { @@ -94485,12 +98511,12 @@ func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRoo _3: _pKey = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIndex) func() { - if _pKey == nil && (_db.X17) == 0 && (_pParse.X16) == 0 { + if _pKey == nil && _db.X17 == 0 && _pParse.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RefillIndexØ00__func__Ø000))), unsafe.Pointer(str(113638))) crt.X__builtin_abort(tls) } }() - _iSorter = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iSorter = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _sqlite3VdbeAddOp4(tls, _v, i32(111), _iSorter, i32(0), int32(_pIndex.X13), (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKey))), i32(-5)) _sqlite3OpenTable(tls, _pParse, _iTab, _iDb, _pTab, i32(106)) _addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iTab, i32(0)) @@ -94539,9 +98565,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RefillIndexØ00__func__Ø000[0], str(113682), 19) } -// If a prior call to sqlite3GenerateIndexKey() generated a jump-over label -// because it was a partial index, then this routine should be called to -// resolve that label. +// C comment +// /* +// ** If a prior call to sqlite3GenerateIndexKey() generated a jump-over label +// ** because it was a partial index, then this routine should be called to +// ** resolve that label. +// */ func _sqlite3ResolvePartIdxLabel(tls *crt.TLS, _pParse *XParse, _iLabel int32) { if _iLabel != 0 { _sqlite3VdbeResolveLabel(tls, (*TVdbe)(_pParse.X2), _iLabel) @@ -94549,7 +98578,10 @@ func _sqlite3ResolvePartIdxLabel(tls *crt.TLS, _pParse *XParse, _iLabel int32) { } } -// Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation. +// C comment +// /* +// ** Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation. +// */ func _sqlite3UniqueConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pIdx *XIndex) { var _j int32 var _zErr, _3_zCol *int8 @@ -94557,7 +98589,7 @@ func _sqlite3UniqueConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pI var _errMsg XStrAccum _pTab = (*XTable)(_pIdx.X3) _sqlite3StrAccumInit(tls, &_errMsg, (*Xsqlite3)(_pParse.X0), nil, i32(0), i32(200)) - if (*XExprList)(_pIdx.X10) != nil { + if _pIdx.X10 != nil { _sqlite3XPrintf(tls, &_errMsg, str(113701), unsafe.Pointer(_pIdx.X0)) goto _1 } @@ -94567,12 +98599,12 @@ _2: goto _5 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_j)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UniqueConstraintØ00__func__Ø000))), unsafe.Pointer(str(113712))) crt.X__builtin_abort(tls) } }() - _3_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))))).X0 + _3_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_j)))))).X0 if _j != 0 { _sqlite3StrAccumAppend(tls, &_errMsg, str(113733), i32(2)) } @@ -94597,23 +98629,26 @@ func init() { crt.Xstrncpy(nil, &_sqlite3UniqueConstraintØ00__func__Ø000[0], str(113736), 24) } -// Generate code that will increment the schema cookie. -// -// The schema cookie is used to determine when the schema for the -// database changes. After each schema change, the cookie value -// changes. When a process first reads the schema it records the -// cookie. Thereafter, whenever it goes to access the database, -// it checks the cookie to make sure the schema has not changed -// since it was last read. -// -// This plan is not completely bullet-proof. It is possible for -// the schema to change multiple times and for the cookie to be -// set back to prior value. But schema changes are infrequent -// and the probability of hitting the same cookie value is only -// 1 chance in 2^32. So we're safe enough. -// -// IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments -// the schema-version whenever the schema changes. +// C comment +// /* +// ** Generate code that will increment the schema cookie. +// ** +// ** The schema cookie is used to determine when the schema for the +// ** database changes. After each schema change, the cookie value +// ** changes. When a process first reads the schema it records the +// ** cookie. Thereafter, whenever it goes to access the database, +// ** it checks the cookie to make sure the schema has not changed +// ** since it was last read. +// ** +// ** This plan is not completely bullet-proof. It is possible for +// ** the schema to change multiple times and for the cookie to be +// ** set back to prior value. But schema changes are infrequent +// ** and the probability of hitting the same cookie value is only +// ** 1 chance in 2^32. So we're safe enough. +// ** +// ** IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments +// ** the schema-version whenever the schema changes. +// */ func _sqlite3ChangeCookie(tls *crt.TLS, _pParse *XParse, _iDb int32) { var _db *Xsqlite3 var _v *TVdbe @@ -94634,12 +98669,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ChangeCookieØ00__func__Ø000[0], str(113760), 20) } -// Add an OP_ParseSchema opcode. This routine is broken out from -// sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees -// as having been used. -// -// The zWhere string must have been obtained from sqlite3_malloc(). -// This routine will take ownership of the allocated memory. +// C comment +// /* +// ** Add an OP_ParseSchema opcode. This routine is broken out from +// ** sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees +// ** as having been used. +// ** +// ** The zWhere string must have been obtained from sqlite3_malloc(). +// ** This routine will take ownership of the allocated memory. +// */ func _sqlite3VdbeAddParseSchemaOp(tls *crt.TLS, _p *TVdbe, _iDb int32, _zWhere *int8) { var _j int32 _sqlite3VdbeAddOp4(tls, _p, i32(139), _iDb, i32(0), i32(0), _zWhere, i32(-1)) @@ -94654,8 +98692,11 @@ _0: _3: } -// Resize an Index object to hold N columns total. Return SQLITE_OK -// on success and SQLITE_NOMEM on an OOM error. +// C comment +// /* +// ** Resize an Index object to hold N columns total. Return SQLITE_OK +// ** on success and SQLITE_NOMEM on an OOM error. +// */ func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r0 int32) { var _nByte int32 var _zExtra *int8 @@ -94663,7 +98704,7 @@ func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r return i32(0) } func() { - if int32((uint32((_pIdx.X16)>>uint(i32(4)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(_pIdx.X16>>uint(i32(4)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101304), unsafe.Pointer((*int8)(unsafe.Pointer(&_resizeIndexObjectØ00__func__Ø000))), unsafe.Pointer(str(113780))) crt.X__builtin_abort(tls) } @@ -94673,24 +98714,24 @@ func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r if _zExtra == nil { return _sqlite3NomemError(tls, i32(101307)) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X8), u64(8)*uint64(_pIdx.X14)) - *(***int8)(unsafe.Pointer(&(_pIdx.X8))) = (**int8)(unsafe.Pointer(_zExtra)) + crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.X8), u64(8)*uint64(_pIdx.X14)) + *(***int8)(unsafe.Pointer(&_pIdx.X8)) = (**int8)(unsafe.Pointer(_zExtra)) { p := &_zExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u64(8)*uint64(_N)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(u64(8)*uint64(_N)))) sink0(*p) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X1), u64(2)*uint64(_pIdx.X14)) - *(**int16)(unsafe.Pointer(&(_pIdx.X1))) = (*int16)(unsafe.Pointer(_zExtra)) + crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.X1), u64(2)*uint64(_pIdx.X14)) + *(**int16)(unsafe.Pointer(&_pIdx.X1)) = (*int16)(unsafe.Pointer(_zExtra)) { p := &_zExtra - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u64(2)*uint64(_N)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(u64(2)*uint64(_N)))) sink0(*p) } - crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X7), uint64(_pIdx.X14)) - *(**uint8)(unsafe.Pointer(&(_pIdx.X7))) = (*uint8)(unsafe.Pointer(_zExtra)) - *(*uint16)(unsafe.Pointer(&(_pIdx.X14))) = uint16(_N) - storebits3((*int8)(unsafe.Pointer(&(_pIdx.X16))), int8(i32(1)), 16, 4) + crt.Xmemcpy(tls, unsafe.Pointer(_zExtra), unsafe.Pointer(_pIdx.X7), uint64(_pIdx.X14)) + *(**uint8)(unsafe.Pointer(&_pIdx.X7)) = (*uint8)(unsafe.Pointer(_zExtra)) + *(*uint16)(unsafe.Pointer(&_pIdx.X14)) = uint16(_N) + storebits3((*int8)(unsafe.Pointer(&_pIdx.X16)), int8(i32(1)), 16, 4) return i32(0) } @@ -94700,7 +98741,10 @@ func init() { crt.Xstrncpy(nil, &_resizeIndexObjectØ00__func__Ø000[0], str(113799), 18) } -// Estimate the total row width for a table. +// C comment +// /* +// ** Estimate the total row width for a table. +// */ func _estimateTableWidth(tls *crt.TLS, _pTab *XTable) { var _i int32 var _wTable uint32 @@ -94722,27 +98766,30 @@ _3: if int32(_pTab.X10) < i32(0) { _wTable += 1 } - *(*int16)(unsafe.Pointer(&(_pTab.X13))) = _sqlite3LogEst(tls, uint64(_wTable*uint32(i32(4)))) -} - -// Compute the affinity string for table pTab, if it has not already been -// computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities. -// -// If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and -// if iReg>0 then code an OP_Affinity opcode that will set the affinities -// for register iReg and following. Or if affinities exists and iReg==0, -// then just set the P4 operand of the previous opcode (which should be -// an OP_MakeRecord) to the affinity string. -// -// A column affinity string has one character per column: -// -// Character Column affinity -// ------------------------------ -// 'A' BLOB -// 'B' TEXT -// 'C' NUMERIC -// 'D' INTEGER -// 'E' REAL + *(*int16)(unsafe.Pointer(&_pTab.X13)) = _sqlite3LogEst(tls, uint64(_wTable*uint32(i32(4)))) +} + +// C comment +// /* +// ** Compute the affinity string for table pTab, if it has not already been +// ** computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities. +// ** +// ** If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and +// ** if iReg>0 then code an OP_Affinity opcode that will set the affinities +// ** for register iReg and following. Or if affinities exists and iReg==0, +// ** then just set the P4 operand of the previous opcode (which should be +// ** an OP_MakeRecord) to the affinity string. +// ** +// ** A column affinity string has one character per column: +// ** +// ** Character Column affinity +// ** ------------------------------ +// ** 'A' BLOB +// ** 'B' TEXT +// ** 'C' NUMERIC +// ** 'D' INTEGER +// ** 'E' REAL +// */ func _sqlite3TableAffinity(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iReg int32) { var _i int32 var _zColAff *int8 @@ -94762,15 +98809,15 @@ _2: if _i >= int32(_pTab.X11) { goto _5 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(_i))) = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_i))).X4 + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zColAff)) + 1*uintptr(_i))) = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_i))).X4 _i += 1 goto _2 _5: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(postInc1(&_i, int32(-1))))) = int8(i32(0)) - if (_i >= i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(_i)))) == i32(65)) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zColAff)) + 1*uintptr(postInc1(&_i, -1)))) = int8(i32(0)) + if (_i >= i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zColAff)) + 1*uintptr(_i)))) == i32(65)) { goto _5 } - *(**int8)(unsafe.Pointer(&(_pTab.X5))) = _zColAff + *(**int8)(unsafe.Pointer(&_pTab.X5)) = _zColAff _0: _i = _sqlite3Strlen30(tls, _zColAff) if _i == 0 { @@ -94785,9 +98832,12 @@ _10: _8: } -// Generate a CREATE TABLE statement appropriate for the given -// table. Memory to hold the text of the statement is obtained -// from sqliteMalloc() and must be freed by the calling function. +// C comment +// /* +// ** Generate a CREATE TABLE statement appropriate for the given +// ** table. Memory to hold the text of the statement is obtained +// ** from sqliteMalloc() and must be freed by the calling function. +// */ func _createTableStmt(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *int8) { var _i, _k, _n, _5_len int32 var _zStmt, _zSep, _zSep2, _zEnd, _5_zType *int8 @@ -94834,16 +98884,16 @@ _5: Xsqlite3_snprintf(tls, _n, _zStmt, str(113829)) _k = _sqlite3Strlen30(tls, _zStmt) _identPut(tls, _zStmt, &_k, _p.X0) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt)) + 1*uintptr(postInc1(&_k, int32(1))))) = int8(i32(40)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStmt)) + 1*uintptr(postInc1(&_k, 1)))) = int8(i32(40)) *func() *int32 { _pCol = (*XColumn)(_p.X1); return &_i }() = i32(0) _7: if _i >= int32(_p.X11) { goto _10 } - Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k))), _zSep) + Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStmt))+1*uintptr(_k))), _zSep) { p := &_k - *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k)))) + *p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStmt))+1*uintptr(_k)))) sink1(*p) } _zSep = _zSep2 @@ -94860,7 +98910,7 @@ _7: crt.X__builtin_abort(tls) } }() - _5_zType = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_createTableStmtØ00azTypeØ001)) + 8*uintptr(int32(_pCol.X4)-i32(65)))) + _5_zType = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_createTableStmtØ00azTypeØ001)) + 8*uintptr(int32(_pCol.X4)-i32(65)))) _5_len = _sqlite3Strlen30(tls, _5_zType) func() { if int32(_pCol.X4) != i32(65) && int32(_pCol.X4) != int32(_sqlite3AffinityType(tls, _5_zType, nil)) { @@ -94868,7 +98918,7 @@ _7: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k)))), (unsafe.Pointer)(_5_zType), uint64(_5_len)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStmt))+1*uintptr(_k)))), unsafe.Pointer(_5_zType), uint64(_5_len)) { p := &_k *p = (*p) + _5_len @@ -94883,16 +98933,19 @@ _7: *(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(32) goto _7 _10: - Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k))), str(24576), unsafe.Pointer(_zEnd)) + Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStmt))+1*uintptr(_k))), str(24576), unsafe.Pointer(_zEnd)) return _zStmt } -// Measure the number of characters needed to output the given -// identifier. The number returned includes any quotes used -// but does not include the null terminator. -// -// The estimate is conservative. It might be larger that what is -// really needed. +// C comment +// /* +// ** Measure the number of characters needed to output the given +// ** identifier. The number returned includes any quotes used +// ** but does not include the null terminator. +// ** +// ** The estimate is conservative. It might be larger that what is +// ** really needed. +// */ func _identLength(tls *crt.TLS, _z *int8) (r0 int32) { var _n int32 _n = i32(0) @@ -94909,17 +98962,20 @@ _3: return _n + i32(2) } -// The first parameter is a pointer to an output buffer. The second -// parameter is a pointer to an integer that contains the offset at -// which to write into the output buffer. This function copies the -// nul-terminated string pointed to by the third parameter, zSignedIdent, -// to the specified offset in the buffer and updates *pIdx to refer -// to the first byte after the last byte written before returning. -// -// If the string zSignedIdent consists entirely of alpha-numeric -// characters, does not begin with a digit and is not an SQL keyword, -// then it is copied to the output buffer exactly as it is. Otherwise, -// it is quoted using double-quotes. +// C comment +// /* +// ** The first parameter is a pointer to an output buffer. The second +// ** parameter is a pointer to an integer that contains the offset at +// ** which to write into the output buffer. This function copies the +// ** nul-terminated string pointed to by the third parameter, zSignedIdent, +// ** to the specified offset in the buffer and updates *pIdx to refer +// ** to the first byte after the last byte written before returning. +// ** +// ** If the string zSignedIdent consists entirely of alpha-numeric +// ** characters, does not begin with a digit and is not an SQL keyword, +// ** then it is copied to the output buffer exactly as it is. Otherwise, +// ** it is quoted using double-quotes. +// */ func _identPut(tls *crt.TLS, _z *int8, _pIdx *int32, _zSignedIdent *int8) { var _i, _j, _needQuote int32 var _zIdent *uint8 @@ -94927,35 +98983,35 @@ func _identPut(tls *crt.TLS, _z *int8, _pIdx *int32, _zSignedIdent *int8) { _i = *_pIdx _j = i32(0) _0: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) == 0 { goto _3 } - if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j))))))) & i32(6)) == 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) != i32(95)) { + if ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j))))))) & i32(6)) == 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) != i32(95)) { goto _3 } _j += 1 goto _0 _3: - _needQuote = bool2int((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(i32(0))))))))&i32(4)) != 0 || (_sqlite3KeywordCode(tls, _zIdent, _j) != i32(27))) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) != i32(0))) || (_j == i32(0))) + _needQuote = bool2int((((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(i32(0))))))))&i32(4)) != 0 || (_sqlite3KeywordCode(tls, _zIdent, _j) != i32(27))) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) != i32(0))) || (_j == i32(0))) if _needQuote != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_i, 1)))) = int8(i32(34)) } _j = i32(0) _10: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) == 0 { goto _13 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == i32(34) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_i, 1)))) = int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIdent)) + 1*uintptr(_j)))) == i32(34) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_i, 1)))) = int8(i32(34)) } _j += 1 goto _10 _13: if _needQuote != 0 { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_i, 1)))) = int8(i32(34)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i))) = int8(i32(0)) *_pIdx = _i } @@ -94978,18 +99034,21 @@ func init() { _createTableStmtØ00azTypeØ001 = [5]*int8{str(0), str(114032), str(114038), str(114043), str(114048)} } -// pZ is a UTF-8 encoded unicode string. If nByte is less than zero, -// return the number of unicode characters in pZ up to (but not including) -// the first 0x00 byte. If nByte is not less than zero, return the -// number of unicode characters in the first nByte of pZ (or up to -// the first 0x00, whichever comes first). +// C comment +// /* +// ** pZ is a UTF-8 encoded unicode string. If nByte is less than zero, +// ** return the number of unicode characters in pZ up to (but not including) +// ** the first 0x00 byte. If nByte is not less than zero, return the +// ** number of unicode characters in the first nByte of pZ (or up to +// ** the first 0x00, whichever comes first). +// */ func _sqlite3Utf8CharLen(tls *crt.TLS, _zIn *int8, _nByte int32) (r0 int32) { var _r int32 var _z, _zTerm *uint8 _r = i32(0) _z = (*uint8)(unsafe.Pointer(_zIn)) if _nByte >= i32(0) { - _zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte))) + _zTerm = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_nByte))) goto _1 } _zTerm = (*uint8)(crt.U2P(uintptr(u64(18446744073709551615)))) @@ -95025,12 +99084,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3Utf8CharLenØ00__func__Ø000[0], str(114063), 19) } -// Add a new column to the table currently being constructed. -// -// The parser calls this routine once for each column declaration -// in a CREATE TABLE statement. sqlite3StartTable() gets called -// first to get things going. Then this routine is called for each -// column. +// C comment +// /* +// ** Add a new column to the table currently being constructed. +// ** +// ** The parser calls this routine once for each column declaration +// ** in a CREATE TABLE statement. sqlite3StartTable() gets called +// ** first to get things going. Then this routine is called for each +// ** column. +// */ func _sqlite3AddColumn(tls *crt.TLS, _pParse *XParse, _pName *XToken, _pType *XToken) { var _i int32 var _z, _zType *int8 @@ -95041,16 +99103,16 @@ func _sqlite3AddColumn(tls *crt.TLS, _pParse *XParse, _pName *XToken, _pType *XT if store44(&_p, (*XTable)(_pParse.X63)) == nil { return } - if (int32(_p.X11) + i32(1)) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) { + if (int32(_p.X11) + i32(1)) > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(2))))) { _sqlite3ErrorMsg(tls, _pParse, str(114082), unsafe.Pointer(_p.X0)) return } - _z = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64(((_pName.X1)+(_pType.X1))+uint32(i32(2))))) + _z = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64((_pName.X1+_pType.X1)+uint32(i32(2))))) if _z == nil { return } - crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_pName.X0), uint64(_pName.X1)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_pName.X1))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pName.X0), uint64(_pName.X1)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_pName.X1))) = int8(i32(0)) _sqlite3Dequote(tls, _z) _i = i32(0) _3: @@ -95059,7 +99121,7 @@ _3: } if Xsqlite3_stricmp(tls, _z, (*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_i))).X0) == i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(114105), unsafe.Pointer(_z)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) return } _i += 1 @@ -95070,42 +99132,45 @@ _6: } _4_aNew = (*XColumn)(_sqlite3DbRealloc(tls, _db, _p.X1, uint64(int32(_p.X11)+i32(8))*u64(32))) if _4_aNew == nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) return } - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _4_aNew + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _4_aNew _8: _pCol = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(_p.X11))) - crt.Xmemset(tls, (unsafe.Pointer)(_pCol), i32(0), u64(32)) - *(**int8)(unsafe.Pointer(&(_pCol.X0))) = _z - if (_pType.X1) == uint32(i32(0)) { - *(*int8)(unsafe.Pointer(&(_pCol.X4))) = int8(i32(65)) - *(*uint8)(unsafe.Pointer(&(_pCol.X5))) = uint8(i32(1)) + crt.Xmemset(tls, unsafe.Pointer(_pCol), i32(0), u64(32)) + *(**int8)(unsafe.Pointer(&_pCol.X0)) = _z + if _pType.X1 == uint32(i32(0)) { + *(*int8)(unsafe.Pointer(&_pCol.X4)) = int8(i32(65)) + *(*uint8)(unsafe.Pointer(&_pCol.X5)) = uint8(i32(1)) goto _11 } _zType = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_sqlite3Strlen30(tls, _z)))))) + uintptr(i32(1)))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_zType), (unsafe.Pointer)(_pType.X0), uint64(_pType.X1)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(_pType.X1))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_zType), unsafe.Pointer(_pType.X0), uint64(_pType.X1)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zType)) + 1*uintptr(_pType.X1))) = int8(i32(0)) _sqlite3Dequote(tls, _zType) - *(*int8)(unsafe.Pointer(&(_pCol.X4))) = _sqlite3AffinityType(tls, _zType, (*uint8)(unsafe.Pointer(&(_pCol.X5)))) + *(*int8)(unsafe.Pointer(&_pCol.X4)) = _sqlite3AffinityType(tls, _zType, (*uint8)(unsafe.Pointer(&_pCol.X5))) { - p := (*uint8)(unsafe.Pointer(&(_pCol.X6))) + p := (*uint8)(unsafe.Pointer(&_pCol.X6)) *p = uint8(int32(*p) | i32(4)) sink2(*p) } _11: - *(*int16)(unsafe.Pointer(&(_p.X11))) += 1 - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1))) = uint32(i32(0)) -} - -// The expression is the default value for the most recently added column -// of the table currently under construction. -// -// Default value expressions must be constant. Raise an exception if this -// is not the case. -// -// This routine is called by the parser while in the middle of -// parsing a CREATE TABLE statement. + *(*int16)(unsafe.Pointer(&_p.X11)) += 1 + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X28)).X1))) = uint32(i32(0)) +} + +// C comment +// /* +// ** The expression is the default value for the most recently added column +// ** of the table currently under construction. +// ** +// ** Default value expressions must be constant. Raise an exception if this +// ** is not the case. +// ** +// ** This routine is called by the parser while in the middle of +// ** parsing a CREATE TABLE statement. +// */ func _sqlite3AddDefaultValue(tls *crt.TLS, _pParse *XParse, _pSpan *XExprSpan) { var _db *Xsqlite3 var _p *XTable @@ -95117,31 +99182,34 @@ func _sqlite3AddDefaultValue(tls *crt.TLS, _pParse *XParse, _pSpan *XExprSpan) { goto _0 } _pCol = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(int32(_p.X11)-i32(1)))) - if _sqlite3ExprIsConstantOrFunction(tls, (*XExpr)(_pSpan.X0), (*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if _sqlite3ExprIsConstantOrFunction(tls, (*XExpr)(_pSpan.X0), (*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { _sqlite3ErrorMsg(tls, _pParse, str(114131), unsafe.Pointer(_pCol.X0)) goto _2 } _sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.X1)) - crt.Xmemset(tls, (unsafe.Pointer)(&_3_x), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_3_x.X0))) = uint8(i32(162)) - *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_3_x.X3))))) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32(int64((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_x.X4))))) = (*XExpr)(_pSpan.X0) - *(*uint32)(unsafe.Pointer(&(_3_x.X2))) = uint32(i32(4096)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCol.X1))))) = _sqlite3ExprDup(tls, _db, &_3_x, i32(1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_3_x.X3))))))) + crt.Xmemset(tls, unsafe.Pointer(&_3_x), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_3_x.X0)) = uint8(i32(162)) + *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_3_x.X3)))) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32(int64((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_x.X4)))) = (*XExpr)(_pSpan.X0) + *(*uint32)(unsafe.Pointer(&_3_x.X2)) = uint32(i32(4096)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pCol.X1)))) = _sqlite3ExprDup(tls, _db, &_3_x, i32(1)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_3_x.X3)))))) _2: _0: _sqlite3ExprDelete(tls, _db, (*XExpr)(_pSpan.X0)) _ = _3_x } -// Walk an expression tree. Return non-zero if the expression is constant -// or a function call with constant arguments. Return and 0 if there -// are any variables. -// -// For the purposes of this function, a double-quoted string (ex: "abc") -// is considered a variable but a single-quoted string (ex: 'abc') is -// a constant. +// C comment +// /* +// ** Walk an expression tree. Return non-zero if the expression is constant +// ** or a function call with constant arguments. Return and 0 if there +// ** are any variables. +// ** +// ** For the purposes of this function, a double-quoted string (ex: "abc") +// ** is considered a variable but a single-quoted string (ex: 'abc') is +// ** a constant. +// */ func _sqlite3ExprIsConstantOrFunction(tls *crt.TLS, _p *XExpr, _isInit uint8) (r0 int32) { func() { if int32(_isInit) != i32(0) && int32(_isInit) != i32(1) { @@ -95164,36 +99232,39 @@ func _spanExpr(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _t XT if _p == nil { goto _0 } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(72)) - *(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(_op) - *(*uint32)(unsafe.Pointer(&(_p.X2))) = uint32(i32(8388608)) - *(*int16)(unsafe.Pointer(&(_p.X10))) = int16(i32(-1)) - *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 72*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), (unsafe.Pointer)(_t.X0), uint64(_t.X1)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_t.X1))) = int8(i32(0)) - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(i32(0))))))))) & i32(128)) == 0 { + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(72)) + *(*uint8)(unsafe.Pointer(&_p.X0)) = uint8(_op) + *(*uint32)(unsafe.Pointer(&_p.X2)) = uint32(i32(8388608)) + *(*int16)(unsafe.Pointer(&_p.X10)) = int16(i32(-1)) + *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 72*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))), unsafe.Pointer(_t.X0), uint64(_t.X1)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(_t.X1))) = int8(i32(0)) + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(i32(0))))))))) & i32(128)) == 0 { goto _1 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(i32(0))))) == i32(34) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3)))))) + 1*uintptr(i32(0))))) == i32(34) { { - p := (*uint32)(unsafe.Pointer(&(_p.X2))) + p := (*uint32)(unsafe.Pointer(&_p.X2)) *p = (*p) | uint32(i32(64)) sink5(*p) } } - _sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + _sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_p.X3))))) _1: - *(*int32)(unsafe.Pointer(&(_p.X7))) = i32(1) + *(*int32)(unsafe.Pointer(&_p.X7)) = i32(1) _0: - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X0))))) = _p - *(**int8)(unsafe.Pointer(&(_pOut.X1))) = _t.X0 - *(**int8)(unsafe.Pointer(&(_pOut.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_t.X0)) + 1*uintptr(_t.X1))) -} - -// This routine is called by the parser while in the middle of -// parsing a CREATE TABLE statement. A "NOT NULL" constraint has -// been seen on a column. This routine sets the notNull flag on -// the column currently under construction. + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOut.X0)))) = _p + *(**int8)(unsafe.Pointer(&_pOut.X1)) = _t.X0 + *(**int8)(unsafe.Pointer(&_pOut.X2)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_t.X0)) + 1*uintptr(_t.X1))) +} + +// C comment +// /* +// ** This routine is called by the parser while in the middle of +// ** parsing a CREATE TABLE statement. A "NOT NULL" constraint has +// ** been seen on a column. This routine sets the notNull flag on +// ** the column currently under construction. +// */ func _sqlite3AddNotNull(tls *crt.TLS, _pParse *XParse, _onError int32) { var _p *XTable _p = (*XTable)(_pParse.X63) @@ -95211,7 +99282,7 @@ func _sqlite3AddNotNull(tls *crt.TLS, _pParse *XParse, _onError int32) { } *(*uint8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(int32(_p.X11)-i32(1)))).X3))) = uint8(_onError) { - p := (*uint32)(unsafe.Pointer(&(_p.X9))) + p := (*uint32)(unsafe.Pointer(&_p.X9)) *p = (*p) | uint32(i32(512)) sink5(*p) } @@ -95223,22 +99294,25 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AddNotNullØ00__func__Ø000[0], str(114231), 18) } -// Designate the PRIMARY KEY for the table. pList is a list of names -// of columns that form the primary key. If pList is NULL, then the -// most recently added column of the table is the primary key. -// -// A table can have at most one primary key. If the table already has -// a primary key (and this is the second primary key) then create an -// error. -// -// If the PRIMARY KEY is on a single column whose datatype is INTEGER, -// then we will try to use that column as the rowid. Set the Table.iPKey -// field of the table under construction to be the index of the -// INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is -// no INTEGER PRIMARY KEY. -// -// If the key is not an INTEGER PRIMARY KEY, then create a unique -// index for the key. No index is created for INTEGER PRIMARY KEYs. +// C comment +// /* +// ** Designate the PRIMARY KEY for the table. pList is a list of names +// ** of columns that form the primary key. If pList is NULL, then the +// ** most recently added column of the table is the primary key. +// ** +// ** A table can have at most one primary key. If the table already has +// ** a primary key (and this is the second primary key) then create an +// ** error. +// ** +// ** If the PRIMARY KEY is on a single column whose datatype is INTEGER, +// ** then we will try to use that column as the rowid. Set the Table.iPKey +// ** field of the table under construction to be the index of the +// ** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is +// ** no INTEGER PRIMARY KEY. +// ** +// ** If the key is not an INTEGER PRIMARY KEY, then create a unique +// ** index for the key. No index is created for INTEGER PRIMARY KEYs. +// */ func _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _onError int32, _autoInc int32, _sortOrder int32) { var _iCol, _i, _nTerm int32 var _5_zCName *int8 @@ -95251,12 +99325,12 @@ func _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _on if _pTab == nil { goto _primary_key_exit } - if ((_pTab.X9) & uint32(i32(4))) != 0 { + if (_pTab.X9 & uint32(i32(4))) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(114249), unsafe.Pointer(_pTab.X0)) goto _primary_key_exit } { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) *p = (*p) | uint32(i32(4)) sink5(*p) } @@ -95264,7 +99338,7 @@ func _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _on _iCol = int32(_pTab.X11) - i32(1) _pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_iCol))) { - p := (*uint8)(unsafe.Pointer(&(_pCol.X6))) + p := (*uint8)(unsafe.Pointer(&_pCol.X6)) *p = uint8(int32(*p) | i32(1)) sink2(*p) } @@ -95277,7 +99351,7 @@ _4: if _i >= _nTerm { goto _7 } - _4_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_i))).X0)) + _4_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_i))).X0)) func() { if _4_pCExpr == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101013), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000))), unsafe.Pointer(str(114290))) @@ -95288,7 +99362,7 @@ _4: if int32(_4_pCExpr.X0) != i32(27) { goto _10 } - _5_zCName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pCExpr.X3))))) + _5_zCName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_4_pCExpr.X3)))) _iCol = i32(0) _11: if _iCol >= int32(_pTab.X11) { @@ -95297,7 +99371,7 @@ _11: if _sqlite3StrICmp(tls, _5_zCName, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_iCol))).X0) == i32(0) { _pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_iCol))) { - p := (*uint8)(unsafe.Pointer(&(_pCol.X6))) + p := (*uint8)(unsafe.Pointer(&_pCol.X6)) *p = uint8(int32(*p) | i32(1)) sink2(*p) } @@ -95314,8 +99388,8 @@ _3: if _nTerm != i32(1) || _pCol == nil || _sqlite3StrICmp(tls, _sqlite3ColumnType(tls, _pCol, str(0)), str(25792)) != i32(0) || _sortOrder == i32(1) { goto _19 } - *(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(_iCol) - *(*uint8)(unsafe.Pointer(&(_pTab.X14))) = uint8(_onError) + *(*int16)(unsafe.Pointer(&_pTab.X10)) = int16(_iCol) + *(*uint8)(unsafe.Pointer(&_pTab.X14)) = uint8(_onError) func() { if _autoInc != i32(0) && _autoInc != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101034), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000))), unsafe.Pointer(str(114300))) @@ -95323,12 +99397,12 @@ _3: } }() { - p := (*uint32)(unsafe.Pointer(&(_pTab.X9))) + p := (*uint32)(unsafe.Pointer(&_pTab.X9)) *p = (*p) | uint32(_autoInc*i32(8)) sink5(*p) } if _pList != nil { - *(*uint8)(unsafe.Pointer(&(_pParse.X53))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(i32(0)))).X3 + *(*uint8)(unsafe.Pointer(&_pParse.X53)) = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(i32(0)))).X3 } goto _primary_key_exit _19: @@ -95348,18 +99422,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AddPrimaryKeyØ00__func__Ø000[0], str(114381), 21) } -// Add a new CHECK constraint to the table currently under construction. +// C comment +// /* +// ** Add a new CHECK constraint to the table currently under construction. +// */ func _sqlite3AddCheckConstraint(tls *crt.TLS, _pParse *XParse, _pCheckExpr *XExpr) { var _db *Xsqlite3 var _pTab *XTable _pTab = (*XTable)(_pParse.X63) _db = (*Xsqlite3)(_pParse.X0) - if _pTab == nil || (_pParse.X55) != 0 || _sqlite3BtreeIsReadonly(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr((*t21)(unsafe.Pointer(&(_db.X33))).X1))).X1)) != 0 { + if _pTab == nil || _pParse.X55 != 0 || _sqlite3BtreeIsReadonly(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr((*t21)(unsafe.Pointer(&_db.X33)).X1))).X1)) != 0 { goto _2 } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X6))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(_pTab.X6), _pCheckExpr) - if ((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1) != 0 { - _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(_pTab.X6), (*XToken)(unsafe.Pointer(&(_pParse.X28))), i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTab.X6)))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(_pTab.X6), _pCheckExpr) + if ((*XToken)(unsafe.Pointer(&_pParse.X28)).X1) != 0 { + _sqlite3ExprListSetName(tls, _pParse, (*XExprList)(_pTab.X6), (*XToken)(unsafe.Pointer(&_pParse.X28)), i32(1)) } goto _4 _2: @@ -95367,25 +99444,31 @@ _2: _4: } -// Return true if the given Btree is read-only. +// C comment +// /* +// ** Return true if the given Btree is read-only. +// */ func _sqlite3BtreeIsReadonly(tls *crt.TLS, _p *XBtree) (r0 int32) { return bool2int((int32((*XBtShared)(_p.X1).X10) & i32(1)) != i32(0)) } -// This routine is called to create a new foreign key on the table -// currently under construction. pFromCol determines which columns -// in the current table point to the foreign key. If pFromCol==0 then -// connect the key to the last column inserted. pTo is the name of -// the table referred to (a.k.a the "parent" table). pToCol is a list -// of tables in the parent pTo table. flags contains all -// information about the conflict resolution algorithms specified -// in the ON DELETE, ON UPDATE and ON INSERT clauses. -// -// An FKey structure is created and added to the table currently -// under construction in the pParse->pNewTable field. -// -// The foreign key is set for IMMEDIATE processing. A subsequent call -// to sqlite3DeferForeignKey() might change this to DEFERRED. +// C comment +// /* +// ** This routine is called to create a new foreign key on the table +// ** currently under construction. pFromCol determines which columns +// ** in the current table point to the foreign key. If pFromCol==0 then +// ** connect the key to the last column inserted. pTo is the name of +// ** the table referred to (a.k.a the "parent" table). pToCol is a list +// ** of tables in the parent pTo table. flags contains all +// ** information about the conflict resolution algorithms specified +// ** in the ON DELETE, ON UPDATE and ON INSERT clauses. +// ** +// ** An FKey structure is created and added to the table currently +// ** under construction in the pParse->pNewTable field. +// ** +// ** The foreign key is set for IMMEDIATE processing. A subsequent call +// ** to sqlite3DeferForeignKey() might change this to DEFERRED. +// */ func _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprList, _pTo *XToken, _pToCol *XExprList, _flags int32) { var _nByte, _i, _nCol, _1_iCol, _10_j, _15_n int32 var _z *int8 @@ -95401,7 +99484,7 @@ func _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprLis crt.X__builtin_abort(tls) } }() - if (_p == nil) || ((_pParse.X55) != 0) { + if (_p == nil) || (_pParse.X55 != 0) { goto _fk_end } if _pFromCol != nil { @@ -95420,14 +99503,14 @@ func _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprLis }() != 0 { goto _fk_end } - if (_pToCol != nil) && ((_pToCol.X0) != i32(1)) { + if (_pToCol != nil) && (_pToCol.X0 != i32(1)) { _sqlite3ErrorMsg(tls, _pParse, str(114409), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_1_iCol))).X0), unsafe.Pointer(_pTo)) goto _fk_end } _nCol = i32(1) goto _13 _4: - if (_pToCol != nil) && ((_pToCol.X0) != (_pFromCol.X0)) { + if (_pToCol != nil) && (_pToCol.X0 != _pFromCol.X0) { _sqlite3ErrorMsg(tls, _pParse, str(114472)) goto _fk_end } @@ -95439,12 +99522,12 @@ _13: } _i = i32(0) _15: - if _i >= (_pToCol.X0) { + if _i >= _pToCol.X0 { goto _18 } { p := &_nByte - *p = (*p) + (_sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+32*uintptr(_i))).X1) + i32(1)) + *p = (*p) + (_sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pToCol.X2))))+32*uintptr(_i))).X1) + i32(1)) sink1(*p) } _i += 1 @@ -95455,27 +99538,27 @@ _14: if _pFKey == nil { goto _fk_end } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X0))))) = _p - *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X1))))) = (*XFKey)(_p.X4) - _z = (*int8)(unsafe.Pointer((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFKey.X0)))) = _p + *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFKey.X1)))) = (*XFKey)(_p.X4) + _z = (*int8)(unsafe.Pointer((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_nCol))))) - *(**int8)(unsafe.Pointer(&(_pFKey.X2))) = _z - crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_pTo.X0), uint64(_pTo.X1)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_pTo.X1))) = int8(i32(0)) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_nCol))))) + *(**int8)(unsafe.Pointer(&_pFKey.X2)) = _z + crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_pTo.X0), uint64(_pTo.X1)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_pTo.X1))) = int8(i32(0)) _sqlite3Dequote(tls, _z) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_pTo.X1)+uint32(i32(1))))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_pTo.X1+uint32(i32(1))))) sink0(*p) } - *(*int32)(unsafe.Pointer(&(_pFKey.X5))) = _nCol + *(*int32)(unsafe.Pointer(&_pFKey.X5)) = _nCol if _pFromCol == nil { - *(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + *(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(i32(0)))).X0))) = int32(_p.X11) - i32(1) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(i32(0)))).X0))) = int32(_p.X11) - i32(1) goto _21 } _i = i32(0) @@ -95488,18 +99571,18 @@ _26: if _10_j >= int32(_p.X11) { goto _29 } - if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_10_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pFromCol.X2)))))+32*uintptr(_i))).X1) == i32(0) { - *(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_10_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pFromCol.X2))))+32*uintptr(_i))).X1) == i32(0) { + *(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_i))).X0))) = _10_j + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_i))).X0))) = _10_j goto _29 } _10_j += 1 goto _26 _29: if _10_j >= int32(_p.X11) { - _sqlite3ErrorMsg(tls, _pParse, str(114566), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pFromCol.X2)))))+32*uintptr(_i))).X1)) + _sqlite3ErrorMsg(tls, _pParse, str(114566), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pFromCol.X2))))+32*uintptr(_i))).X1)) goto _fk_end } _i += 1 @@ -95514,32 +99597,32 @@ _33: if _i >= _nCol { goto _36 } - _15_n = _sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+32*uintptr(_i))).X1) - *(**int8)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _15_n = _sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pToCol.X2))))+32*uintptr(_i))).X1) + *(**int8)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_i))).X1))) = _z - crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+32*uintptr(_i))).X1), uint64(_15_n)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_15_n))) = int8(i32(0)) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_i))).X1))) = _z + crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pToCol.X2))))+32*uintptr(_i))).X1), uint64(_15_n)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_15_n))) = int8(i32(0)) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_15_n+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_15_n+i32(1)))) sink0(*p) } _i += 1 goto _33 _36: _32: - *(*uint8)(unsafe.Pointer(&(_pFKey.X6))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(0)))) = uint8(_flags & i32(255)) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(1)))) = uint8((_flags >> uint(i32(8))) & i32(255)) + *(*uint8)(unsafe.Pointer(&_pFKey.X6)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(i32(0)))) = uint8(_flags & i32(255)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(i32(1)))) = uint8((_flags >> uint(i32(8))) & i32(255)) func() { if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_p.X20)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102408), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(114612))) crt.X__builtin_abort(tls) } }() - _pNextTo = (*XFKey)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_p.X20).X5))), _pFKey.X2, (unsafe.Pointer)(_pFKey))) + _pNextTo = (*XFKey)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_p.X20).X5))), _pFKey.X2, unsafe.Pointer(_pFKey))) if _pNextTo == _pFKey { _sqlite3OomFault(tls, _db) goto _fk_end @@ -95551,13 +99634,13 @@ _32: crt.X__builtin_abort(tls) } }() - *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X3))))) = _pNextTo - *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNextTo.X4))))) = _pFKey + *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFKey.X3)))) = _pNextTo + *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNextTo.X4)))) = _pFKey } - *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _pFKey + *(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))) = _pFKey _pFKey = nil _fk_end: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pFKey)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pFKey)) _sqlite3ExprListDelete(tls, _db, _pFromCol) _sqlite3ExprListDelete(tls, _db, _pToCol) } @@ -95568,11 +99651,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CreateForeignKeyØ00__func__Ø000[0], str(114674), 24) } -// This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED -// clause is seen as part of a foreign key definition. The isDeferred -// parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. -// The behavior of the most recently created foreign key is adjusted -// accordingly. +// C comment +// /* +// ** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED +// ** clause is seen as part of a foreign key definition. The isDeferred +// ** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. +// ** The behavior of the most recently created foreign key is adjusted +// ** accordingly. +// */ func _sqlite3DeferForeignKey(tls *crt.TLS, _pParse *XParse, _isDeferred int32) { var _pTab *XTable var _pFKey *XFKey @@ -95585,7 +99671,7 @@ func _sqlite3DeferForeignKey(tls *crt.TLS, _pParse *XParse, _isDeferred int32) { crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pFKey.X6))) = uint8(_isDeferred) + *(*uint8)(unsafe.Pointer(&_pFKey.X6)) = uint8(_isDeferred) } var _sqlite3DeferForeignKeyØ00__func__Ø000 [23]int8 @@ -95594,8 +99680,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DeferForeignKeyØ00__func__Ø000[0], str(114729), 23) } -// Set the collation function of the most recently parsed table column -// to the CollSeq given. +// C comment +// /* +// ** Set the collation function of the most recently parsed table column +// ** to the CollSeq given. +// */ func _sqlite3AddCollateType(tls *crt.TLS, _pParse *XParse, _pToken *XToken) { var _i int32 var _zColl *int8 @@ -95614,7 +99703,7 @@ func _sqlite3AddCollateType(tls *crt.TLS, _pParse *XParse, _pToken *XToken) { if _sqlite3LocateCollSeq(tls, _pParse, _zColl) == nil { goto _2 } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_i))).X2)) + _sqlite3DbFree(tls, _db, unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_p.X1)+32*uintptr(_i))).X2)) *(**int8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(_i))).X2))) = _zColl _1_pIdx = (*XIndex)(_p.X2) _3: @@ -95627,15 +99716,15 @@ _3: crt.X__builtin_abort(tls) } }() - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(i32(0))))) == _i { - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X8)) + 8*uintptr(i32(0)))) = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(_i))).X2 + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pIdx.X1)) + 2*uintptr(i32(0))))) == _i { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pIdx.X8)) + 8*uintptr(i32(0)))) = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 32*uintptr(_i))).X2 } _1_pIdx = (*XIndex)(_1_pIdx.X5) goto _3 _6: goto _10 _2: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zColl)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zColl)) _10: } @@ -95645,8 +99734,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AddCollateTypeØ00__func__Ø000[0], str(114769), 22) } -// This routine is called to do the work of a DROP TABLE statement. -// pName is the name of the table to be dropped. +// C comment +// /* +// ** This routine is called to do the work of a DROP TABLE statement. +// ** pName is the name of the table to be dropped. +// */ func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView int32, _noErr int32) { var _iDb, _4_code int32 var _4_zTab, _4_zDb, _4_zArg2 *int8 @@ -95654,17 +99746,17 @@ func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView var _pTab *XTable var _v *TVdbe _db = (*Xsqlite3)(_pParse.X0) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _exit_drop_table } func() { - if (_pParse.X16) != i32(0) { + if _pParse.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102213), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(112366))) crt.X__builtin_abort(tls) } }() func() { - if (_pName.X0) != i32(1) { + if _pName.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102214), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(114791))) crt.X__builtin_abort(tls) } @@ -95673,7 +99765,7 @@ func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView goto _exit_drop_table } if _noErr != 0 { - *(*uint8)(unsafe.Pointer(&(_db.X21))) += 1 + *(*uint8)(unsafe.Pointer(&_db.X21)) += 1 } func() { if _isView != i32(0) && _isView != i32(1) { @@ -95681,26 +99773,26 @@ func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView crt.X__builtin_abort(tls) } }() - _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(_isView), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+112*uintptr(i32(0))))) + _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(_isView), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2))))+112*uintptr(i32(0))))) if _noErr != 0 { - *(*uint8)(unsafe.Pointer(&(_db.X21))) -= 1 + *(*uint8)(unsafe.Pointer(&_db.X21)) -= 1 } if _pTab != nil { goto _11 } if _noErr != 0 { - _sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+112*uintptr(i32(0)))).X1) + _sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2))))+112*uintptr(i32(0)))).X1) } goto _exit_drop_table _11: _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } }() - if (_pTab.X16) != 0 && _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 { + if _pTab.X16 != 0 && _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 { goto _exit_drop_table } _4_zTab = func() *int8 { @@ -95725,7 +99817,7 @@ _11: _25: goto _28 _22: - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _4_code = i32(30) _4_zArg2 = (*XModule)(_sqlite3GetVTable(tls, _db, _pTab).X1).X1 goto _28 @@ -95751,7 +99843,7 @@ _28: _sqlite3ErrorMsg(tls, _pParse, str(114879), unsafe.Pointer(_pTab.X0)) goto _exit_drop_table } - if (_isView == 0) && ((*XSelect)(_pTab.X3) != nil) { + if (_isView == 0) && (_pTab.X3 != nil) { _sqlite3ErrorMsg(tls, _pParse, str(114913), unsafe.Pointer(_pTab.X0)) goto _exit_drop_table } @@ -95772,8 +99864,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DropTableØ00__func__Ø000[0], str(114945), 17) } -// If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each -// attached database. Otherwise, invoke it for the database named zDb only. +// C comment +// /* +// ** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each +// ** attached database. Otherwise, invoke it for the database named zDb only. +// */ func _sqlite3CodeVerifyNamedSchema(tls *crt.TLS, _pParse *XParse, _zDb *int8) { var _i int32 var _db *Xsqlite3 @@ -95781,11 +99876,11 @@ func _sqlite3CodeVerifyNamedSchema(tls *crt.TLS, _pParse *XParse, _zDb *int8) { _db = (*Xsqlite3)(_pParse.X0) _i = i32(0) _0: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _3 } _1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) - if ((*XBtree)(_1_pDb.X1) != nil) && ((_zDb == nil) || (i32(0) == _sqlite3StrICmp(tls, _zDb, _1_pDb.X0))) { + if (_1_pDb.X1 != nil) && ((_zDb == nil) || (i32(0) == _sqlite3StrICmp(tls, _zDb, _1_pDb.X0))) { _sqlite3CodeVerifySchema(tls, _pParse, _i) } _i += 1 @@ -95793,8 +99888,11 @@ _0: _3: } -// Remove entries from the sqlite_statN tables (for N in (1,2,3)) -// after a DROP INDEX or DROP TABLE command. +// C comment +// /* +// ** Remove entries from the sqlite_statN tables (for N in (1,2,3)) +// ** after a DROP INDEX or DROP TABLE command. +// */ func _sqlite3ClearStatTables(tls *crt.TLS, _pParse *XParse, _iDb int32, _zType *int8, _zName *int8) { var _i int32 var _zDbName *int8 @@ -95815,28 +99913,31 @@ _3: _ = _1_zTab } -// This function is called to generate code that runs when table pTab is -// being dropped from the database. The SrcList passed as the second argument -// to this function contains a single entry guaranteed to resolve to -// table pTab. -// -// Normally, no code is required. However, if either -// -// (a) The table is the parent table of a FK constraint, or -// (b) The table is the child table of a deferred FK constraint and it is -// determined at runtime that there are outstanding deferred FK -// constraint violations in the database, -// -// then the equivalent of "DELETE FROM <tbl>" is executed before dropping -// the table from the database. Triggers are disabled while running this -// DELETE, but foreign key actions are not. +// C comment +// /* +// ** This function is called to generate code that runs when table pTab is +// ** being dropped from the database. The SrcList passed as the second argument +// ** to this function contains a single entry guaranteed to resolve to +// ** table pTab. +// ** +// ** Normally, no code is required. However, if either +// ** +// ** (a) The table is the parent table of a FK constraint, or +// ** (b) The table is the child table of a deferred FK constraint and it is +// ** determined at runtime that there are outstanding deferred FK +// ** constraint violations in the database, +// ** +// ** then the equivalent of "DELETE FROM <tbl>" is executed before dropping +// ** the table from the database. Triggers are disabled while running this +// ** DELETE, but foreign key actions are not. +// */ func _sqlite3FkDropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _pTab *XTable) { var _1_iSkip int32 var _db *Xsqlite3 var _1_v *TVdbe var _2_p *XFKey _db = (*Xsqlite3)(_pParse.X0) - if ((_db.X6)&i32(524288)) == 0 || (_pTab.X16) != 0 || (*XSelect)(_pTab.X3) != nil { + if (_db.X6&i32(524288)) == 0 || _pTab.X16 != 0 || _pTab.X3 != nil { goto _2 } _1_iSkip = i32(0) @@ -95855,7 +99956,7 @@ _6: if _2_p == nil { goto _9 } - if ((_2_p.X6) != 0) || ((_db.X6)&i32(33554432)) != 0 { + if (_2_p.X6 != 0) || (_db.X6&i32(33554432)) != 0 { goto _9 } _2_p = (*XFKey)(_2_p.X1) @@ -95867,10 +99968,10 @@ _9: _1_iSkip = _sqlite3VdbeMakeLabel(tls, _1_v) _sqlite3VdbeAddOp2(tls, _1_v, i32(45), i32(1), _1_iSkip) _5: - *(*uint8)(unsafe.Pointer(&(_pParse.X47))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X47)) = uint8(i32(1)) _sqlite3DeleteFrom(tls, _pParse, _sqlite3SrcListDup(tls, _db, _pName, i32(0)), nil) - *(*uint8)(unsafe.Pointer(&(_pParse.X47))) = uint8(i32(0)) - if ((_db.X6) & i32(33554432)) == i32(0) { + *(*uint8)(unsafe.Pointer(&_pParse.X47)) = uint8(i32(0)) + if (_db.X6 & i32(33554432)) == i32(0) { _sqlite3VdbeAddOp2(tls, _1_v, i32(45), i32(0), _sqlite3VdbeCurrentAddr(tls, _1_v)+i32(2)) _sqlite3HaltConstraint(tls, _pParse, i32(787), i32(2), nil, int8(i32(-2)), uint8(i32(4))) } @@ -95886,27 +99987,33 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FkDropTableØ00__func__Ø000[0], str(115006), 19) } -// This function returns a linked list of FKey objects (connected by -// FKey.pNextTo) holding all children of table pTab. For example, -// given the following schema: -// -// CREATE TABLE t1(a PRIMARY KEY); -// CREATE TABLE t2(b REFERENCES t1(a); -// -// Calling this function with table "t1" as an argument returns a pointer -// to the FKey structure representing the foreign key constraint on table -// "t2". Calling this function with "t2" as the argument would return a -// NULL pointer (as there are no FK constraints for which t2 is the parent -// table). +// C comment +// /* +// ** This function returns a linked list of FKey objects (connected by +// ** FKey.pNextTo) holding all children of table pTab. For example, +// ** given the following schema: +// ** +// ** CREATE TABLE t1(a PRIMARY KEY); +// ** CREATE TABLE t2(b REFERENCES t1(a); +// ** +// ** Calling this function with table "t1" as an argument returns a pointer +// ** to the FKey structure representing the foreign key constraint on table +// ** "t2". Calling this function with "t2" as the argument would return a +// ** NULL pointer (as there are no FK constraints for which t2 is the parent +// ** table). +// */ func _sqlite3FkReferences(tls *crt.TLS, _pTab *XTable) (r0 *XFKey) { return (*XFKey)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTab.X20).X5))), _pTab.X0)) } -// Generate code for a DELETE FROM statement. -// -// DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL; -// \________/ \________________/ -// pTabList pWhere +// C comment +// /* +// ** Generate code for a DELETE FROM statement. +// ** +// ** DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL; +// ** \________/ \________________/ +// ** pTabList pWhere +// */ func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr) { var _nPk, _nKey int16 var _i, _iTabCur, _iDataCur, _iIdxCur, _nIdx, _iDb, _memCnt, _rcauth, _eOnePass, _iPk, _iKey, _iEphCur, _iRowSet, _addrBypass, _addrLoop, _addrEphOpen, _bComplex, _isView, _28_iAddrOnce, _36_count int32 @@ -95933,13 +100040,13 @@ func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh _addrBypass = i32(0) _addrLoop = i32(0) _addrEphOpen = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sContext), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(&_sContext), i32(0), u64(16)) _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { goto _delete_from_cleanup } func() { - if (_pTabList.X0) != i32(1) { + if _pTabList.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115025))) crt.X__builtin_abort(tls) } @@ -95964,7 +100071,7 @@ func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh } _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) func() { - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104923), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(54328))) crt.X__builtin_abort(tls) } @@ -95986,18 +100093,18 @@ func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWh } }() func() { - if (_pTabList.X0) != i32(1) { + if _pTabList.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104934), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115025))) crt.X__builtin_abort(tls) } }() - _iTabCur = store1((*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X11))), postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))) + _iTabCur = store1((*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X11))), postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1)) *func() **XIndex { _nIdx = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2) _22: if _pIdx == nil { goto _25 } - *(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X17)) += 1 *func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_nIdx }() += 1 goto _22 _25: @@ -96016,17 +100123,17 @@ _25: _sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iTabCur) _iDataCur = store1(&_iIdxCur, _iTabCur) } - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = _pTabList if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 { goto _delete_from_cleanup } - if ((_db.X6) & i32(128)) != 0 { - _memCnt = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (_db.X6 & i32(128)) != 0 { + _memCnt = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _memCnt) } - if _rcauth != i32(0) || _pWhere != nil || _bComplex != 0 || (_pTab.X16) != 0 { + if _rcauth != i32(0) || _pWhere != nil || _bComplex != 0 || _pTab.X16 != 0 { goto _35 } func() { @@ -96036,7 +100143,7 @@ _25: } }() _sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(i32(1)), _pTab.X0) - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _sqlite3VdbeAddOp4(tls, _v, i32(134), _pTab.X7, _iDb, _memCnt, _pTab.X0, i32(-2)) } _pIdx = (*XIndex)(_pTab.X2) @@ -96070,10 +100177,10 @@ _35: }()) sink14(*p) } - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _pPk = nil _nPk = int16(i32(1)) - _iRowSet = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iRowSet = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _iRowSet) goto _50 } @@ -96085,13 +100192,13 @@ _35: } }() _nPk = int16(_pPk.X13) - _iPk = (_pParse.X18) + i32(1) + _iPk = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_nPk) sink1(*p) } - _iEphCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iEphCur = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _addrEphOpen = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iEphCur, int32(_nPk)) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk) _50: @@ -96101,18 +100208,18 @@ _50: } _eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass))) func() { - if (_pTab.X16) != i32(0) && _eOnePass == i32(2) { + if _pTab.X16 != i32(0) && _eOnePass == i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105048), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115166))) crt.X__builtin_abort(tls) } }() func() { - if (_pTab.X16) == 0 && _bComplex == 0 && _eOnePass == i32(0) { + if _pTab.X16 == 0 && _bComplex == 0 && _eOnePass == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105049), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115212))) crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(128)) != 0 { + if (_db.X6 & i32(128)) != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(73), _memCnt, i32(1)) } if _pPk == nil { @@ -96124,22 +100231,22 @@ _63: goto _66 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115265))) crt.X__builtin_abort(tls) } }() - _sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTabCur, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i) + _sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTabCur, int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i) _i += 1 goto _63 _66: _iKey = _iPk goto _69 _62: - _iKey = (_pParse.X18) + i32(1) + _iKey = _pParse.X18 + i32(1) _iKey = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, i32(-1), _iTabCur, _iKey, uint8(i32(0))) - if _iKey > (_pParse.X18) { - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = _iKey + if _iKey > _pParse.X18 { + *(*int32)(unsafe.Pointer(&_pParse.X18)) = _iKey } _69: if _eOnePass == i32(0) { @@ -96151,13 +100258,13 @@ _69: _sqlite3WhereEnd(tls, _pWInfo) goto _delete_from_cleanup } - crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint64(_nIdx+i32(1))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0)) - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iTabCur))) = uint8(i32(0)) + crt.Xmemset(tls, unsafe.Pointer(_aToOpen), i32(1), uint64(_nIdx+i32(1))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0)) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iTabCur))) = uint8(i32(0)) } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iTabCur))) = uint8(i32(0)) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iTabCur))) = uint8(i32(0)) } if _addrEphOpen != 0 { _sqlite3VdbeChangeToNoop(tls, _v, _addrEphOpen) @@ -96165,7 +100272,7 @@ _69: goto _76 _71: if _pPk != nil { - _iKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iKey = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _nKey = int16(i32(0)) _sqlite3VdbeAddOp4(tls, _v, i32(101), _iPk, int32(_nPk), _iKey, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pPk), int32(_nPk)) _sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iEphCur, _iKey, _iPk, int32(_nPk)) @@ -96190,13 +100297,13 @@ _80: } _sqlite3OpenTableAndIndices(tls, _pParse, _pTab, i32(107), uint8(i32(8)), _iTabCur, _aToOpen, &_iDataCur, &_iIdxCur) func() { - if _pPk == nil && (_pTab.X16) == 0 && _iDataCur != _iTabCur { + if _pPk == nil && _pTab.X16 == 0 && _iDataCur != _iTabCur { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105121), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115285))) crt.X__builtin_abort(tls) } }() func() { - if _pPk == nil && (_pTab.X16) == 0 && _iIdxCur != (_iDataCur+i32(1)) { + if _pPk == nil && _pTab.X16 == 0 && _iIdxCur != (_iDataCur+i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115329))) crt.X__builtin_abort(tls) } @@ -96214,7 +100321,7 @@ _81: crt.X__builtin_abort(tls) } }() - if ((_pTab.X16) == 0) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_iDataCur-_iTabCur)))) != 0) { + if (_pTab.X16 == 0) && ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_iDataCur-_iTabCur)))) != 0) { func() { if _pPk == nil && (*XSelect)(_pTab.X3) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105132), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115385))) @@ -96244,7 +100351,7 @@ _92: } }() _104: - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { goto _107 } _34_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab))) @@ -96259,12 +100366,12 @@ _104: }() _sqlite3MayAbort(tls, _pParse) if (_eOnePass == i32(1)) && ((*XParse)(_pParse.X39) == nil) { - *(*uint8)(unsafe.Pointer(&(_pParse.X8))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X8)) = uint8(i32(0)) } goto _113 _107: _36_count = bool2int(int32(_pParse.X6) == i32(0)) - _sqlite3GenerateRowDelete(tls, _pParse, _pTab, _pTrigger, _iDataCur, _iIdxCur, _iKey, _nKey, uint8(_36_count), uint8(i32(10)), uint8(_eOnePass), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) + _sqlite3GenerateRowDelete(tls, _pParse, _pTab, _pTrigger, _iDataCur, _iIdxCur, _iKey, _nKey, uint8(_36_count), uint8(i32(10)), uint8(_eOnePass), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1))))) _113: if _eOnePass != i32(0) { _sqlite3VdbeResolveLabel(tls, _v, _addrBypass) @@ -96283,7 +100390,7 @@ _45: if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) { _sqlite3AutoincrementEnd(tls, _pParse) } - if (((_db.X6)&i32(128)) != 0 && ((_pParse.X6) == 0)) && ((*XTable)(_pParse.X40) == nil) { + if ((_db.X6&i32(128)) != 0 && (_pParse.X6 == 0)) && (_pParse.X40 == nil) { _sqlite3VdbeAddOp2(tls, _v, i32(67), _memCnt, i32(1)) _sqlite3VdbeSetNumCols(tls, _v, i32(1)) _sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(115478), nil) @@ -96292,7 +100399,7 @@ _delete_from_cleanup: _sqlite3AuthContextPop(tls, &_sContext) _sqlite3SrcListDelete(tls, _db, _pTabList) _sqlite3ExprDelete(tls, _db, _pWhere) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aToOpen)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_aToOpen)) _ = _sContext _ = _sNC _ = _aiCurOnePass @@ -96304,10 +100411,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DeleteFromØ00__func__Ø000[0], str(115491), 18) } -// Return a list of all triggers on table pTab if there exists at least -// one trigger that must be fired when an operation of type 'op' is -// performed on the table, and, if that operation is an UPDATE, if at -// least one of the columns in pChanges is being modified. +// C comment +// /* +// ** Return a list of all triggers on table pTab if there exists at least +// ** one trigger that must be fired when an operation of type 'op' is +// ** performed on the table, and, if that operation is an UPDATE, if at +// ** least one of the columns in pChanges is being modified. +// */ func _sqlite3TriggersExist(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _pChanges *XExprList, _pMask *int32) (r0 *XTrigger) { var _mask int32 var _pList, _p *XTrigger @@ -96317,7 +100427,7 @@ func _sqlite3TriggersExist(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int _pList = _sqlite3TriggerList(tls, _pParse, _pTab) } func() { - if _pList != nil && (_pTab.X16) != i32(0) { + if _pList != nil && _pTab.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123273), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggersExistØ00__func__Ø000))), unsafe.Pointer(str(115509))) crt.X__builtin_abort(tls) } @@ -96348,25 +100458,28 @@ _7: }() } -// Given table pTab, return a list of all the triggers attached to -// the table. The list is connected by Trigger.pNext pointers. -// -// All of the triggers on pTab that are in the same database as pTab -// are already attached to pTab->pTrigger. But there might be additional -// triggers on pTab in the TEMP schema. This routine prepends all -// TEMP triggers on pTab to the beginning of the pTab->pTrigger list -// and returns the combined list. -// -// To state it another way: This routine returns a list of all triggers -// that fire off of pTab. The list will include any TEMP triggers on -// pTab as well as the triggers lised in pTab->pTrigger. +// C comment +// /* +// ** Given table pTab, return a list of all the triggers attached to +// ** the table. The list is connected by Trigger.pNext pointers. +// ** +// ** All of the triggers on pTab that are in the same database as pTab +// ** are already attached to pTab->pTrigger. But there might be additional +// ** triggers on pTab in the TEMP schema. This routine prepends all +// ** TEMP triggers on pTab to the beginning of the pTab->pTrigger list +// ** and returns the combined list. +// ** +// ** To state it another way: This routine returns a list of all triggers +// ** that fire off of pTab. The list will include any TEMP triggers on +// ** pTab as well as the triggers lised in pTab->pTrigger. +// */ func _sqlite3TriggerList(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *XTrigger) { var _pTmpSchema *XSchema var _2_p *XHashElem var _pList, _3_pTrig *XTrigger _pTmpSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 32*uintptr(i32(1)))).X4) _pList = nil - if (_pParse.X47) != 0 { + if _pParse.X47 != 0 { return nil } if _pTmpSchema == (*XSchema)(_pTab.X20) { @@ -96378,14 +100491,14 @@ func _sqlite3TriggerList(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *XTri crt.X__builtin_abort(tls) } }() - _2_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pTmpSchema.X4))).X2) + _2_p = (*XHashElem)((*XHash)(unsafe.Pointer(&_pTmpSchema.X4)).X2) _4: if _2_p == nil { goto _7 } _3_pTrig = (*XTrigger)(_2_p.X2) if ((*XSchema)(_3_pTrig.X7) == (*XSchema)(_pTab.X20)) && (i32(0) == _sqlite3StrICmp(tls, _3_pTrig.X1, _pTab.X0)) { - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pTrig.X9))))) = func() *XTrigger { + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_pTrig.X9)))) = func() *XTrigger { if _pList != nil { return _pList } @@ -96417,13 +100530,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TriggersExistØ00__func__Ø000[0], str(115609), 21) } -// pEList is the SET clause of an UPDATE statement. Each entry -// in pEList is of the format <id>=<expr>. If any of the entries -// in pEList have an <id> which matches an identifier in pIdList, -// then return TRUE. If pIdList==NULL, then it is considered a -// wildcard that matches anything. Likewise if pEList==NULL then -// it matches anything so always return true. Return false only -// if there is no match. +// C comment +// /* +// ** pEList is the SET clause of an UPDATE statement. Each entry +// ** in pEList is of the format <id>=<expr>. If any of the entries +// ** in pEList have an <id> which matches an identifier in pIdList, +// ** then return TRUE. If pIdList==NULL, then it is considered a +// ** wildcard that matches anything. Likewise if pEList==NULL then +// ** it matches anything so always return true. Return false only +// ** if there is no match. +// */ func _checkColumnOverlap(tls *crt.TLS, _pIdList *XIdList, _pEList *XExprList) (r0 int32) { var _e int32 if (_pIdList == nil) || func() int32 { @@ -96440,10 +100556,10 @@ func _checkColumnOverlap(tls *crt.TLS, _pIdList *XIdList, _pEList *XExprList) (r } _e = i32(0) _4: - if _e >= (_pEList.X0) { + if _e >= _pEList.X0 { goto _7 } - if _sqlite3IdListIndex(tls, _pIdList, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(_e))).X1) >= i32(0) { + if _sqlite3IdListIndex(tls, _pIdList, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(_e))).X1) >= i32(0) { return i32(1) } _e += 1 @@ -96458,26 +100574,29 @@ func init() { crt.Xstrncpy(nil, &_checkColumnOverlapØ00__func__Ø000[0], str(115630), 19) } -// This function is called before generating code to update or delete a -// row contained in table pTab. If the operation is a DELETE, then -// parameter aChange is passed a NULL value. For an UPDATE, aChange points -// to an array of size N, where N is the number of columns in table pTab. -// If the i'th column is not modified by the UPDATE, then the corresponding -// entry in the aChange[] array is set to -1. If the column is modified, -// the value is 0 or greater. Parameter chngRowid is set to true if the -// UPDATE statement modifies the rowid fields of the table. -// -// If any foreign key processing will be required, this function returns -// non-zero. If there is no foreign key related processing, this function -// returns zero. -// -// For an UPDATE, this function returns 2 if: -// -// * There are any FKs for which pTab is the child and the parent table, or -// * the UPDATE modifies one or more parent keys for which the action is -// not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL). -// -// Or, assuming some other foreign key processing is required, 1. +// C comment +// /* +// ** This function is called before generating code to update or delete a +// ** row contained in table pTab. If the operation is a DELETE, then +// ** parameter aChange is passed a NULL value. For an UPDATE, aChange points +// ** to an array of size N, where N is the number of columns in table pTab. +// ** If the i'th column is not modified by the UPDATE, then the corresponding +// ** entry in the aChange[] array is set to -1. If the column is modified, +// ** the value is 0 or greater. Parameter chngRowid is set to true if the +// ** UPDATE statement modifies the rowid fields of the table. +// ** +// ** If any foreign key processing will be required, this function returns +// ** non-zero. If there is no foreign key related processing, this function +// ** returns zero. +// ** +// ** For an UPDATE, this function returns 2 if: +// ** +// ** * There are any FKs for which pTab is the child and the parent table, or +// ** * the UPDATE modifies one or more parent keys for which the action is +// ** not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL). +// ** +// ** Or, assuming some other foreign key processing is required, 1. +// */ func _sqlite3FkRequired(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aChange *int32, _chngRowid int32) (r0 int32) { var _eRet int32 var _3_p *XFKey @@ -96486,7 +100605,7 @@ func _sqlite3FkRequired(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aChange * goto _0 } if _aChange == nil { - _eRet = bool2int((_sqlite3FkReferences(tls, _pTab) != nil) || ((*XFKey)(_pTab.X4) != nil)) + _eRet = bool2int((_sqlite3FkReferences(tls, _pTab) != nil) || (_pTab.X4 != nil)) goto _3 } _3_p = (*XFKey)(_pTab.X4) @@ -96511,7 +100630,7 @@ _10: if _fkParentIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) == 0 { goto _14 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_3_p.X7))))) + 1*uintptr(i32(1))))) != i32(0) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_3_p.X7)))) + 1*uintptr(i32(1))))) != i32(0) { return i32(2) } _eRet = i32(1) @@ -96524,28 +100643,31 @@ _0: return _eRet } -// The second argument points to an FKey object representing a foreign key -// for which pTab is the child table. An UPDATE statement against pTab -// is currently being processed. For each column of the table that is -// actually updated, the corresponding element in the aChange[] array -// is zero or greater (if a column is unmodified the corresponding element -// is set to -1). If the rowid column is modified by the UPDATE statement -// the bChngRowid argument is non-zero. -// -// This function returns true if any of the columns that are part of the -// child key for FK constraint *p are modified. +// C comment +// /* +// ** The second argument points to an FKey object representing a foreign key +// ** for which pTab is the child table. An UPDATE statement against pTab +// ** is currently being processed. For each column of the table that is +// ** actually updated, the corresponding element in the aChange[] array +// ** is zero or greater (if a column is unmodified the corresponding element +// ** is set to -1). If the rowid column is modified by the UPDATE statement +// ** the bChngRowid argument is non-zero. +// ** +// ** This function returns true if any of the columns that are part of the +// ** child key for FK constraint *p are modified. +// */ func _fkChildIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) { var _i, _1_iChildKey int32 _i = i32(0) _0: - if _i >= (_p.X5) { + if _i >= _p.X5 { goto _3 } - _1_iChildKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _1_iChildKey = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_p.X9))))) + 16*uintptr(_i))).X0 - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aChange)) + 4*uintptr(_1_iChildKey)))) >= i32(0) { + })(unsafe.Pointer(&_p.X9)))) + 16*uintptr(_i))).X0 + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aChange)) + 4*uintptr(_1_iChildKey)))) >= i32(0) { return i32(1) } if (_1_iChildKey == int32(_pTab.X10)) && _bChngRowid != 0 { @@ -96557,35 +100679,38 @@ _3: return i32(0) } -// The second argument points to an FKey object representing a foreign key -// for which pTab is the parent table. An UPDATE statement against pTab -// is currently being processed. For each column of the table that is -// actually updated, the corresponding element in the aChange[] array -// is zero or greater (if a column is unmodified the corresponding element -// is set to -1). If the rowid column is modified by the UPDATE statement -// the bChngRowid argument is non-zero. -// -// This function returns true if any of the columns that are part of the -// parent key for FK constraint *p are modified. +// C comment +// /* +// ** The second argument points to an FKey object representing a foreign key +// ** for which pTab is the parent table. An UPDATE statement against pTab +// ** is currently being processed. For each column of the table that is +// ** actually updated, the corresponding element in the aChange[] array +// ** is zero or greater (if a column is unmodified the corresponding element +// ** is set to -1). If the rowid column is modified by the UPDATE statement +// ** the bChngRowid argument is non-zero. +// ** +// ** This function returns true if any of the columns that are part of the +// ** parent key for FK constraint *p are modified. +// */ func _fkParentIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) { var _i, _1_iKey int32 var _1_zKey *int8 var _3_pCol *XColumn _i = i32(0) _0: - if _i >= (_p.X5) { + if _i >= _p.X5 { goto _3 } - _1_zKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _1_zKey = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_p.X9))))) + 16*uintptr(_i))).X1 + })(unsafe.Pointer(&_p.X9)))) + 16*uintptr(_i))).X1 _1_iKey = i32(0) _4: if _1_iKey >= int32(_pTab.X11) { goto _7 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aChange)) + 4*uintptr(_1_iKey)))) < i32(0) && (_1_iKey != int32(_pTab.X10) || _bChngRowid == 0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aChange)) + 4*uintptr(_1_iKey)))) < i32(0) && (_1_iKey != int32(_pTab.X10) || _bChngRowid == 0) { goto _10 } _3_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_1_iKey))) @@ -96611,30 +100736,37 @@ _3: return i32(0) } -// Check to make sure the given table is writable. If it is not -// writable, generate an error message and return 1. If it is -// writable return 0; +// C comment +// /* +// ** Check to make sure the given table is writable. If it is not +// ** writable, generate an error message and return 1. If it is +// ** writable return 0; +// */ func _sqlite3IsReadOnly(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _viewOk int32) (r0 int32) { - if ((_pTab.X16) != 0 && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { + if (_pTab.X16 != 0 && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 - }{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32 - }{((*Xsqlite3_module)((*XModule)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.X0), _pTab).X1).X0).X13)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 { + v := (*Xsqlite3_module)((*XModule)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.X0), _pTab).X1).X0).X13 + return *(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32 - }{nil})))) || (((((_pTab.X9) & uint32(i32(1))) != uint32(i32(0))) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(2048)) == i32(0))) && (int32(_pParse.X6) == i32(0))) { + }{nil})))) || ((((_pTab.X9 & uint32(i32(1))) != uint32(i32(0))) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(2048)) == i32(0))) && (int32(_pParse.X6) == i32(0))) { _sqlite3ErrorMsg(tls, _pParse, str(115649), unsafe.Pointer(_pTab.X0)) return i32(1) } - if (_viewOk == 0) && ((*XSelect)(_pTab.X3) != nil) { + if (_viewOk == 0) && (_pTab.X3 != nil) { _sqlite3ErrorMsg(tls, _pParse, str(115678), unsafe.Pointer(_pTab.X0)) return i32(1) } return i32(0) } -// Push an authorization context. After this routine is called, the -// zArg3 argument to authorization callbacks will be zContext until -// popped. Or if pParse==0, this routine is a no-op. +// C comment +// /* +// ** Push an authorization context. After this routine is called, the +// ** zArg3 argument to authorization callbacks will be zContext until +// ** popped. Or if pParse==0, this routine is a no-op. +// */ func _sqlite3AuthContextPush(tls *crt.TLS, _pParse *XParse, _pContext *XAuthContext, _zContext *int8) { func() { if _pParse == nil { @@ -96642,9 +100774,9 @@ func _sqlite3AuthContextPush(tls *crt.TLS, _pParse *XParse, _pContext *XAuthCont crt.X__builtin_abort(tls) } }() - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pContext.X1))))) = _pParse - *(**int8)(unsafe.Pointer(&(_pContext.X0))) = _pParse.X65 - *(**int8)(unsafe.Pointer(&(_pParse.X65))) = _zContext + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pContext.X1)))) = _pParse + *(**int8)(unsafe.Pointer(&_pContext.X0)) = _pParse.X65 + *(**int8)(unsafe.Pointer(&_pParse.X65)) = _zContext } var _sqlite3AuthContextPushØ00__func__Ø000 [23]int8 @@ -96653,15 +100785,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AuthContextPushØ00__func__Ø000[0], str(115723), 23) } -// Set a flag in the vdbe to update the change counter when it is finalised -// or reset. +// C comment +// /* +// ** Set a flag in the vdbe to update the change counter when it is finalised +// ** or reset. +// */ func _sqlite3VdbeCountChanges(tls *crt.TLS, _v *TVdbe) { - storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(1)), 16, 4) + storebits18((*int16)(unsafe.Pointer(&_v.X32)), int16(i32(1)), 16, 4) } -// Evaluate a view and store its result in an ephemeral table. The -// pWhere argument is an optional WHERE clause that restricts the -// set of rows in the view that are to be added to the ephemeral table. +// C comment +// /* +// ** Evaluate a view and store its result in an ephemeral table. The +// ** pWhere argument is an optional WHERE clause that restricts the +// ** set of rows in the view that are to be added to the ephemeral table. +// */ func _sqlite3MaterializeView(tls *crt.TLS, _pParse *XParse, _pView *XTable, _pWhere *XExpr, _iCur int32) { var _iDb int32 var _db *Xsqlite3 @@ -96674,21 +100812,21 @@ func _sqlite3MaterializeView(tls *crt.TLS, _pParse *XParse, _pView *XTable, _pWh _pFrom = _sqlite3SrcListAppend(tls, _db, nil, nil, nil) if _pFrom != nil { func() { - if (_pFrom.X0) != i32(1) { + if _pFrom.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104736), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115746))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 112*uintptr(i32(0)))).X2))) = _sqlite3DbStrDup(tls, _db, _pView.X0) - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 112*uintptr(i32(0)))).X1))) = _sqlite3DbStrDup(tls, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2)))) + 112*uintptr(i32(0)))).X2))) = _sqlite3DbStrDup(tls, _db, _pView.X0) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2)))) + 112*uintptr(i32(0)))).X1))) = _sqlite3DbStrDup(tls, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) func() { - if (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2)))))+112*uintptr(i32(0)))).X12) != nil { + if (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2))))+112*uintptr(i32(0)))).X12) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115761))) crt.X__builtin_abort(tls) } }() func() { - if (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2)))))+112*uintptr(i32(0)))).X13) != nil { + if (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pFrom.X2))))+112*uintptr(i32(0)))).X13) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104740), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115780))) crt.X__builtin_abort(tls) } @@ -96707,8 +100845,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3MaterializeViewØ00__func__Ø000[0], str(115802), 23) } -// Allocate a new Select structure and return a pointer to that -// structure. +// C comment +// /* +// ** Allocate a new Select structure and return a pointer to that +// ** structure. +// */ func _sqlite3SelectNew(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pSrc *XSrcList, _pWhere *XExpr, _pGroupBy *XExprList, _pHaving *XExpr, _pOrderBy *XExprList, _selFlags uint32, _pLimit *XExpr, _pOffset *XExpr) (r0 *XSelect) { var _standin XSelect var _pNew *XSelect @@ -96725,30 +100866,30 @@ func _sqlite3SelectNew(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pSrc if _pEList == nil { _pEList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, (*Xsqlite3)(_pParse.X0), i32(161), nil)) } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pEList - *(*uint8)(unsafe.Pointer(&(_pNew.X1))) = uint8(i32(119)) - *(*uint32)(unsafe.Pointer(&(_pNew.X3))) = _selFlags - *(*int32)(unsafe.Pointer(&(_pNew.X4))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pNew.X5))) = i32(0) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int8)(unsafe.Pointer(&(_pNew.X6))))) + 1*uintptr(i32(0)))) = int8(i32(0)) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pNew.X7))))) + 4*uintptr(i32(0)))) = i32(-1) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pNew.X7))))) + 4*uintptr(i32(1)))) = i32(-1) - *(*int16)(unsafe.Pointer(&(_pNew.X2))) = int16(i32(0)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X0)))) = _pEList + *(*uint8)(unsafe.Pointer(&_pNew.X1)) = uint8(i32(119)) + *(*uint32)(unsafe.Pointer(&_pNew.X3)) = _selFlags + *(*int32)(unsafe.Pointer(&_pNew.X4)) = i32(0) + *(*int32)(unsafe.Pointer(&_pNew.X5)) = i32(0) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&_pNew.X6)))) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pNew.X7)))) + 4*uintptr(i32(0)))) = i32(-1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pNew.X7)))) + 4*uintptr(i32(1)))) = i32(-1) + *(*int16)(unsafe.Pointer(&_pNew.X2)) = int16(i32(0)) if _pSrc == nil { _pSrc = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), u64(120))) } - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X8))))) = _pSrc - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X9))))) = _pWhere - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X10))))) = _pGroupBy - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X11))))) = _pHaving - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X12))))) = _pOrderBy - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X13))))) = nil - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X14))))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X15))))) = _pLimit - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X16))))) = _pOffset - *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X17))))) = nil - func() { - if _pOffset != nil && _pLimit == nil && (_pParse.X16) <= i32(0) && int32((*Xsqlite3)(_pParse.X0).X17) == i32(0) { + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X8)))) = _pSrc + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X9)))) = _pWhere + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X10)))) = _pGroupBy + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X11)))) = _pHaving + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X12)))) = _pOrderBy + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X13)))) = nil + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X14)))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X15)))) = _pLimit + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X16)))) = _pOffset + *(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X17)))) = nil + func() { + if _pOffset != nil && _pLimit == nil && _pParse.X16 <= i32(0) && int32((*Xsqlite3)(_pParse.X0).X17) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(115825))) crt.X__builtin_abort(tls) } @@ -96759,7 +100900,7 @@ func _sqlite3SelectNew(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pSrc goto _11 } func() { - if (*XSrcList)(_pNew.X8) == nil && (_pParse.X16) <= i32(0) { + if (*XSrcList)(_pNew.X8) == nil && _pParse.X16 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116671), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(115898))) crt.X__builtin_abort(tls) } @@ -96783,45 +100924,51 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SelectNewØ00__func__Ø000[0], str(115945), 17) } -// Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to -// operate directly on the rowis returned by a WHERE clause. Return -// ONEPASS_SINGLE (1) if the statement can operation directly because only -// a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass -// optimization can be used on multiple -// -// If the ONEPASS optimization is used (if this routine returns true) -// then also write the indices of open cursors used by ONEPASS -// into aiCur[0] and aiCur[1]. iaCur[0] gets the cursor of the data -// table and iaCur[1] gets the cursor used by an auxiliary index. -// Either value may be -1, indicating that cursor is not used. -// Any cursors returned will have been opened for writing. -// -// aiCur[0] and aiCur[1] both get -1 if the where-clause logic is -// unable to use the ONEPASS optimization. +// C comment +// /* +// ** Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to +// ** operate directly on the rowis returned by a WHERE clause. Return +// ** ONEPASS_SINGLE (1) if the statement can operation directly because only +// ** a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass +// ** optimization can be used on multiple +// ** +// ** If the ONEPASS optimization is used (if this routine returns true) +// ** then also write the indices of open cursors used by ONEPASS +// ** into aiCur[0] and aiCur[1]. iaCur[0] gets the cursor of the data +// ** table and iaCur[1] gets the cursor used by an auxiliary index. +// ** Either value may be -1, indicating that cursor is not used. +// ** Any cursors returned will have been opened for writing. +// ** +// ** aiCur[0] and aiCur[1] both get -1 if the where-clause logic is +// ** unable to use the ONEPASS optimization. +// */ func _sqlite3WhereOkOnePass(tls *crt.TLS, _pWInfo *XWhereInfo, _aiCur *int32) (r0 int32) { - crt.Xmemcpy(tls, (unsafe.Pointer)(_aiCur), (unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6)))), u64(8)) + crt.Xmemcpy(tls, unsafe.Pointer(_aiCur), unsafe.Pointer((*[2]int32)(unsafe.Pointer(&_pWInfo.X6))), u64(8)) return int32(_pWInfo.X14) } -// Allocate cursors for the pTab table and all its indices and generate -// code to open and initialized those cursors. -// -// The cursor for the object that contains the complete data (normally -// the table itself, but the PRIMARY KEY index in the case of a WITHOUT -// ROWID table) is returned in *piDataCur. The first index cursor is -// returned in *piIdxCur. The number of indices is returned. -// -// Use iBase as the first cursor (either the *piDataCur for rowid tables -// or the first index for WITHOUT ROWID tables) if it is non-negative. -// If iBase is negative, then allocate the next available cursor. -// -// For a rowid table, *piDataCur will be exactly one less than *piIdxCur. -// For a WITHOUT ROWID table, *piDataCur will be somewhere in the range -// of *piIdxCurs, depending on where the PRIMARY KEY index appears on the -// pTab->pIndex list. -// -// If pTab is a virtual table, then this routine is a no-op and the -// *piDataCur and *piIdxCur values are left uninitialized. +// C comment +// /* +// ** Allocate cursors for the pTab table and all its indices and generate +// ** code to open and initialized those cursors. +// ** +// ** The cursor for the object that contains the complete data (normally +// ** the table itself, but the PRIMARY KEY index in the case of a WITHOUT +// ** ROWID table) is returned in *piDataCur. The first index cursor is +// ** returned in *piIdxCur. The number of indices is returned. +// ** +// ** Use iBase as the first cursor (either the *piDataCur for rowid tables +// ** or the first index for WITHOUT ROWID tables) if it is non-negative. +// ** If iBase is negative, then allocate the next available cursor. +// ** +// ** For a rowid table, *piDataCur will be exactly one less than *piIdxCur. +// ** For a WITHOUT ROWID table, *piDataCur will be somewhere in the range +// ** of *piIdxCurs, depending on where the PRIMARY KEY index appears on the +// ** pTab->pIndex list. +// ** +// ** If pTab is a virtual table, then this routine is a no-op and the +// ** *piDataCur and *piIdxCur values are left uninitialized. +// */ func _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _p5 uint8, _iBase int32, _aToOpen *uint8, _piDataCur *int32, _piIdxCur *int32) (r0 int32) { var _i, _iDb, _iDataCur, _4_iIdxCur int32 var _v *TVdbe @@ -96838,7 +100985,7 @@ func _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _ crt.X__builtin_abort(tls) } }() - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return i32(0) } _iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20)) @@ -96852,11 +100999,11 @@ func _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _ if _iBase < i32(0) { _iBase = _pParse.X17 } - _iDataCur = postInc1(&_iBase, int32(1)) + _iDataCur = postInc1(&_iBase, 1) if _piDataCur != nil { *_piDataCur = _iDataCur } - if (((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) && ((_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(i32(0))))) != 0)) { + if ((_pTab.X9 & uint32(i32(32))) == uint32(i32(0))) && ((_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(i32(0))))) != 0)) { _sqlite3OpenTable(tls, _pParse, _iDataCur, _iDb, _pTab, _op) goto _14 } @@ -96870,14 +101017,14 @@ _16: if _pIdx == nil { goto _19 } - _4_iIdxCur = postInc1(&_iBase, int32(1)) + _4_iIdxCur = postInc1(&_iBase, 1) func() { if (*XSchema)(_pIdx.X6) != (*XSchema)(_pTab.X20) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000))), unsafe.Pointer(str(115137))) crt.X__builtin_abort(tls) } }() - if int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2) || ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) { + if int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) != i32(2) || (_pTab.X9&uint32(i32(32))) == uint32(i32(0)) { goto _23 } if _piDataCur != nil { @@ -96885,7 +101032,7 @@ _16: } _p5 = uint8(i32(0)) _23: - if (_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_i+i32(1))))) != 0) { + if (_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_i+i32(1))))) != 0) { _sqlite3VdbeAddOp3(tls, _v, _op, _4_iIdxCur, _pIdx.X11, _iDb) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx) _sqlite3VdbeChangeP5(tls, _v, uint16(_p5)) @@ -96894,8 +101041,8 @@ _23: *func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_i }() += 1 goto _16 _19: - if _iBase > (_pParse.X17) { - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = _iBase + if _iBase > _pParse.X17 { + *(*int32)(unsafe.Pointer(&_pParse.X17)) = _iBase } return _i } @@ -96906,42 +101053,45 @@ func init() { crt.Xstrncpy(nil, &_sqlite3OpenTableAndIndicesØ00__func__Ø000[0], str(116024), 27) } -// Make sure virtual table pTab is contained in the pParse->apVirtualLock[] -// array so that an OP_VBegin will get generated for it. Add pTab to the -// array if it is missing. If pTab is already in the array, this routine -// is a no-op. +// C comment +// /* +// ** Make sure virtual table pTab is contained in the pParse->apVirtualLock[] +// ** array so that an OP_VBegin will get generated for it. Add pTab to the +// ** array if it is missing. If pTab is already in the array, this routine +// ** is a no-op. +// */ func _sqlite3VtabMakeWritable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) { var _i, _n int32 var _pToplevel *XParse var _apVtabLock **XTable _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() func() { - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126093), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabMakeWritableØ00__func__Ø000))), unsafe.Pointer(str(24529))) crt.X__builtin_abort(tls) } }() _i = i32(0) _4: - if _i >= (_pToplevel.X56) { + if _i >= _pToplevel.X56 { goto _7 } - if _pTab == (*(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pToplevel.X67)) + 8*uintptr(_i)))) { + if _pTab == (*(**XTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_pToplevel.X67)) + 8*uintptr(_i)))) { return } _i += 1 goto _4 _7: - _n = int32(uint64((_pToplevel.X56)+i32(1)) * u64(8)) - _apVtabLock = (**XTable)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_pToplevel.X67), uint64(_n))) + _n = int32(uint64(_pToplevel.X56+i32(1)) * u64(8)) + _apVtabLock = (**XTable)(Xsqlite3_realloc64(tls, unsafe.Pointer(_pToplevel.X67), uint64(_n))) if _apVtabLock != nil { - *(***XTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_pToplevel.X67))))) = _apVtabLock - *(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pToplevel.X67)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pToplevel.X56))), int32(1))))) = _pTab + *(***XTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_pToplevel.X67)))) = _apVtabLock + *(**XTable)(unsafe.Pointer(uintptr(unsafe.Pointer(_pToplevel.X67)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_pToplevel.X56)), 1)))) = _pTab goto _10 } _sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.X0)) @@ -96954,45 +101104,48 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabMakeWritableØ00__func__Ø000[0], str(116051), 24) } -// This routine generates VDBE code that causes a single row of a -// single table to be deleted. Both the original table entry and -// all indices are removed. -// -// Preconditions: -// -// 1. iDataCur is an open cursor on the btree that is the canonical data -// store for the table. (This will be either the table itself, -// in the case of a rowid table, or the PRIMARY KEY index in the case -// of a WITHOUT ROWID table.) -// -// 2. Read/write cursors for all indices of pTab must be open as -// cursor number iIdxCur+i for the i-th index. -// -// 3. The primary key for the row to be deleted must be stored in a -// sequence of nPk memory cells starting at iPk. If nPk==0 that means -// that a search record formed from OP_MakeRecord is contained in the -// single memory location iPk. -// -// eMode: -// Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or -// ONEPASS_MULTI. If eMode is not ONEPASS_OFF, then the cursor -// iDataCur already points to the row to delete. If eMode is ONEPASS_OFF -// then this function must seek iDataCur to the entry identified by iPk -// and nPk before reading from it. -// -// If eMode is ONEPASS_MULTI, then this call is being made as part -// of a ONEPASS delete that affects multiple rows. In this case, if -// iIdxNoSeek is a valid cursor number (>=0) and is not the same as -// iDataCur, then its position should be preserved following the delete -// operation. Or, if iIdxNoSeek is not a valid cursor number, the -// position of iDataCur should be preserved instead. -// -// iIdxNoSeek: -// If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur, -// then it identifies an index cursor (from within array of cursors -// starting at iIdxCur) that already points to the index entry to be deleted. -// Except, this optimization is disabled if there are BEFORE triggers since -// the trigger body might have moved the cursor. +// C comment +// /* +// ** This routine generates VDBE code that causes a single row of a +// ** single table to be deleted. Both the original table entry and +// ** all indices are removed. +// ** +// ** Preconditions: +// ** +// ** 1. iDataCur is an open cursor on the btree that is the canonical data +// ** store for the table. (This will be either the table itself, +// ** in the case of a rowid table, or the PRIMARY KEY index in the case +// ** of a WITHOUT ROWID table.) +// ** +// ** 2. Read/write cursors for all indices of pTab must be open as +// ** cursor number iIdxCur+i for the i-th index. +// ** +// ** 3. The primary key for the row to be deleted must be stored in a +// ** sequence of nPk memory cells starting at iPk. If nPk==0 that means +// ** that a search record formed from OP_MakeRecord is contained in the +// ** single memory location iPk. +// ** +// ** eMode: +// ** Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or +// ** ONEPASS_MULTI. If eMode is not ONEPASS_OFF, then the cursor +// ** iDataCur already points to the row to delete. If eMode is ONEPASS_OFF +// ** then this function must seek iDataCur to the entry identified by iPk +// ** and nPk before reading from it. +// ** +// ** If eMode is ONEPASS_MULTI, then this call is being made as part +// ** of a ONEPASS delete that affects multiple rows. In this case, if +// ** iIdxNoSeek is a valid cursor number (>=0) and is not the same as +// ** iDataCur, then its position should be preserved following the delete +// ** operation. Or, if iIdxNoSeek is not a valid cursor number, the +// ** position of iDataCur should be preserved instead. +// ** +// ** iIdxNoSeek: +// ** If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur, +// ** then it identifies an index cursor (from within array of cursors +// ** starting at iIdxCur) that already points to the index entry to be deleted. +// ** Except, this optimization is disabled if there are BEFORE triggers since +// ** the trigger body might have moved the cursor. +// */ func _sqlite3GenerateRowDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pTrigger *XTrigger, _iDataCur int32, _iIdxCur int32, _iPk int32, _nPk int16, _count uint8, _onconf uint8, _eMode uint8, _iIdxNoSeek int32) { var _iOld, _iLabel, _2_iCol, _2_addrStart int32 var _2_mask uint32 @@ -97008,7 +101161,7 @@ func _sqlite3GenerateRowDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pT }() _iLabel = _sqlite3VdbeMakeLabel(tls, _v) _opSeek = uint8(func() int32 { - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { return i32(32) } return i32(29) @@ -97025,9 +101178,9 @@ func _sqlite3GenerateRowDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pT *p = (*p) | _sqlite3FkOldmask(tls, _pParse, _pTab) sink5(*p) } - _iOld = (_pParse.X18) + i32(1) + _iOld = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + (i32(1) + int32(_pTab.X11)) sink1(*p) } @@ -97063,7 +101216,7 @@ _6: return i32(0) }()) if int32(_pParse.X6) == i32(0) { - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pTab), i32(-15)) + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), i32(-15)) } if int32(_eMode) != i32(0) { _sqlite3VdbeChangeP5(tls, _v, uint16(i32(4))) @@ -97091,29 +101244,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GenerateRowDeleteØ00__func__Ø000[0], str(116075), 25) } -// Triggers may access values stored in the old.* or new.* pseudo-table. -// This function returns a 32-bit bitmask indicating which columns of the -// old.* or new.* tables actually are used by triggers. This information -// may be used by the caller, for example, to avoid having to load the entire -// old.* record into memory when executing an UPDATE or DELETE command. -// -// Bit 0 of the returned mask is set if the left-most column of the -// table may be accessed using an [old|new].<col> reference. Bit 1 is set if -// the second leftmost column value is required, and so on. If there -// are more than 32 columns in the table, and at least one of the columns -// with an index greater than 32 may be accessed, 0xffffffff is returned. -// -// It is not possible to determine if the old.rowid or new.rowid column is -// accessed by triggers. The caller must always assume that it is. -// -// Parameter isNew must be either 1 or 0. If it is 0, then the mask returned -// applies to the old.* table. If 1, the new.* table. -// -// Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE -// and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only -// included in the returned mask if the TRIGGER_BEFORE bit is set in the -// tr_tm parameter. Similarly, values accessed by AFTER triggers are only -// included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm. +// C comment +// /* +// ** Triggers may access values stored in the old.* or new.* pseudo-table. +// ** This function returns a 32-bit bitmask indicating which columns of the +// ** old.* or new.* tables actually are used by triggers. This information +// ** may be used by the caller, for example, to avoid having to load the entire +// ** old.* record into memory when executing an UPDATE or DELETE command. +// ** +// ** Bit 0 of the returned mask is set if the left-most column of the +// ** table may be accessed using an [old|new].<col> reference. Bit 1 is set if +// ** the second leftmost column value is required, and so on. If there +// ** are more than 32 columns in the table, and at least one of the columns +// ** with an index greater than 32 may be accessed, 0xffffffff is returned. +// ** +// ** It is not possible to determine if the old.rowid or new.rowid column is +// ** accessed by triggers. The caller must always assume that it is. +// ** +// ** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned +// ** applies to the old.* table. If 1, the new.* table. +// ** +// ** Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE +// ** and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only +// ** included in the returned mask if the TRIGGER_BEFORE bit is set in the +// ** tr_tm parameter. Similarly, values accessed by AFTER triggers are only +// ** included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm. +// */ func _sqlite3TriggerColmask(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pChanges *XExprList, _isNew int32, _tr_tm int32, _pTab *XTable, _orconf int32) (r0 uint32) { var _op int32 var _mask uint32 @@ -97144,7 +101300,7 @@ _5: if _2_pPrg != nil { { p := &_mask - *p = (*p) | (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_2_pPrg.X4))))) + 4*uintptr(_isNew)))) + *p = (*p) | (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_2_pPrg.X4)))) + 4*uintptr(_isNew)))) sink5(*p) } } @@ -97161,28 +101317,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TriggerColmaskØ00__func__Ø000[0], str(116121), 22) } -// Return a pointer to a TriggerPrg object containing the sub-program for -// trigger pTrigger with default ON CONFLICT algorithm orconf. If no such -// TriggerPrg object exists, a new object is allocated and populated before -// being returned. +// C comment +// /* +// ** Return a pointer to a TriggerPrg object containing the sub-program for +// ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such +// ** TriggerPrg object exists, a new object is allocated and populated before +// ** being returned. +// */ func _getRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) { var _pRoot *XParse var _pPrg *XTriggerPrg _pRoot = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() func() { - if (_pTrigger.X0) != nil && _pTab != _tableOfTrigger(tls, _pTrigger) { + if _pTrigger.X0 != nil && _pTab != _tableOfTrigger(tls, _pTrigger) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123555), unsafe.Pointer((*int8)(unsafe.Pointer(&_getRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116143))) crt.X__builtin_abort(tls) } }() _pPrg = (*XTriggerPrg)(_pRoot.X69) _5: - if _pPrg == nil || (*XTrigger)(_pPrg.X0) == _pTrigger && (_pPrg.X3) == _orconf { + if _pPrg == nil || (*XTrigger)(_pPrg.X0) == _pTrigger && _pPrg.X3 == _orconf { goto _10 } _pPrg = (*XTriggerPrg)(_pPrg.X1) @@ -97200,8 +101359,11 @@ func init() { crt.Xstrncpy(nil, &_getRowTriggerØ00__func__Ø000[0], str(116196), 14) } -// Create and populate a new TriggerPrg object with a sub-program -// implementing trigger pTrigger with ON CONFLICT policy orconf. +// C comment +// /* +// ** Create and populate a new TriggerPrg object with a sub-program +// ** implementing trigger pTrigger with ON CONFLICT policy orconf. +// */ func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) { var _iEndTrigger int32 var _db *Xsqlite3 @@ -97212,7 +101374,7 @@ func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab * var _sNC XNameContext var _pPrg *XTriggerPrg _pTop = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse @@ -97222,13 +101384,13 @@ func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab * _pProgram = nil _iEndTrigger = i32(0) func() { - if (_pTrigger.X0) != nil && _pTab != _tableOfTrigger(tls, _pTrigger) { + if _pTrigger.X0 != nil && _pTab != _tableOfTrigger(tls, _pTrigger) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123449), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116143))) crt.X__builtin_abort(tls) } }() func() { - if (*TVdbe)(_pTop.X2) == nil { + if _pTop.X2 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123450), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116210))) crt.X__builtin_abort(tls) } @@ -97237,29 +101399,29 @@ func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab * if _pPrg == nil { return nil } - *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X1))))) = (*XTriggerPrg)(_pTop.X69) - *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTop.X69))))) = _pPrg - *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X2))))) = store75(&_pProgram, (*XSubProgram)(_sqlite3DbMallocZero(tls, _db, u64(48)))) + *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrg.X1)))) = (*XTriggerPrg)(_pTop.X69) + *(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTop.X69)))) = _pPrg + *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrg.X2)))) = store75(&_pProgram, (*XSubProgram)(_sqlite3DbMallocZero(tls, _db, u64(48)))) if _pProgram == nil { return nil } _sqlite3VdbeLinkSubProgram(tls, (*TVdbe)(_pTop.X2), _pProgram) - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X0))))) = _pTrigger - *(*int32)(unsafe.Pointer(&(_pPrg.X3))) = _orconf - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(0)))) = u32(4294967295) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(1)))) = u32(4294967295) + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pPrg.X0)))) = _pTrigger + *(*int32)(unsafe.Pointer(&_pPrg.X3)) = _orconf + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_pPrg.X4)))) + 4*uintptr(i32(0)))) = u32(4294967295) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_pPrg.X4)))) + 4*uintptr(i32(1)))) = u32(4294967295) _pSubParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, u64(600))) if _pSubParse == nil { return nil } - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pSubParse - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X0))))) = _db - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X40))))) = _pTab - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X39))))) = _pTop - *(**int8)(unsafe.Pointer(&(_pSubParse.X65))) = _pTrigger.X0 - *(*uint8)(unsafe.Pointer(&(_pSubParse.X45))) = _pTrigger.X2 - *(*uint32)(unsafe.Pointer(&(_pSubParse.X42))) = _pParse.X42 + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pSubParse + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubParse.X0)))) = _db + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubParse.X40)))) = _pTab + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSubParse.X39)))) = _pTop + *(**int8)(unsafe.Pointer(&_pSubParse.X65)) = _pTrigger.X0 + *(*uint8)(unsafe.Pointer(&_pSubParse.X45)) = _pTrigger.X2 + *(*uint32)(unsafe.Pointer(&_pSubParse.X42)) = _pParse.X42 _v = _sqlite3GetVdbe(tls, _pSubParse) if _v == nil { goto _10 @@ -97286,7 +101448,7 @@ func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab * return str(0) }()), unsafe.Pointer(_pTab.X0)) _sqlite3VdbeChangeP4(tls, _v, i32(-1), _sqlite3MPrintf(tls, _db, str(116253), unsafe.Pointer(_pTrigger.X0)), i32(-1)) - if (*XExpr)(_pTrigger.X4) == nil { + if _pTrigger.X4 == nil { goto _19 } _pWhen = _sqlite3ExprDup(tls, _db, (*XExpr)(_pTrigger.X4), i32(0)) @@ -97304,29 +101466,29 @@ _19: _sqlite3VdbeComment(tls, _v, str(116267), unsafe.Pointer(_pTrigger.X0), unsafe.Pointer(_onErrorText(tls, _orconf))) _transferParseError(tls, _pParse, _pSubParse) if int32(_db.X17) == i32(0) { - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pProgram.X0))))) = _sqlite3VdbeTakeOpArray(tls, _v, (*int32)(unsafe.Pointer(&(_pProgram.X1))), (*int32)(unsafe.Pointer(&(_pTop.X33)))) + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pProgram.X0)))) = _sqlite3VdbeTakeOpArray(tls, _v, (*int32)(unsafe.Pointer(&_pProgram.X1)), (*int32)(unsafe.Pointer(&_pTop.X33))) } - *(*int32)(unsafe.Pointer(&(_pProgram.X2))) = _pSubParse.X18 - *(*int32)(unsafe.Pointer(&(_pProgram.X3))) = _pSubParse.X17 - *(*unsafe.Pointer)(unsafe.Pointer(&(_pProgram.X5))) = (unsafe.Pointer)(_pTrigger) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(0)))) = _pSubParse.X43 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(1)))) = _pSubParse.X44 + *(*int32)(unsafe.Pointer(&_pProgram.X2)) = _pSubParse.X18 + *(*int32)(unsafe.Pointer(&_pProgram.X3)) = _pSubParse.X17 + *(*unsafe.Pointer)(unsafe.Pointer(&_pProgram.X5)) = unsafe.Pointer(_pTrigger) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_pPrg.X4)))) + 4*uintptr(i32(0)))) = _pSubParse.X43 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_pPrg.X4)))) + 4*uintptr(i32(1)))) = _pSubParse.X44 _sqlite3VdbeDelete(tls, _v) _10: func() { - if (*TAggInfo_func)(_pSubParse.X38) != nil || (*XTable)(_pSubParse.X68) != nil { + if _pSubParse.X38 != nil || _pSubParse.X68 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123532), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116278))) crt.X__builtin_abort(tls) } }() func() { - if (*XTriggerPrg)(_pSubParse.X69) != nil || (_pSubParse.X33) != 0 { + if _pSubParse.X69 != nil || _pSubParse.X33 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123533), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116322))) crt.X__builtin_abort(tls) } }() _sqlite3ParserReset(tls, _pSubParse) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubParse)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pSubParse)) return _pPrg _ = _sNC @@ -97339,16 +101501,22 @@ func init() { crt.Xstrncpy(nil, &_codeRowTriggerØ00__func__Ø000[0], str(116369), 15) } -// Link the SubProgram object passed as the second argument into the linked -// list at Vdbe.pSubProgram. This list is used to delete all sub-program -// objects when the VM is no longer required. +// C comment +// /* +// ** Link the SubProgram object passed as the second argument into the linked +// ** list at Vdbe.pSubProgram. This list is used to delete all sub-program +// ** objects when the VM is no longer required. +// */ func _sqlite3VdbeLinkSubProgram(tls *crt.TLS, _pVdbe *TVdbe, _p *XSubProgram) { - *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = (*XSubProgram)(_pVdbe.X42) - *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVdbe.X42))))) = _p + *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X6)))) = (*XSubProgram)(_pVdbe.X42) + *(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVdbe.X42)))) = _p } -// This function is used to add VdbeComment() annotations to a VDBE -// program. It is not used in production code, only for debugging. +// C comment +// /* +// ** This function is used to add VdbeComment() annotations to a VDBE +// ** program. It is not used in production code, only for debugging. +// */ func _onErrorText(tls *crt.TLS, _onError int32) (r0 *int8) { switch _onError { case i32(1): @@ -97389,8 +101557,11 @@ _7: return str(116392) } -// Generate VDBE code for the statements inside the body of a single -// trigger. +// C comment +// /* +// ** Generate VDBE code for the statements inside the body of a single +// ** trigger. +// */ func _codeTriggerProgram(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _orconf int32) (r0 int32) { var _db *Xsqlite3 var _v *TVdbe @@ -97400,7 +101571,7 @@ func _codeTriggerProgram(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep _v = (*TVdbe)(_pParse.X2) _db = (*Xsqlite3)(_pParse.X0) func() { - if (*XTable)(_pParse.X40) == nil || (*XParse)(_pParse.X39) == nil { + if _pParse.X40 == nil || _pParse.X39 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123331), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(116396))) crt.X__builtin_abort(tls) } @@ -97422,9 +101593,9 @@ _7: if _pStep == nil { goto _10 } - *(*uint8)(unsafe.Pointer(&(_pParse.X46))) = func() uint8 { + *(*uint8)(unsafe.Pointer(&_pParse.X46)) = func() uint8 { if _orconf == i32(10) { - return (_pStep.X1) + return _pStep.X1 } return uint8(_orconf) }() @@ -97485,11 +101656,14 @@ func init() { crt.Xstrncpy(nil, &_codeTriggerProgramØ00__func__Ø000[0], str(116493), 19) } -// Process an UPDATE statement. -// -// UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; -// \_______/ \________/ \______/ \________________/ -// * onError pTabList pChanges pWhere +// C comment +// /* +// ** Process an UPDATE statement. +// ** +// ** UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL; +// ** \_______/ \________/ \______/ \________________/ +// * onError pTabList pChanges pWhere +// */ func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChanges *XExprList, _pWhere *XExpr, _onError int32) { var _nPk, _21_iIdxCol int16 var _i, _j, _addrTop, _nIdx, _iBaseCur, _iDataCur, _iIdxCur, _iDb, _eOnePass, _hasFK, _labelBreak, _labelContinue, _flags, _isView, _tmask, _newmask, _iEph, _nKey, _addrOpen, _iPk, _bReplace, _regRowCount, _regOldRowid, _regNewRowid, _regNew, _regOld, _regRowSet, _regKey, _15_rc, _18_reg, _36_iCur, _45_addrOnce, _71_addr1 int32 @@ -97524,13 +101698,13 @@ func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChange _regOld = i32(0) _regRowSet = i32(0) _regKey = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sContext), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(&_sContext), i32(0), u64(16)) _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { goto _update_cleanup } func() { - if (_pTabList.X0) != i32(1) { + if _pTabList.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123900), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(115025))) crt.X__builtin_abort(tls) } @@ -97554,10 +101728,10 @@ func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChange if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 { goto _update_cleanup } - *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X11))) = store1(&_iBaseCur, store1(&_iDataCur, postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)))) + *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X11))) = store1(&_iBaseCur, store1(&_iDataCur, postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1))) _iIdxCur = _iDataCur + i32(1) _pPk = func() *XIndex { - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { return nil } return _sqlite3PrimaryKeyIndex(tls, _pTab) @@ -97569,9 +101743,9 @@ _12: } if (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) && (_pPk != nil) { _iDataCur = _pParse.X17 - *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X11))) = _iDataCur + *(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X11))) = _iDataCur } - *(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X17)) += 1 *func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_nIdx }() += 1 goto _12 _15: @@ -97581,27 +101755,27 @@ _15: } _aRegIdx = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_pTab.X11)*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4))))))))))) _aToOpen = (*uint8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_nIdx)*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4))))))))))))) - crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint64(_nIdx+i32(1))) - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0)) + crt.Xmemset(tls, unsafe.Pointer(_aToOpen), i32(1), uint64(_nIdx+i32(1))) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0)) _i = i32(0) _19: if _i >= int32(_pTab.X11) { goto _22 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i))) = i32(-1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_i))) = i32(-1) _i += 1 goto _19 _22: - crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList + crt.Xmemset(tls, unsafe.Pointer(&_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X0)))) = _pParse + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNC.X1)))) = _pTabList _chngRowid = store2(&_chngPk, uint8(i32(0))) _i = i32(0) _23: - if _i >= (_pChanges.X0) { + if _i >= _pChanges.X0 { goto _26 } - if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(_i))).X0)) != 0 { + if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(_i))).X0)) != 0 { goto _update_cleanup } _j = i32(0) @@ -97609,19 +101783,19 @@ _28: if _j >= int32(_pTab.X11) { goto _31 } - if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(_i))).X1) != i32(0) { + if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(_i))).X1) != i32(0) { goto _32 } if _j == int32(_pTab.X10) { _chngRowid = uint8(i32(1)) - _pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2))))) + 32*uintptr(_i))).X0) + _pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2)))) + 32*uintptr(_i))).X0) goto _36 } if (_pPk != nil) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_j))).X6) & i32(1)) != i32(0)) { _chngPk = uint8(i32(1)) } _36: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_j))) = _i + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_j))) = _i goto _31 _32: _j += 1 @@ -97630,14 +101804,14 @@ _31: if _j < int32(_pTab.X11) { goto _37 } - if (_pPk == nil) && _sqlite3IsRowid(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(_i))).X1) != 0 { + if (_pPk == nil) && _sqlite3IsRowid(tls, (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(_i))).X1) != 0 { _j = i32(-1) _chngRowid = uint8(i32(1)) - _pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2))))) + 32*uintptr(_i))).X0) + _pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2)))) + 32*uintptr(_i))).X0) goto _40 } - _sqlite3ErrorMsg(tls, _pParse, str(116533), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(_i))).X1)) - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + _sqlite3ErrorMsg(tls, _pParse, str(116533), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(_i))).X1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) goto _update_cleanup _40: _37: @@ -97651,7 +101825,7 @@ _37: goto _update_cleanup } if _15_rc == i32(2) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_j))) = i32(-1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_j))) = i32(-1) } _i += 1 goto _23 @@ -97675,8 +101849,8 @@ _26: } }() _chngKey = uint8(int32(_chngRowid) + int32(_chngPk)) - *(*uint64)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X14))) = func() uint64 { - if (_pTab.X16) != 0 { + *(*uint64)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X14))) = func() uint64 { + if _pTab.X16 != 0 { return u64(18446744073709551615) } return uint64(i32(0)) @@ -97687,10 +101861,10 @@ _56: if _pIdx == nil { goto _59 } - if (((_chngKey != 0) || (_hasFK > i32(1))) || ((*XExpr)(_pIdx.X9) != nil)) || (_pIdx == _pPk) { - _18_reg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (((_chngKey != 0) || (_hasFK > i32(1))) || (_pIdx.X9 != nil)) || (_pIdx == _pPk) { + _18_reg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_pIdx.X14) sink1(*p) } @@ -97702,13 +101876,13 @@ _65: if _i >= int32(_pIdx.X13) { goto _68 } - _21_iIdxCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))) - if int32(_21_iIdxCol) >= i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_21_iIdxCol)))) < i32(0) { + _21_iIdxCol = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i))) + if int32(_21_iIdxCol) >= i32(0) && (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_21_iIdxCol)))) < i32(0) { goto _70 } - _18_reg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _18_reg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_pIdx.X14) sink1(*p) } @@ -97722,14 +101896,14 @@ _70: _68: _64: if _18_reg == i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_j+i32(1)))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_j+i32(1)))) = uint8(i32(0)) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_j))) = _18_reg + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_j))) = _18_reg *func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_j }() += 1 goto _56 _59: if _bReplace != 0 { - crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint64(_nIdx+i32(1))) + crt.Xmemset(tls, unsafe.Pointer(_aToOpen), i32(1), uint64(_nIdx+i32(1))) } _v = _sqlite3GetVdbe(tls, _pParse) if _v == nil { @@ -97739,25 +101913,25 @@ _59: _sqlite3VdbeCountChanges(tls, _v) } _sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb) - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { goto _78 } - _regRowSet = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regOldRowid = store1(&_regNewRowid, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)) + _regRowSet = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regOldRowid = store1(&_regNewRowid, preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1)) if ((_chngPk != 0) || (_pTrigger != nil)) || _hasFK != 0 { - _regOld = (_pParse.X18) + i32(1) + _regOld = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_pTab.X11) sink1(*p) } } if ((_chngKey != 0) || (_pTrigger != nil)) || _hasFK != 0 { - _regNewRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _regNewRowid = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) } - _regNew = (_pParse.X18) + i32(1) + _regNew = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_pTab.X11) sink1(*p) } @@ -97771,15 +101945,15 @@ _78: if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 { goto _update_cleanup } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _updateVirtualTable(tls, _pParse, _pTabList, _pTab, _pChanges, _pRowidExpr, _aXRef, _pWhere, _onError) goto _update_cleanup } - if ((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil) { - _regRowCount = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (_db.X6&i32(128)) != 0 && (_pParse.X40 == nil) { + _regRowCount = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regRowCount) } - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _regRowSet, _regOldRowid) goto _92 } @@ -97790,20 +101964,20 @@ _78: } }() _nPk = int16(_pPk.X13) - _iPk = (_pParse.X18) + i32(1) + _iPk = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_nPk) sink1(*p) } - _regKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _iEph = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _regKey = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _iEph = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _iPk) _addrOpen = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iEph, int32(_nPk)) _sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk) _92: _flags = i32(4100) - if (((((_pParse.X6) == 0) && (_pTrigger == nil)) && (_hasFK == 0)) && (_chngKey == 0)) && (_bReplace == 0) { + if ((((_pParse.X6 == 0) && (_pTrigger == nil)) && (_hasFK == 0)) && (_chngKey == 0)) && (_bReplace == 0) { { p := &_flags *p = (*p) | i32(8) @@ -97818,18 +101992,18 @@ _92: if _eOnePass != i32(2) { goto _101 } - _36_iCur = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))) - if ((_36_iCur >= i32(0)) && (_36_iCur != _iDataCur)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_36_iCur-_iBaseCur)))) != 0) { + _36_iCur = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1)))) + if ((_36_iCur >= i32(0)) && (_36_iCur != _iDataCur)) && ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr(_36_iCur-_iBaseCur)))) != 0) { _eOnePass = i32(0) } func() { - if _36_iCur == _iDataCur && ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) { + if _36_iCur == _iDataCur && (_pTab.X9&uint32(i32(32))) == uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124164), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116628))) crt.X__builtin_abort(tls) } }() _101: - if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { goto _108 } _sqlite3VdbeAddOp2(tls, _v, i32(125), _iDataCur, _regOldRowid) @@ -97844,12 +102018,12 @@ _111: goto _114 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(115265))) crt.X__builtin_abort(tls) } }() - _sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i) + _sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i) _i += 1 goto _111 _114: @@ -97874,14 +102048,14 @@ _110: if _eOnePass == i32(0) { goto _121 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iBaseCur))) = uint8(i32(0)) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iBaseCur))) = uint8(i32(0)) } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iBaseCur))) = uint8(i32(0)) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iBaseCur))) = uint8(i32(0)) } _121: - if (_eOnePass == i32(2)) && ((_nIdx - bool2int((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0))) > i32(0)) { + if (_eOnePass == i32(2)) && ((_nIdx - bool2int((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0))) > i32(0)) { _45_addrOnce = _sqlite3VdbeAddOp0(tls, _v, i32(20)) } _sqlite3OpenTableAndIndices(tls, _pParse, _pTab, i32(107), uint8(i32(0)), _iBaseCur, _aToOpen, nil, nil) @@ -97892,7 +102066,7 @@ _120: if _eOnePass == i32(0) { goto _127 } - if ((_isView == 0) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) != _iDataCur)) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) != _iDataCur) { + if ((_isView == 0) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(0))))) != _iDataCur)) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aiCurOnePass)) + 4*uintptr(i32(1))))) != _iDataCur) { func() { if _pPk == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116662))) @@ -97977,9 +102151,9 @@ _162: _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regNew+_i) goto _167 } - _j = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i))) + _j = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_i))) if _j >= i32(0) { - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(_j))).X0), _regNew+_i) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(_j))).X0), _regNew+_i) goto _173 } if ((i32(0) == (_tmask & i32(1))) || (_i > i32(31))) || ((uint32(_newmask) & (u32(1) << uint(_i))) != 0) { @@ -98008,7 +102182,7 @@ _177: if _i >= int32(_pTab.X11) { goto _180 } - if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))) < i32(0)) && (_i != int32(_pTab.X10)) { + if ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_i)))) < i32(0)) && (_i != int32(_pTab.X10)) { _sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regNew+_i) } _i += 1 @@ -98065,7 +102239,7 @@ _188: _sqlite3FkActions(tls, _pParse, _pTab, _pChanges, _regOldRowid, _aXRef, int32(_chngKey)) } _183: - if ((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil) { + if (_db.X6&i32(128)) != 0 && (_pParse.X40 == nil) { _sqlite3VdbeAddOp2(tls, _v, i32(73), _regRowCount, i32(1)) } _sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(110), _pChanges, i32(2), _pTab, _regOldRowid, _onError, _labelContinue) @@ -98088,14 +102262,14 @@ _208: if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) { _sqlite3AutoincrementEnd(tls, _pParse) } - if (((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil)) && ((_pParse.X6) == 0) { + if ((_db.X6&i32(128)) != 0 && (_pParse.X40 == nil)) && (_pParse.X6 == 0) { _sqlite3VdbeAddOp2(tls, _v, i32(67), _regRowCount, i32(1)) _sqlite3VdbeSetNumCols(tls, _v, i32(1)) _sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(116759), nil) } _update_cleanup: _sqlite3AuthContextPop(tls, &_sContext) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aXRef)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_aXRef)) _sqlite3SrcListDelete(tls, _db, _pTabList) _sqlite3ExprListDelete(tls, _db, _pChanges) _sqlite3ExprDelete(tls, _db, _pWhere) @@ -98110,25 +102284,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3UpdateØ00__func__Ø000[0], str(116772), 14) } -// Generate code for an UPDATE of a virtual table. -// -// There are two possible strategies - the default and the special -// "onepass" strategy. Onepass is only used if the virtual table -// implementation indicates that pWhere may match at most one row. -// -// The default strategy is to create an ephemeral table that contains -// for each row to be changed: -// -// (A) The original rowid of that row. -// (B) The revised rowid for the row. -// (C) The content of every column in the row. -// -// Then loop through the contents of this ephemeral table executing a -// VUpdate for each row. When finished, drop the ephemeral table. -// -// The "onepass" strategy does not use an ephemeral table. Instead, it -// stores the same values (A, B and C above) in a register array and -// makes a single invocation of VUpdate. +// C comment +// /* +// ** Generate code for an UPDATE of a virtual table. +// ** +// ** There are two possible strategies - the default and the special +// ** "onepass" strategy. Onepass is only used if the virtual table +// ** implementation indicates that pWhere may match at most one row. +// ** +// ** The default strategy is to create an ephemeral table that contains +// ** for each row to be changed: +// ** +// ** (A) The original rowid of that row. +// ** (B) The revised rowid for the row. +// ** (C) The content of every column in the row. +// ** +// ** Then loop through the contents of this ephemeral table executing a +// ** VUpdate for each row. When finished, drop the ephemeral table. +// ** +// ** The "onepass" strategy does not use an ephemeral table. Instead, it +// ** stores the same values (A, B and C above) in a register array and +// ** makes a single invocation of VUpdate. +// */ func _updateVirtualTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pChanges *XExprList, _pRowid *XExpr, _aXRef *int32, _pWhere *XExpr, _onError int32) { var _ephemTab, _i, _nArg, _regArg, _regRec, _regRowid, _iCsr, _bOnePass, _addr int32 var _pVTab *int8 @@ -98140,23 +102317,23 @@ func _updateVirtualTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab * _db = (*Xsqlite3)(_pParse.X0) _pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab))) _nArg = i32(2) + int32(_pTab.X11) - _iCsr = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr(i32(0)))).X11 + _iCsr = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(i32(0)))).X11 func() { if _v == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124539), unsafe.Pointer((*int8)(unsafe.Pointer(&_updateVirtualTableØ00__func__Ø000))), unsafe.Pointer(str(41861))) crt.X__builtin_abort(tls) } }() - _ephemTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _ephemTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _ephemTab, _nArg) - _regArg = (_pParse.X18) + i32(1) + _regArg = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + _nArg sink1(*p) } - _regRec = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _regRec = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _regRowid = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(i32(4)), i32(0)) if _pWInfo == nil { return @@ -98173,8 +102350,8 @@ _5: if _i >= int32(_pTab.X11) { goto _8 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))) >= i32(0) { - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+32*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))))).X0), (_regArg+i32(2))+_i) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_i)))) >= i32(0) { + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pChanges.X2))))+32*uintptr(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + 4*uintptr(_i)))))).X0), (_regArg+i32(2))+_i) goto _10 } _sqlite3VdbeAddOp3(tls, _v, i32(159), _iCsr, _i, (_regArg+i32(2))+_i) @@ -98188,7 +102365,7 @@ _8: } _sqlite3VdbeChangeToNoop(tls, _v, _addr) if (*XParse)(_pParse.X39) == nil { - *(*uint8)(unsafe.Pointer(&(_pParse.X8))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pParse.X8)) = uint8(i32(0)) } goto _13 _11: @@ -98237,8 +102414,11 @@ func init() { crt.Xstrncpy(nil, &_updateVirtualTableØ00__func__Ø000[0], str(116786), 19) } -// This function is called before generating code to update or delete a -// row contained in table pTab. +// C comment +// /* +// ** This function is called before generating code to update or delete a +// ** row contained in table pTab. +// */ func _sqlite3FkOldmask(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 uint32) { var _1_i int32 var _mask uint32 @@ -98255,22 +102435,22 @@ _1: } _1_i = i32(0) _5: - if _1_i >= (_1_p.X5) { + if _1_i >= _1_p.X5 { goto _8 } { p := &_mask *p = (*p) | func() uint32 { - if ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + if ((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_1_p.X9))))) + 16*uintptr(_1_i))).X0) > i32(31) { + })(unsafe.Pointer(&_1_p.X9)))) + 16*uintptr(_1_i))).X0) > i32(31) { return u32(4294967295) } - return (u32(1) << uint((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + return (u32(1) << uint((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_1_p.X9)))))+16*uintptr(_1_i))).X0)) + })(unsafe.Pointer(&_1_p.X9))))+16*uintptr(_1_i))).X0)) }() sink5(*p) } @@ -98296,7 +102476,7 @@ _16: goto _19 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108482), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkOldmaskØ00__func__Ø000))), unsafe.Pointer(str(116805))) crt.X__builtin_abort(tls) } @@ -98304,10 +102484,10 @@ _16: { p := &_mask *p = (*p) | func() uint32 { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i)))) > i32(31) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pIdx.X1)) + 2*uintptr(_1_i)))) > i32(31) { return u32(4294967295) } - return (u32(1) << uint(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i)))))) + return (u32(1) << uint(int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_3_pIdx.X1)) + 2*uintptr(_1_i)))))) }() sink5(*p) } @@ -98322,44 +102502,47 @@ _0: return _mask } -// A foreign key constraint requires that the key columns in the parent -// table are collectively subject to a UNIQUE or PRIMARY KEY constraint. -// Given that pParent is the parent table for foreign key constraint pFKey, -// search the schema for a unique index on the parent key columns. -// -// If successful, zero is returned. If the parent key is an INTEGER PRIMARY -// KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx -// is set to point to the unique index. -// -// If the parent key consists of a single column (the foreign key constraint -// is not a composite foreign key), output variable *paiCol is set to NULL. -// Otherwise, it is set to point to an allocated array of size N, where -// N is the number of columns in the parent key. The first element of the -// array is the index of the child table column that is mapped by the FK -// constraint to the parent table column stored in the left-most column -// of index *ppIdx. The second element of the array is the index of the -// child table column that corresponds to the second left-most column of -// *ppIdx, and so on. -// -// If the required index cannot be found, either because: -// -// 1) The named parent key columns do not exist, or -// -// 2) The named parent key columns do exist, but are not subject to a -// UNIQUE or PRIMARY KEY constraint, or -// -// 3) No parent key columns were provided explicitly as part of the -// foreign key definition, and the parent table does not have a -// PRIMARY KEY, or -// -// 4) No parent key columns were provided explicitly as part of the -// foreign key definition, and the PRIMARY KEY of the parent table -// consists of a different number of columns to the child key in -// the child table. -// -// then non-zero is returned, and a "foreign key mismatch" error loaded -// into pParse. If an OOM error occurs, non-zero is returned and the -// pParse->db->mallocFailed flag is set. +// C comment +// /* +// ** A foreign key constraint requires that the key columns in the parent +// ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint. +// ** Given that pParent is the parent table for foreign key constraint pFKey, +// ** search the schema for a unique index on the parent key columns. +// ** +// ** If successful, zero is returned. If the parent key is an INTEGER PRIMARY +// ** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx +// ** is set to point to the unique index. +// ** +// ** If the parent key consists of a single column (the foreign key constraint +// ** is not a composite foreign key), output variable *paiCol is set to NULL. +// ** Otherwise, it is set to point to an allocated array of size N, where +// ** N is the number of columns in the parent key. The first element of the +// ** array is the index of the child table column that is mapped by the FK +// ** constraint to the parent table column stored in the left-most column +// ** of index *ppIdx. The second element of the array is the index of the +// ** child table column that corresponds to the second left-most column of +// ** *ppIdx, and so on. +// ** +// ** If the required index cannot be found, either because: +// ** +// ** 1) The named parent key columns do not exist, or +// ** +// ** 2) The named parent key columns do exist, but are not subject to a +// ** UNIQUE or PRIMARY KEY constraint, or +// ** +// ** 3) No parent key columns were provided explicitly as part of the +// ** foreign key definition, and the parent table does not have a +// ** PRIMARY KEY, or +// ** +// ** 4) No parent key columns were provided explicitly as part of the +// ** foreign key definition, and the PRIMARY KEY of the parent table +// ** consists of a different number of columns to the child key in +// ** the child table. +// ** +// ** then non-zero is returned, and a "foreign key mismatch" error loaded +// ** into pParse. If an OOM error occurs, non-zero is returned and the +// ** pParse->db->mallocFailed flag is set. +// */ func _sqlite3FkLocateIndex(tls *crt.TLS, _pParse *XParse, _pParent *XTable, _pFKey *XFKey, _ppIdx **XIndex, _paiCol **int32) (r0 int32) { var _10_iCol int16 var _nCol, _8_i, _9_i, _9_j int32 @@ -98369,10 +102552,10 @@ func _sqlite3FkLocateIndex(tls *crt.TLS, _pParse *XParse, _pParent *XTable, _pFK _pIdx = nil _aiCol = nil _nCol = _pFKey.X5 - _zKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _zKey = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(i32(0)))).X1 + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(i32(0)))).X1 func() { if _ppIdx == nil || (*_ppIdx) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000))), unsafe.Pointer(str(116826))) @@ -98443,10 +102626,10 @@ _27: if _8_i >= _nCol { goto _30 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_8_i))) = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_8_i))) = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_8_i))).X0 + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_8_i))).X0 _8_i += 1 goto _27 _30: @@ -98460,7 +102643,7 @@ _32: if _9_i >= _nCol { goto _35 } - _10_iCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_9_i))) + _10_iCol = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_9_i))) if int32(_10_iCol) < i32(0) { goto _35 } @@ -98468,7 +102651,7 @@ _32: if _10_zDfltColl == nil { _10_zDfltColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) } - if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_9_i))), _10_zDfltColl) != 0 { + if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_9_i))), _10_zDfltColl) != 0 { goto _35 } _10_zIdxCol = (*XColumn)(unsafe.Pointer(uintptr(_pParent.X1) + 32*uintptr(_10_iCol))).X0 @@ -98477,17 +102660,17 @@ _39: if _9_j >= _nCol { goto _42 } - if _sqlite3StrICmp(tls, (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + if _sqlite3StrICmp(tls, (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9)))))+16*uintptr(_9_j))).X1, _10_zIdxCol) != i32(0) { + })(unsafe.Pointer(&_pFKey.X9))))+16*uintptr(_9_j))).X1, _10_zIdxCol) != i32(0) { goto _43 } if _aiCol != nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_9_i))) = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_9_i))) = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_9_j))).X0 + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_9_j))).X0 } goto _42 _43: @@ -98511,10 +102694,10 @@ _20: if _pIdx != nil { goto _47 } - if (_pParse.X47) == 0 { + if _pParse.X47 == 0 { _sqlite3ErrorMsg(tls, _pParse, str(116874), unsafe.Pointer((*XTable)(_pFKey.X0).X0), unsafe.Pointer(_pFKey.X2)) } - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_aiCol)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_aiCol)) return i32(1) _47: @@ -98534,44 +102717,47 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FkOldmaskØ00__func__Ø000[0], str(116940), 17) } -// This is called to code the required FOR EACH ROW triggers for an operation -// on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) -// is given by the op parameter. The tr_tm parameter determines whether the -// BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then -// parameter pChanges is passed the list of columns being modified. -// -// If there are no triggers that fire at the specified time for the specified -// operation on pTab, this function is a no-op. -// -// The reg argument is the address of the first in an array of registers -// that contain the values substituted for the new.* and old.* references -// in the trigger program. If N is the number of columns in table pTab -// (a copy of pTab->nCol), then registers are populated as follows: -// -// Register Contains -// ------------------------------------------------------ -// reg+0 OLD.rowid -// reg+1 OLD.* value of left-most column of pTab -// ... ... -// reg+N OLD.* value of right-most column of pTab -// reg+N+1 NEW.rowid -// reg+N+2 OLD.* value of left-most column of pTab -// ... ... -// reg+N+N+1 NEW.* value of right-most column of pTab -// -// For ON DELETE triggers, the registers containing the NEW.* values will -// never be accessed by the trigger program, so they are not allocated or -// populated by the caller (there is no data to populate them with anyway). -// Similarly, for ON INSERT triggers the values stored in the OLD.* registers -// are never accessed, and so are not allocated by the caller. So, for an -// ON INSERT trigger, the value passed to this function as parameter reg -// is not a readable register, although registers (reg+N) through -// (reg+N+N+1) are. -// -// Parameter orconf is the default conflict resolution algorithm for the -// trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump -// is the instruction that control should jump to if a trigger program -// raises an IGNORE exception. +// C comment +// /* +// ** This is called to code the required FOR EACH ROW triggers for an operation +// ** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) +// ** is given by the op parameter. The tr_tm parameter determines whether the +// ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then +// ** parameter pChanges is passed the list of columns being modified. +// ** +// ** If there are no triggers that fire at the specified time for the specified +// ** operation on pTab, this function is a no-op. +// ** +// ** The reg argument is the address of the first in an array of registers +// ** that contain the values substituted for the new.* and old.* references +// ** in the trigger program. If N is the number of columns in table pTab +// ** (a copy of pTab->nCol), then registers are populated as follows: +// ** +// ** Register Contains +// ** ------------------------------------------------------ +// ** reg+0 OLD.rowid +// ** reg+1 OLD.* value of left-most column of pTab +// ** ... ... +// ** reg+N OLD.* value of right-most column of pTab +// ** reg+N+1 NEW.rowid +// ** reg+N+2 OLD.* value of left-most column of pTab +// ** ... ... +// ** reg+N+N+1 NEW.* value of right-most column of pTab +// ** +// ** For ON DELETE triggers, the registers containing the NEW.* values will +// ** never be accessed by the trigger program, so they are not allocated or +// ** populated by the caller (there is no data to populate them with anyway). +// ** Similarly, for ON INSERT triggers the values stored in the OLD.* registers +// ** are never accessed, and so are not allocated by the caller. So, for an +// ** ON INSERT trigger, the value passed to this function as parameter reg +// ** is not a readable register, although registers (reg+N) through +// ** (reg+N+N+1) are. +// ** +// ** Parameter orconf is the default conflict resolution algorithm for the +// ** trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump +// ** is the instruction that control should jump to if a trigger program +// ** raises an IGNORE exception. +// */ func _sqlite3CodeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _op int32, _pChanges *XExprList, _tr_tm int32, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) { var _p *XTrigger func() { @@ -98629,10 +102815,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerØ00__func__Ø000[0], str(117181), 22) } -// Generate code for the trigger program associated with trigger p on -// table pTab. The reg, orconf and ignoreJump parameters passed to this -// function are the same as those described in the header function for -// sqlite3CodeRowTrigger() +// C comment +// /* +// ** Generate code for the trigger program associated with trigger p on +// ** table pTab. The reg, orconf and ignoreJump parameters passed to this +// ** function are the same as those described in the header function for +// ** sqlite3CodeRowTrigger() +// */ func _sqlite3CodeRowTriggerDirect(tls *crt.TLS, _pParse *XParse, _p *XTrigger, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) { var _1_bRecursive int32 var _v *TVdbe @@ -98640,17 +102829,17 @@ func _sqlite3CodeRowTriggerDirect(tls *crt.TLS, _pParse *XParse, _p *XTrigger, _ _v = _sqlite3GetVdbe(tls, _pParse) _pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf) func() { - if _pPrg == nil && (_pParse.X16) == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 { + if _pPrg == nil && _pParse.X16 == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerDirectØ00__func__Ø000))), unsafe.Pointer(str(117203))) crt.X__builtin_abort(tls) } }() if _pPrg != nil { - _1_bRecursive = bool2int(((_p.X0) != nil) && (i32(0) == (((*Xsqlite3)(_pParse.X0).X6) & i32(262144)))) - _sqlite3VdbeAddOp4(tls, _v, i32(44), _reg, _ignoreJump, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1), (*int8)(unsafe.Pointer((*XSubProgram)(_pPrg.X2))), i32(-13)) + _1_bRecursive = bool2int((_p.X0 != nil) && (i32(0) == (((*Xsqlite3)(_pParse.X0).X6) & i32(262144)))) + _sqlite3VdbeAddOp4(tls, _v, i32(44), _reg, _ignoreJump, preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1), (*int8)(unsafe.Pointer((*XSubProgram)(_pPrg.X2))), i32(-13)) _sqlite3VdbeComment(tls, _v, str(117252), unsafe.Pointer(func() *int8 { - if (_p.X0) != nil { - return (_p.X0) + if _p.X0 != nil { + return _p.X0 } return str(117264) }()), unsafe.Pointer(_onErrorText(tls, _orconf))) @@ -98664,87 +102853,90 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerDirectØ00__func__Ø000[0], str(117269), 28) } -// Generate code to do constraint checks prior to an INSERT or an UPDATE -// on table pTab. -// -// The regNewData parameter is the first register in a range that contains -// the data to be inserted or the data after the update. There will be -// pTab->nCol+1 registers in this range. The first register (the one -// that regNewData points to) will contain the new rowid, or NULL in the -// case of a WITHOUT ROWID table. The second register in the range will -// contain the content of the first table column. The third register will -// contain the content of the second table column. And so forth. -// -// The regOldData parameter is similar to regNewData except that it contains -// the data prior to an UPDATE rather than afterwards. regOldData is zero -// for an INSERT. This routine can distinguish between UPDATE and INSERT by -// checking regOldData for zero. -// -// For an UPDATE, the pkChng boolean is true if the true primary key (the -// rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table) -// might be modified by the UPDATE. If pkChng is false, then the key of -// the iDataCur content table is guaranteed to be unchanged by the UPDATE. -// -// For an INSERT, the pkChng boolean indicates whether or not the rowid -// was explicitly specified as part of the INSERT statement. If pkChng -// is zero, it means that the either rowid is computed automatically or -// that the table is a WITHOUT ROWID table and has no rowid. On an INSERT, -// pkChng will only be true if the INSERT statement provides an integer -// value for either the rowid column or its INTEGER PRIMARY KEY alias. -// -// The code generated by this routine will store new index entries into -// registers identified by aRegIdx[]. No index entry is created for -// indices where aRegIdx[i]==0. The order of indices in aRegIdx[] is -// the same as the order of indices on the linked list of indices -// at pTab->pIndex. -// -// The caller must have already opened writeable cursors on the main -// table and all applicable indices (that is to say, all indices for which -// aRegIdx[] is not zero). iDataCur is the cursor for the main table when -// inserting or updating a rowid table, or the cursor for the PRIMARY KEY -// index when operating on a WITHOUT ROWID table. iIdxCur is the cursor -// for the first index in the pTab->pIndex list. Cursors for other indices -// are at iIdxCur+N for the N-th element of the pTab->pIndex list. -// -// This routine also generates code to check constraints. NOT NULL, -// CHECK, and UNIQUE constraints are all checked. If a constraint fails, -// then the appropriate action is performed. There are five possible -// actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE. -// -// Constraint type Action What Happens -// --------------- ---------- ---------------------------------------- -// any ROLLBACK The current transaction is rolled back and -// sqlite3_step() returns immediately with a -// return code of SQLITE_CONSTRAINT. -// -// any ABORT Back out changes from the current command -// only (do not do a complete rollback) then -// cause sqlite3_step() to return immediately -// with SQLITE_CONSTRAINT. -// -// any FAIL Sqlite3_step() returns immediately with a -// return code of SQLITE_CONSTRAINT. The -// transaction is not rolled back and any -// changes to prior rows are retained. -// -// any IGNORE The attempt in insert or update the current -// row is skipped, without throwing an error. -// Processing continues with the next row. -// (There is an immediate jump to ignoreDest.) -// -// NOT NULL REPLACE The NULL value is replace by the default -// value for that column. If the default value -// is NULL, the action is the same as ABORT. -// -// UNIQUE REPLACE The other row that conflicts with the row -// being inserted is removed. -// -// CHECK REPLACE Illegal. The results in an exception. -// -// Which action to take is determined by the overrideError parameter. -// Or if overrideError==OE_Default, then the pParse->onError parameter -// is used. Or if pParse->onError==OE_Default then the onError value -// for the constraint is used. +// C comment +// /* +// ** Generate code to do constraint checks prior to an INSERT or an UPDATE +// ** on table pTab. +// ** +// ** The regNewData parameter is the first register in a range that contains +// ** the data to be inserted or the data after the update. There will be +// ** pTab->nCol+1 registers in this range. The first register (the one +// ** that regNewData points to) will contain the new rowid, or NULL in the +// ** case of a WITHOUT ROWID table. The second register in the range will +// ** contain the content of the first table column. The third register will +// ** contain the content of the second table column. And so forth. +// ** +// ** The regOldData parameter is similar to regNewData except that it contains +// ** the data prior to an UPDATE rather than afterwards. regOldData is zero +// ** for an INSERT. This routine can distinguish between UPDATE and INSERT by +// ** checking regOldData for zero. +// ** +// ** For an UPDATE, the pkChng boolean is true if the true primary key (the +// ** rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table) +// ** might be modified by the UPDATE. If pkChng is false, then the key of +// ** the iDataCur content table is guaranteed to be unchanged by the UPDATE. +// ** +// ** For an INSERT, the pkChng boolean indicates whether or not the rowid +// ** was explicitly specified as part of the INSERT statement. If pkChng +// ** is zero, it means that the either rowid is computed automatically or +// ** that the table is a WITHOUT ROWID table and has no rowid. On an INSERT, +// ** pkChng will only be true if the INSERT statement provides an integer +// ** value for either the rowid column or its INTEGER PRIMARY KEY alias. +// ** +// ** The code generated by this routine will store new index entries into +// ** registers identified by aRegIdx[]. No index entry is created for +// ** indices where aRegIdx[i]==0. The order of indices in aRegIdx[] is +// ** the same as the order of indices on the linked list of indices +// ** at pTab->pIndex. +// ** +// ** The caller must have already opened writeable cursors on the main +// ** table and all applicable indices (that is to say, all indices for which +// ** aRegIdx[] is not zero). iDataCur is the cursor for the main table when +// ** inserting or updating a rowid table, or the cursor for the PRIMARY KEY +// ** index when operating on a WITHOUT ROWID table. iIdxCur is the cursor +// ** for the first index in the pTab->pIndex list. Cursors for other indices +// ** are at iIdxCur+N for the N-th element of the pTab->pIndex list. +// ** +// ** This routine also generates code to check constraints. NOT NULL, +// ** CHECK, and UNIQUE constraints are all checked. If a constraint fails, +// ** then the appropriate action is performed. There are five possible +// ** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE. +// ** +// ** Constraint type Action What Happens +// ** --------------- ---------- ---------------------------------------- +// ** any ROLLBACK The current transaction is rolled back and +// ** sqlite3_step() returns immediately with a +// ** return code of SQLITE_CONSTRAINT. +// ** +// ** any ABORT Back out changes from the current command +// ** only (do not do a complete rollback) then +// ** cause sqlite3_step() to return immediately +// ** with SQLITE_CONSTRAINT. +// ** +// ** any FAIL Sqlite3_step() returns immediately with a +// ** return code of SQLITE_CONSTRAINT. The +// ** transaction is not rolled back and any +// ** changes to prior rows are retained. +// ** +// ** any IGNORE The attempt in insert or update the current +// ** row is skipped, without throwing an error. +// ** Processing continues with the next row. +// ** (There is an immediate jump to ignoreDest.) +// ** +// ** NOT NULL REPLACE The NULL value is replace by the default +// ** value for that column. If the default value +// ** is NULL, the action is the same as ABORT. +// ** +// ** UNIQUE REPLACE The other row that conflicts with the row +// ** being inserted is removed. +// ** +// ** CHECK REPLACE Illegal. The results in an exception. +// ** +// ** Which action to take is determined by the overrideError parameter. +// ** Or if overrideError==OE_Default, then the pParse->onError parameter +// ** is used. Or if pParse->onError==OE_Default then the onError value +// ** for the constraint is used. +// */ func _sqlite3GenerateConstraintChecks(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aRegIdx *int32, _iDataCur int32, _iIdxCur int32, _regNewData int32, _regOldData int32, _pkChng uint8, _overrideError uint8, _ignoreDest int32, _pbMayReplace *int32, _aiChng *int32) { var _i, _ix, _nCol, _onError, _addr1, _seenReplace, _nPkField, _ipkTop, _ipkBottom, _14_allOk, _17_addrRowidOk, _34_regIdx, _34_regR, _34_iThisCur, _34_addrUniqueOk, _37_iField, _37_x, _50_x, _53_addrJump, _53_op, _53_regCmp int32 var _10_zMsg, _16_zName, _54_p4 *int8 @@ -98776,7 +102968,7 @@ func _sqlite3GenerateConstraintChecks(tls *crt.TLS, _pParse *XParse, _pTab *XTab } }() _nCol = int32(_pTab.X11) - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _pPk = nil _nPkField = i32(1) goto _5 @@ -98792,7 +102984,7 @@ _6: if _i == int32(_pTab.X10) { goto _7 } - if (_aiChng != nil) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiChng)) + 4*uintptr(_i)))) < i32(0)) { + if (_aiChng != nil) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiChng)) + 4*uintptr(_i)))) < i32(0)) { goto _7 } _onError = int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_i))).X3) @@ -98834,7 +103026,7 @@ _26: _27: _10_zMsg = _sqlite3MPrintf(tls, _db, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_i))).X0)) _sqlite3VdbeAddOp3(tls, _v, i32(54), i32(1299), _onError, (_regNewData+i32(1))+_i) - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_10_zMsg), i32(-1)) + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_10_zMsg), i32(-1)) _sqlite3VdbeChangeP5(tls, _v, uint16(i32(1))) goto _31 _29: @@ -98856,11 +103048,11 @@ _7: _i += 1 goto _6 _9: - if (*XExprList)(_pTab.X6) == nil || ((_db.X6)&i32(8192)) != i32(0) { + if _pTab.X6 == nil || (_db.X6&i32(8192)) != i32(0) { goto _35 } _13_pCheck = (*XExprList)(_pTab.X6) - *(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X21)) = _regNewData + i32(1) _onError = func() int32 { if int32(_overrideError) != i32(10) { return int32(_overrideError) @@ -98869,10 +103061,10 @@ _9: }() _i = i32(0) _38: - if _i >= (_13_pCheck.X0) { + if _i >= _13_pCheck.X0 { goto _41 } - _14_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pCheck.X2))))) + 32*uintptr(_i))).X0) + _14_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_13_pCheck.X2)))) + 32*uintptr(_i))).X0) if (_aiChng != nil) && _checkConstraintUnchanged(tls, _14_pExpr, _aiChng, int32(_pkChng)) != 0 { goto _39 } @@ -98882,7 +103074,7 @@ _38: _sqlite3VdbeGoto(tls, _v, _ignoreDest) goto _45 } - _16_zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pCheck.X2))))) + 32*uintptr(_i))).X1 + _16_zName = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_13_pCheck.X2)))) + 32*uintptr(_i))).X1 if _16_zName == nil { _16_zName = _pTab.X0 } @@ -98953,7 +103145,7 @@ _64: goto _69 _67: _27_pTrigger = nil - if ((_db.X6) & i32(262144)) != 0 { + if (_db.X6 & i32(262144)) != 0 { _27_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil) } if (_27_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, i32(0)) != 0 { @@ -98961,7 +103153,7 @@ _67: _sqlite3GenerateRowDelete(tls, _pParse, _pTab, _27_pTrigger, _iDataCur, _iIdxCur, _regNewData, int16(i32(1)), uint8(i32(0)), uint8(i32(5)), uint8(i32(1)), i32(-1)) goto _73 } - if (*XIndex)(_pTab.X2) != nil { + if _pTab.X2 != nil { _sqlite3MultiWrite(tls, _pParse) _sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, i32(-1)) } @@ -98983,7 +103175,7 @@ _76: if _pIdx == nil { goto _79 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) == i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_ix)))) == i32(0) { goto _77 } if int32(_bAffinityDone) == i32(0) { @@ -98992,23 +103184,23 @@ _76: } _34_iThisCur = _iIdxCur + _ix _34_addrUniqueOk = _sqlite3VdbeMakeLabel(tls, _v) - if (*XExpr)(_pIdx.X9) != nil { - _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) - *(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1) + if _pIdx.X9 != nil { + _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_ix)))) + *(*int32)(unsafe.Pointer(&_pParse.X21)) = _regNewData + i32(1) _sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.X9), _34_addrUniqueOk, i32(16)) - *(*int32)(unsafe.Pointer(&(_pParse.X21))) = i32(0) + *(*int32)(unsafe.Pointer(&_pParse.X21)) = i32(0) } - _34_regIdx = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) + i32(1) + _34_regIdx = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_ix)))) + i32(1) _i = i32(0) _83: if _i >= int32(_pIdx.X14) { goto _86 } - _37_iField = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) + _37_iField = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) if _37_iField == i32(-2) { - *(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1) - _sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_i))).X0), _34_regIdx+_i) - *(*int32)(unsafe.Pointer(&(_pParse.X21))) = i32(0) + *(*int32)(unsafe.Pointer(&_pParse.X21)) = _regNewData + i32(1) + _sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+32*uintptr(_i))).X0), _34_regIdx+_i) + *(*int32)(unsafe.Pointer(&_pParse.X21)) = i32(0) _sqlite3VdbeComment(tls, _v, str(117424), unsafe.Pointer(_pIdx.X0), _i) goto _88 } @@ -99034,7 +103226,7 @@ _88: _i += 1 goto _83 _86: - _sqlite3VdbeAddOp3(tls, _v, i32(101), _34_regIdx, int32(_pIdx.X14), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) + _sqlite3VdbeAddOp3(tls, _v, i32(101), _34_regIdx, int32(_pIdx.X14), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_ix)))) _sqlite3VdbeComment(tls, _v, str(107188), unsafe.Pointer(_pIdx.X0)) if ((_isUpdate != 0) && (_pPk == _pIdx)) && (int32(_pkChng) == i32(0)) { _sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk) @@ -99053,7 +103245,7 @@ _86: _onError = i32(2) } _102: - if (((((_ix == i32(0)) && ((*XIndex)(_pIdx.X5) == nil)) && (_pPk == _pIdx)) && (_onError == i32(5))) && ((i32(0) == ((_db.X6) & i32(262144))) || (nil == _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)))) && ((i32(0) == ((_db.X6) & i32(524288))) || ((nil == (*XFKey)(_pTab.X4)) && (nil == _sqlite3FkReferences(tls, _pTab)))) { + if (((((_ix == i32(0)) && ((*XIndex)(_pIdx.X5) == nil)) && (_pPk == _pIdx)) && (_onError == i32(5))) && ((i32(0) == (_db.X6 & i32(262144))) || (nil == _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)))) && ((i32(0) == (_db.X6 & i32(524288))) || ((nil == (*XFKey)(_pTab.X4)) && (nil == _sqlite3FkReferences(tls, _pTab)))) { _sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk) goto _77 } @@ -99067,7 +103259,7 @@ _102: if _isUpdate == 0 && _onError != i32(5) { goto _115 } - if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { goto _116 } _sqlite3VdbeAddOp2(tls, _v, i32(131), _34_iThisCur, _34_regR) @@ -99086,14 +103278,14 @@ _120: goto _123 } func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(115265))) crt.X__builtin_abort(tls) } }() - _50_x = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) + _50_x = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i))))) _sqlite3VdbeAddOp3(tls, _v, i32(99), _34_iThisCur, _50_x, _34_regR+_i) - _sqlite3VdbeComment(tls, _v, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))))).X0)) + _sqlite3VdbeComment(tls, _v, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))))).X0)) _i += 1 goto _120 _123: @@ -99114,8 +103306,8 @@ _129: if _i >= int32(_pPk.X13) { goto _132 } - _54_p4 = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 8*uintptr(_i)))))) - _50_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) + _54_p4 = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X8)) + 8*uintptr(_i)))))) + _50_x = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPk.X1)) + 2*uintptr(_i)))) func() { if _50_x < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110453), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(109743))) @@ -99168,7 +103360,7 @@ _147: } }() _sqlite3MultiWrite(tls, _pParse) - if ((_db.X6) & i32(262144)) != 0 { + if (_db.X6 & i32(262144)) != 0 { _59_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil) } _sqlite3GenerateRowDelete(tls, _pParse, _pTab, _59_pTrigger, _iDataCur, _iIdxCur, _34_regR, int16(_nPkField), uint8(i32(0)), uint8(i32(5)), uint8(func() int32 { @@ -99201,38 +103393,43 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GenerateConstraintChecksØ00__func__Ø000[0], str(117437), 32) } -// pExpr is a CHECK constraint on a row that is being UPDATE-ed. The -// only columns that are modified by the UPDATE are those for which -// aiChng[i]>=0, and also the ROWID is modified if chngRowid is true. -// -// Return true if CHECK constraint pExpr does not use any of the -// changing columns (or the rowid if it is changing). In other words, -// return true if this CHECK constraint can be skipped when validating -// the new row in the UPDATE statement. +// C comment +// /* +// ** pExpr is a CHECK constraint on a row that is being UPDATE-ed. The +// ** only columns that are modified by the UPDATE are those for which +// ** aiChng[i]>=0, and also the ROWID is modified if chngRowid is true. +// ** +// ** Return true if CHECK constraint pExpr does not use any of the +// ** changing columns (or the rowid if it is changing). In other words, +// ** return true if this CHECK constraint can be skipped when validating +// ** the new row in the UPDATE statement. +// */ func _checkConstraintUnchanged(tls *crt.TLS, _pExpr *XExpr, _aiChng *int32, _chngRowid int32) (r0 int32) { var _w XWalker - crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u64(48)) - *(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(0)) - *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _checkConstraintExprNode - *(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))) = _aiChng + crt.Xmemset(tls, unsafe.Pointer(&_w), i32(0), u64(48)) + *(*uint8)(unsafe.Pointer(&_w.X5)) = uint8(i32(0)) + *(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_w.X1)))) = _checkConstraintExprNode + *(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_w.X6)))) = _aiChng _sqlite3WalkExpr(tls, &_w, _pExpr) if _chngRowid == 0 { { - p := (*uint8)(unsafe.Pointer(&(_w.X5))) + p := (*uint8)(unsafe.Pointer(&_w.X5)) *p = uint8(int32(*p) & i32(-3)) sink2(*p) } } - return bool2int((_w.X5) == 0) + return bool2int(_w.X5 == 0) _ = _w panic(0) } -// This is the Walker callback from checkConstraintUnchanged(). Set -// bit 0x01 of pWalker->eCode if -// pWalker->eCode to 0 if this expression node references any of the -// columns that are being modifed by an UPDATE statement. +// C comment +// /* This is the Walker callback from checkConstraintUnchanged(). Set +// ** bit 0x01 of pWalker->eCode if +// ** pWalker->eCode to 0 if this expression node references any of the +// ** columns that are being modifed by an UPDATE statement. +// */ func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) { if int32(_pExpr.X0) != i32(152) { goto _0 @@ -99246,9 +103443,9 @@ func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r if int32(_pExpr.X9) < i32(0) { goto _4 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))) + 4*uintptr(_pExpr.X9)))) >= i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&_pWalker.X6)))))) + 4*uintptr(_pExpr.X9)))) >= i32(0) { { - p := (*uint8)(unsafe.Pointer(&(_pWalker.X5))) + p := (*uint8)(unsafe.Pointer(&_pWalker.X5)) *p = uint8(int32(*p) | i32(1)) sink2(*p) } @@ -99256,7 +103453,7 @@ func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r goto _6 _4: { - p := (*uint8)(unsafe.Pointer(&(_pWalker.X5))) + p := (*uint8)(unsafe.Pointer(&_pWalker.X5)) *p = uint8(int32(*p) | i32(2)) sink2(*p) } @@ -99271,7 +103468,10 @@ func init() { crt.Xstrncpy(nil, &_checkConstraintExprNodeØ00__func__Ø000[0], str(117509), 24) } -// Code an OP_Halt due to non-unique rowid. +// C comment +// /* +// ** Code an OP_Halt due to non-unique rowid. +// */ func _sqlite3RowidConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pTab *XTable) { var _rc int32 var _zMsg *int8 @@ -99286,38 +103486,44 @@ _1: _sqlite3HaltConstraint(tls, _pParse, _rc, _onError, _zMsg, int8(i32(-1)), uint8(i32(2))) } -// Indicate that the statement currently under construction might write -// more than one entry (example: deleting one row then inserting another, -// inserting multiple rows in a table, or inserting a row and index entries.) -// If an abort occurs after some of these writes have completed, then it will -// be necessary to undo the completed writes. +// C comment +// /* +// ** Indicate that the statement currently under construction might write +// ** more than one entry (example: deleting one row then inserting another, +// ** inserting multiple rows in a table, or inserting a row and index entries.) +// ** If an abort occurs after some of these writes have completed, then it will +// ** be necessary to undo the completed writes. +// */ func _sqlite3MultiWrite(tls *crt.TLS, _pParse *XParse) { var _pToplevel *XParse _pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() - *(*uint8)(unsafe.Pointer(&(_pToplevel.X8))) = uint8(i32(1)) -} - -// This routine generates VDBE code that causes the deletion of all -// index entries associated with a single row of a single table, pTab -// -// Preconditions: -// -// 1. A read/write cursor "iDataCur" must be open on the canonical storage -// btree for the table pTab. (This will be either the table itself -// for rowid tables or to the primary key index for WITHOUT ROWID -// tables.) -// -// 2. Read/write cursors for all indices of pTab must be open as -// cursor number iIdxCur+i for the i-th index. (The pTab->pIndex -// index is the 0-th index.) -// -// 3. The "iDataCur" cursor must be already be positioned on the row -// that is to be deleted. + *(*uint8)(unsafe.Pointer(&_pToplevel.X8)) = uint8(i32(1)) +} + +// C comment +// /* +// ** This routine generates VDBE code that causes the deletion of all +// ** index entries associated with a single row of a single table, pTab +// ** +// ** Preconditions: +// ** +// ** 1. A read/write cursor "iDataCur" must be open on the canonical storage +// ** btree for the table pTab. (This will be either the table itself +// ** for rowid tables or to the primary key index for WITHOUT ROWID +// ** tables.) +// ** +// ** 2. Read/write cursors for all indices of pTab must be open as +// ** cursor number iIdxCur+i for the i-th index. (The pTab->pIndex +// ** index is the 0-th index.) +// ** +// ** 3. The "iDataCur" cursor must be already be positioned on the row +// ** that is to be deleted. +// */ func _sqlite3GenerateRowIndexDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _aRegIdx *int32, _iIdxNoSeek int32) { var _i, _r1, _iPartIdxLabel int32 var _v *TVdbe @@ -99326,7 +103532,7 @@ func _sqlite3GenerateRowIndexDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable _pPrior = nil _v = (*TVdbe)(_pParse.X2) _pPk = func() *XIndex { - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { return nil } return _sqlite3PrimaryKeyIndex(tls, _pTab) @@ -99342,7 +103548,7 @@ _2: crt.X__builtin_abort(tls) } }() - if (_aRegIdx != nil) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i)))) == i32(0)) { + if (_aRegIdx != nil) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i)))) == i32(0)) { goto _3 } if _pIdx == _pPk { @@ -99353,10 +103559,10 @@ _2: } _r1 = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _iDataCur, i32(0), i32(1), &_iPartIdxLabel, _pPrior, _r1) _sqlite3VdbeAddOp3(tls, _v, i32(129), _iIdxCur+_i, _r1, int32(func() uint16 { - if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { - return (_pIdx.X13) + if ((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { + return _pIdx.X13 } - return (_pIdx.X14) + return _pIdx.X14 }())) _sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel) _pPrior = _pIdx @@ -99372,24 +103578,27 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GenerateRowIndexDeleteØ00__func__Ø000[0], str(117575), 30) } -// This function is called when inserting, deleting or updating a row of -// table pTab to generate VDBE code to perform foreign key constraint -// processing for the operation. -// -// For a DELETE operation, parameter regOld is passed the index of the -// first register in an array of (pTab->nCol+1) registers containing the -// rowid of the row being deleted, followed by each of the column values -// of the row being deleted, from left to right. Parameter regNew is passed -// zero in this case. -// -// For an INSERT operation, regOld is passed zero and regNew is passed the -// first register of an array of (pTab->nCol+1) registers containing the new -// row data. -// -// For an UPDATE operation, this function is called twice. Once before -// the original record is deleted from the table using the calling convention -// described for DELETE. Then again after the original record is deleted -// but before the new record is inserted using the INSERT convention. +// C comment +// /* +// ** This function is called when inserting, deleting or updating a row of +// ** table pTab to generate VDBE code to perform foreign key constraint +// ** processing for the operation. +// ** +// ** For a DELETE operation, parameter regOld is passed the index of the +// ** first register in an array of (pTab->nCol+1) registers containing the +// ** rowid of the row being deleted, followed by each of the column values +// ** of the row being deleted, from left to right. Parameter regNew is passed +// ** zero in this case. +// ** +// ** For an INSERT operation, regOld is passed zero and regNew is passed the +// ** first register of an array of (pTab->nCol+1) registers containing the new +// ** row data. +// ** +// ** For an UPDATE operation, this function is called twice. Once before +// ** the original record is deleted from the table using the calling convention +// ** described for DELETE. Then again after the original record is deleted +// ** but before the new record is inserted using the INSERT convention. +// */ func _sqlite3FkCheck(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regOld int32, _regNew int32, _aChange *int32, _bChngRowid int32) { var _iDb, _isIgnoreErrors, _1_iCol, _1_i, _1_bIgnore, _6_iJump, _7_iReg, _12_rcauth, _21_eAction int32 var _1_aiFree, _1_aiCol, _15_aiCol *int32 @@ -99409,7 +103618,7 @@ func _sqlite3FkCheck(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regOld int32 crt.X__builtin_abort(tls) } }() - if ((_db.X6) & i32(524288)) == i32(0) { + if (_db.X6 & i32(524288)) == i32(0) { return } _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) @@ -99425,7 +103634,7 @@ _3: if ((_aChange != nil) && (Xsqlite3_stricmp(tls, _pTab.X0, _pFKey.X2) != i32(0))) && (_fkChildIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == i32(0)) { goto _4 } - if (_pParse.X47) != 0 { + if _pParse.X47 != 0 { _1_pTo = _sqlite3FindTable(tls, _db, _pFKey.X2, _zDb) goto _11 } @@ -99440,23 +103649,23 @@ _11: crt.X__builtin_abort(tls) } }() - if (_isIgnoreErrors == 0) || ((_db.X17) != 0) { + if (_isIgnoreErrors == 0) || (_db.X17 != 0) { return } if _1_pTo != nil { goto _20 } _6_v = _sqlite3GetVdbe(tls, _pParse) - _6_iJump = (_sqlite3VdbeCurrentAddr(tls, _6_v) + (_pFKey.X5)) + i32(1) + _6_iJump = (_sqlite3VdbeCurrentAddr(tls, _6_v) + _pFKey.X5) + i32(1) _1_i = i32(0) _21: - if _1_i >= (_pFKey.X5) { + if _1_i >= _pFKey.X5 { goto _24 } - _7_iReg = (((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _7_iReg = (((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(_1_i))).X0) + _regOld) + i32(1) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(_1_i))).X0) + _regOld) + i32(1) _sqlite3VdbeAddOp2(tls, _6_v, i32(75), _7_iReg, _6_iJump) _1_i += 1 goto _21 @@ -99466,7 +103675,7 @@ _20: goto _4 _13: func() { - if (_pFKey.X5) != i32(1) && (_1_aiFree == nil || _1_pIdx == nil) { + if _pFKey.X5 != i32(1) && (_1_aiFree == nil || _1_pIdx == nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117676))) crt.X__builtin_abort(tls) } @@ -99475,32 +103684,32 @@ _13: _1_aiCol = _1_aiFree goto _30 } - _1_iCol = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _1_iCol = (*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(i32(0)))).X0 + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(i32(0)))).X0 _1_aiCol = &_1_iCol _30: _1_i = i32(0) _31: - if _1_i >= (_pFKey.X5) { + if _1_i >= _pFKey.X5 { goto _34 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aiCol)) + 4*uintptr(_1_i)))) == int32(_pTab.X10) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aiCol)) + 4*uintptr(_1_i))) = i32(-1) + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aiCol)) + 4*uintptr(_1_i)))) == int32(_pTab.X10) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aiCol)) + 4*uintptr(_1_i))) = i32(-1) } func() { - if _1_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) { + if _1_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108349), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117711))) crt.X__builtin_abort(tls) } }() - if (_db.X59) != nil { + if _db.X59 != nil { _12_zCol = (*XColumn)(unsafe.Pointer(uintptr(_1_pTo.X1) + 32*uintptr(func() int16 { if _1_pIdx != nil { - return (*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(_1_i)))) + return (*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pIdx.X1)) + 2*uintptr(_1_i)))) } - return (_1_pTo.X10) + return _1_pTo.X10 }()))).X0 _12_rcauth = _sqlite3AuthReadCol(tls, _pParse, _1_pTo.X0, _12_zCol, _iDb) _1_bIgnore = bool2int(_12_rcauth == i32(2)) @@ -99509,14 +103718,14 @@ _31: goto _31 _34: _sqlite3TableLock(tls, _pParse, _iDb, _1_pTo.X7, uint8(i32(0)), _1_pTo.X0) - *(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X17)) += 1 if _regOld != i32(0) { _fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regOld, i32(-1), _1_bIgnore) } if (_regNew != i32(0)) && (_isSetNullAction(tls, _pParse, _pFKey) == 0) { _fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regNew, i32(1), _1_bIgnore) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_aiFree)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_aiFree)) _4: _pFKey = (*XFKey)(_pFKey.X1) goto _3 @@ -99531,7 +103740,7 @@ _45: if (_aChange != nil) && (_fkParentIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == i32(0)) { goto _46 } - if ((((_pFKey.X6) == 0) && (((_db.X6) & i32(33554432)) == 0)) && ((*XParse)(_pParse.X39) == nil)) && ((_pParse.X8) == 0) { + if (((_pFKey.X6 == 0) && ((_db.X6 & i32(33554432)) == 0)) && (_pParse.X39 == nil)) && (_pParse.X8 == 0) { func() { if _regOld != i32(0) || _regNew == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117743))) @@ -99543,13 +103752,13 @@ _45: if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_15_pIdx, &_15_aiCol) == 0 { goto _58 } - if (_isIgnoreErrors == 0) || ((_db.X17) != 0) { + if (_isIgnoreErrors == 0) || (_db.X17 != 0) { return } goto _46 _58: func() { - if _15_aiCol == nil && (_pFKey.X5) != i32(1) { + if _15_aiCol == nil && _pFKey.X5 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108414), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117766))) crt.X__builtin_abort(tls) } @@ -99558,27 +103767,27 @@ _58: if _15_pSrc == nil { goto _64 } - _19_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_15_pSrc.X2))))) - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pItem.X4))))) = (*XTable)(_pFKey.X0) - *(**int8)(unsafe.Pointer(&(_19_pItem.X2))) = (*XTable)(_pFKey.X0).X0 + _19_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_15_pSrc.X2)))) + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_19_pItem.X4)))) = (*XTable)(_pFKey.X0) + *(**int8)(unsafe.Pointer(&_19_pItem.X2)) = (*XTable)(_pFKey.X0).X0 *(*uint32)(unsafe.Pointer(&((*XTable)(_19_pItem.X4).X8))) += 1 - *(*int32)(unsafe.Pointer(&(_19_pItem.X11))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + *(*int32)(unsafe.Pointer(&_19_pItem.X11)) = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) if _regNew != i32(0) { _fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regNew, i32(-1)) } if _regOld == i32(0) { goto _66 } - _21_eAction = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(bool2int(_aChange != nil))))) + _21_eAction = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(bool2int(_aChange != nil))))) _fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regOld, i32(1)) - if (((_pFKey.X6) == 0) && (_21_eAction != i32(9))) && (_21_eAction != i32(7)) { + if ((_pFKey.X6 == 0) && (_21_eAction != i32(9))) && (_21_eAction != i32(7)) { _sqlite3MayAbort(tls, _pParse) } _66: - *(**int8)(unsafe.Pointer(&(_19_pItem.X2))) = nil + *(**int8)(unsafe.Pointer(&_19_pItem.X2)) = nil _sqlite3SrcListDelete(tls, _db, _15_pSrc) _64: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_15_aiCol)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_15_aiCol)) _46: _pFKey = (*XFKey)(_pFKey.X3) goto _45 @@ -99592,45 +103801,48 @@ func init() { crt.Xstrncpy(nil, &_sqlite3FkCheckØ00__func__Ø000[0], str(117790), 15) } -// This function is called when a row is inserted into or deleted from the -// child table of foreign key constraint pFKey. If an SQL UPDATE is executed -// on the child table of pFKey, this function is invoked twice for each row -// affected - once to "delete" the old row, and then again to "insert" the -// new row. -// -// Each time it is called, this function generates VDBE code to locate the -// row in the parent table that corresponds to the row being inserted into -// or deleted from the child table. If the parent row can be found, no -// special action is taken. Otherwise, if the parent row can *not* be -// found in the parent table: -// -// Operation | FK type | Action taken -// -------------------------------------------------------------------------- -// INSERT immediate Increment the "immediate constraint counter". -// -// DELETE immediate Decrement the "immediate constraint counter". -// -// INSERT deferred Increment the "deferred constraint counter". -// -// DELETE deferred Decrement the "deferred constraint counter". -// -// These operations are identified in the comment at the top of this file -// (fkey.c) as "I.1" and "D.1". +// C comment +// /* +// ** This function is called when a row is inserted into or deleted from the +// ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed +// ** on the child table of pFKey, this function is invoked twice for each row +// ** affected - once to "delete" the old row, and then again to "insert" the +// ** new row. +// ** +// ** Each time it is called, this function generates VDBE code to locate the +// ** row in the parent table that corresponds to the row being inserted into +// ** or deleted from the child table. If the parent row can be found, no +// ** special action is taken. Otherwise, if the parent row can *not* be +// ** found in the parent table: +// ** +// ** Operation | FK type | Action taken +// ** -------------------------------------------------------------------------- +// ** INSERT immediate Increment the "immediate constraint counter". +// ** +// ** DELETE immediate Decrement the "immediate constraint counter". +// ** +// ** INSERT deferred Increment the "deferred constraint counter". +// ** +// ** DELETE deferred Decrement the "deferred constraint counter". +// ** +// ** These operations are identified in the comment at the top of this file +// ** (fkey.c) as "I.1" and "D.1". +// */ func _fkLookupParent(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32, _isIgnore int32) { var _i, _iCur, _iOk, _2_iReg, _4_iMustBeInt, _4_regTemp, _6_nCol, _6_regTemp, _6_regRec, _8_iJump, _9_iChild, _9_iParent int32 var _v *TVdbe _v = _sqlite3GetVdbe(tls, _pParse) - _iCur = (_pParse.X17) - i32(1) + _iCur = _pParse.X17 - i32(1) _iOk = _sqlite3VdbeMakeLabel(tls, _v) if _nIncr < i32(0) { _sqlite3VdbeAddOp2(tls, _v, i32(45), int32(_pFKey.X6), _iOk) } _i = i32(0) _1: - if _i >= (_pFKey.X5) { + if _i >= _pFKey.X5 { goto _4 } - _2_iReg = ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) + _regData) + i32(1) + _2_iReg = ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_i)))) + _regData) + i32(1) _sqlite3VdbeAddOp2(tls, _v, i32(75), _2_iReg, _iOk) _i += 1 goto _1 @@ -99642,7 +103854,7 @@ _4: goto _6 } _4_regTemp = _sqlite3GetTempReg(tls, _pParse) - _sqlite3VdbeAddOp2(tls, _v, i32(65), ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(i32(0)))))+i32(1))+_regData, _4_regTemp) + _sqlite3VdbeAddOp2(tls, _v, i32(65), ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(i32(0)))))+i32(1))+_regData, _4_regTemp) _4_iMustBeInt = _sqlite3VdbeAddOp2(tls, _v, i32(17), _4_regTemp, i32(0)) if (_pTab == (*XTable)(_pFKey.X0)) && (_nIncr == i32(1)) { _sqlite3VdbeAddOp3(tls, _v, i32(78), _regData, _iOk, _4_regTemp) @@ -99666,7 +103878,7 @@ _10: if _i >= _6_nCol { goto _13 } - _sqlite3VdbeAddOp2(tls, _v, i32(64), ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i))))+i32(1))+_regData, _6_regTemp+_i) + _sqlite3VdbeAddOp2(tls, _v, i32(64), ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_i))))+i32(1))+_regData, _6_regTemp+_i) _i += 1 goto _10 _13: @@ -99679,21 +103891,21 @@ _16: if _i >= _6_nCol { goto _19 } - _9_iChild = ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) + i32(1)) + _regData - _9_iParent = (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) + i32(1)) + _regData + _9_iChild = ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_i)))) + i32(1)) + _regData + _9_iParent = (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) + i32(1)) + _regData func() { - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) < i32(0) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107820), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(116805))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) == int32(_pTab.X10) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_i)))) == int32(_pTab.X10) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107821), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(117805))) crt.X__builtin_abort(tls) } }() - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) == int32(_pTab.X10) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) == int32(_pTab.X10) { _9_iParent = _regData } _sqlite3VdbeAddOp3(tls, _v, i32(77), _9_iChild, _8_iJump, _9_iParent) @@ -99709,7 +103921,7 @@ _15: _sqlite3ReleaseTempRange(tls, _pParse, _6_regTemp, _6_nCol) _9: _5: - if ((((_pFKey.X6) == 0) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(33554432)) == 0)) && ((*XParse)(_pParse.X39) == nil)) && ((_pParse.X8) == 0) { + if (((_pFKey.X6 == 0) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(33554432)) == 0)) && (_pParse.X39 == nil)) && (_pParse.X8 == 0) { func() { if _nIncr != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107849), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(117827))) @@ -99734,59 +103946,65 @@ func init() { crt.Xstrncpy(nil, &_fkLookupParentØ00__func__Ø000[0], str(117836), 15) } -// Return true if the parser passed as the first argument is being -// used to code a trigger that is really a "SET NULL" action belonging -// to trigger pFKey. +// C comment +// /* +// ** Return true if the parser passed as the first argument is being +// ** used to code a trigger that is really a "SET NULL" action belonging +// ** to trigger pFKey. +// */ func _isSetNullAction(tls *crt.TLS, _pParse *XParse, _pFKey *XFKey) (r0 int32) { var _1_p *XTrigger var _pTop *XParse _pTop = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse }() - if (*XTriggerPrg)(_pTop.X69) == nil { + if _pTop.X69 == nil { goto _2 } _1_p = (*XTrigger)((*XTriggerPrg)(_pTop.X69).X0) - if ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(i32(0)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(0))))) == i32(7))) || ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(i32(1)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(1))))) == i32(7))) { + if ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(i32(0)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(i32(0))))) == i32(7))) || ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(i32(1)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(i32(1))))) == i32(7))) { return i32(1) } _2: return i32(0) } -// This function is called to generate code executed when a row is deleted -// from the parent table of foreign key constraint pFKey and, if pFKey is -// deferred, when a row is inserted into the same table. When generating -// code for an SQL UPDATE operation, this function may be called twice - -// once to "delete" the old row and once to "insert" the new row. -// -// Parameter nIncr is passed -1 when inserting a row (as this may decrease -// the number of FK violations in the db) or +1 when deleting one (as this -// may increase the number of FK constraint problems). -// -// The code generated by this function scans through the rows in the child -// table that correspond to the parent table row being deleted or inserted. -// For each child row found, one of the following actions is taken: -// -// Operation | FK type | Action taken -// -------------------------------------------------------------------------- -// DELETE immediate Increment the "immediate constraint counter". -// Or, if the ON (UPDATE|DELETE) action is RESTRICT, -// throw a "FOREIGN KEY constraint failed" exception. -// -// INSERT immediate Decrement the "immediate constraint counter". -// -// DELETE deferred Increment the "deferred constraint counter". -// Or, if the ON (UPDATE|DELETE) action is RESTRICT, -// throw a "FOREIGN KEY constraint failed" exception. -// -// INSERT deferred Decrement the "deferred constraint counter". -// -// These operations are identified in the comment at the top of this file -// (fkey.c) as "I.2" and "D.2". +// C comment +// /* +// ** This function is called to generate code executed when a row is deleted +// ** from the parent table of foreign key constraint pFKey and, if pFKey is +// ** deferred, when a row is inserted into the same table. When generating +// ** code for an SQL UPDATE operation, this function may be called twice - +// ** once to "delete" the old row and once to "insert" the new row. +// ** +// ** Parameter nIncr is passed -1 when inserting a row (as this may decrease +// ** the number of FK violations in the db) or +1 when deleting one (as this +// ** may increase the number of FK constraint problems). +// ** +// ** The code generated by this function scans through the rows in the child +// ** table that correspond to the parent table row being deleted or inserted. +// ** For each child row found, one of the following actions is taken: +// ** +// ** Operation | FK type | Action taken +// ** -------------------------------------------------------------------------- +// ** DELETE immediate Increment the "immediate constraint counter". +// ** Or, if the ON (UPDATE|DELETE) action is RESTRICT, +// ** throw a "FOREIGN KEY constraint failed" exception. +// ** +// ** INSERT immediate Decrement the "immediate constraint counter". +// ** +// ** DELETE deferred Increment the "deferred constraint counter". +// ** Or, if the ON (UPDATE|DELETE) action is RESTRICT, +// ** throw a "FOREIGN KEY constraint failed" exception. +// ** +// ** INSERT deferred Decrement the "deferred constraint counter". +// ** +// ** These operations are identified in the comment at the top of this file +// ** (fkey.c) as "I.2" and "D.2". +// */ func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32) { var _2_iCol, _6_iCol int16 var _i, _iFkIfZero int32 @@ -99808,19 +104026,19 @@ func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTab } }() func() { - if _pIdx != nil && int32(_pIdx.X13) != (_pFKey.X5) { + if _pIdx != nil && int32(_pIdx.X13) != _pFKey.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107970), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117881))) crt.X__builtin_abort(tls) } }() func() { - if _pIdx == nil && (_pFKey.X5) != i32(1) { + if _pIdx == nil && _pFKey.X5 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107971), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117919))) crt.X__builtin_abort(tls) } }() func() { - if _pIdx == nil && ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) { + if _pIdx == nil && (_pTab.X9&uint32(i32(32))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107972), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117945))) crt.X__builtin_abort(tls) } @@ -99830,24 +104048,24 @@ func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTab } _i = i32(0) _13: - if _i >= (_pFKey.X5) { + if _i >= _pFKey.X5 { goto _16 } _2_iCol = int16(func() int32 { if _pIdx != nil { - return int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) + return int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i)))) } return i32(-1) }()) _2_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _2_iCol) _2_iCol = int16(func() int32 { if _aiCol != nil { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aiCol)) + 4*uintptr(_i)))) } - return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + return ((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(i32(0)))).X0) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(i32(0)))).X0) }()) func() { if int32(_2_iCol) < i32(0) { @@ -99865,9 +104083,9 @@ _16: if _pTab != (*XTable)(_pFKey.X0) || _nIncr <= i32(0) { goto _24 } - if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, int16(i32(-1))) - _3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(i32(0)))).X11, int16(i32(-1))) + _3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(i32(0)))).X11, int16(i32(-1))) _3_pNe = _sqlite3PExpr(tls, _pParse, i32(77), _3_pLeft, _3_pRight) goto _26 } @@ -99884,7 +104102,7 @@ _29: if _i >= int32(_5_pPk.X13) { goto _32 } - _6_iCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))) + _6_iCol = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X1)) + 2*uintptr(_i))) func() { if int32(_6_iCol) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108029), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(99182))) @@ -99892,7 +104110,7 @@ _29: } }() _3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _6_iCol) - _3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(i32(0)))).X11, _6_iCol) + _3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(i32(0)))).X11, _6_iCol) _5_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _3_pLeft, _3_pRight) _5_pAll = _sqlite3ExprAnd(tls, _db, _5_pAll, _5_pEq) _i += 1 @@ -99902,9 +104120,9 @@ _32: _26: _pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _3_pNe) _24: - crt.Xmemset(tls, (unsafe.Pointer)(&_sNameContext), i32(0), u64(56)) - *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNameContext.X1))))) = _pSrc - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNameContext.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_sNameContext), i32(0), u64(56)) + *(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNameContext.X1)))) = _pSrc + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sNameContext.X0)))) = _pParse _sqlite3ResolveExprNames(tls, &_sNameContext, _pWhere) _pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(i32(0)), i32(0)) _sqlite3VdbeAddOp2(tls, _v, i32(147), int32(_pFKey.X6), _nIncr) @@ -99924,12 +104142,15 @@ func init() { crt.Xstrncpy(nil, &_fkScanChildrenØ00__func__Ø000[0], str(117971), 15) } -// Return an Expr object that refers to a memory register corresponding -// to column iCol of table pTab. -// -// regBase is the first of an array of register that contains the data -// for pTab. regBase itself holds the rowid. regBase+1 holds the first -// column. regBase+2 holds the second column, and so forth. +// C comment +// /* +// ** Return an Expr object that refers to a memory register corresponding +// ** to column iCol of table pTab. +// ** +// ** regBase is the first of an array of register that contains the data +// ** for pTab. regBase itself holds the rowid. regBase+1 holds the first +// ** column. regBase+2 holds the second column, and so forth. +// */ func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase int32, _iCol int16) (r0 *XExpr) { var _zColl *int8 var _db *Xsqlite3 @@ -99944,8 +104165,8 @@ func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase i goto _2 } _pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 32*uintptr(_iCol))) - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = (_regBase + int32(_iCol)) + i32(1) - *(*int8)(unsafe.Pointer(&(_pExpr.X1))) = _pCol.X4 + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = (_regBase + int32(_iCol)) + i32(1) + *(*int8)(unsafe.Pointer(&_pExpr.X1)) = _pCol.X4 _zColl = _pCol.X2 if _zColl == nil { _zColl = (*XCollSeq)(_db.X2).X0 @@ -99953,33 +104174,39 @@ func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase i _pExpr = _sqlite3ExprAddCollateString(tls, _pParse, _pExpr, _zColl) goto _4 _2: - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _regBase - *(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68)) + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _regBase + *(*int8)(unsafe.Pointer(&_pExpr.X1)) = int8(i32(68)) _4: _0: return _pExpr } -// Return an Expr object that refers to column iCol of table pTab which -// has cursor iCur. +// C comment +// /* +// ** Return an Expr object that refers to column iCol of table pTab which +// ** has cursor iCur. +// */ func _exprTableColumn(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _iCursor int32, _iCol int16) (r0 *XExpr) { var _pExpr *XExpr _pExpr = _sqlite3Expr(tls, _db, i32(152), nil) if _pExpr != nil { - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = _pTab - *(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _iCursor - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = _iCol + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pExpr.X14)))) = _pTab + *(*int32)(unsafe.Pointer(&_pExpr.X8)) = _iCursor + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = _iCol } return _pExpr } -// This routine generates code to finish the INSERT or UPDATE operation -// that was started by a prior call to sqlite3GenerateConstraintChecks. -// A consecutive range of registers starting at regNewData contains the -// rowid and the content to be inserted. -// -// The arguments to this routine should be the same as the first six -// arguments to sqlite3GenerateConstraintChecks. +// C comment +// /* +// ** This routine generates code to finish the INSERT or UPDATE operation +// ** that was started by a prior call to sqlite3GenerateConstraintChecks. +// ** A consecutive range of registers starting at regNewData contains the +// ** rowid and the content to be inserted. +// ** +// ** The arguments to this routine should be the same as the first six +// ** arguments to sqlite3GenerateConstraintChecks. +// */ func _sqlite3CompleteInsertion(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _regNewData int32, _aRegIdx *int32, _update_flags int32, _appendBias int32, _useSeekResult int32) { var _regData, _regRec, _i int32 var _pik_flags, _bAffinityDone uint8 @@ -100010,12 +104237,12 @@ _8: if _pIdx == nil { goto _11 } - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i)))) == i32(0) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i)))) == i32(0) { goto _9 } _bAffinityDone = uint8(i32(1)) - if (*XExpr)(_pIdx.X9) != nil { - _sqlite3VdbeAddOp2(tls, _v, i32(75), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))), _sqlite3VdbeCurrentAddr(tls, _v)+i32(2)) + if _pIdx.X9 != nil { + _sqlite3VdbeAddOp2(tls, _v, i32(75), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i))), _sqlite3VdbeCurrentAddr(tls, _v)+i32(2)) } _pik_flags = uint8(func() int32 { if _useSeekResult != 0 { @@ -100023,7 +104250,7 @@ _8: } return i32(0) }()) - if (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) && (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) { + if (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) && ((_pTab.X9 & uint32(i32(32))) != uint32(i32(0))) { func() { if int32(_pParse.X6) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000))), unsafe.Pointer(str(118090))) @@ -100041,18 +104268,18 @@ _8: sink2(*p) } } - _sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iIdxCur+_i, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))), (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))))+i32(1), int32(func() uint16 { - if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { - return (_pIdx.X13) + _sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iIdxCur+_i, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i))), (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i))))+i32(1), int32(func() uint16 { + if ((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { + return _pIdx.X13 } - return (_pIdx.X14) + return _pIdx.X14 }())) _sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags)) _9: *func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_i }() += 1 goto _8 _11: - if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pTab.X9 & uint32(i32(32))) != uint32(i32(0)) { return } _regData = _regNewData + i32(1) @@ -100062,7 +104289,7 @@ _11: _sqlite3TableAffinity(tls, _v, _pTab, i32(0)) _sqlite3ExprCacheAffinityChange(tls, _pParse, _regData, int32(_pTab.X11)) } - if (_pParse.X6) != 0 { + if _pParse.X6 != 0 { _pik_flags = uint8(i32(0)) goto _25 } @@ -100093,8 +104320,8 @@ _25: } } _sqlite3VdbeAddOp3(tls, _v, i32(118), _iDataCur, _regRec, _regNewData) - if (_pParse.X6) == 0 { - _sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pTab), i32(-15)) + if _pParse.X6 == 0 { + _sqlite3VdbeAppendP4(tls, _v, unsafe.Pointer(_pTab), i32(-15)) } _sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags)) } @@ -100105,8 +104332,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CompleteInsertionØ00__func__Ø000[0], str(118108), 25) } -// This function is called when deleting or updating a row to implement -// any required CASCADE, SET NULL or SET DEFAULT actions. +// C comment +// /* +// ** This function is called when deleting or updating a row to implement +// ** any required CASCADE, SET NULL or SET DEFAULT actions. +// */ func _sqlite3FkActions(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pChanges *XExprList, _regOld int32, _aChange *int32, _bChngRowid int32) { var _3_pAct *XTrigger var _1_pFKey *XFKey @@ -100132,33 +104362,36 @@ _4: _0: } -// This function is called when an UPDATE or DELETE operation is being -// compiled on table pTab, which is the parent table of foreign-key pFKey. -// If the current operation is an UPDATE, then the pChanges parameter is -// passed a pointer to the list of columns being modified. If it is a -// DELETE, pChanges is passed a NULL pointer. -// -// It returns a pointer to a Trigger structure containing a trigger -// equivalent to the ON UPDATE or ON DELETE action specified by pFKey. -// If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is -// returned (these actions require no special handling by the triggers -// sub-system, code for them is created by fkScanChildren()). -// -// For example, if pFKey is the foreign key and pTab is table "p" in -// the following schema: -// -// CREATE TABLE p(pk PRIMARY KEY); -// CREATE TABLE c(ck REFERENCES p ON DELETE CASCADE); -// -// then the returned trigger structure is equivalent to: -// -// CREATE TRIGGER ... DELETE ON p BEGIN -// DELETE FROM c WHERE ck = old.pk; -// END; -// -// The returned pointer is cached as part of the foreign key object. It -// is eventually freed along with the rest of the foreign key object by -// sqlite3FkDelete(). +// C comment +// /* +// ** This function is called when an UPDATE or DELETE operation is being +// ** compiled on table pTab, which is the parent table of foreign-key pFKey. +// ** If the current operation is an UPDATE, then the pChanges parameter is +// ** passed a pointer to the list of columns being modified. If it is a +// ** DELETE, pChanges is passed a NULL pointer. +// ** +// ** It returns a pointer to a Trigger structure containing a trigger +// ** equivalent to the ON UPDATE or ON DELETE action specified by pFKey. +// ** If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is +// ** returned (these actions require no special handling by the triggers +// ** sub-system, code for them is created by fkScanChildren()). +// ** +// ** For example, if pFKey is the foreign key and pTab is table "p" in +// ** the following schema: +// ** +// ** CREATE TABLE p(pk PRIMARY KEY); +// ** CREATE TABLE c(ck REFERENCES p ON DELETE CASCADE); +// ** +// ** then the returned trigger structure is equivalent to: +// ** +// ** CREATE TRIGGER ... DELETE ON p BEGIN +// ** DELETE FROM c WHERE ck = old.pk; +// ** END; +// ** +// ** The returned pointer is cached as part of the foreign key object. It +// ** is eventually freed along with the rest of the foreign key object by +// ** sqlite3FkDelete(). +// */ func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKey, _pChanges *XExprList) (r0 *XTrigger) { var _action, _iAction, _2_nFrom, _2_i, _3_iFromCol int32 var _2_aiCol *int32 @@ -100173,11 +104406,11 @@ func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKe var _2_pStep *XTriggerStep _db = (*Xsqlite3)(_pParse.X0) _iAction = bool2int(_pChanges != nil) - _action = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(_iAction)))) - if (_action == i32(6)) && ((_db.X6)&i32(33554432)) != 0 { + _action = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_pFKey.X7)))) + 1*uintptr(_iAction)))) + if (_action == i32(6)) && (_db.X6&i32(33554432)) != 0 { return nil } - _pTrigger = *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(_iAction))) + _pTrigger = *(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(_iAction))) if _action == i32(0) || _pTrigger != nil { goto _3 } @@ -100192,30 +104425,30 @@ func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKe return nil } func() { - if _2_aiCol == nil && (_pFKey.X5) != i32(1) { + if _2_aiCol == nil && _pFKey.X5 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108611), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(117766))) crt.X__builtin_abort(tls) } }() _2_i = i32(0) _8: - if _2_i >= (_pFKey.X5) { + if _2_i >= _pFKey.X5 { goto _11 } _3_tOld = XToken{} - *(**int8)(unsafe.Pointer(&(_3_tOld.X0))) = str(43177) - *(*uint32)(unsafe.Pointer(&(_3_tOld.X1))) = uint32(i32(3)) + *(**int8)(unsafe.Pointer(&_3_tOld.X0)) = str(43177) + *(*uint32)(unsafe.Pointer(&_3_tOld.X1)) = uint32(i32(3)) _3_tNew = XToken{} - *(**int8)(unsafe.Pointer(&(_3_tNew.X0))) = str(43173) - *(*uint32)(unsafe.Pointer(&(_3_tNew.X1))) = uint32(i32(3)) + *(**int8)(unsafe.Pointer(&_3_tNew.X0)) = str(43173) + *(*uint32)(unsafe.Pointer(&_3_tNew.X1)) = uint32(i32(3)) _3_iFromCol = func() int32 { if _2_aiCol != nil { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aiCol)) + 4*uintptr(_2_i)))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_aiCol)) + 4*uintptr(_2_i)))) } - return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + return ((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_pFKey.X9))))) + 16*uintptr(i32(0)))).X0) + })(unsafe.Pointer(&_pFKey.X9)))) + 16*uintptr(i32(0)))).X0) }() func() { if _3_iFromCol < i32(0) { @@ -100230,16 +104463,16 @@ _8: } }() func() { - if _2_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X1)) + 2*uintptr(_2_i)))) < i32(0) { + if _2_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pIdx.X1)) + 2*uintptr(_2_i)))) < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108624), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(117711))) crt.X__builtin_abort(tls) } }() _sqlite3TokenInit(tls, &_3_tToCol, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(func() int16 { if _2_pIdx != nil { - return (*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X1)) + 2*uintptr(_2_i)))) + return (*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pIdx.X1)) + 2*uintptr(_2_i)))) } - return (_pTab.X10) + return _pTab.X10 }()))).X0) _sqlite3TokenInit(tls, &_3_tFromCol, (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pFKey.X0).X1)+32*uintptr(_3_iFromCol))).X0) _3_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _sqlite3PExpr(tls, _pParse, i32(122), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tOld, i32(0)), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tToCol, i32(0))), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tFromCol, i32(0))) @@ -100275,38 +104508,38 @@ _28: _2_i += 1 goto _8 _11: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_aiCol)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_2_aiCol)) _2_zFrom = (*XTable)(_pFKey.X0).X0 _2_nFrom = _sqlite3Strlen30(tls, _2_zFrom) if _action != i32(6) { goto _35 } - *(**int8)(unsafe.Pointer(&(_11_tFrom.X0))) = _2_zFrom - *(*uint32)(unsafe.Pointer(&(_11_tFrom.X1))) = uint32(_2_nFrom) + *(**int8)(unsafe.Pointer(&_11_tFrom.X0)) = _2_zFrom + *(*uint32)(unsafe.Pointer(&_11_tFrom.X1)) = uint32(_2_nFrom) _11_pRaise = _sqlite3Expr(tls, _db, i32(56), str(58234)) if _11_pRaise != nil { - *(*int8)(unsafe.Pointer(&(_11_pRaise.X1))) = int8(i32(2)) + *(*int8)(unsafe.Pointer(&_11_pRaise.X1)) = int8(i32(2)) } _2_pSelect = _sqlite3SelectNew(tls, _pParse, _sqlite3ExprListAppend(tls, _pParse, nil, _11_pRaise), _sqlite3SrcListAppend(tls, _db, nil, &_11_tFrom, nil), _2_pWhere, nil, nil, nil, uint32(i32(0)), nil, nil) _2_pWhere = nil _35: - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1 + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) += 1 _pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, (u64(144)+uint64(_2_nFrom))+uint64(i32(1)))) if _pTrigger == nil { goto _37 } - _2_pStep = store76((**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X8))))), (*XTriggerStep)(unsafe.Pointer((*XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrigger))+72*uintptr(i32(1))))))) - *(**int8)(unsafe.Pointer(&(_2_pStep.X4))) = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pStep)) + 72*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_2_pStep.X4), (unsafe.Pointer)(_2_zFrom), uint64(_2_nFrom)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X5))))) = _sqlite3ExprDup(tls, _db, _2_pWhere, i32(1)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X6))))) = _sqlite3ExprListDup(tls, _db, _2_pList, i32(1)) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X3))))) = _sqlite3SelectDup(tls, _db, _2_pSelect, i32(1)) + _2_pStep = store76((**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X8)))), (*XTriggerStep)(unsafe.Pointer((*XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTrigger))+72*uintptr(i32(1))))))) + *(**int8)(unsafe.Pointer(&_2_pStep.X4)) = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pStep)) + 72*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_2_pStep.X4), unsafe.Pointer(_2_zFrom), uint64(_2_nFrom)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pStep.X5)))) = _sqlite3ExprDup(tls, _db, _2_pWhere, i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pStep.X6)))) = _sqlite3ExprListDup(tls, _db, _2_pList, i32(1)) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pStep.X3)))) = _sqlite3SelectDup(tls, _db, _2_pSelect, i32(1)) if _2_pWhen != nil { _2_pWhen = _sqlite3PExpr(tls, _pParse, i32(19), _2_pWhen, nil) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X4))))) = _sqlite3ExprDup(tls, _db, _2_pWhen, i32(1)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X4)))) = _sqlite3ExprDup(tls, _db, _2_pWhen, i32(1)) } _37: - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1 + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) -= 1 _sqlite3ExprDelete(tls, _db, _2_pWhere) _sqlite3ExprDelete(tls, _db, _2_pWhen) _sqlite3ExprListDelete(tls, _db, _2_pList) @@ -100331,21 +104564,21 @@ _37: } _43: - *(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(119)) + *(*uint8)(unsafe.Pointer(&_2_pStep.X0)) = uint8(i32(119)) goto _46 _44: if _pChanges == nil { - *(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(109)) + *(*uint8)(unsafe.Pointer(&_2_pStep.X0)) = uint8(i32(109)) goto _46 } _47: - *(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(110)) + *(*uint8)(unsafe.Pointer(&_2_pStep.X0)) = uint8(i32(110)) _46: - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X2))))) = _pTrigger - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X6))))) = (*XSchema)(_pTab.X20) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X7))))) = (*XSchema)(_pTab.X20) - *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 8*uintptr(_iAction))) = _pTrigger - *(*uint8)(unsafe.Pointer(&(_pTrigger.X2))) = uint8(func() int32 { + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_2_pStep.X2)))) = _pTrigger + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X6)))) = (*XSchema)(_pTab.X20) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X7)))) = (*XSchema)(_pTab.X20) + *(**XTrigger)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]unsafe.Pointer)(unsafe.Pointer(&_pFKey.X8)))) + 8*uintptr(_iAction))) = _pTrigger + *(*uint8)(unsafe.Pointer(&_pTrigger.X2)) = uint8(func() int32 { if _pChanges != nil { return i32(110) } @@ -100369,16 +104602,19 @@ func init() { } func _sqlite3AutoincrementEnd(tls *crt.TLS, _pParse *XParse) { - if (*TAggInfo_func)(_pParse.X38) != nil { + if _pParse.X38 != nil { _autoIncrementEnd(tls, _pParse) } } -// This routine generates the code needed to write autoincrement -// maximum rowid values back into the sqlite_sequence register. -// Every statement that might do an INSERT into an autoincrement -// table (either directly or through triggers) needs to call this -// routine just before the "exit" code. +// C comment +// /* +// ** This routine generates the code needed to write autoincrement +// ** maximum rowid values back into the sqlite_sequence register. +// ** Every statement that might do an INSERT into an autoincrement +// ** table (either directly or through triggers) needs to call this +// ** routine just before the "exit" code. +// */ func _autoIncrementEnd(tls *crt.TLS, _pParse *XParse) { var _1_iRec, _1_memId int32 var _db *Xsqlite3 @@ -100413,13 +104649,13 @@ _2: if _1_aOp == nil { goto _5 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(0)))).X3))) = _1_memId + i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(1)))).X4))) = _1_memId + i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(2)))).X3))) = _1_memId - i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(2)))).X5))) = _1_iRec - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X4))) = _1_iRec - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X5))) = _1_memId + i32(1) - *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 32*uintptr(i32(3)))).X2))) = uint16(i32(8)) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(0)))).X3))) = _1_memId + i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(1)))).X4))) = _1_memId + i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(2)))).X3))) = _1_memId - i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(2)))).X5))) = _1_iRec + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X4))) = _1_iRec + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X5))) = _1_memId + i32(1) + *(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_aOp)) + 32*uintptr(i32(3)))).X2))) = uint16(i32(8)) _sqlite3ReleaseTempReg(tls, _pParse, _1_iRec) _p = (*TAggInfo_func)(_p.X0) goto _2 @@ -100440,23 +104676,29 @@ func init() { var _autoIncrementEndØ00iLnØ001 int32 -// Pop an authorization context that was previously pushed -// by sqlite3AuthContextPush +// C comment +// /* +// ** Pop an authorization context that was previously pushed +// ** by sqlite3AuthContextPush +// */ func _sqlite3AuthContextPop(tls *crt.TLS, _pContext *XAuthContext) { - if (*XParse)(_pContext.X1) != nil { + if _pContext.X1 != nil { *(**int8)(unsafe.Pointer(&((*XParse)(_pContext.X1).X65))) = _pContext.X0 - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pContext.X1))))) = nil + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pContext.X1)))) = nil } } -// Convert the pStep->zTarget string into a SrcList and return a pointer -// to that SrcList. -// -// This routine adds a specific database name, if needed, to the target when -// forming the SrcList. This prevents a trigger in one database from -// referring to a target in another database. An exception is when the -// trigger is in TEMP in which case it can refer to any other database it -// wants. +// C comment +// /* +// ** Convert the pStep->zTarget string into a SrcList and return a pointer +// ** to that SrcList. +// ** +// ** This routine adds a specific database name, if needed, to the target when +// ** forming the SrcList. This prevents a trigger in one database from +// ** referring to a target in another database. An exception is when the +// ** trigger is in TEMP in which case it can refer to any other database it +// ** wants. +// */ func _targetSrcList(tls *crt.TLS, _pParse *XParse, _pStep *XTriggerStep) (r0 *XSrcList) { var _iDb int32 var _2_zDb *int8 @@ -100468,22 +104710,22 @@ func _targetSrcList(tls *crt.TLS, _pParse *XParse, _pStep *XTriggerStep) (r0 *XS goto _0 } func() { - if (_pSrc.X0) <= i32(0) { + if _pSrc.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123305), unsafe.Pointer((*int8)(unsafe.Pointer(&_targetSrcListØ00__func__Ø000))), unsafe.Pointer(str(118241))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr((_pSrc.X0)-i32(1)))).X2))) = _sqlite3DbStrDup(tls, _db, _pStep.X4) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_pSrc.X0-i32(1)))).X2))) = _sqlite3DbStrDup(tls, _db, _pStep.X4) _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)((*XTrigger)(_pStep.X2).X6)) if (_iDb == i32(0)) || (_iDb >= i32(2)) { func() { - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123310), unsafe.Pointer((*int8)(unsafe.Pointer(&_targetSrcListØ00__func__Ø000))), unsafe.Pointer(str(54328))) crt.X__builtin_abort(tls) } }() _2_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 112*uintptr((_pSrc.X0)-i32(1)))).X1))) = _sqlite3DbStrDup(tls, _db, _2_zDb) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2)))) + 112*uintptr(_pSrc.X0-i32(1)))).X1))) = _sqlite3DbStrDup(tls, _db, _2_zDb) } _0: return _pSrc @@ -100495,101 +104737,104 @@ func init() { crt.Xstrncpy(nil, &_targetSrcListØ00__func__Ø000[0], str(118254), 14) } -// This routine is called to handle SQL of the following forms: -// -// insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),... -// insert into TABLE (IDLIST) select -// insert into TABLE (IDLIST) default values -// -// The IDLIST following the table name is always optional. If omitted, -// then a list of all (non-hidden) columns for the table is substituted. -// The IDLIST appears in the pColumn parameter. pColumn is NULL if IDLIST -// is omitted. -// -// For the pSelect parameter holds the values to be inserted for the -// first two forms shown above. A VALUES clause is really just short-hand -// for a SELECT statement that omits the FROM clause and everything else -// that follows. If the pSelect parameter is NULL, that means that the -// DEFAULT VALUES form of the INSERT statement is intended. -// -// The code generated follows one of four templates. For a simple -// insert with data coming from a single-row VALUES clause, the code executes -// once straight down through. Pseudo-code follows (we call this -// the "1st template"): -// -// open write cursor to <table> and its indices -// put VALUES clause expressions into registers -// write the resulting record into <table> -// cleanup -// -// The three remaining templates assume the statement is of the form -// -// INSERT INTO <table> SELECT ... -// -// If the SELECT clause is of the restricted form "SELECT * FROM <table2>" - -// in other words if the SELECT pulls all columns from a single table -// and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and -// if <table2> and <table1> are distinct tables but have identical -// schemas, including all the same indices, then a special optimization -// is invoked that copies raw records from <table2> over to <table1>. -// See the xferOptimization() function for the implementation of this -// template. This is the 2nd template. -// -// open a write cursor to <table> -// open read cursor on <table2> -// transfer all records in <table2> over to <table> -// close cursors -// foreach index on <table> -// open a write cursor on the <table> index -// open a read cursor on the corresponding <table2> index -// transfer all records from the read to the write cursors -// close cursors -// end foreach -// -// The 3rd template is for when the second template does not apply -// and the SELECT clause does not read from <table> at any time. -// The generated code follows this template: -// -// X <- A -// goto B -// A: setup for the SELECT -// loop over the rows in the SELECT -// load values into registers R..R+n -// yield X -// end loop -// cleanup after the SELECT -// end-coroutine X -// B: open write cursor to <table> and its indices -// C: yield X, at EOF goto D -// insert the select result into <table> from R..R+n -// goto C -// D: cleanup -// -// The 4th template is used if the insert statement takes its -// values from a SELECT but the data is being inserted into a table -// that is also read as part of the SELECT. In the third form, -// we have to use an intermediate table to store the results of -// the select. The template is like this: -// -// X <- A -// goto B -// A: setup for the SELECT -// loop over the tables in the SELECT -// load value into register R..R+n -// yield X -// end loop -// cleanup after the SELECT -// end co-routine R -// B: open temp table -// L: yield X, at EOF goto M -// insert row from R..R+n into temp table -// goto L -// M: open write cursor to <table> and its indices -// rewind temp table -// C: loop over rows of intermediate table -// transfer values form intermediate table into <table> -// end loop -// D: cleanup +// C comment +// /* +// ** This routine is called to handle SQL of the following forms: +// ** +// ** insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),... +// ** insert into TABLE (IDLIST) select +// ** insert into TABLE (IDLIST) default values +// ** +// ** The IDLIST following the table name is always optional. If omitted, +// ** then a list of all (non-hidden) columns for the table is substituted. +// ** The IDLIST appears in the pColumn parameter. pColumn is NULL if IDLIST +// ** is omitted. +// ** +// ** For the pSelect parameter holds the values to be inserted for the +// ** first two forms shown above. A VALUES clause is really just short-hand +// ** for a SELECT statement that omits the FROM clause and everything else +// ** that follows. If the pSelect parameter is NULL, that means that the +// ** DEFAULT VALUES form of the INSERT statement is intended. +// ** +// ** The code generated follows one of four templates. For a simple +// ** insert with data coming from a single-row VALUES clause, the code executes +// ** once straight down through. Pseudo-code follows (we call this +// ** the "1st template"): +// ** +// ** open write cursor to <table> and its indices +// ** put VALUES clause expressions into registers +// ** write the resulting record into <table> +// ** cleanup +// ** +// ** The three remaining templates assume the statement is of the form +// ** +// ** INSERT INTO <table> SELECT ... +// ** +// ** If the SELECT clause is of the restricted form "SELECT * FROM <table2>" - +// ** in other words if the SELECT pulls all columns from a single table +// ** and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and +// ** if <table2> and <table1> are distinct tables but have identical +// ** schemas, including all the same indices, then a special optimization +// ** is invoked that copies raw records from <table2> over to <table1>. +// ** See the xferOptimization() function for the implementation of this +// ** template. This is the 2nd template. +// ** +// ** open a write cursor to <table> +// ** open read cursor on <table2> +// ** transfer all records in <table2> over to <table> +// ** close cursors +// ** foreach index on <table> +// ** open a write cursor on the <table> index +// ** open a read cursor on the corresponding <table2> index +// ** transfer all records from the read to the write cursors +// ** close cursors +// ** end foreach +// ** +// ** The 3rd template is for when the second template does not apply +// ** and the SELECT clause does not read from <table> at any time. +// ** The generated code follows this template: +// ** +// ** X <- A +// ** goto B +// ** A: setup for the SELECT +// ** loop over the rows in the SELECT +// ** load values into registers R..R+n +// ** yield X +// ** end loop +// ** cleanup after the SELECT +// ** end-coroutine X +// ** B: open write cursor to <table> and its indices +// ** C: yield X, at EOF goto D +// ** insert the select result into <table> from R..R+n +// ** goto C +// ** D: cleanup +// ** +// ** The 4th template is used if the insert statement takes its +// ** values from a SELECT but the data is being inserted into a table +// ** that is also read as part of the SELECT. In the third form, +// ** we have to use an intermediate table to store the results of +// ** the select. The template is like this: +// ** +// ** X <- A +// ** goto B +// ** A: setup for the SELECT +// ** loop over the tables in the SELECT +// ** load value into register R..R+n +// ** yield X +// ** end loop +// ** cleanup after the SELECT +// ** end co-routine R +// ** B: open temp table +// ** L: yield X, at EOF goto M +// ** insert row from R..R+n into temp table +// ** goto L +// ** M: open write cursor to <table> and its indices +// ** rewind temp table +// ** C: loop over rows of intermediate table +// ** transfer values form intermediate table into <table> +// ** end loop +// ** D: cleanup +// */ func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect *XSelect, _pColumn *XIdList, _onError int32) { var _i, _j, _nColumn, _nHidden, _iDataCur, _iIdxCur, _ipkColumn, _endOfLoop, _srcTab, _addrInsTop, _addrCont, _iDb, _regFromSelect, _regAutoinc, _regRowCount, _regIns, _regRowid, _regData, _isView, _tmask, _18_regYield, _18_addrTop, _18_rc, _20_regRec, _20_regTempRowid, _20_addrL, _30_nIdx, _35_regCols, _37_addr1, _54_addr1, _59_iRegStore, _72_isReplace, _72_bUseSeek int32 var _aRegIdx *int32 @@ -100619,23 +104864,23 @@ func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect _regRowCount = i32(0) _aRegIdx = nil _db = (*Xsqlite3)(_pParse.X0) - crt.Xmemset(tls, (unsafe.Pointer)(&_dest), i32(0), u64(40)) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + crt.Xmemset(tls, unsafe.Pointer(&_dest), i32(0), u64(40)) + if _pParse.X16 != 0 || (_db.X17 != 0) { goto _insert_cleanup } - if ((_pSelect != nil) && (((_pSelect.X3) & uint32(i32(512))) != uint32(i32(0)))) && ((*XSelect)(_pSelect.X13) == nil) { + if ((_pSelect != nil) && ((_pSelect.X3 & uint32(i32(512))) != uint32(i32(0)))) && ((*XSelect)(_pSelect.X13) == nil) { _pList = (*XExprList)(_pSelect.X0) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelect.X0))))) = nil + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSelect.X0)))) = nil _sqlite3SelectDelete(tls, _db, _pSelect) _pSelect = nil } func() { - if (_pTabList.X0) != i32(1) { + if _pTabList.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109377), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(115025))) crt.X__builtin_abort(tls) } }() - _zTab = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 112*uintptr(i32(0)))).X2 + _zTab = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTabList.X2)))) + 112*uintptr(i32(0)))).X2 if func() int32 { if _zTab == nil { return func() int32 { @@ -100654,7 +104899,7 @@ func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect } _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) func() { - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(54328))) crt.X__builtin_abort(tls) } @@ -100662,7 +104907,7 @@ func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect if _sqlite3AuthCheck(tls, _pParse, i32(18), _pTab.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0) != 0 { goto _insert_cleanup } - _withoutRowid = uint8(bool2int(((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)))) + _withoutRowid = uint8(bool2int((_pTab.X9 & uint32(i32(32))) != uint32(i32(0)))) _pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(108), nil, &_tmask) _isView = bool2int((*XSelect)(_pTab.X3) != nil) func() { @@ -100701,24 +104946,24 @@ func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect goto _insert_end } _regAutoinc = _autoIncBegin(tls, _pParse, _iDb, _pTab) - _regRowid = store1(&_regIns, (_pParse.X18)+i32(1)) + _regRowid = store1(&_regIns, _pParse.X18+i32(1)) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + (int32(_pTab.X11) + i32(1)) sink1(*p) } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _regRowid += 1 - *(*int32)(unsafe.Pointer(&(_pParse.X18))) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X18)) += 1 } _regData = _regRowid + i32(1) - _bIdListInOrder = uint8(bool2int(((_pTab.X9) & uint32(i32(128))) == uint32(i32(0)))) + _bIdListInOrder = uint8(bool2int((_pTab.X9 & uint32(i32(128))) == uint32(i32(0)))) if _pColumn == nil { goto _31 } _i = i32(0) _32: - if _i >= (_pColumn.X1) { + if _i >= _pColumn.X1 { goto _35 } *(*int32)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 16*uintptr(_i))).X1))) = i32(-1) @@ -100727,7 +104972,7 @@ _32: _35: _i = i32(0) _36: - if _i >= (_pColumn.X1) { + if _i >= _pColumn.X1 { goto _39 } _j = i32(0) @@ -100765,7 +105010,7 @@ _43: goto _52 } _sqlite3ErrorMsg(tls, _pParse, str(118350), unsafe.Pointer(_pTabList), i32(0), unsafe.Pointer((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0)+16*uintptr(_i))).X0)) - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) goto _insert_cleanup _52: _49: @@ -100776,26 +105021,26 @@ _31: if _pSelect == nil { goto _53 } - _18_regYield = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _18_regYield = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1) _sqlite3VdbeAddOp3(tls, _v, i32(15), _18_regYield, i32(0), _18_addrTop) _sqlite3SelectDestInit(tls, &_dest, i32(13), _18_regYield) - *(*int32)(unsafe.Pointer(&(_dest.X3))) = func() int32 { + *(*int32)(unsafe.Pointer(&_dest.X3)) = func() int32 { if _bIdListInOrder != 0 { return _regData } return i32(0) }() - *(*int32)(unsafe.Pointer(&(_dest.X4))) = int32(_pTab.X11) + *(*int32)(unsafe.Pointer(&_dest.X4)) = int32(_pTab.X11) _18_rc = _sqlite3Select(tls, _pParse, _pSelect, &_dest) _regFromSelect = _dest.X3 - if (_18_rc != 0 || ((_db.X17) != 0)) || (_pParse.X16) != 0 { + if (_18_rc != 0 || (_db.X17 != 0)) || _pParse.X16 != 0 { goto _insert_cleanup } _sqlite3VdbeEndCoroutine(tls, _v, _18_regYield) _sqlite3VdbeJumpHere(tls, _v, _18_addrTop-i32(1)) func() { - if (*XExprList)(_pSelect.X0) == nil { + if _pSelect.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109526), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118382))) crt.X__builtin_abort(tls) } @@ -100805,7 +105050,7 @@ _31: _useTempTable = uint8(i32(1)) } if _useTempTable != 0 { - _srcTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _srcTab = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _20_regRec = _sqlite3GetTempReg(tls, _pParse) _20_regTempRowid = _sqlite3GetTempReg(tls, _pParse) _sqlite3VdbeAddOp2(tls, _v, i32(110), _srcTab, _nColumn) @@ -100820,8 +105065,8 @@ _31: } goto _64 _53: - crt.Xmemset(tls, (unsafe.Pointer)(&_21_sNC), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_21_sNC.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_21_sNC), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_21_sNC.X0)))) = _pParse _srcTab = i32(-1) func() { if int32(_useTempTable) != i32(0) { @@ -100866,12 +105111,12 @@ _75: _sqlite3ErrorMsg(tls, _pParse, str(118414), unsafe.Pointer(_pTabList), i32(0), int32(_pTab.X11)-_nHidden, _nColumn) goto _insert_cleanup } - if (_pColumn != nil) && (_nColumn != (_pColumn.X1)) { + if (_pColumn != nil) && (_nColumn != _pColumn.X1) { _sqlite3ErrorMsg(tls, _pParse, str(118466), _nColumn, _pColumn.X1) goto _insert_cleanup } - if ((_db.X6) & i32(128)) != 0 { - _regRowCount = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + if (_db.X6 & i32(128)) != 0 { + _regRowCount = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regRowCount) } if _isView != 0 { @@ -100893,9 +105138,9 @@ _86: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + 4*uintptr(_i))) = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + int32(_pIdx.X14) sink1(*p) } @@ -100937,7 +105182,7 @@ _94: crt.X__builtin_abort(tls) } }() - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_ipkColumn))).X0), _35_regCols) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_ipkColumn))).X0), _35_regCols) _101: _37_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(76), _35_regCols) _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(-1), _35_regCols) @@ -100945,7 +105190,7 @@ _101: _sqlite3VdbeAddOp1(tls, _v, i32(17), _35_regCols) _97: func() { - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(41933))) crt.X__builtin_abort(tls) } @@ -100960,7 +105205,7 @@ _106: } _j = i32(0) _111: - if _j >= (_pColumn.X1) { + if _j >= _pColumn.X1 { goto _114 } if ((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 16*uintptr(_j))).X1) == _i { @@ -100970,7 +105215,7 @@ _111: goto _111 _114: _110: - if (((_useTempTable == 0) && (_pList == nil)) || ((_pColumn != nil) && (_j >= (_pColumn.X1)))) || ((_pColumn == nil) && i32(0) != 0) { + if (((_useTempTable == 0) && (_pList == nil)) || ((_pColumn != nil) && (_j >= _pColumn.X1))) || ((_pColumn == nil) && i32(0) != 0) { _sqlite3ExprCode(tls, _pParse, (*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_i))).X1), (_35_regCols+_i)+i32(1)) goto _124 } @@ -100984,7 +105229,7 @@ _110: crt.X__builtin_abort(tls) } }() - _sqlite3ExprCodeAndCache(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_j))).X0), (_35_regCols+_i)+i32(1)) + _sqlite3ExprCodeAndCache(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_j))).X0), (_35_regCols+_i)+i32(1)) _124: if (_pColumn == nil) && i32(1) != 0 { _j += 1 @@ -101001,7 +105246,7 @@ _95: if _isView != 0 { goto _130 } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regIns) } if _ipkColumn < i32(0) { @@ -101015,7 +105260,7 @@ _95: _sqlite3VdbeAddOp2(tls, _v, i32(64), _regFromSelect+_ipkColumn, _regRowid) goto _136 } - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_ipkColumn))).X0), _regRowid) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_ipkColumn))).X0), _regRowid) _52_pOp = _sqlite3VdbeGetOp(tls, _v, i32(-1)) if (func() int32 { if _52_pOp != nil { @@ -101026,18 +105271,18 @@ _95: crt.X__builtin_abort(tls) return i32(0) }() - }() != 0 && (int32(_52_pOp.X0) == i32(59))) && ((_pTab.X16) == 0) { + }() != 0 && (int32(_52_pOp.X0) == i32(59))) && (_pTab.X16 == 0) { _appendFlag = uint8(i32(1)) - *(*uint8)(unsafe.Pointer(&(_52_pOp.X0))) = uint8(i32(117)) - *(*int32)(unsafe.Pointer(&(_52_pOp.X3))) = _iDataCur - *(*int32)(unsafe.Pointer(&(_52_pOp.X4))) = _regRowid - *(*int32)(unsafe.Pointer(&(_52_pOp.X5))) = _regAutoinc + *(*uint8)(unsafe.Pointer(&_52_pOp.X0)) = uint8(i32(117)) + *(*int32)(unsafe.Pointer(&_52_pOp.X3)) = _iDataCur + *(*int32)(unsafe.Pointer(&_52_pOp.X4)) = _regRowid + *(*int32)(unsafe.Pointer(&_52_pOp.X5)) = _regAutoinc } _136: if _appendFlag != 0 { goto _142 } - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { _54_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(76), _regRowid) _sqlite3VdbeAddOp3(tls, _v, i32(117), _iDataCur, _regRowid, _regAutoinc) _sqlite3VdbeJumpHere(tls, _v, _54_addr1) @@ -101050,7 +105295,7 @@ _144: _142: goto _148 _132: - if (_pTab.X16) != 0 || (_withoutRowid != 0) { + if _pTab.X16 != 0 || (_withoutRowid != 0) { _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regRowid) goto _148 } @@ -101083,7 +105328,7 @@ _156: _154: _j = i32(0) _158: - if _j >= (_pColumn.X1) { + if _j >= _pColumn.X1 { goto _161 } if ((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 16*uintptr(_j))).X1) == _i { @@ -101093,7 +105338,7 @@ _158: goto _158 _161: _157: - if ((_j < i32(0)) || (_nColumn == i32(0))) || ((_pColumn != nil) && (_j >= (_pColumn.X1))) { + if ((_j < i32(0)) || (_nColumn == i32(0))) || ((_pColumn != nil) && (_j >= _pColumn.X1)) { _sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+32*uintptr(_i))).X1), _59_iRegStore) goto _172 } @@ -101109,13 +105354,13 @@ _157: } goto _172 _170: - _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+32*uintptr(_j))).X0), _59_iRegStore) + _sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2))))+32*uintptr(_j))).X0), _59_iRegStore) _172: _150: _i += 1 goto _149 _152: - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _71_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab))) _sqlite3VtabMakeWritable(tls, _pParse, _pTab) _sqlite3VdbeAddOp4(tls, _v, i32(12), i32(1), int32(_pTab.X11)+i32(2), _regIns, _71_pVTab, i32(-8)) @@ -101130,11 +105375,11 @@ _152: } _sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regIns, i32(0), uint8(bool2int(_ipkColumn >= i32(0))), uint8(_onError), _endOfLoop, &_72_isReplace, nil) _sqlite3FkCheck(tls, _pParse, _pTab, i32(0), _regIns, nil, i32(0)) - _72_bUseSeek = bool2int((_72_isReplace == i32(0)) || ((_pTrigger == nil) && ((((_db.X6) & i32(524288)) == i32(0)) || (_sqlite3FkReferences(tls, _pTab) == nil)))) + _72_bUseSeek = bool2int((_72_isReplace == i32(0)) || ((_pTrigger == nil) && (((_db.X6 & i32(524288)) == i32(0)) || (_sqlite3FkReferences(tls, _pTab) == nil)))) _sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regIns, _aRegIdx, i32(0), int32(_appendFlag), _72_bUseSeek) _176: _130: - if ((_db.X6) & i32(128)) != i32(0) { + if (_db.X6 & i32(128)) != i32(0) { _sqlite3VdbeAddOp2(tls, _v, i32(73), _regRowCount, i32(1)) } if _pTrigger != nil { @@ -101155,7 +105400,7 @@ _insert_end: if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) { _sqlite3AutoincrementEnd(tls, _pParse) } - if (((_db.X6)&i32(128)) != 0 && ((_pParse.X6) == 0)) && ((*XTable)(_pParse.X40) == nil) { + if ((_db.X6&i32(128)) != 0 && (_pParse.X6 == 0)) && (_pParse.X40 == nil) { _sqlite3VdbeAddOp2(tls, _v, i32(67), _regRowCount, i32(1)) _sqlite3VdbeSetNumCols(tls, _v, i32(1)) _sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(118507), nil) @@ -101165,7 +105410,7 @@ _insert_cleanup: _sqlite3ExprListDelete(tls, _db, _pList) _sqlite3SelectDelete(tls, _db, _pSelect) _sqlite3IdListDelete(tls, _db, _pColumn) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aRegIdx)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_aRegIdx)) _ = _dest _ = _21_sNC } @@ -101176,29 +105421,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3InsertØ00__func__Ø000[0], str(118521), 14) } -// Attempt the transfer optimization on INSERTs of the form -// -// INSERT INTO tab1 SELECT * FROM tab2; -// -// The xfer optimization transfers raw records from tab2 over to tab1. -// Columns are not decoded and reassembled, which greatly improves -// performance. Raw index records are transferred in the same way. -// -// The xfer optimization is only attempted if tab1 and tab2 are compatible. -// There are lots of rules for determining compatibility - see comments -// embedded in the code for details. -// -// This routine returns TRUE if the optimization is guaranteed to be used. -// Sometimes the xfer optimization will only work if the destination table -// is empty - a factor that can only be determined at run-time. In that -// case, this routine generates code for the xfer optimization but also -// does a test to see if the destination table is empty and jumps over the -// xfer optimization code if the test fails. In that case, this routine -// returns FALSE so that the caller will know to go ahead and generate -// an unoptimized transfer. This routine also returns FALSE if there -// is no chance that the xfer optimization can be applied. -// -// This optimization is particularly useful at making VACUUM run faster. +// C comment +// /* +// ** Attempt the transfer optimization on INSERTs of the form +// ** +// ** INSERT INTO tab1 SELECT * FROM tab2; +// ** +// ** The xfer optimization transfers raw records from tab2 over to tab1. +// ** Columns are not decoded and reassembled, which greatly improves +// ** performance. Raw index records are transferred in the same way. +// ** +// ** The xfer optimization is only attempted if tab1 and tab2 are compatible. +// ** There are lots of rules for determining compatibility - see comments +// ** embedded in the code for details. +// ** +// ** This routine returns TRUE if the optimization is guaranteed to be used. +// ** Sometimes the xfer optimization will only work if the destination table +// ** is empty - a factor that can only be determined at run-time. In that +// ** case, this routine generates code for the xfer optimization but also +// ** does a test to see if the destination table is empty and jumps over the +// ** xfer optimization code if the test fails. In that case, this routine +// ** returns FALSE so that the caller will know to go ahead and generate +// ** an unoptimized transfer. This routine also returns FALSE if there +// ** is no chance that the xfer optimization can be applied. +// ** +// ** This optimization is particularly useful at making VACUUM run faster. +// */ func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect *XSelect, _onError int32, _iDbDest int32) (r0 int32) { var _i, _iDbSrc, _iSrc, _iDest, _addr1, _addr2, _emptyDestTest, _emptySrcTest, _regAutoinc, _destHasUniqueIdx, _regData, _regRowid int32 var _47_zColl *int8 @@ -101217,13 +105465,13 @@ func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect * if _pSelect == nil { return i32(0) } - if ((*XWith)(_pParse.X70) != nil) || ((*XWith)(_pSelect.X17) != nil) { + if (_pParse.X70 != nil) || (_pSelect.X17 != nil) { return i32(0) } if _sqlite3TriggerList(tls, _pParse, _pDest) != nil { return i32(0) } - if (_pDest.X16) != 0 { + if _pDest.X16 != 0 { return i32(0) } if _onError != i32(10) { @@ -101237,7 +105485,7 @@ func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect * } _5: func() { - if (*XSrcList)(_pSelect.X8) == nil { + if _pSelect.X8 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110825), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118535))) crt.X__builtin_abort(tls) } @@ -101245,19 +105493,19 @@ _5: if ((*XSrcList)(_pSelect.X8).X0) != i32(1) { return i32(0) } - if (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.X8).X2)))))+112*uintptr(i32(0)))).X5) != nil { + if ((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.X8).X2))))) + 112*uintptr(i32(0)))).X5) != nil { return i32(0) } - if (*XExpr)(_pSelect.X9) != nil { + if _pSelect.X9 != nil { return i32(0) } - if (*XExprList)(_pSelect.X12) != nil { + if _pSelect.X12 != nil { return i32(0) } - if (*XExprList)(_pSelect.X10) != nil { + if _pSelect.X10 != nil { return i32(0) } - if (*XExpr)(_pSelect.X15) != nil { + if _pSelect.X15 != nil { return i32(0) } func() { @@ -101266,10 +105514,10 @@ _5: crt.X__builtin_abort(tls) } }() - if (*XSelect)(_pSelect.X13) != nil { + if _pSelect.X13 != nil { return i32(0) } - if ((_pSelect.X3) & uint32(i32(1))) != 0 { + if (_pSelect.X3 & uint32(i32(1))) != 0 { return i32(0) } _pEList = (*XExprList)(_pSelect.X0) @@ -101279,16 +105527,16 @@ _5: crt.X__builtin_abort(tls) } }() - if (_pEList.X0) != i32(1) { + if _pEList.X0 != i32(1) { return i32(0) } func() { - if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(i32(0)))).X0) == nil { + if ((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2)))) + 32*uintptr(i32(0)))).X0) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110858), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118569))) crt.X__builtin_abort(tls) } }() - if int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+32*uintptr(i32(0)))).X0).X0) != i32(161) { + if int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pEList.X2))))+32*uintptr(i32(0)))).X0).X0) != i32(161) { return i32(0) } _pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.X8).X2))))) @@ -101299,13 +105547,13 @@ _5: if _pSrc == _pDest { return i32(0) } - if (((_pDest.X9) & uint32(i32(32))) == uint32(i32(0))) != (((_pSrc.X9) & uint32(i32(32))) == uint32(i32(0))) { + if ((_pDest.X9 & uint32(i32(32))) == uint32(i32(0))) != ((_pSrc.X9 & uint32(i32(32))) == uint32(i32(0))) { return i32(0) } - if (_pSrc.X16) != 0 { + if _pSrc.X16 != 0 { return i32(0) } - if (*XSelect)(_pSrc.X3) != nil { + if _pSrc.X3 != nil { return i32(0) } if int32(_pDest.X11) != int32(_pSrc.X11) { @@ -101327,7 +105575,7 @@ _33: if Xsqlite3_stricmp(tls, _23_pDestCol.X2, _23_pSrcCol.X2) != i32(0) { return i32(0) } - if ((_23_pDestCol.X3) != 0) && ((_23_pSrcCol.X3) == 0) { + if (_23_pDestCol.X3 != 0) && (_23_pSrcCol.X3 == 0) { return i32(0) } if _i <= i32(0) { @@ -101345,7 +105593,7 @@ _33: crt.X__builtin_abort(tls) } }() - if (((*XExpr)(_23_pDestCol.X1) == nil) != ((*XExpr)(_23_pSrcCol.X1) == nil)) || (((*XExpr)(_23_pDestCol.X1) != nil) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pDestCol.X1).X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pSrcCol.X1).X3)))))) != i32(0))) { + if (((*XExpr)(_23_pDestCol.X1) == nil) != ((*XExpr)(_23_pSrcCol.X1) == nil)) || ((_23_pDestCol.X1 != nil) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pDestCol.X1).X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pSrcCol.X1).X3)))))) != i32(0))) { return i32(0) } _41: @@ -101377,36 +105625,36 @@ _59: _pDestIdx = (*XIndex)(_pDestIdx.X5) goto _51 _54: - if ((*XExprList)(_pDest.X6) != nil) && _sqlite3ExprListCompare(tls, (*XExprList)(_pSrc.X6), (*XExprList)(_pDest.X6), i32(-1)) != 0 { + if (_pDest.X6 != nil) && _sqlite3ExprListCompare(tls, (*XExprList)(_pSrc.X6), (*XExprList)(_pDest.X6), i32(-1)) != 0 { return i32(0) } - if (((_db.X6) & i32(524288)) != i32(0)) && ((*XFKey)(_pDest.X4) != nil) { + if ((_db.X6 & i32(524288)) != i32(0)) && ((*XFKey)(_pDest.X4) != nil) { return i32(0) } - if ((_db.X6) & i32(128)) != i32(0) { + if (_db.X6 & i32(128)) != i32(0) { return i32(0) } _iDbSrc = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pSrc.X20)) _v = _sqlite3GetVdbe(tls, _pParse) _sqlite3CodeVerifySchema(tls, _pParse, _iDbSrc) - _iSrc = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) - _iDest = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _iSrc = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) + _iDest = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _regAutoinc = _autoIncBegin(tls, _pParse, _iDbDest, _pDest) _regData = _sqlite3GetTempReg(tls, _pParse) _regRowid = _sqlite3GetTempReg(tls, _pParse) _sqlite3OpenTable(tls, _pParse, _iDest, _iDbDest, _pDest, i32(107)) func() { - if ((_pDest.X9)&uint32(i32(32))) != uint32(i32(0)) && _destHasUniqueIdx == 0 { + if (_pDest.X9&uint32(i32(32))) != uint32(i32(0)) && _destHasUniqueIdx == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110971), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118688))) crt.X__builtin_abort(tls) } }() - if (((_db.X6) & i32(268435456)) == i32(0)) && ((((int32(_pDest.X10) < i32(0)) && ((*XIndex)(_pDest.X2) != nil)) || _destHasUniqueIdx != 0) || ((_onError != i32(2)) && (_onError != i32(1)))) { + if ((_db.X6 & i32(268435456)) == i32(0)) && ((((int32(_pDest.X10) < i32(0)) && ((*XIndex)(_pDest.X2) != nil)) || _destHasUniqueIdx != 0) || ((_onError != i32(2)) && (_onError != i32(1)))) { _addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iDest, i32(0)) _emptyDestTest = _sqlite3VdbeAddOp0(tls, _v, i32(13)) _sqlite3VdbeJumpHere(tls, _v, _addr1) } - if ((_pSrc.X9) & uint32(i32(32))) != uint32(i32(0)) { + if (_pSrc.X9 & uint32(i32(32))) != uint32(i32(0)) { goto _76 } _sqlite3OpenTable(tls, _pParse, _iSrc, _iDbSrc, _pSrc, i32(106)) @@ -101425,14 +105673,14 @@ _54: } _addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(125), _iSrc, _regRowid) func() { - if ((_pDest.X9) & uint32(i32(8))) != uint32(i32(0)) { + if (_pDest.X9 & uint32(i32(8))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111013), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118724))) crt.X__builtin_abort(tls) } }() _80: _sqlite3VdbeAddOp3(tls, _v, i32(124), _iSrc, _regData, i32(1)) - if ((_db.X6) & i32(268435456)) != 0 { + if (_db.X6 & i32(268435456)) != 0 { _sqlite3VdbeAddOp3(tls, _v, i32(33), _iDest, i32(0), i32(-1)) _37_insFlags = uint8(i32(57)) goto _84 @@ -101490,7 +105738,7 @@ _95: _sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pDestIdx.X0)) _addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iSrc, i32(0)) _sqlite3VdbeAddOp3(tls, _v, i32(124), _iSrc, _regData, i32(1)) - if ((_db.X6) & i32(268435456)) == 0 { + if (_db.X6 & i32(268435456)) == 0 { goto _99 } _i = i32(0) @@ -101498,7 +105746,7 @@ _100: if _i >= int32(_pSrcIdx.X14) { goto _103 } - _47_zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrcIdx.X8)) + 8*uintptr(_i))) + _47_zColl = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSrcIdx.X8)) + 8*uintptr(_i))) if Xsqlite3_stricmp(tls, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), _47_zColl) != 0 { goto _103 } @@ -101510,7 +105758,7 @@ _103: _sqlite3VdbeAddOp3(tls, _v, i32(33), _iDest, i32(0), i32(-1)) } _99: - if (((_pSrc.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pDestIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) { + if ((_pSrc.X9 & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pDestIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) { { p := &_44_idxInsFlags *p = uint8(int32(*p) | i32(1)) @@ -101547,15 +105795,18 @@ func init() { crt.Xstrncpy(nil, &_xferOptimizationØ00__func__Ø000[0], str(118772), 17) } -// Check to see if index pSrc is compatible as a source of data -// for index pDest in an insert transfer optimization. The rules -// for a compatible index: -// -// * The index is over the same set of columns -// * The same DESC and ASC markings occurs on all columns -// * The same onError processing (OE_Abort, OE_Ignore, etc) -// * The same collating sequence on each column -// * The index has the exact same WHERE clause +// C comment +// /* +// ** Check to see if index pSrc is compatible as a source of data +// ** for index pDest in an insert transfer optimization. The rules +// ** for a compatible index: +// ** +// ** * The index is over the same set of columns +// ** * The same DESC and ASC markings occurs on all columns +// ** * The same onError processing (OE_Abort, OE_Ignore, etc) +// ** * The same collating sequence on each column +// ** * The index has the exact same WHERE clause +// */ func _xferCompatibleIndex(tls *crt.TLS, _pDest *XIndex, _pSrc *XIndex) (r0 int32) { var _i int32 func() { @@ -101581,10 +105832,10 @@ _7: if _i >= int32(_pSrc.X13) { goto _10 } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X1)) + 2*uintptr(_i)))) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X1)) + 2*uintptr(_i)))) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSrc.X1)) + 2*uintptr(_i)))) != int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDest.X1)) + 2*uintptr(_i)))) { return i32(0) } - if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X1)) + 2*uintptr(_i)))) != i32(-2) { + if int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSrc.X1)) + 2*uintptr(_i)))) != i32(-2) { goto _12 } func() { @@ -101593,14 +105844,14 @@ _7: crt.X__builtin_abort(tls) } }() - if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSrc.X10).X2)))))+32*uintptr(_i))).X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pDest.X10).X2)))))+32*uintptr(_i))).X0), i32(-1)) != i32(0) { + if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSrc.X10).X2)))))+32*uintptr(_i))).X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pDest.X10).X2)))))+32*uintptr(_i))).X0), i32(-1)) != i32(0) { return i32(0) } _12: - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X7)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X7)) + 1*uintptr(_i)))) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSrc.X7)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDest.X7)) + 1*uintptr(_i)))) { return i32(0) } - if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X8)) + 8*uintptr(_i))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X8)) + 8*uintptr(_i)))) != i32(0) { + if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pSrc.X8)) + 8*uintptr(_i))), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDest.X8)) + 8*uintptr(_i)))) != i32(0) { return i32(0) } _i += 1 @@ -101618,36 +105869,39 @@ func init() { crt.Xstrncpy(nil, &_xferCompatibleIndexØ00__func__Ø000[0], str(118871), 20) } -// Locate or create an AutoincInfo structure associated with table pTab -// which is in database iDb. Return the register number for the register -// that holds the maximum rowid. Return zero if pTab is not an AUTOINCREMENT -// table. (Also return zero when doing a VACUUM since we do not want to -// update the AUTOINCREMENT counters during a VACUUM.) -// -// There is at most one AutoincInfo structure per table even if the -// same table is autoincremented multiple times due to inserts within -// triggers. A new AutoincInfo structure is created if this is the -// first use of table pTab. On 2nd and subsequent uses, the original -// AutoincInfo structure is used. -// -// Three memory locations are allocated: -// -// (1) Register to hold the name of the pTab table. -// (2) Register to hold the maximum ROWID of pTab. -// (3) Register to hold the rowid in sqlite_sequence of pTab -// -// The 2nd register is the one that is returned. That is all the -// insert routine needs to know about. +// C comment +// /* +// ** Locate or create an AutoincInfo structure associated with table pTab +// ** which is in database iDb. Return the register number for the register +// ** that holds the maximum rowid. Return zero if pTab is not an AUTOINCREMENT +// ** table. (Also return zero when doing a VACUUM since we do not want to +// ** update the AUTOINCREMENT counters during a VACUUM.) +// ** +// ** There is at most one AutoincInfo structure per table even if the +// ** same table is autoincremented multiple times due to inserts within +// ** triggers. A new AutoincInfo structure is created if this is the +// ** first use of table pTab. On 2nd and subsequent uses, the original +// ** AutoincInfo structure is used. +// ** +// ** Three memory locations are allocated: +// ** +// ** (1) Register to hold the name of the pTab table. +// ** (2) Register to hold the maximum ROWID of pTab. +// ** (3) Register to hold the rowid in sqlite_sequence of pTab +// ** +// ** The 2nd register is the one that is returned. That is all the +// ** insert routine needs to know about. +// */ func _autoIncBegin(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable) (r0 int32) { var _memId int32 var _1_pToplevel *XParse var _1_pInfo *TAggInfo_func _memId = i32(0) - if ((_pTab.X9)&uint32(i32(8))) == uint32(i32(0)) || (((*Xsqlite3)(_pParse.X0).X6)&i32(268435456)) != i32(0) { + if (_pTab.X9&uint32(i32(8))) == uint32(i32(0)) || (((*Xsqlite3)(_pParse.X0).X6)&i32(268435456)) != i32(0) { goto _1 } _1_pToplevel = func() *XParse { - if (*XParse)(_pParse.X39) != nil { + if _pParse.X39 != nil { return (*XParse)(_pParse.X39) } return _pParse @@ -101665,35 +105919,41 @@ _4: if _1_pInfo == nil { return i32(0) } - *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInfo.X0))))) = (*TAggInfo_func)(_1_pToplevel.X38) - *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pToplevel.X38))))) = _1_pInfo - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInfo.X1))))) = _pTab - *(*int32)(unsafe.Pointer(&(_1_pInfo.X2))) = _iDb - *(*int32)(unsafe.Pointer(&(_1_pToplevel.X18))) += 1 - *(*int32)(unsafe.Pointer(&(_1_pInfo.X3))) = preInc1((*int32)(unsafe.Pointer(&(_1_pToplevel.X18))), 1) - *(*int32)(unsafe.Pointer(&(_1_pToplevel.X18))) += 1 + *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pInfo.X0)))) = (*TAggInfo_func)(_1_pToplevel.X38) + *(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pToplevel.X38)))) = _1_pInfo + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pInfo.X1)))) = _pTab + *(*int32)(unsafe.Pointer(&_1_pInfo.X2)) = _iDb + *(*int32)(unsafe.Pointer(&_1_pToplevel.X18)) += 1 + *(*int32)(unsafe.Pointer(&_1_pInfo.X3)) = preInc1((*int32)(unsafe.Pointer(&_1_pToplevel.X18)), 1) + *(*int32)(unsafe.Pointer(&_1_pToplevel.X18)) += 1 _7: _memId = _1_pInfo.X3 _1: return _memId } -// Update the maximum rowid for an autoincrement calculation. -// -// This routine should be called when the regRowid register holds a -// new rowid that is about to be inserted. If that new rowid is -// larger than the maximum rowid in the memId memory cell, then the -// memory cell is updated. +// C comment +// /* +// ** Update the maximum rowid for an autoincrement calculation. +// ** +// ** This routine should be called when the regRowid register holds a +// ** new rowid that is about to be inserted. If that new rowid is +// ** larger than the maximum rowid in the memId memory cell, then the +// ** memory cell is updated. +// */ func _autoIncStep(tls *crt.TLS, _pParse *XParse, _memId int32, _regRowid int32) { if _memId > i32(0) { _sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(148), _memId, _regRowid) } } -// Return non-zero if the table pTab in database iDb or any of its indices -// have been opened at any point in the VDBE program. This is used to see if -// a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can -// run without using a temporary table for the results of the SELECT. +// C comment +// /* +// ** Return non-zero if the table pTab in database iDb or any of its indices +// ** have been opened at any point in the VDBE program. This is used to see if +// ** a statement of the form "INSERT INTO <iDb, pTab> SELECT ..." can +// ** run without using a temporary table for the results of the SELECT. +// */ func _readsTable(tls *crt.TLS, _p *XParse, _iDb int32, _pTab *XTable) (r0 int32) { var _i, _iEnd, _2_tnum int32 var _v *TVdbe @@ -101703,7 +105963,7 @@ func _readsTable(tls *crt.TLS, _p *XParse, _iDb int32, _pTab *XTable) (r0 int32) _v = _sqlite3GetVdbe(tls, _p) _iEnd = _sqlite3VdbeCurrentAddr(tls, _v) _pVTab = func() *XVTable { - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { return _sqlite3GetVTable(tls, (*Xsqlite3)(_p.X0), _pTab) } return nil @@ -101720,11 +105980,11 @@ _2: crt.X__builtin_abort(tls) } }() - if int32(_1_pOp.X0) != i32(106) || (_1_pOp.X5) != _iDb { + if int32(_1_pOp.X0) != i32(106) || _1_pOp.X5 != _iDb { goto _9 } _2_tnum = _1_pOp.X4 - if _2_tnum == (_pTab.X7) { + if _2_tnum == _pTab.X7 { return i32(1) } _2_pIndex = (*XIndex)(_pTab.X2) @@ -101732,16 +105992,16 @@ _11: if _2_pIndex == nil { goto _14 } - if _2_tnum == (_2_pIndex.X11) { + if _2_tnum == _2_pIndex.X11 { return i32(1) } _2_pIndex = (*XIndex)(_2_pIndex.X5) goto _11 _14: _9: - if (int32(_1_pOp.X0) == i32(158)) && ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6)))))) == _pVTab) { + if (int32(_1_pOp.X0) == i32(158)) && ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_1_pOp.X6))))) == _pVTab) { func() { - if (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6)))))) == nil { + if (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_1_pOp.X6))))) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109025), unsafe.Pointer((*int8)(unsafe.Pointer(&_readsTableØ00__func__Ø000))), unsafe.Pointer(str(118891))) crt.X__builtin_abort(tls) } @@ -101766,16 +106026,19 @@ func init() { crt.Xstrncpy(nil, &_readsTableØ00__func__Ø000[0], str(118908), 11) } -// Generate code that evaluates the given expression and puts the result -// in register target. -// -// Also make a copy of the expression results into another "cache" register -// and modify the expression so that the next time it is evaluated, -// the result is a copy of the cache register. -// -// This routine is used for expressions that are used multiple -// times. They are evaluated once and the results of the expression -// are reused. +// C comment +// /* +// ** Generate code that evaluates the given expression and puts the result +// ** in register target. +// ** +// ** Also make a copy of the expression results into another "cache" register +// ** and modify the expression so that the next time it is evaluated, +// ** the result is a copy of the cache register. +// ** +// ** This routine is used for expressions that are used multiple +// ** times. They are evaluated once and the results of the expression +// ** are reused. +// */ func _sqlite3ExprCodeAndCache(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) { var _iMem int32 var _v *TVdbe @@ -101793,7 +106056,7 @@ func _sqlite3ExprCodeAndCache(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _tar } }() _sqlite3ExprCode(tls, _pParse, _pExpr, _target) - _iMem = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _iMem = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeAddOp2(tls, _v, i32(64), _target, _iMem) _exprToRegister(tls, _pExpr, _iMem) } @@ -101804,29 +106067,32 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprCodeAndCacheØ00__func__Ø000[0], str(118942), 24) } -// Parse context structure pFrom has just been used to create a sub-vdbe -// (trigger program). If an error has occurred, transfer error information -// from pFrom to pTo. +// C comment +// /* +// ** Parse context structure pFrom has just been used to create a sub-vdbe +// ** (trigger program). If an error has occurred, transfer error information +// ** from pFrom to pTo. +// */ func _transferParseError(tls *crt.TLS, _pTo *XParse, _pFrom *XParse) { func() { - if (_pFrom.X1) != nil && (_pFrom.X16) == 0 { + if _pFrom.X1 != nil && _pFrom.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123418), unsafe.Pointer((*int8)(unsafe.Pointer(&_transferParseErrorØ00__func__Ø000))), unsafe.Pointer(str(118966))) crt.X__builtin_abort(tls) } }() func() { - if (_pTo.X1) != nil && (_pTo.X16) == 0 { + if _pTo.X1 != nil && _pTo.X16 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123419), unsafe.Pointer((*int8)(unsafe.Pointer(&_transferParseErrorØ00__func__Ø000))), unsafe.Pointer(str(118999))) crt.X__builtin_abort(tls) } }() - if (_pTo.X16) == i32(0) { - *(**int8)(unsafe.Pointer(&(_pTo.X1))) = _pFrom.X1 - *(*int32)(unsafe.Pointer(&(_pTo.X16))) = _pFrom.X16 - *(*int32)(unsafe.Pointer(&(_pTo.X3))) = _pFrom.X3 + if _pTo.X16 == i32(0) { + *(**int8)(unsafe.Pointer(&_pTo.X1)) = _pFrom.X1 + *(*int32)(unsafe.Pointer(&_pTo.X16)) = _pFrom.X16 + *(*int32)(unsafe.Pointer(&_pTo.X3)) = _pFrom.X3 goto _7 } - _sqlite3DbFree(tls, (*Xsqlite3)(_pFrom.X0), (unsafe.Pointer)(_pFrom.X1)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pFrom.X0), unsafe.Pointer(_pFrom.X1)) _7: } @@ -101836,15 +106102,18 @@ func init() { crt.Xstrncpy(nil, &_transferParseErrorØ00__func__Ø000[0], str(119028), 19) } -// This function returns a pointer to the array of opcodes associated with -// the Vdbe passed as the first argument. It is the callers responsibility -// to arrange for the returned array to be eventually freed using the -// vdbeFreeOpArray() function. -// -// Before returning, *pnOp is set to the number of entries in the returned -// array. Also, *pnMaxArg is set to the larger of its current value and -// the number of entries in the Vdbe.apArg[] array required to execute the -// returned program. +// C comment +// /* +// ** This function returns a pointer to the array of opcodes associated with +// ** the Vdbe passed as the first argument. It is the callers responsibility +// ** to arrange for the returned array to be eventually freed using the +// ** vdbeFreeOpArray() function. +// ** +// ** Before returning, *pnOp is set to the number of entries in the returned +// ** array. Also, *pnMaxArg is set to the larger of its current value and +// ** the number of entries in the Vdbe.apArg[] array required to execute the +// ** returned program. +// */ func _sqlite3VdbeTakeOpArray(tls *crt.TLS, _p *TVdbe, _pnOp *int32, _pnMaxArg *int32) (r0 *XVdbeOp) { var _aOp *XVdbeOp _aOp = (*XVdbeOp)(_p.X17) @@ -101855,14 +106124,14 @@ func _sqlite3VdbeTakeOpArray(tls *crt.TLS, _p *TVdbe, _pnOp *int32, _pnMaxArg *i } }() func() { - if (_p.X33) != uint32(i32(0)) { + if _p.X33 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72111), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000))), unsafe.Pointer(str(119075))) crt.X__builtin_abort(tls) } }() _resolveP2Values(tls, _p, _pnMaxArg) *_pnOp = _p.X27 - *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = nil + *(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X17)))) = nil return _aOp } @@ -101872,7 +106141,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeTakeOpArrayØ00__func__Ø000[0], str(119103), 23) } -// Generate code to drop a table. +// C comment +// /* +// ** Generate code to drop a table. +// */ func _sqlite3CodeDropTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDb int32, _isView int32) { var _db *Xsqlite3 var _pDb *XDb @@ -101888,7 +106160,7 @@ func _sqlite3CodeDropTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDb in } }() _sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb) - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3VdbeAddOp0(tls, _v, i32(155)) } _pTrigger = _sqlite3TriggerList(tls, _pParse, _pTab) @@ -101904,14 +106176,14 @@ _3: _pTrigger = (*XTrigger)(_pTrigger.X9) goto _3 } - if ((_pTab.X9) & uint32(i32(8))) != 0 { + if (_pTab.X9 & uint32(i32(8))) != 0 { _sqlite3NestedParse(tls, _pParse, str(119200), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_pTab.X0)) } _sqlite3NestedParse(tls, _pParse, str(119245), unsafe.Pointer(_pDb.X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pTab.X0)) - if (_isView == 0) && ((_pTab.X16) == 0) { + if (_isView == 0) && (_pTab.X16 == 0) { _destroyTable(tls, _pParse, _pTab) } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3VdbeAddOp4(tls, _v, i32(157), _iDb, i32(0), i32(0), _pTab.X0, i32(0)) } _sqlite3VdbeAddOp4(tls, _v, i32(141), _iDb, i32(0), i32(0), _pTab.X0, i32(0)) @@ -101925,7 +106197,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3CodeDropTableØ00__func__Ø000[0], str(119301), 21) } -// Drop a trigger given a pointer to that trigger. +// C comment +// /* +// ** Drop a trigger given a pointer to that trigger. +// */ func _sqlite3DropTriggerPtr(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger) { var _iDb, _1_code int32 var _1_zDb, _1_zTab *int8 @@ -101935,7 +106210,7 @@ func _sqlite3DropTriggerPtr(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger) _db = (*Xsqlite3)(_pParse.X0) _iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTrigger.X6)) func() { - if _iDb < i32(0) || _iDb >= (_db.X5) { + if _iDb < i32(0) || _iDb >= _db.X5 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123183), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000))), unsafe.Pointer(str(21738))) crt.X__builtin_abort(tls) } @@ -101986,10 +106261,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DropTriggerPtrØ00__func__Ø000[0], str(119418), 22) } -// Write VDBE code to erase table pTab and all associated indices on disk. -// Code to update the sqlite_master tables and internal schema definitions -// in case a root-page belonging to another table is moved by the btree layer -// is also added (this can happen with an auto-vacuum database). +// C comment +// /* +// ** Write VDBE code to erase table pTab and all associated indices on disk. +// ** Code to update the sqlite_master tables and internal schema definitions +// ** in case a root-page belonging to another table is moved by the btree layer +// ** is also added (this can happen with an auto-vacuum database). +// */ func _destroyTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) { var _iTab, _iDestroyed, _1_iLargest, _3_iIdx, _6_iDb int32 var _1_pIdx *XIndex @@ -102062,7 +106340,10 @@ func init() { crt.Xstrncpy(nil, &_destroyRootPageØ00__func__Ø000[0], str(119518), 16) } -// Clear the column names from every VIEW in database idx. +// C comment +// /* +// ** Clear the column names from every VIEW in database idx. +// */ func _sqliteViewResetAll(tls *crt.TLS, _db *Xsqlite3, _idx int32) { var _i *XHashElem var _1_pTab *XTable @@ -102081,10 +106362,10 @@ _3: goto _6 } _1_pTab = (*XTable)(_i.X2) - if (*XSelect)(_1_pTab.X3) != nil { + if _1_pTab.X3 != nil { _sqlite3DeleteColumnNames(tls, _db, _1_pTab) - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pTab.X1))))) = nil - *(*int16)(unsafe.Pointer(&(_1_pTab.X11))) = int16(i32(0)) + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pTab.X1)))) = nil + *(*int16)(unsafe.Pointer(&_1_pTab.X11)) = int16(i32(0)) } _i = (*XHashElem)(_i.X0) goto _3 @@ -102102,7 +106383,10 @@ func init() { crt.Xstrncpy(nil, &_sqliteViewResetAllØ00__func__Ø000[0], str(119569), 19) } -// The parser calls this routine in order to create a new VIEW +// C comment +// /* +// ** The parser calls this routine in order to create a new VIEW +// */ func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 *XToken, _pName2 *XToken, _pCNames *XExprList, _pSelect *XSelect, _isTemp int32, _noErr int32) { var _n, _iDb int32 var _z *int8 @@ -102119,7 +106403,7 @@ func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 } _sqlite3StartTable(tls, _pParse, _pName1, _pName2, _isTemp, i32(1), i32(0), _noErr) _p = (*XTable)(_pParse.X63) - if (_p == nil) || (_pParse.X16) != 0 { + if (_p == nil) || _pParse.X16 != 0 { goto _create_view_fail } _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName) @@ -102128,26 +106412,26 @@ func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 if _sqlite3FixSelect(tls, &_sFix, _pSelect) != 0 { goto _create_view_fail } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1)) - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = _sqlite3ExprListDup(tls, _db, _pCNames, i32(1)) - if (_db.X17) != 0 { + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1)) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X6)))) = _sqlite3ExprListDup(tls, _db, _pCNames, i32(1)) + if _db.X17 != 0 { goto _create_view_fail } _sEnd = _pParse.X51 func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_sEnd.X0)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_sEnd.X0)) + 1*uintptr(i32(0))))) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000))), unsafe.Pointer(str(119624))) crt.X__builtin_abort(tls) } }() - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_sEnd.X0)) + 1*uintptr(i32(0))))) != i32(59) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_sEnd.X0)) + 1*uintptr(i32(0))))) != i32(59) { { - p := (**int8)(unsafe.Pointer(&(_sEnd.X0))) - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sEnd.X1))) + p := (**int8)(unsafe.Pointer(&_sEnd.X0)) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sEnd.X1))) sink0(*p) } } - *(*uint32)(unsafe.Pointer(&(_sEnd.X1))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_sEnd.X1)) = uint32(i32(0)) _n = int32(int64((uintptr(unsafe.Pointer(_sEnd.X0)) - uintptr(unsafe.Pointer(_pBegin.X0))) / 1)) func() { if _n <= i32(0) { @@ -102157,12 +106441,12 @@ func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 }() _z = _pBegin.X0 _10: - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) & i32(1)) != 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1))))))))) & i32(1)) != 0 { _n -= 1 goto _10 } - *(**int8)(unsafe.Pointer(&(_sEnd.X0))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1)))) - *(*uint32)(unsafe.Pointer(&(_sEnd.X1))) = uint32(i32(1)) + *(**int8)(unsafe.Pointer(&_sEnd.X0)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1)))) + *(*uint32)(unsafe.Pointer(&_sEnd.X1)) = uint32(i32(1)) _sqlite3EndTable(tls, _pParse, nil, &_sEnd, uint8(i32(0)), nil) _create_view_fail: _sqlite3SelectDelete(tls, _db, _pSelect) @@ -102180,7 +106464,7 @@ func init() { func _parserDoubleLinkSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect) { var _1_mxSelect, _1_cnt int32 var _1_pNext, _1_pLoop *XSelect - if (*XSelect)(_p.X13) == nil { + if _p.X13 == nil { goto _0 } _1_pNext = nil @@ -102190,9 +106474,9 @@ _1: if _1_pLoop == nil { goto _4 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pLoop.X14))))) = _1_pNext + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pLoop.X14)))) = _1_pNext { - p := (*uint32)(unsafe.Pointer(&(_1_pLoop.X3))) + p := (*uint32)(unsafe.Pointer(&_1_pLoop.X3)) *p = (*p) | uint32(i32(256)) sink5(*p) } @@ -102202,7 +106486,7 @@ _1: }() += 1 goto _1 _4: - if ((((_p.X3) & uint32(i32(1024))) == uint32(i32(0))) && (store1(&_1_mxSelect, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(4))))) > i32(0))) && (_1_cnt > _1_mxSelect) { + if (((_p.X3 & uint32(i32(1024))) == uint32(i32(0))) && (store1(&_1_mxSelect, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(4))))) > i32(0))) && (_1_cnt > _1_mxSelect) { _sqlite3ErrorMsg(tls, _pParse, str(119655)) } _0: @@ -102214,12 +106498,15 @@ func init() { crt.Xstrncpy(nil, &_yy_reduceØ00__func__Ø000[0], str(119689), 10) } -// Set the ExprList.a[].zSpan element of the most recently added item -// on the expression list. -// -// pList might be NULL following an OOM error. But pSpan should never be -// NULL. If a memory allocation fails, the pParse->db->mallocFailed flag -// is set. +// C comment +// /* +// ** Set the ExprList.a[].zSpan element of the most recently added item +// ** on the expression list. +// ** +// ** pList might be NULL following an OOM error. But pSpan should never be +// ** NULL. If a memory allocation fails, the pParse->db->mallocFailed flag +// ** is set. +// */ func _sqlite3ExprListSetSpan(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pSpan *XExprSpan) { var _db *Xsqlite3 var _1_pItem *TExprList_item @@ -102231,21 +106518,21 @@ func _sqlite3ExprListSetSpan(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _ } }() if _pList != nil { - _1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr((_pList.X0)-i32(1)))) + _1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_pList.X0-i32(1)))) func() { - if (_pList.X0) <= i32(0) { + if _pList.X0 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92524), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000))), unsafe.Pointer(str(21335))) crt.X__builtin_abort(tls) } }() func() { - if (_db.X17) == 0 && (*XExpr)(_1_pItem.X0) != (*XExpr)(_pSpan.X0) { + if _db.X17 == 0 && (*XExpr)(_1_pItem.X0) != (*XExpr)(_pSpan.X0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92525), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000))), unsafe.Pointer(str(119731))) crt.X__builtin_abort(tls) } }() - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pItem.X2)) - *(**int8)(unsafe.Pointer(&(_1_pItem.X2))) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32(int64((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_pItem.X2)) + *(**int8)(unsafe.Pointer(&_1_pItem.X2)) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32(int64((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))) } } @@ -102255,39 +106542,45 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListSetSpanØ00__func__Ø000[0], str(119778), 23) } -// When building up a FROM clause in the parser, the join operator -// is initially attached to the left operand. But the code generator -// expects the join operator to be on the right operand. This routine -// Shifts all join operators from left to right for an entire FROM -// clause. -// -// Example: Suppose the join is like this: -// -// A natural cross join B -// -// The operator is "natural cross join". The A and B operands are stored -// in p->a[0] and p->a[1], respectively. The parser initially stores the -// operator with A. This routine shifts that operator over to B. +// C comment +// /* +// ** When building up a FROM clause in the parser, the join operator +// ** is initially attached to the left operand. But the code generator +// ** expects the join operator to be on the right operand. This routine +// ** Shifts all join operators from left to right for an entire FROM +// ** clause. +// ** +// ** Example: Suppose the join is like this: +// ** +// ** A natural cross join B +// ** +// ** The operator is "natural cross join". The A and B operands are stored +// ** in p->a[0] and p->a[1], respectively. The parser initially stores the +// ** operator with A. This routine shifts that operator over to B. +// */ func _sqlite3SrcListShiftJoinType(tls *crt.TLS, _p *XSrcList) { var _1_i int32 if _p == nil { goto _0 } - _1_i = (_p.X0) - i32(1) + _1_i = _p.X0 - i32(1) _1: if _1_i <= i32(0) { goto _4 } - *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr(_1_i))).X9))).X0))) = (*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr(_1_i-i32(1)))).X9))).X0 + *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_1_i))).X9))).X0))) = (*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_1_i-i32(1)))).X9))).X0 _1_i -= 1 goto _1 _4: - *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr(i32(0)))).X9))).X0))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(i32(0)))).X9))).X0))) = uint8(i32(0)) _0: } -// Add an INDEXED BY or NOT INDEXED clause to the most recently added -// element of the source-list passed as the second argument. +// C comment +// /* +// ** Add an INDEXED BY or NOT INDEXED clause to the most recently added +// ** element of the source-list passed as the second argument. +// */ func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pIndexedBy *XToken) { var _1_pItem *TSrcList_item func() { @@ -102297,7 +106590,7 @@ func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pInd } }() if _p == nil || func() int32 { - if (_p.X0) > i32(0) { + if _p.X0 > i32(0) { return i32(1) } return func() int32 { @@ -102308,31 +106601,31 @@ func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pInd }() == 0 { goto _5 } - _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr((_p.X0)-i32(1)))) + _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_p.X0-i32(1)))) func() { - if int32((uint32((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103579), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119815))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103580), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119839))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119864))) crt.X__builtin_abort(tls) } }() - if ((_pIndexedBy.X1) == uint32(i32(1))) && ((_pIndexedBy.X0) == nil) { - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(i32(1)), 1, 0) + if (_pIndexedBy.X1 == uint32(i32(1))) && (_pIndexedBy.X0 == nil) { + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1))), int8(i32(1)), 1, 0) goto _14 } - *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15))))) = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pIndexedBy) - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(bool2int((*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15)))))) != nil)), 2, 1) + *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pItem.X15)))) = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pIndexedBy) + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1))), int8(bool2int((*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pItem.X15))))) != nil)), 2, 1) _14: _5: } @@ -102343,32 +106636,35 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListIndexedByØ00__func__Ø000[0], str(119887), 24) } -// Add the list of function arguments to the SrcList entry for a -// table-valued-function. +// C comment +// /* +// ** Add the list of function arguments to the SrcList entry for a +// ** table-valued-function. +// */ func _sqlite3SrcListFuncArgs(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pList *XExprList) { var _1_pItem *TSrcList_item if _p != nil { - _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 112*uintptr((_p.X0)-i32(1)))) + _1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_p.X2)))) + 112*uintptr(_p.X0-i32(1)))) func() { - if int32((uint32((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103600), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119815))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)>>uint(i32(1)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103601), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119839))) crt.X__builtin_abort(tls) } }() func() { - if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { + if int32((uint32(((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1)>>uint(i32(2)))<<uint(i32(31)))>>uint(i32(31))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103602), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119864))) crt.X__builtin_abort(tls) } }() - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15))))))) = _pList - storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(i32(1)), 4, 2) + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&_1_pItem.X15)))))) = _pList + storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&_1_pItem.X9)).X1))), int8(i32(1)), 4, 2) goto _7 } _sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _pList) @@ -102381,45 +106677,48 @@ func init() { crt.Xstrncpy(nil, &_sqlite3SrcListFuncArgsØ00__func__Ø000[0], str(119911), 23) } -// Given 1 to 3 identifiers preceding the JOIN keyword, determine the -// type of join. Return an integer constant that expresses that type -// in terms of the following bit values: -// -// JT_INNER -// JT_CROSS -// JT_OUTER -// JT_NATURAL -// JT_LEFT -// JT_RIGHT -// -// A full outer join is the combination of JT_LEFT and JT_RIGHT. -// -// If an illegal or unsupported join type is seen, then still return -// a join type, but put an error in the pParse structure. +// C comment +// /* +// ** Given 1 to 3 identifiers preceding the JOIN keyword, determine the +// ** type of join. Return an integer constant that expresses that type +// ** in terms of the following bit values: +// ** +// ** JT_INNER +// ** JT_CROSS +// ** JT_OUTER +// ** JT_NATURAL +// ** JT_LEFT +// ** JT_RIGHT +// ** +// ** A full outer join is the combination of JT_LEFT and JT_RIGHT. +// ** +// ** If an illegal or unsupported join type is seen, then still return +// ** a join type, but put an error in the pParse structure. +// */ func _sqlite3JoinType(tls *crt.TLS, _pParse *XParse, _pA *XToken, _pB *XToken, _pC *XToken) (r0 int32) { var _jointype, _i, _j int32 var _5_zSp *int8 var _p *XToken var _apAll [3]*XToken _jointype = i32(0) - *(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 8*uintptr(i32(0)))) = _pA - *(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 8*uintptr(i32(1)))) = _pB - *(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 8*uintptr(i32(2)))) = _pC + *(**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apAll)) + 8*uintptr(i32(0)))) = _pA + *(**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apAll)) + 8*uintptr(i32(1)))) = _pB + *(**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apAll)) + 8*uintptr(i32(2)))) = _pC _i = i32(0) _0: - if _i >= i32(3) || (*(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 8*uintptr(_i)))) == nil { + if _i >= i32(3) || (*(**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apAll)) + 8*uintptr(_i)))) == nil { goto _4 } - _p = *(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 8*uintptr(_i))) + _p = *(**XToken)(unsafe.Pointer(uintptr(unsafe.Pointer(&_apAll)) + 8*uintptr(_i))) _j = i32(0) _5: if _j >= i32(7) { goto _8 } - if ((_p.X1) == uint32((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X1)) && (Xsqlite3_strnicmp(tls, _p.X0, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00zKeyTextØ001))+1*uintptr((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X0))), int32(_p.X1)) == i32(0)) { + if (_p.X1 == uint32((*t77)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X1)) && (Xsqlite3_strnicmp(tls, _p.X0, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3JoinTypeØ00zKeyTextØ001))+1*uintptr((*t77)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X0))), int32(_p.X1)) == i32(0)) { { p := &_jointype - *p = (*p) | int32((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X2) + *p = (*p) | int32((*t77)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X2) sink1(*p) } goto _8 @@ -102492,15 +106791,18 @@ func init() { crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00__func__Ø000[0], str(120075), 16) } -// pColumns and pExpr form a vector assignment which is part of the SET -// clause of an UPDATE statement. Like this: -// -// (a,b,c) = (expr1,expr2,expr3) -// Or: (a,b,c) = (SELECT x,y,z FROM ....) -// -// For each term of the vector assignment, append new entries to the -// expression list pList. In the case of a subquery on the RHS, append -// TK_SELECT_COLUMN expressions. +// C comment +// /* +// ** pColumns and pExpr form a vector assignment which is part of the SET +// ** clause of an UPDATE statement. Like this: +// ** +// ** (a,b,c) = (expr1,expr2,expr3) +// ** Or: (a,b,c) = (SELECT x,y,z FROM ....) +// ** +// ** For each term of the vector assignment, append new entries to the +// ** expression list pList. In the case of a subquery on the RHS, append +// ** TK_SELECT_COLUMN expressions. +// */ func _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pColumns *XIdList, _pExpr *XExpr) (r0 *XExprList) { var _n, _i, _iFirst int32 var _db *Xsqlite3 @@ -102508,7 +106810,7 @@ func _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprLi _db = (*Xsqlite3)(_pParse.X0) _iFirst = func() int32 { if _pList != nil { - return (_pList.X0) + return _pList.X0 } return i32(0) }() @@ -102527,31 +106829,31 @@ func _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprLi if _pExpr == nil { goto _vector_append_error } - if (int32(_pExpr.X0) != i32(119)) && ((_pColumns.X1) != store1(&_n, _sqlite3ExprVectorSize(tls, _pExpr))) { + if (int32(_pExpr.X0) != i32(119)) && (_pColumns.X1 != store1(&_n, _sqlite3ExprVectorSize(tls, _pExpr))) { _sqlite3ErrorMsg(tls, _pParse, str(42971), _pColumns.X1, _n) goto _vector_append_error } _i = i32(0) _8: - if _i >= (_pColumns.X1) { + if _i >= _pColumns.X1 { goto _11 } _2_pSubExpr = _sqlite3ExprForVectorField(tls, _pParse, _pExpr, _i) _pList = _sqlite3ExprListAppend(tls, _pParse, _pList, _2_pSubExpr) if _pList != nil { func() { - if (_pList.X0) != ((_iFirst + _i) + i32(1)) { + if _pList.X0 != ((_iFirst + _i) + i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92441), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(120091))) crt.X__builtin_abort(tls) } }() - *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr((_pList.X0)-i32(1)))).X1))) = (*TIdList_item)(unsafe.Pointer(uintptr(_pColumns.X0) + 16*uintptr(_i))).X0 + *(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_pList.X0-i32(1)))).X1))) = (*TIdList_item)(unsafe.Pointer(uintptr(_pColumns.X0) + 16*uintptr(_i))).X0 *(**int8)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pColumns.X0) + 16*uintptr(_i))).X0))) = nil } _i += 1 goto _8 _11: - if (((_db.X17) == 0) && (int32(_pExpr.X0) == i32(119))) && func() int32 { + if ((_db.X17 == 0) && (int32(_pExpr.X0) == i32(119))) && func() int32 { if _pList != nil { return i32(1) } @@ -102561,7 +106863,7 @@ _11: return i32(0) }() }() != 0 { - _4_pFirst = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 32*uintptr(_iFirst))).X0) + _4_pFirst = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_pList.X2)))) + 32*uintptr(_iFirst))).X0) func() { if _4_pFirst == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92449), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(120116))) @@ -102574,9 +106876,9 @@ _11: crt.X__builtin_abort(tls) } }() - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pFirst.X5))))) = _pExpr + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pFirst.X5)))) = _pExpr _pExpr = nil - *(*int32)(unsafe.Pointer(&(_4_pFirst.X8))) = _pColumns.X1 + *(*int32)(unsafe.Pointer(&_4_pFirst.X8)) = _pColumns.X1 } _vector_append_error: _sqlite3ExprDelete(tls, _db, _pExpr) @@ -102590,10 +106892,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprListAppendVectorØ00__func__Ø000[0], str(120155), 28) } -// Append a new element to the given IdList. Create a new IdList if -// need be. -// -// A new IdList is returned, or NULL if malloc() fails. +// C comment +// /* +// ** Append a new element to the given IdList. Create a new IdList if +// ** need be. +// ** +// ** A new IdList is returned, or NULL if malloc() fails. +// */ func _sqlite3IdListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList, _pToken *XToken) (r0 *XIdList) { var _i int32 if _pList != nil { @@ -102604,7 +106909,7 @@ func _sqlite3IdListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList, _pToken return nil } _0: - *(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = (*TIdList_item)(_sqlite3ArrayAllocate(tls, _db, _pList.X0, int32(u64(16)), (*int32)(unsafe.Pointer(&(_pList.X1))), &_i)) + *(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pList.X0)))) = (*TIdList_item)(_sqlite3ArrayAllocate(tls, _db, _pList.X0, int32(u64(16)), (*int32)(unsafe.Pointer(&_pList.X1)), &_i)) if _i < i32(0) { _sqlite3IdListDelete(tls, _db, _pList) return nil @@ -102614,24 +106919,27 @@ _0: } func _spanSet(tls *crt.TLS, _pOut *XExprSpan, _pStart *XToken, _pEnd *XToken) { - *(**int8)(unsafe.Pointer(&(_pOut.X1))) = _pStart.X0 - *(**int8)(unsafe.Pointer(&(_pOut.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pEnd.X0)) + 1*uintptr(_pEnd.X1))) -} - -// Assign a variable number to an expression that encodes a wildcard -// in the original SQL statement. -// -// Wildcards consisting of a single "?" are assigned the next sequential -// variable number. -// -// Wildcards of the form "?nnn" are assigned the number "nnn". We make -// sure "nnn" is not too big to avoid a denial of service attack when -// the SQL statement comes from an external source. -// -// Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number -// as the previous instance of the same wildcard. Or if this is the first -// instance of the wildcard, the next sequential variable number is -// assigned. + *(**int8)(unsafe.Pointer(&_pOut.X1)) = _pStart.X0 + *(**int8)(unsafe.Pointer(&_pOut.X2)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pEnd.X0)) + 1*uintptr(_pEnd.X1))) +} + +// C comment +// /* +// ** Assign a variable number to an expression that encodes a wildcard +// ** in the original SQL statement. +// ** +// ** Wildcards consisting of a single "?" are assigned the next sequential +// ** variable number. +// ** +// ** Wildcards of the form "?nnn" are assigned the number "nnn". We make +// ** sure "nnn" is not too big to avoid a denial of service attack when +// ** the SQL statement comes from an external source. +// ** +// ** Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number +// ** as the previous instance of the same wildcard. Or if this is the first +// ** instance of the wildcard, the next sequential variable number is +// ** assigned. +// */ func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _n uint32) { var _x int16 var _2_doAdd, _3_bOk int32 @@ -102643,12 +106951,12 @@ func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ return } func() { - if ((_pExpr.X2) & uint32(i32(25600))) != uint32(i32(0)) { + if (_pExpr.X2 & uint32(i32(25600))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91849), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120183))) crt.X__builtin_abort(tls) } }() - _z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) + _z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pExpr.X3)))) func() { if _z == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91851), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(44451))) @@ -102656,7 +106964,7 @@ func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ } }() func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91852), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120244))) crt.X__builtin_abort(tls) } @@ -102667,34 +106975,34 @@ func _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ crt.X__builtin_abort(tls) } }() - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) == i32(0) { func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(63) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(63) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91856), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120279))) crt.X__builtin_abort(tls) } }() - _x = preInc18((*int16)(unsafe.Pointer(&(_pParse.X52))), 1) + _x = preInc18((*int16)(unsafe.Pointer(&_pParse.X52)), 1) goto _12 } _2_doAdd = i32(0) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(63) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(63) { goto _13 } if _n == uint32(i32(2)) { - _3_i = int64(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) - i32(48)) + _3_i = int64(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) - i32(48)) _3_bOk = i32(1) goto _15 } - _3_bOk = bool2int(i32(0) == _sqlite3Atoi64(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(1)))), &_3_i, int32(_n-uint32(i32(1))), uint8(i32(1)))) + _3_bOk = bool2int(i32(0) == _sqlite3Atoi64(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(i32(1)))), &_3_i, int32(_n-uint32(i32(1))), uint8(i32(1)))) _15: - if ((_3_bOk == i32(0)) || (_3_i < int64(i32(1)))) || (_3_i > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9)))))) { - _sqlite3ErrorMsg(tls, _pParse, str(120289), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9))))) + if ((_3_bOk == i32(0)) || (_3_i < int64(i32(1)))) || (_3_i > int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(9)))))) { + _sqlite3ErrorMsg(tls, _pParse, str(120289), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(9))))) return } _x = int16(_3_i) if int32(_x) > int32(_pParse.X52) { - *(*int16)(unsafe.Pointer(&(_pParse.X52))) = int16(int32(_x)) + *(*int16)(unsafe.Pointer(&_pParse.X52)) = int16(int32(_x)) _2_doAdd = i32(1) goto _21 } @@ -102706,16 +107014,16 @@ _21: _13: _x = int16(_sqlite3VListNameToNum(tls, _pParse.X60, _z, int32(_n))) if int32(_x) == i32(0) { - _x = preInc18((*int16)(unsafe.Pointer(&(_pParse.X52))), 1) + _x = preInc18((*int16)(unsafe.Pointer(&_pParse.X52)), 1) _2_doAdd = i32(1) } _22: if _2_doAdd != 0 { - *(**int32)(unsafe.Pointer(&(_pParse.X60))) = _sqlite3VListAdd(tls, _db, _pParse.X60, _z, int32(_n), int32(_x)) + *(**int32)(unsafe.Pointer(&_pParse.X60)) = _sqlite3VListAdd(tls, _db, _pParse.X60, _z, int32(_n), int32(_x)) } _12: - *(*int16)(unsafe.Pointer(&(_pExpr.X9))) = _x - if int32(_x) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9))))) { + *(*int16)(unsafe.Pointer(&_pExpr.X9)) = _x + if int32(_x) > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(9))))) { _sqlite3ErrorMsg(tls, _pParse, str(120332)) } } @@ -102726,83 +107034,86 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprAssignVarNumberØ00__func__Ø000[0], str(120355), 27) } -// Add a new name/number pair to a VList. This might require that the -// VList object be reallocated, so return the new VList. If an OOM -// error occurs, the original VList returned and the -// db->mallocFailed flag is set. -// -// A VList is really just an array of integers. To destroy a VList, -// simply pass it to sqlite3DbFree(). -// -// The first integer is the number of integers allocated for the whole -// VList. The second integer is the number of integers actually used. -// Each name/number pair is encoded by subsequent groups of 3 or more -// integers. -// -// Each name/number pair starts with two integers which are the numeric -// value for the pair and the size of the name/number pair, respectively. -// The text name overlays one or more following integers. The text name -// is always zero-terminated. -// -// Conceptually: -// -// struct VList { -// int nAlloc; // Number of allocated slots -// int nUsed; // Number of used slots -// struct VListEntry { -// int iValue; // Value for this entry -// int nSlot; // Slots used by this entry -// // ... variable name goes here -// } a[0]; -// } -// -// During code generation, pointers to the variable names within the -// VList are taken. When that happens, nAlloc is set to zero as an -// indication that the VList may never again be enlarged, since the -// accompanying realloc() would invalidate the pointers. +// C comment +// /* +// ** Add a new name/number pair to a VList. This might require that the +// ** VList object be reallocated, so return the new VList. If an OOM +// ** error occurs, the original VList returned and the +// ** db->mallocFailed flag is set. +// ** +// ** A VList is really just an array of integers. To destroy a VList, +// ** simply pass it to sqlite3DbFree(). +// ** +// ** The first integer is the number of integers allocated for the whole +// ** VList. The second integer is the number of integers actually used. +// ** Each name/number pair is encoded by subsequent groups of 3 or more +// ** integers. +// ** +// ** Each name/number pair starts with two integers which are the numeric +// ** value for the pair and the size of the name/number pair, respectively. +// ** The text name overlays one or more following integers. The text name +// ** is always zero-terminated. +// ** +// ** Conceptually: +// ** +// ** struct VList { +// ** int nAlloc; // Number of allocated slots +// ** int nUsed; // Number of used slots +// ** struct VListEntry { +// ** int iValue; // Value for this entry +// ** int nSlot; // Slots used by this entry +// ** // ... variable name goes here +// ** } a[0]; +// ** } +// ** +// ** During code generation, pointers to the variable names within the +// ** VList are taken. When that happens, nAlloc is set to zero as an +// ** indication that the VList may never again be enlarged, since the +// ** accompanying realloc() would invalidate the pointers. +// */ func _sqlite3VListAdd(tls *crt.TLS, _db *Xsqlite3, _pIn *int32, _zName *int8, _nName int32, _iVal int32) (r0 *int32) { var _nInt, _i, _1_nAlloc int32 var _1_pOut *int32 var _z *int8 _nInt = (_nName / i32(4)) + i32(3) func() { - if _pIn != nil && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) < i32(3) { + if _pIn != nil && (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(0))))) < i32(3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29170), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000))), unsafe.Pointer(str(120382))) crt.X__builtin_abort(tls) } }() - if _pIn != nil && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))))+_nInt) <= (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) { + if _pIn != nil && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1)))))+_nInt) <= (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(0))))) { goto _4 } _1_nAlloc = func() int32 { if _pIn != nil { - return ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) * i32(2)) + return ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(0))))) * i32(2)) } return i32(10) }() + _nInt - _1_pOut = (*int32)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pIn), uint64(_1_nAlloc)*u64(4))) + _1_pOut = (*int32)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pIn), uint64(_1_nAlloc)*u64(4))) if _1_pOut == nil { return _pIn } if _pIn == nil { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOut)) + 4*uintptr(i32(1)))) = i32(2) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pOut)) + 4*uintptr(i32(1)))) = i32(2) } _pIn = _1_pOut - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0)))) = _1_nAlloc + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(0)))) = _1_nAlloc _4: - _i = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i))) = _iVal - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1)))) = _nInt - _z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2)))))) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))) = _i + _nInt + _i = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1)))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i))) = _iVal + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(1)))) = _nInt + _z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(_i+i32(2)))))) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1)))) = _i + _nInt func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1))))) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(1))))) > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIn)) + 4*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000))), unsafe.Pointer(str(120402))) crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_zName), uint64(_nName)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nName))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(_zName), uint64(_nName)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_nName))) = int8(i32(0)) return _pIn } @@ -102812,8 +107123,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VListAddØ00__func__Ø000[0], str(120417), 16) } -// Construct a new expression node for a function with multiple -// arguments. +// C comment +// /* +// ** Construct a new expression node for a function with multiple +// ** arguments. +// */ func _sqlite3ExprFunction(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pToken *XToken) (r0 *XExpr) { var _db *Xsqlite3 var _pNew *XExpr @@ -102829,9 +107143,9 @@ func _sqlite3ExprFunction(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pTo _sqlite3ExprListDelete(tls, _db, _pList) return nil } - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _pList + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pNew.X6)))))) = _pList func() { - if ((_pNew.X2) & uint32(i32(2048))) != uint32(i32(0)) { + if (_pNew.X2 & uint32(i32(2048))) != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000))), unsafe.Pointer(str(103875))) crt.X__builtin_abort(tls) } @@ -102846,14 +107160,17 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ExprFunctionØ00__func__Ø000[0], str(120440), 20) } -// Set the Expr.nHeight variable using the exprSetHeight() function. If -// the height is greater than the maximum allowed expression depth, -// leave an error in pParse. -// -// Also propagate all EP_Propagate flags from the Expr.x.pList into -// Expr.flags. +// C comment +// /* +// ** Set the Expr.nHeight variable using the exprSetHeight() function. If +// ** the height is greater than the maximum allowed expression depth, +// ** leave an error in pParse. +// ** +// ** Also propagate all EP_Propagate flags from the Expr.x.pList into +// ** Expr.flags. +// */ func _sqlite3ExprSetHeightAndFlags(tls *crt.TLS, _pParse *XParse, _p *XExpr) { - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return } _exprSetHeight(tls, _p) @@ -102861,44 +107178,47 @@ func _sqlite3ExprSetHeightAndFlags(tls *crt.TLS, _pParse *XParse, _p *XExpr) { } func _spanBinaryExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExprSpan, _pRight *XExprSpan) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLeft.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pLeft.X0), (*XExpr)(_pRight.X0)) - *(**int8)(unsafe.Pointer(&(_pLeft.X2))) = _pRight.X2 + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pLeft.X0)))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pLeft.X0), (*XExpr)(_pRight.X0)) + *(**int8)(unsafe.Pointer(&_pLeft.X2)) = _pRight.X2 } func _exprNot(tls *crt.TLS, _pParse *XParse, _doNot int32, _pSpan *XExprSpan) { if _doNot != 0 { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSpan.X0))))) = _sqlite3PExpr(tls, _pParse, i32(19), (*XExpr)(_pSpan.X0), nil) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pSpan.X0)))) = _sqlite3PExpr(tls, _pParse, i32(19), (*XExpr)(_pSpan.X0), nil) } } func _spanUnaryPostfix(tls *crt.TLS, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPostOp *XToken) { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOperand.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil) - *(**int8)(unsafe.Pointer(&(_pOperand.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPostOp.X0)) + 1*uintptr(_pPostOp.X1))) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOperand.X0)))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil) + *(**int8)(unsafe.Pointer(&_pOperand.X2)) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPostOp.X0)) + 1*uintptr(_pPostOp.X1))) } func _binaryToUnaryIfNull(tls *crt.TLS, _pParse *XParse, _pY *XExpr, _pA *XExpr, _op int32) { var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) if ((_pA != nil) && (_pY != nil)) && (int32(_pY.X0) == i32(101)) { - *(*uint8)(unsafe.Pointer(&(_pA.X0))) = uint8(_op) + *(*uint8)(unsafe.Pointer(&_pA.X0)) = uint8(_op) _sqlite3ExprDelete(tls, _db, (*XExpr)(_pA.X5)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X5))))) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pA.X5)))) = nil } } func _spanUnaryPrefix(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPreOp *XToken) { - *(**int8)(unsafe.Pointer(&(_pOut.X1))) = _pPreOp.X0 - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil) - *(**int8)(unsafe.Pointer(&(_pOut.X2))) = _pOperand.X2 + *(**int8)(unsafe.Pointer(&_pOut.X1)) = _pPreOp.X0 + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pOut.X0)))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil) + *(**int8)(unsafe.Pointer(&_pOut.X2)) = _pOperand.X2 } -// Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due -// do a memory allocation failure) then delete the pSelect object. +// C comment +// /* +// ** Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due +// ** do a memory allocation failure) then delete the pSelect object. +// */ func _sqlite3PExprAddSelect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSelect *XSelect) { if _pExpr != nil { - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) = _pSelect + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&_pExpr.X6)))))) = _pSelect { - p := (*uint32)(unsafe.Pointer(&(_pExpr.X2))) + p := (*uint32)(unsafe.Pointer(&_pExpr.X2)) *p = (*p) | uint32(i32(2099200)) sink5(*p) } @@ -102931,8 +107251,11 @@ func _parserAddExprIdListTerm(tls *crt.TLS, _pParse *XParse, _pPrior *XExprList, return _p } -// This routine will drop an existing named index. This routine -// implements the DROP INDEX statement. +// C comment +// /* +// ** This routine will drop an existing named index. This routine +// ** implements the DROP INDEX statement. +// */ func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExists int32) { var _iDb, _7_code int32 var _7_zDb, _7_zTab *int8 @@ -102942,16 +107265,16 @@ func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExist var _pIndex *XIndex _db = (*Xsqlite3)(_pParse.X0) func() { - if (_pParse.X16) != i32(0) { + if _pParse.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000))), unsafe.Pointer(str(112366))) crt.X__builtin_abort(tls) } }() - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _exit_drop_index } func() { - if (_pName.X0) != i32(1) { + if _pName.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103189), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000))), unsafe.Pointer(str(114791))) crt.X__builtin_abort(tls) } @@ -102959,7 +107282,7 @@ func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExist if i32(0) != _sqlite3ReadSchema(tls, _pParse) { goto _exit_drop_index } - _pIndex = _sqlite3FindIndex(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+112*uintptr(i32(0)))).X2, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+112*uintptr(i32(0)))).X1) + _pIndex = _sqlite3FindIndex(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2))))+112*uintptr(i32(0)))).X2, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2))))+112*uintptr(i32(0)))).X1) if _pIndex != nil { goto _6 } @@ -102967,9 +107290,9 @@ func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExist _sqlite3ErrorMsg(tls, _pParse, str(120520), unsafe.Pointer(_pName), i32(0)) goto _8 } - _sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+112*uintptr(i32(0)))).X1) + _sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2))))+112*uintptr(i32(0)))).X1) _8: - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) goto _exit_drop_index _6: if int32((uint32(_pIndex.X16)<<uint(i32(30)))>>uint(i32(30))) != i32(0) { @@ -103014,34 +107337,37 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DropIndexØ00__func__Ø000[0], str(120660), 17) } -// The VACUUM command is used to clean up the database, -// collapse free space, etc. It is modelled after the VACUUM command -// in PostgreSQL. The VACUUM command works as follows: -// -// (1) Create a new transient database file -// (2) Copy all content from the database being vacuumed into -// the new transient database file -// (3) Copy content from the transient database back into the -// original database. -// -// The transient database requires temporary disk space approximately -// equal to the size of the original database. The copy operation of -// step (3) requires additional temporary disk space approximately equal -// to the size of the original database for the rollback journal. -// Hence, temporary disk space that is approximately 2x the size of the -// original database is required. Every page of the database is written -// approximately 3 times: Once for step (2) and twice for step (3). -// Two writes per page are required in step (3) because the original -// database content must be written into the rollback journal prior to -// overwriting the database with the vacuumed content. -// -// Only 1x temporary space and only 1x writes would be required if -// the copy of step (3) were replaced by deleting the original database -// and renaming the transient database as the original. But that will -// not work if other processes are attached to the original database. -// And a power loss in between deleting the original and renaming the -// transient would cause the database file to appear to be deleted -// following reboot. +// C comment +// /* +// ** The VACUUM command is used to clean up the database, +// ** collapse free space, etc. It is modelled after the VACUUM command +// ** in PostgreSQL. The VACUUM command works as follows: +// ** +// ** (1) Create a new transient database file +// ** (2) Copy all content from the database being vacuumed into +// ** the new transient database file +// ** (3) Copy content from the transient database back into the +// ** original database. +// ** +// ** The transient database requires temporary disk space approximately +// ** equal to the size of the original database. The copy operation of +// ** step (3) requires additional temporary disk space approximately equal +// ** to the size of the original database for the rollback journal. +// ** Hence, temporary disk space that is approximately 2x the size of the +// ** original database is required. Every page of the database is written +// ** approximately 3 times: Once for step (2) and twice for step (3). +// ** Two writes per page are required in step (3) because the original +// ** database content must be written into the rollback journal prior to +// ** overwriting the database with the vacuumed content. +// ** +// ** Only 1x temporary space and only 1x writes would be required if +// ** the copy of step (3) were replaced by deleting the original database +// ** and renaming the transient database as the original. But that will +// ** not work if other processes are attached to the original database. +// ** And a power loss in between deleting the original and renaming the +// ** transient would cause the database file to appear to be deleted +// ** following reboot. +// */ func _sqlite3Vacuum(tls *crt.TLS, _pParse *XParse, _pNm *XToken) { var _iDb int32 var _v *TVdbe @@ -103064,19 +107390,22 @@ _1: } } -// Process a pragma statement. -// -// Pragmas are of this form: -// -// PRAGMA [schema.]id [= value] -// -// The identifier might also be a string. The value is a string, and -// identifier, or a number. If minusFlag is true, then the value is -// a number that was preceded by a minus sign. -// -// If the left side is "database.id" then pId1 is the database name -// and pId2 is the id. If the left side is just "id" then pId1 is the -// id and pId2 is any empty string. +// C comment +// /* +// ** Process a pragma statement. +// ** +// ** Pragmas are of this form: +// ** +// ** PRAGMA [schema.]id [= value] +// ** +// ** The identifier might also be a string. The value is a string, and +// ** identifier, or a number. If minusFlag is true, then the value is +// ** a number that was preceded by a minus sign. +// ** +// ** If the left side is "database.id" then pId1 is the database name +// ** and pId2 is the id. If the left side is just "id" then pId1 is the +// ** id and pId2 is any empty string. +// */ func _sqlite3Pragma(tls *crt.TLS, _pParse *XParse, _pId1 *XToken, _pId2 *XToken, _pValue *XToken, _minusFlag int32) { var _99_cnum, _177_szThreshold int16 var _iDb, _rc, _13_size, _15_size, _18_b, _20_ii, _22_iReg, _25_eMode, _28_ii, _31_eMode, _31_ii, _33_n, _43_eAuto, _44_iAddr, _45_iLimit, _45_addr, _49_size, _52_size, _57_ii, _68_res, _77_iLevel, _80_mask, _85_i, _85_k, _85_nHidden, _96_i, _96_mx, _101_i, _104_i, _106_i, _110_i, _111_j, _113_i, _113_j, _113_x, _113_regResult, _113_regKey, _113_regRow, _113_addrTop, _113_addrOk, _124_iCol, _126_jmp, _135_i, _135_j, _135_addr, _135_mxErr, _135_isQuick, _138_cnt, _138_mxIdx, _138_nIdx, _143_loopTop, _143_iDataCur, _143_iIdxCur, _143_r1, _146_jmp2, _148_addrCkFault, _148_addrCkOk, _148_k, _150_jmp2, _150_jmp3, _150_jmp4, _150_jmp5, _150_ckUniq, _151_uniqOk, _151_jmp6, _151_kk, _152_iCol, _164_iCookie, _167_i, _169_iBt, _169_eMode, _177_iDbLast, _177_iTabCur, _185_r1, _193_i, _194_j int32 @@ -103113,7 +107442,7 @@ func _sqlite3Pragma(tls *crt.TLS, _pParse *XParse, _pId1 *XToken, _pId2 *XToken, return } _sqlite3VdbeRunOnlyOnce(tls, _v) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(2) _iDb = _sqlite3TwoPartName(tls, _pParse, _pId1, _pId2, &_pId) if _iDb < i32(0) { return @@ -103139,36 +107468,39 @@ _6: } }() _zDb = func() *int8 { - if (_pId2.X1) > uint32(i32(0)) { - return (_pDb.X0) + if _pId2.X1 > uint32(i32(0)) { + return _pDb.X0 } return nil }() if _sqlite3AuthCheck(tls, _pParse, i32(19), _zLeft, _zRight, _zDb) != 0 { goto _pragma_out } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0)))) = nil - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(1)))) = _zLeft - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(2)))) = _zRight - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(3)))) = nil - *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0) - _rc = Xsqlite3_file_control(tls, _db, _zDb, i32(14), (unsafe.Pointer)(&_aFcntl)) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0)))) = nil + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(1)))) = _zLeft + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(2)))) = _zRight + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(3)))) = nil + *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X2))) = i32(0) + _rc = Xsqlite3_file_control(tls, _db, _zDb, i32(14), unsafe.Pointer(&_aFcntl)) if _rc == i32(0) { _sqlite3VdbeSetNumCols(tls, _v, i32(1)) - _sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0)))), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) - _returnSingleText(tls, _v, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0))))) - Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0)))))) + _sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0)))), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) + _returnSingleText(tls, _v, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0))))) + Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0)))))) goto _pragma_out } if _rc == i32(12) { goto _13 } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0))))) != nil { - _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0)))))) - Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 8*uintptr(i32(0)))))) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0))))) != nil { + _sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0)))))) + Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aFcntl)) + 8*uintptr(i32(0)))))) } - *(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1 - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc + *(*int32)(unsafe.Pointer(&_pParse.X16)) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _rc goto _pragma_out _13: _pPragma = _pragmaLocate(tls, _zLeft) @@ -103270,7 +107602,7 @@ _22: goto _60 } { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + i32(2) sink1(*p) } @@ -103288,9 +107620,9 @@ _22: }() != 0 { goto _64 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 32*uintptr(i32(6)))).X3))) = i32(-2000) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_11_aOp)) + 32*uintptr(i32(6)))).X3))) = i32(-2000) goto _65 _60: _13_size = _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight)) @@ -103333,7 +107665,7 @@ _23: _returnSingleInt(tls, _v, int64(_15_size)) goto _75 } - *(*int32)(unsafe.Pointer(&(_db.X27))) = _sqlite3Atoi(tls, _zRight) + *(*int32)(unsafe.Pointer(&_db.X27)) = _sqlite3Atoi(tls, _zRight) if i32(7) == _sqlite3BtreeSetPageSize(tls, _14_pBt, _db.X27, i32(-1), i32(0)) { _sqlite3OomFault(tls, _db) } @@ -103351,12 +107683,12 @@ _24: if _zRight != nil { _18_b = int32(_sqlite3GetBoolean(tls, _zRight, uint8(i32(0)))) } - if (_pId2.X1) != uint32(i32(0)) || _18_b < i32(0) { + if _pId2.X1 != uint32(i32(0)) || _18_b < i32(0) { goto _81 } _20_ii = i32(0) _82: - if _20_ii >= (_db.X5) { + if _20_ii >= _db.X5 { goto _85 } _sqlite3BtreeSecureDelete(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_20_ii))).X1), _18_b) @@ -103369,8 +107701,8 @@ _81: goto _64 _25: _sqlite3CodeVerifySchema(tls, _pParse, _iDb) - _22_iReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(112) { + _22_iReg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(112) { _sqlite3VdbeAddOp2(tls, _v, i32(161), _iDb, _22_iReg) goto _87 } @@ -103381,11 +107713,11 @@ _87: _26: _25_zRet = str(91148) _25_eMode = _getLockingMode(tls, _zRight) - if ((_pId2.X1) == uint32(i32(0))) && (_25_eMode == i32(-1)) { + if (_pId2.X1 == uint32(i32(0))) && (_25_eMode == i32(-1)) { _25_eMode = int32(_db.X19) goto _90 } - if (_pId2.X1) != uint32(i32(0)) { + if _pId2.X1 != uint32(i32(0)) { goto _91 } func() { @@ -103396,7 +107728,7 @@ _26: }() _28_ii = i32(2) _94: - if _28_ii >= (_db.X5) { + if _28_ii >= _db.X5 { goto _97 } _27_pPager = _sqlite3BtreePager(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_28_ii))).X1)) @@ -103404,7 +107736,7 @@ _94: _28_ii += 1 goto _94 _97: - *(*uint8)(unsafe.Pointer(&(_db.X19))) = uint8(_25_eMode) + *(*uint8)(unsafe.Pointer(&_db.X19)) = uint8(_25_eMode) _91: _27_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.X1)) _25_eMode = _sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode) @@ -103441,16 +107773,16 @@ _107: _31_eMode = i32(-1) } _103: - if (_31_eMode == i32(-1)) && ((_pId2.X1) == uint32(i32(0))) { + if (_31_eMode == i32(-1)) && (_pId2.X1 == uint32(i32(0))) { _iDb = i32(0) - *(*uint32)(unsafe.Pointer(&(_pId2.X1))) = uint32(i32(1)) + *(*uint32)(unsafe.Pointer(&_pId2.X1)) = uint32(i32(1)) } - _31_ii = (_db.X5) - i32(1) + _31_ii = _db.X5 - i32(1) _112: if _31_ii < i32(0) { goto _115 } - if ((*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_31_ii))).X1) != nil) && ((_31_ii == _iDb) || ((_pId2.X1) == uint32(i32(0)))) { + if (((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_31_ii))).X1) != nil) && ((_31_ii == _iDb) || (_pId2.X1 == uint32(i32(0)))) { _sqlite3VdbeUsesBtree(tls, _v, _31_ii) _sqlite3VdbeAddOp3(tls, _v, i32(9), _31_ii, i32(1), _31_eMode) } @@ -103492,7 +107824,7 @@ _29: crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(&(_db.X20))) = int8(uint8(_43_eAuto)) + *(*int8)(unsafe.Pointer(&_db.X20)) = int8(uint8(_43_eAuto)) _rc = _sqlite3BtreeSetAutoVacuum(tls, _41_pBt, _43_eAuto) if _rc != i32(0) || _43_eAuto != i32(1) && _43_eAuto != i32(2) { goto _130 @@ -103512,11 +107844,11 @@ _29: }() != 0 { goto _64 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 32*uintptr(i32(2)))).X4))) = _44_iAddr + i32(4) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 32*uintptr(i32(4)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 32*uintptr(i32(4)))).X5))) = _43_eAuto - i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_44_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_44_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_44_aOp)) + 32*uintptr(i32(2)))).X4))) = _44_iAddr + i32(4) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_44_aOp)) + 32*uintptr(i32(4)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_44_aOp)) + 32*uintptr(i32(4)))).X5))) = _43_eAuto - i32(1) _sqlite3VdbeUsesBtree(tls, _v, _iDb) _130: _124: @@ -103558,7 +107890,7 @@ _32: }() if _zRight == nil { _returnSingleInt(tls, _v, int64(func() int32 { - if ((_db.X6) & i32(32)) == i32(0) { + if (_db.X6 & i32(32)) == i32(0) { return i32(0) } return _sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.X1), i32(0)) @@ -103571,14 +107903,14 @@ _32: } if _sqlite3GetBoolean(tls, _zRight, uint8(bool2int(_52_size != i32(0)))) != 0 { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(32) sink1(*p) } goto _149 } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-33) sink1(*p) } @@ -103600,15 +107932,15 @@ _33: if _56_sz < int64(i32(0)) { _56_sz = _sqlite3Config.X17 } - if (_pId2.X1) == uint32(i32(0)) { - *(*int64)(unsafe.Pointer(&(_db.X8))) = _56_sz + if _pId2.X1 == uint32(i32(0)) { + *(*int64)(unsafe.Pointer(&_db.X8)) = _56_sz } - _57_ii = (_db.X5) - i32(1) + _57_ii = _db.X5 - i32(1) _155: if _57_ii < i32(0) { goto _158 } - if ((*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_57_ii))).X1) != nil) && ((_57_ii == _iDb) || ((_pId2.X1) == uint32(i32(0)))) { + if (((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_57_ii))).X1) != nil) && ((_57_ii == _iDb) || (_pId2.X1 == uint32(i32(0)))) { _sqlite3BtreeSetMmapLimit(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_57_ii))).X1), _56_sz) } _57_ii -= 1 @@ -103616,14 +107948,14 @@ _155: _158: _152: _56_sz = int64(i32(-1)) - _rc = Xsqlite3_file_control(tls, _db, _zDb, i32(18), (unsafe.Pointer)(&_56_sz)) + _rc = Xsqlite3_file_control(tls, _db, _zDb, i32(18), unsafe.Pointer(&_56_sz)) if _rc == i32(0) { _returnSingleInt(tls, _v, _56_sz) goto _164 } if _rc != i32(12) { - *(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1 - *(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc + *(*int32)(unsafe.Pointer(&_pParse.X16)) += 1 + *(*int32)(unsafe.Pointer(&_pParse.X3)) = _rc } _164: goto _64 @@ -103640,7 +107972,7 @@ _35: _returnSingleText(tls, _v, Xsqlite3_temp_directory) goto _168 } - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRight)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRight)) + 1*uintptr(i32(0))))) == 0 { goto _169 } _rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_db.X0), _zRight, i32(1), &_68_res) @@ -103652,8 +107984,8 @@ _169: if (i32(0) != 0 || (i32(1) != 0 && (int32(_db.X16) <= i32(1)))) || i32(0) != 0 { _invalidateTempStorage(tls, _pParse) } - Xsqlite3_free(tls, (unsafe.Pointer)(Xsqlite3_temp_directory)) - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRight)) + 1*uintptr(i32(0))))) != 0 { + Xsqlite3_free(tls, unsafe.Pointer(Xsqlite3_temp_directory)) + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zRight)) + 1*uintptr(i32(0))))) != 0 { Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(_zRight)) bug20530(Xsqlite3_temp_directory) goto _177 @@ -103668,7 +108000,7 @@ _36: _returnSingleInt(tls, _v, int64(int32(_pDb.X2)-i32(1))) goto _179 } - if (_db.X15) == 0 { + if _db.X15 == 0 { _sqlite3ErrorMsg(tls, _pParse, str(120826)) goto _182 } @@ -103679,8 +108011,8 @@ _36: if _77_iLevel == i32(0) { _77_iLevel = i32(1) } - *(*uint8)(unsafe.Pointer(&(_pDb.X2))) = uint8(_77_iLevel) - *(*uint8)(unsafe.Pointer(&(_pDb.X3))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pDb.X2)) = uint8(_77_iLevel) + *(*uint8)(unsafe.Pointer(&_pDb.X3)) = uint8(i32(1)) _setAllPagerFlags(tls, _db) _182: _179: @@ -103688,7 +108020,7 @@ _179: _37: if _zRight == nil { _setPragmaResultColumnNames(tls, _v, _pPragma) - _returnSingleInt(tls, _v, int64(bool2int((uint32(_db.X6)&(_pPragma.X5)) != uint32(i32(0))))) + _returnSingleInt(tls, _v, int64(bool2int((uint32(_db.X6)&_pPragma.X5) != uint32(i32(0))))) goto _185 } _80_mask = int32(_pPragma.X5) @@ -103701,19 +108033,19 @@ _37: } if _sqlite3GetBoolean(tls, _zRight, uint8(i32(0))) != 0 { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | _80_mask sink1(*p) } goto _188 } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & (^_80_mask) sink1(*p) } if _80_mask == i32(33554432) { - *(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_db.X78)) = int64(i32(0)) } _188: _sqlite3VdbeAddOp0(tls, _v, i32(153)) @@ -103730,7 +108062,7 @@ _38: } _85_nHidden = i32(0) _85_pPk = _sqlite3PrimaryKeyIndex(tls, _84_pTab) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(6) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) _sqlite3ViewGetColumnNames(tls, _pParse, _84_pTab) *func() **XColumn { _85_i = i32(0); return &_85_pCol }() = (*XColumn)(_84_pTab.X1) @@ -103752,7 +108084,7 @@ _192: } _85_k = i32(1) _201: - if _85_k > int32(_84_pTab.X11) || int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_85_pPk.X1)) + 2*uintptr(_85_k-i32(1))))) == _85_i { + if _85_k > int32(_84_pTab.X11) || int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_85_pPk.X1)) + 2*uintptr(_85_k-i32(1))))) == _85_i { goto _205 } _85_k += 1 @@ -103766,12 +108098,12 @@ _200: } }() _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120922), _85_i-_85_nHidden, unsafe.Pointer(_85_pCol.X0), unsafe.Pointer(_sqlite3ColumnType(tls, _85_pCol, str(0))), func() int32 { - if (_85_pCol.X3) != 0 { + if _85_pCol.X3 != 0 { return i32(1) } return i32(0) }(), unsafe.Pointer(func() *int8 { - if (*XExpr)(_85_pCol.X1) != nil { + if _85_pCol.X1 != nil { return (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_85_pCol.X1).X3)))))) } return nil @@ -103785,7 +108117,7 @@ _191: _190: goto _64 _39: - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(5) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(5) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) _92_i = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X2))).X2) _213: @@ -103800,7 +108132,7 @@ _217: if _92_pIdx == nil { goto _220 } - _sqlite3VdbeMultiLoad(tls, _v, i32(2), str(120935), unsafe.Pointer(_92_pIdx.X0), int32(_92_pIdx.X12), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_92_pIdx.X2)) + 2*uintptr(i32(0))))), (uint32((_92_pIdx.X16)>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) + _sqlite3VdbeMultiLoad(tls, _v, i32(2), str(120935), unsafe.Pointer(_92_pIdx.X0), int32(_92_pIdx.X12), int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_92_pIdx.X2)) + 2*uintptr(i32(0))))), (uint32(_92_pIdx.X16>>uint(i32(7)))<<uint(i32(31)))>>uint(i32(31))) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(5)) _92_pIdx = (*XIndex)(_92_pIdx.X5) goto _217 @@ -103817,18 +108149,18 @@ _40: if _95_pIdx == nil { goto _222 } - if (_pPragma.X5) != 0 { + if _pPragma.X5 != 0 { _96_mx = int32(_95_pIdx.X14) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(6) goto _224 } _96_mx = int32(_95_pIdx.X13) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(3) _224: _95_pTab = (*XTable)(_95_pIdx.X3) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) func() { - if (_pParse.X18) > int32(_pPragma.X4) { + if _pParse.X18 > int32(_pPragma.X4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114390), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120940))) crt.X__builtin_abort(tls) } @@ -103838,15 +108170,15 @@ _227: if _96_i >= _96_mx { goto _230 } - _99_cnum = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X1)) + 2*uintptr(_96_i))) + _99_cnum = *(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_95_pIdx.X1)) + 2*uintptr(_96_i))) _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120974), _96_i, int32(_99_cnum), unsafe.Pointer(func() *int8 { if int32(_99_cnum) < i32(0) { return nil } return ((*XColumn)(unsafe.Pointer(uintptr(_95_pTab.X1) + 32*uintptr(_99_cnum))).X0) }())) - if (_pPragma.X5) != 0 { - _sqlite3VdbeMultiLoad(tls, _v, i32(4), str(120978), int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X7)) + 1*uintptr(_96_i)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X8)) + 8*uintptr(_96_i)))), bool2int(_96_i < int32(_95_pIdx.X13))) + if _pPragma.X5 != 0 { + _sqlite3VdbeMultiLoad(tls, _v, i32(4), str(120978), int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_95_pIdx.X7)) + 1*uintptr(_96_i)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_95_pIdx.X8)) + 8*uintptr(_96_i)))), bool2int(_96_i < int32(_95_pIdx.X13))) } _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), _pParse.X18) _96_i += 1 @@ -103863,7 +108195,7 @@ _41: if _101_pTab == nil { goto _235 } - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(5) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(5) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) *func() *int32 { _101_pIdx = (*XIndex)(_101_pTab.X2); return &_101_i }() = i32(0) _236: @@ -103871,10 +108203,10 @@ _236: goto _239 } _103_azOrigin = [3]*int8{} - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 8*uintptr(i32(0)))) = str(120982) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 8*uintptr(i32(1)))) = str(120984) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 8*uintptr(i32(2)))) = str(61650) - _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120986), _101_i, unsafe.Pointer(_101_pIdx.X0), bool2int(int32(_101_pIdx.X15) != i32(0)), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 8*uintptr((uint32(_101_pIdx.X16)<<uint(i32(30)))>>uint(i32(30)))))), bool2int((*XExpr)(_101_pIdx.X9) != nil)) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_103_azOrigin)) + 8*uintptr(i32(0)))) = str(120982) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_103_azOrigin)) + 8*uintptr(i32(1)))) = str(120984) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_103_azOrigin)) + 8*uintptr(i32(2)))) = str(61650) + _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120986), _101_i, unsafe.Pointer(_101_pIdx.X0), bool2int(int32(_101_pIdx.X15) != i32(0)), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_103_azOrigin)) + 8*uintptr((uint32(_101_pIdx.X16)<<uint(i32(30)))>>uint(i32(30)))))), bool2int((*XExpr)(_101_pIdx.X9) != nil)) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(5)) *func() *int32 { _101_pIdx = (*XIndex)(_101_pIdx.X5); return &_101_i }() += 1 goto _236 @@ -103883,10 +108215,10 @@ _235: _234: goto _64 _42: - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(3) _104_i = i32(0) _240: - if _104_i >= (_db.X5) { + if _104_i >= _db.X5 { goto _243 } if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_104_i))).X1) == nil { @@ -103907,14 +108239,14 @@ _243: goto _64 _43: _106_i = i32(0) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2) - _106_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X70))).X2) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(2) + _106_p = (*XHashElem)((*XHash)(unsafe.Pointer(&_db.X70)).X2) _247: if _106_p == nil { goto _250 } _107_pColl = (*XCollSeq)(_106_p.X2) - _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121019), postInc1(&_106_i, int32(1)), unsafe.Pointer(_107_pColl.X0)) + _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121019), postInc1(&_106_i, 1), unsafe.Pointer(_107_pColl.X0)) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(2)) _106_p = (*XHashElem)(_106_p.X0) goto _247 @@ -103933,7 +108265,7 @@ _44: goto _253 } _110_i = i32(0) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(8) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(8) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) _254: if _108_pFK == nil { @@ -103941,16 +108273,16 @@ _254: } _111_j = i32(0) _256: - if _111_j >= (_108_pFK.X5) { + if _111_j >= _108_pFK.X5 { goto _259 } - _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121022), _110_i, _111_j, unsafe.Pointer(_108_pFK.X2), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_108_pTab.X1)+32*uintptr((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121022), _110_i, _111_j, unsafe.Pointer(_108_pFK.X2), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_108_pTab.X1)+32*uintptr((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_108_pFK.X9)))))+16*uintptr(_111_j))).X0))).X0), unsafe.Pointer((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + })(unsafe.Pointer(&_108_pFK.X9))))+16*uintptr(_111_j))).X0))).X0), unsafe.Pointer((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_108_pFK.X9)))))+16*uintptr(_111_j))).X1), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_108_pFK.X7))))) + 1*uintptr(i32(1)))))), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_108_pFK.X7))))) + 1*uintptr(i32(0)))))), unsafe.Pointer(str(121031))) + })(unsafe.Pointer(&_108_pFK.X9))))+16*uintptr(_111_j))).X1), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_108_pFK.X7)))) + 1*uintptr(i32(1)))))), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint8)(unsafe.Pointer(&_108_pFK.X7)))) + 1*uintptr(i32(0)))))), unsafe.Pointer(str(121031))) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(8)) _111_j += 1 goto _256 @@ -103964,14 +108296,14 @@ _252: _251: goto _64 _45: - _113_regResult = (_pParse.X18) + i32(1) + _113_regResult = _pParse.X18 + i32(1) { - p := (*int32)(unsafe.Pointer(&(_pParse.X18))) + p := (*int32)(unsafe.Pointer(&_pParse.X18)) *p = (*p) + i32(4) sink1(*p) } - _113_regKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) - _113_regRow = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _113_regKey = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) + _113_regRow = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3CodeVerifySchema(tls, _pParse, _iDb) _113_k = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4).X2))).X2) _260: @@ -103990,8 +108322,8 @@ _263: goto _260 } _sqlite3TableLock(tls, _pParse, _iDb, _113_pTab.X7, uint8(i32(0)), _113_pTab.X0) - if (int32(_113_pTab.X11) + _113_regRow) > (_pParse.X18) { - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = int32(_113_pTab.X11) + _113_regRow + if (int32(_113_pTab.X11) + _113_regRow) > _pParse.X18 { + *(*int32)(unsafe.Pointer(&_pParse.X18)) = int32(_113_pTab.X11) + _113_regRow } _sqlite3OpenTable(tls, _pParse, i32(0), _iDb, _113_pTab, i32(106)) _sqlite3VdbeLoadString(tls, _v, _113_regResult, _113_pTab.X0) @@ -104027,7 +108359,7 @@ _268: goto _267 _270: func() { - if (_pParse.X16) <= i32(0) && _113_pFK != nil { + if _pParse.X16 <= i32(0) && _113_pFK != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114546), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121036))) crt.X__builtin_abort(tls) } @@ -104035,8 +108367,8 @@ _270: if _113_pFK != nil { goto _261 } - if (_pParse.X17) < _113_i { - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = _113_i + if _pParse.X17 < _113_i { + *(*int32)(unsafe.Pointer(&_pParse.X17)) = _113_i } _113_addrTop = _sqlite3VdbeAddOp1(tls, _v, i32(37), i32(0)) *func() **XFKey { _113_i = i32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.X4) @@ -104059,17 +108391,17 @@ _281: _113_addrOk = _sqlite3VdbeMakeLabel(tls, _v) _113_j = i32(0) _288: - if _113_j >= (_113_pFK.X5) { + if _113_j >= _113_pFK.X5 { goto _291 } _124_iCol = func() int32 { if _113_aiCols != nil { - return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_113_aiCols)) + 4*uintptr(_113_j)))) + return (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_113_aiCols)) + 4*uintptr(_113_j)))) } - return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + return ((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_113_pFK.X9))))) + 16*uintptr(_113_j))).X0) + })(unsafe.Pointer(&_113_pFK.X9)))) + 16*uintptr(_113_j))).X0) }() _sqlite3ExprCodeGetColumnOfTable(tls, _v, _113_pTab, i32(0), _124_iCol, _113_regRow+_113_j) _sqlite3VdbeAddOp2(tls, _v, i32(75), _113_regRow+_113_j, _113_addrOk) @@ -104086,14 +108418,14 @@ _291: _sqlite3VdbeAddOp3(tls, _v, i32(31), _113_i, _126_jmp, _113_regRow) _sqlite3VdbeGoto(tls, _v, _113_addrOk) func() { - if (_113_pFK.X5) != i32(1) { + if _113_pFK.X5 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121066))) crt.X__builtin_abort(tls) } }() } _296: - if ((_113_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_113_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _sqlite3VdbeAddOp2(tls, _v, i32(125), i32(0), _113_regResult+i32(1)) goto _300 } @@ -104102,7 +108434,7 @@ _300: _sqlite3VdbeMultiLoad(tls, _v, _113_regResult+i32(2), str(121079), unsafe.Pointer(_113_pFK.X2), _113_i-i32(1)) _sqlite3VdbeAddOp2(tls, _v, i32(67), _113_regResult, i32(4)) _sqlite3VdbeResolveLabel(tls, _v, _113_addrOk) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_113_aiCols)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_113_aiCols)) *func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.X1) goto _281 _284: @@ -104129,7 +108461,7 @@ _47: } goto _64 _48: - _135_isQuick = bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(113)) + _135_isQuick = bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(113)) func() { if _iDb < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114657), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(42040))) @@ -104137,15 +108469,15 @@ _48: } }() func() { - if _iDb != i32(0) && (_pId2.X0) == nil { + if _iDb != i32(0) && _pId2.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114658), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121091))) crt.X__builtin_abort(tls) } }() - if (_pId2.X0) == nil { + if _pId2.X0 == nil { _iDb = i32(-1) } - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(6) _135_mxErr = i32(100) if _zRight == nil { goto _311 @@ -104158,7 +108490,7 @@ _311: _sqlite3VdbeAddOp2(tls, _v, i32(56), _135_mxErr-i32(1), i32(1)) _135_i = i32(0) _313: - if _135_i >= (_db.X5) { + if _135_i >= _db.X5 { goto _316 } _138_cnt = i32(0) @@ -104182,7 +108514,7 @@ _322: goto _325 } _139_pTab = (*XTable)(_138_x.X2) - if ((_139_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_139_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { _138_cnt += 1 } *func() **XIndex { _138_nIdx = i32(0); return &_139_pIdx }() = (*XIndex)(_139_pTab.X2) @@ -104210,25 +108542,25 @@ _333: goto _336 } _141_pTab = (*XTable)(_138_x.X2) - if ((_141_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, int32(1))))) = _141_pTab.X7 + if (_141_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, 1)))) = _141_pTab.X7 } _141_pIdx = (*XIndex)(_141_pTab.X2) _338: if _141_pIdx == nil { goto _341 } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, int32(1))))) = _141_pIdx.X11 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, 1)))) = _141_pIdx.X11 _141_pIdx = (*XIndex)(_141_pIdx.X5) goto _338 _341: _138_x = (*XHashElem)(_138_x.X0) goto _333 _336: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(_138_cnt))) = i32(0) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 { - if (_pParse.X18) > (i32(8) + _138_mxIdx) { - return (_pParse.X18) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_138_aRoot)) + 4*uintptr(_138_cnt))) = i32(0) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = func() int32 { + if _pParse.X18 > (i32(8) + _138_mxIdx) { + return _pParse.X18 } return (i32(8) + _138_mxIdx) }() @@ -104248,14 +108580,14 @@ _344: _143_pTab = (*XTable)(_138_x.X2) _143_pPrior = nil _143_r1 = i32(-1) - if (_143_pTab.X7) < i32(1) { + if _143_pTab.X7 < i32(1) { goto _345 } - if (((*XExprList)(_143_pTab.X6) == nil) && (((_143_pTab.X9) & uint32(i32(512))) == uint32(i32(0)))) && (((*XIndex)(_143_pTab.X2) == nil) || _135_isQuick != 0) { + if (((*XExprList)(_143_pTab.X6) == nil) && ((_143_pTab.X9 & uint32(i32(512))) == uint32(i32(0)))) && (((*XIndex)(_143_pTab.X2) == nil) || _135_isQuick != 0) { goto _345 } _143_pPk = func() *XIndex { - if ((_143_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) { + if (_143_pTab.X9 & uint32(i32(32))) == uint32(i32(0)) { return nil } return _sqlite3PrimaryKeyIndex(tls, _143_pTab) @@ -104273,7 +108605,7 @@ _355: goto _355 _358: func() { - if (_pParse.X18) < (i32(8) + _135_j) { + if _pParse.X18 < (i32(8) + _135_j) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121166))) crt.X__builtin_abort(tls) } @@ -104308,7 +108640,7 @@ _364: _135_j += 1 goto _363 _366: - if (*XExprList)(_143_pTab.X6) == nil || ((_db.X6)&i32(8192)) != i32(0) { + if _143_pTab.X6 == nil || (_db.X6&i32(8192)) != i32(0) { goto _370 } _147_pCheck = _sqlite3ExprListDup(tls, _db, (*XExprList)(_143_pTab.X6), i32(0)) @@ -104317,18 +108649,18 @@ _366: } _148_addrCkFault = _sqlite3VdbeMakeLabel(tls, _v) _148_addrCkOk = _sqlite3VdbeMakeLabel(tls, _v) - *(*int32)(unsafe.Pointer(&(_pParse.X22))) = _143_iDataCur + *(*int32)(unsafe.Pointer(&_pParse.X22)) = _143_iDataCur _sqlite3ExprCachePush(tls, _pParse) - _148_k = (_147_pCheck.X0) - i32(1) + _148_k = _147_pCheck.X0 - i32(1) _372: if _148_k <= i32(0) { goto _375 } - _sqlite3ExprIfFalse(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_147_pCheck.X2)))))+32*uintptr(_148_k))).X0), _148_addrCkFault, i32(0)) + _sqlite3ExprIfFalse(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_147_pCheck.X2))))+32*uintptr(_148_k))).X0), _148_addrCkFault, i32(0)) _148_k -= 1 goto _372 _375: - _sqlite3ExprIfTrue(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_147_pCheck.X2)))))+32*uintptr(i32(0)))).X0), _148_addrCkOk, i32(16)) + _sqlite3ExprIfTrue(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&_147_pCheck.X2))))+32*uintptr(i32(0)))).X0), _148_addrCkOk, i32(16)) _sqlite3VdbeResolveLabel(tls, _v, _148_addrCkFault) _148_zErr = _sqlite3MPrintf(tls, _db, str(121240), unsafe.Pointer(_143_pTab.X0)) _sqlite3VdbeAddOp4(tls, _v, i32(97), i32(0), i32(3), i32(0), _148_zErr, i32(-1)) @@ -104368,7 +108700,7 @@ _383: if _151_kk >= int32(_143_pIdx.X13) { goto _386 } - _152_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_143_pIdx.X1)) + 2*uintptr(_151_kk)))) + _152_iCol = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_143_pIdx.X1)) + 2*uintptr(_151_kk)))) func() { if _152_iCol == i32(-1) || _152_iCol >= int32(_143_pTab.X11) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114827), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121296))) @@ -104433,9 +108765,9 @@ _314: _316: _155_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(4), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00endCodeØ006)), _sqlite3PragmaØ00iLnØ005) if _155_aOp != nil { - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 32*uintptr(i32(0)))).X4))) = i32(1) - _135_mxErr - *(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 32*uintptr(i32(2)))).X1))) = int8(i32(-2)) - *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 32*uintptr(i32(2)))).X6))))) = str(121386) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_155_aOp)) + 32*uintptr(i32(0)))).X4))) = i32(1) - _135_mxErr + *(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_155_aOp)) + 32*uintptr(i32(2)))).X1))) = int8(i32(-2)) + *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_155_aOp)) + 32*uintptr(i32(2)))).X6))))) = str(121386) } goto _64 _49: @@ -104446,37 +108778,37 @@ _49: goto _pragma_out } func() { - if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(1)))).X1) != i32(1) { + if int32((*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(1)))).X1) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121389))) crt.X__builtin_abort(tls) } }() func() { - if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(2)))).X1) != i32(2) { + if int32((*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(2)))).X1) != i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121428))) crt.X__builtin_abort(tls) } }() func() { - if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(3)))).X1) != i32(3) { + if int32((*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr(i32(3)))).X1) != i32(3) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114927), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121473))) crt.X__builtin_abort(tls) } }() - _returnSingleText(tls, _v, (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr((*Xsqlite3)(_pParse.X0).X14))).X0) + _returnSingleText(tls, _v, (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007))+16*uintptr((*Xsqlite3)(_pParse.X0).X14))).X0) goto _407 _399: if (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X4).X9)&i32(1)) == i32(1) && (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X4).X9)&i32(4)) != i32(4) { goto _409 } - _157_pEnc = (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007)) + 16*uintptr(i32(0)))) + _157_pEnc = (*TEncName)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00encnamesØ007)) + 16*uintptr(i32(0)))) _410: - if (_157_pEnc.X0) == nil { + if _157_pEnc.X0 == nil { goto _413 } if i32(0) == _sqlite3StrICmp(tls, _zRight, _157_pEnc.X0) { - *(*uint8)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8))) = store2((*uint8)(unsafe.Pointer(&(_db.X14))), uint8(func() int32 { - if (_157_pEnc.X1) != 0 { + *(*uint8)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8))) = store2((*uint8)(unsafe.Pointer(&_db.X14)), uint8(func() int32 { + if _157_pEnc.X1 != 0 { return int32(_157_pEnc.X1) } return i32(2) @@ -104486,7 +108818,7 @@ _410: *(*uintptr)(unsafe.Pointer(&_157_pEnc)) += uintptr(16) goto _410 _413: - if (_157_pEnc.X0) == nil { + if _157_pEnc.X0 == nil { _sqlite3ErrorMsg(tls, _pParse, str(121518), unsafe.Pointer(_zRight)) } _409: @@ -104512,10 +108844,10 @@ _50: }() != 0 { goto _64 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 32*uintptr(i32(1)))).X4))) = _164_iCookie - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 32*uintptr(i32(1)))).X5))) = _sqlite3Atoi(tls, _zRight) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_165_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_165_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_165_aOp)) + 32*uintptr(i32(1)))).X4))) = _164_iCookie + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_165_aOp)) + 32*uintptr(i32(1)))).X5))) = _sqlite3Atoi(tls, _zRight) goto _423 _419: _sqlite3VdbeVerifyNoMallocRequired(tls, _v, i32(3)) @@ -104532,17 +108864,17 @@ _419: }() != 0 { goto _64 } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 32*uintptr(i32(1)))).X5))) = _164_iCookie + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_166_aOp)) + 32*uintptr(i32(0)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_166_aOp)) + 32*uintptr(i32(1)))).X3))) = _iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_166_aOp)) + 32*uintptr(i32(1)))).X5))) = _164_iCookie _sqlite3VdbeReusable(tls, _v) _423: goto _64 _51: _167_i = i32(0) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(1) _427: - if store0(&_167_zOpt, Xsqlite3_compileoption_get(tls, postInc1(&_167_i, int32(1)))) != nil { + if store0(&_167_zOpt, Xsqlite3_compileoption_get(tls, postInc1(&_167_i, 1))) != nil { _sqlite3VdbeLoadString(tls, _v, i32(1), _167_zOpt) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1)) goto _427 @@ -104551,7 +108883,7 @@ _427: goto _64 _52: _169_iBt = func() int32 { - if (_pId2.X0) != nil { + if _pId2.X0 != nil { return _iDb } return i32(10) @@ -104573,7 +108905,7 @@ _52: } _436: _431: - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(3) _sqlite3VdbeAddOp3(tls, _v, i32(8), _169_iBt, _169_eMode, i32(1)) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(3)) goto _64 @@ -104584,9 +108916,10 @@ _53: _returnSingleInt(tls, _v, int64(func() int32 { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 - }{(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32 - }{(_db.X51)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 { + v := _db.X51 + return *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32 }{_sqlite3WalDefaultHook})) { return int32(int64(crt.P2U(_db.X52))) @@ -104609,12 +108942,12 @@ _55: _440: _177_opMask = uint32(i32(65534)) _442: - _177_iTabCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)) + _177_iTabCur = postInc1((*int32)(unsafe.Pointer(&_pParse.X17)), 1) _177_iDbLast = func() int32 { if _zDb != nil { return _iDb } - return ((_db.X5) - i32(1)) + return (_db.X5 - i32(1)) }() _445: if _iDb > _177_iDbLast { @@ -104625,13 +108958,13 @@ _445: } _sqlite3CodeVerifySchema(tls, _pParse, _iDb) _177_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - _177_k = (*XHashElem)((*XHash)(unsafe.Pointer(&(_177_pSchema.X2))).X2) + _177_k = (*XHashElem)((*XHash)(unsafe.Pointer(&_177_pSchema.X2)).X2) _450: if _177_k == nil { goto _453 } _177_pTab = (*XTable)(_177_k.X2) - if ((_177_pTab.X9) & uint32(i32(256))) == uint32(i32(0)) { + if (_177_pTab.X9 & uint32(i32(256))) == uint32(i32(0)) { goto _451 } _177_szThreshold = int16(int32(_177_pTab.X12) + i32(46)) @@ -104646,7 +108979,7 @@ _457: if _177_pIdx == nil { goto _460 } - if ((uint32((_177_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { + if ((uint32(_177_pIdx.X16>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 { _177_szThreshold = int16(i32(0)) goto _460 } @@ -104701,10 +109034,10 @@ _58: _returnSingleInt(tls, _v, int64(Xsqlite3_limit(tls, _db, i32(11), i32(-1)))) goto _64 _59: - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(2) _193_i = i32(0) _473: - if _193_i >= (_db.X5) { + if _193_i >= _db.X5 { goto _476 } _194_zState = str(121636) @@ -104721,8 +109054,8 @@ _473: return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_193_i))).X0) } return nil - }(), i32(1), (unsafe.Pointer)(&_194_j)) == i32(0) { - _194_zState = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00azLockNameØ0010)) + 8*uintptr(_194_j))) + }(), i32(1), unsafe.Pointer(&_194_j)) == i32(0) { + _194_zState = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3PragmaØ00azLockNameØ0010)) + 8*uintptr(_194_j))) } _483: _sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121651), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_193_i))).X0), unsafe.Pointer(_194_zState)) @@ -104737,17 +109070,20 @@ _64: _sqlite3VdbeVerifyNoResultRow(tls, _v) } _pragma_out: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zLeft)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zRight)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zLeft)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zRight)) _ = _aFcntl _ = _103_azOrigin _ = _106_i _ = _167_i } -// Mark the VDBE as one that can only be run one time. +// C comment +// /* +// ** Mark the VDBE as one that can only be run one time. +// */ func _sqlite3VdbeRunOnlyOnce(tls *crt.TLS, _p *TVdbe) { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 32, 5) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 32, 5) } var _sqlite3PragmaØ00__func__Ø000 [14]int8 @@ -104756,7 +109092,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PragmaØ00__func__Ø000[0], str(121654), 14) } -// Invoke the xFileControl method on a particular database. +// C comment +// /* +// ** Invoke the xFileControl method on a particular database. +// */ func Xsqlite3_file_control(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _op int32, _pArg unsafe.Pointer) (r0 int32) { var _rc int32 var _pBtree *XBtree @@ -104801,7 +109140,7 @@ func Xsqlite3_file_control(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _op int3 _rc = i32(0) goto _13 } - if (*Xsqlite3_io_methods)(_1_fd.X0) != nil { + if _1_fd.X0 != nil { _rc = _sqlite3OsFileControl(tls, _1_fd, _op, _pArg) goto _13 } @@ -104813,7 +109152,10 @@ _1: return _rc } -// Return the Btree pointer identified by zDbName. Return NULL if not found. +// C comment +// /* +// ** Return the Btree pointer identified by zDbName. Return NULL if not found. +// */ func _sqlite3DbNameToBtree(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *XBtree) { var _iDb int32 _iDb = func() int32 { @@ -104836,23 +109178,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_file_controlØ00__func__Ø000[0], str(121674), 21) } -// Return the file handle for the journal file (if it exists). -// This will be either the rollback journal or the WAL file. +// C comment +// /* +// ** Return the file handle for the journal file (if it exists). +// ** This will be either the rollback journal or the WAL file. +// */ func _sqlite3PagerJrnlFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) { return func() *Xsqlite3_file { - if (*XWal)(_pPager.X60) != nil { + if _pPager.X60 != nil { return _sqlite3WalFile(tls, (*XWal)(_pPager.X60)) } return (*Xsqlite3_file)(_pPager.X32) }() } -// Return the sqlite3_file object for the WAL file +// C comment +// /* Return the sqlite3_file object for the WAL file +// */ func _sqlite3WalFile(tls *crt.TLS, _pWal *XWal) (r0 *Xsqlite3_file) { return (*Xsqlite3_file)(_pWal.X2) } -// Generate code to return a single text value. +// C comment +// /* +// ** Generate code to return a single text value. +// */ func _returnSingleText(tls *crt.TLS, _v *TVdbe, _zValue *int8) { if _zValue != nil { _sqlite3VdbeLoadString(tls, _v, i32(1), _zValue) @@ -104860,7 +109210,10 @@ func _returnSingleText(tls *crt.TLS, _v *TVdbe, _zValue *int8) { } } -// Set result column names for a pragma. +// C comment +// /* +// ** Set result column names for a pragma. +// */ func _setPragmaResultColumnNames(tls *crt.TLS, _v *TVdbe, _pPragma *XPragmaName) { var _2_i, _2_j int32 var _n uint8 @@ -104880,7 +109233,7 @@ _4: if _2_i >= int32(_n) { goto _7 } - _sqlite3VdbeSetColName(tls, _v, _2_i, i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pragCName)) + 8*uintptr(_2_j))), nil) + _sqlite3VdbeSetColName(tls, _v, _2_i, i32(0), *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_pragCName)) + 8*uintptr(_2_j))), nil) *func() *int32 { _2_i += 1; return &_2_j }() += 1 goto _4 _7: @@ -104889,7 +109242,7 @@ _3: func _sqlite3VdbeVerifyNoMallocRequired(tls *crt.TLS, _p *TVdbe, _N int32) { func() { - if ((_p.X27) + _N) > ((*XParse)(_p.X3).X19) { + if (_p.X27 + _N) > ((*XParse)(_p.X3).X19) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72075), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000))), unsafe.Pointer(str(121695))) crt.X__builtin_abort(tls) } @@ -104910,15 +109263,21 @@ func init() { var _sqlite3PragmaØ00iLnØ001 int32 -// Generate code to return a single integer value. +// C comment +// /* +// ** Generate code to return a single integer value. +// */ func _returnSingleInt(tls *crt.TLS, _v *TVdbe, _value int64) { _sqlite3VdbeAddOp4Dup8(tls, _v, i32(57), i32(0), i32(1), i32(0), (*uint8)(unsafe.Pointer(&_value)), i32(-10)) _sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1)) } -// Set the BTS_SECURE_DELETE flag if newFlag is 0 or 1. If newFlag is -1, -// then make no changes. Always return the value of the BTS_SECURE_DELETE -// setting after the change. +// C comment +// /* +// ** Set the BTS_SECURE_DELETE flag if newFlag is 0 or 1. If newFlag is -1, +// ** then make no changes. Always return the value of the BTS_SECURE_DELETE +// ** setting after the change. +// */ func _sqlite3BtreeSecureDelete(tls *crt.TLS, _p *XBtree, _newFlag int32) (r0 int32) { var _b int32 if _p == nil { @@ -104946,7 +109305,10 @@ _1: return _b } -// Interpret the given string as a locking mode value. +// C comment +// /* +// ** Interpret the given string as a locking mode value. +// */ func _getLockingMode(tls *crt.TLS, _z *int8) (r0 int32) { if _z == nil { goto _0 @@ -104961,14 +109323,17 @@ _0: return i32(-1) } -// Get/set the locking-mode for this pager. Parameter eMode must be one -// of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or -// PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then -// the locking-mode is set to the value specified. -// -// The returned value is either PAGER_LOCKINGMODE_NORMAL or -// PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated) -// locking-mode. +// C comment +// /* +// ** Get/set the locking-mode for this pager. Parameter eMode must be one +// ** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or +// ** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then +// ** the locking-mode is set to the value specified. +// ** +// ** The returned value is either PAGER_LOCKINGMODE_NORMAL or +// ** PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated) +// ** locking-mode. +// */ func _sqlite3PagerLockingMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) { func() { if _eMode != i32(-1) && _eMode != i32(0) && _eMode != i32(1) { @@ -104979,13 +109344,13 @@ func _sqlite3PagerLockingMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 i i32(0) i32(0) func() { - if (_pPager.X1) == 0 && i32(0) != _sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) { + if _pPager.X1 == 0 && i32(0) != _sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54052), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000))), unsafe.Pointer(str(121867))) crt.X__builtin_abort(tls) } }() - if ((_eMode >= i32(0)) && ((_pPager.X10) == 0)) && (_sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) == 0) { - *(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(_eMode) + if ((_eMode >= i32(0)) && (_pPager.X10 == 0)) && (_sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) == 0) { + *(*uint8)(unsafe.Pointer(&_pPager.X1)) = uint8(_eMode) } return int32(_pPager.X1) } @@ -104996,36 +109361,48 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PagerLockingModeØ00__func__Ø000[0], str(121930), 24) } -// Return true if the argument is non-NULL and the WAL module is using -// heap-memory for the wal-index. Otherwise, if the argument is NULL or the -// WAL module is using shared-memory, return false. +// C comment +// /* +// ** Return true if the argument is non-NULL and the WAL module is using +// ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the +// ** WAL module is using shared-memory, return false. +// */ func _sqlite3WalHeapMemory(tls *crt.TLS, _pWal *XWal) (r0 int32) { return bool2int((_pWal != nil) && (int32(_pWal.X11) == i32(2))) } -// Get/set the size-limit used for persistent journal files. -// -// Setting the size limit to -1 means no limit is enforced. -// An attempt to set a limit smaller than -1 is a no-op. +// C comment +// /* +// ** Get/set the size-limit used for persistent journal files. +// ** +// ** Setting the size limit to -1 means no limit is enforced. +// ** An attempt to set a limit smaller than -1 is a no-op. +// */ func _sqlite3PagerJournalSizeLimit(tls *crt.TLS, _pPager *XPager, _iLimit int64) (r0 int64) { if _iLimit >= int64(i32(-1)) { - *(*int64)(unsafe.Pointer(&(_pPager.X50))) = _iLimit + *(*int64)(unsafe.Pointer(&_pPager.X50)) = _iLimit _sqlite3WalLimit(tls, (*XWal)(_pPager.X60), _iLimit) } return _pPager.X50 } -// Change the size to which the WAL file is trucated on each reset. +// C comment +// /* +// ** Change the size to which the WAL file is trucated on each reset. +// */ func _sqlite3WalLimit(tls *crt.TLS, _pWal *XWal, _iLimit int64) { if _pWal != nil { - *(*int64)(unsafe.Pointer(&(_pWal.X4))) = _iLimit + *(*int64)(unsafe.Pointer(&_pWal.X4)) = _iLimit } } -// Interpret the given string as an auto-vacuum mode value. -// -// The following strings, "none", "full" and "incremental" are -// acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. +// C comment +// /* +// ** Interpret the given string as an auto-vacuum mode value. +// ** +// ** The following strings, "none", "full" and "incremental" are +// ** acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. +// */ func _getAutoVacuum(tls *crt.TLS, _z *int8) (r0 int32) { var _i int32 if i32(0) == _sqlite3StrICmp(tls, _z, str(42897)) { @@ -105057,7 +109434,7 @@ var _sqlite3PragmaØ00iLnØ003 int32 func _setAllPagerFlags(tls *crt.TLS, _db *Xsqlite3) { var _1_n int32 var _1_pDb *XDb - if (_db.X15) == 0 { + if _db.X15 == 0 { goto _0 } _1_pDb = (*XDb)(_db.X4) @@ -105073,11 +109450,11 @@ func _setAllPagerFlags(tls *crt.TLS, _db *Xsqlite3) { } }() _3: - if postInc1(&_1_n, int32(-1)) <= i32(0) { + if postInc1(&_1_n, -1) <= i32(0) { goto _4 } - if (*XBtree)(_1_pDb.X1) != nil { - _sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_1_pDb.X1), uint32(int32(_1_pDb.X2)|((_db.X6)&i32(56)))) + if _1_pDb.X1 != nil { + _sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_1_pDb.X1), uint32(int32(_1_pDb.X2)|(_db.X6&i32(56)))) } *(*uintptr)(unsafe.Pointer(&_1_pDb)) += uintptr(32) goto _3 @@ -105092,8 +109469,11 @@ func init() { crt.Xstrncpy(nil, &_setAllPagerFlagsØ00__func__Ø000[0], str(122030), 17) } -// Change the limit on the amount of the database file that may be -// memory mapped. +// C comment +// /* +// ** Change the limit on the amount of the database file that may be +// ** memory mapped. +// */ func _sqlite3BtreeSetMmapLimit(tls *crt.TLS, _p *XBtree, _szMmap int64) (r0 int32) { var _pBt *XBtShared _pBt = (*XBtShared)(_p.X1) @@ -105115,9 +109495,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreeSetMmapLimitØ00__func__Ø000[0], str(122047), 25) } -// If the TEMP database is open, close it and mark the database schema -// as needing reloading. This must be done when using the SQLITE_TEMP_STORE -// or DEFAULT_TEMP_STORE pragmas. +// C comment +// /* +// ** If the TEMP database is open, close it and mark the database schema +// ** as needing reloading. This must be done when using the SQLITE_TEMP_STORE +// ** or DEFAULT_TEMP_STORE pragmas. +// */ func _changeTempStorage(tls *crt.TLS, _pParse *XParse, _zStorageType *int8) (r0 int32) { var _ts int32 var _db *Xsqlite3 @@ -105129,16 +109512,19 @@ func _changeTempStorage(tls *crt.TLS, _pParse *XParse, _zStorageType *int8) (r0 if _invalidateTempStorage(tls, _pParse) != i32(0) { return i32(1) } - *(*uint8)(unsafe.Pointer(&(_db.X16))) = uint8(_ts) + *(*uint8)(unsafe.Pointer(&_db.X16)) = uint8(_ts) return i32(0) } -// Interpret the given string as a temp db location. Return 1 for file -// backed temporary databases, 2 for the Red-Black tree in memory database -// and 0 to use the compile-time default. +// C comment +// /* +// ** Interpret the given string as a temp db location. Return 1 for file +// ** backed temporary databases, 2 for the Red-Black tree in memory database +// ** and 0 to use the compile-time default. +// */ func _getTempStore(tls *crt.TLS, _z *int8) (r0 int32) { - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) >= i32(48)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) <= i32(50)) { - return int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) - i32(48) + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) >= i32(48)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) <= i32(50)) { + return int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) - i32(48) } if _sqlite3StrICmp(tls, _z, str(61722)) == i32(0) { return i32(1) @@ -105149,15 +109535,18 @@ func _getTempStore(tls *crt.TLS, _z *int8) (r0 int32) { return i32(0) } -// Invalidate temp storage, either when the temp storage is changed -// from default, or when 'file' and the temp_store_directory has changed +// C comment +// /* +// ** Invalidate temp storage, either when the temp storage is changed +// ** from default, or when 'file' and the temp_store_directory has changed +// */ func _invalidateTempStorage(tls *crt.TLS, _pParse *XParse) (r0 int32) { var _db *Xsqlite3 _db = (*Xsqlite3)(_pParse.X0) if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X1) == nil { goto _0 } - if ((_db.X15) == 0) || _sqlite3BtreeIsInReadTrans(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X1)) != 0 { + if (_db.X15 == 0) || _sqlite3BtreeIsInReadTrans(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X1)) != 0 { _sqlite3ErrorMsg(tls, _pParse, str(122072)) return i32(1) } @@ -105170,12 +109559,15 @@ _0: var Xsqlite3_temp_directory *int8 -// Generate code that initializes multiple registers to string or integer -// constants. The registers begin with iDest and increase consecutively. -// One register is initialized for each characgter in zTypes[]. For each -// "s" character in zTypes[], the register is a string if the argument is -// not NULL, or OP_Null if the value is a null pointer. For each "i" character -// in zTypes[], the register is initialized to an integer. +// C comment +// /* +// ** Generate code that initializes multiple registers to string or integer +// ** constants. The registers begin with iDest and increase consecutively. +// ** One register is initialized for each characgter in zTypes[]. For each +// ** "s" character in zTypes[], the register is a string if the argument is +// ** not NULL, or OP_Null if the value is a null pointer. For each "i" character +// ** in zTypes[], the register is initialized to an integer. +// */ func _sqlite3VdbeMultiLoad(tls *crt.TLS, _p *TVdbe, _iDest int32, _zTypes *int8, args ...interface{}) { var _i int32 var _c int8 @@ -105184,7 +109576,7 @@ func _sqlite3VdbeMultiLoad(tls *crt.TLS, _p *TVdbe, _iDest int32, _zTypes *int8, _ap = args _i = i32(0) _0: - if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTypes)) + 1*uintptr(_i))))) == i32(0) { + if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTypes)) + 1*uintptr(_i))))) == i32(0) { goto _3 } if int32(_c) == i32(115) { @@ -105194,7 +109586,7 @@ _0: return i32(59) } return i32(97) - }(), i32(0), postInc1(&_iDest, int32(1)), i32(0), _2_z, i32(0)) + }(), i32(0), postInc1(&_iDest, 1), i32(0), _2_z, i32(0)) goto _7 } func() { @@ -105203,7 +109595,7 @@ _0: crt.X__builtin_abort(tls) } }() - _sqlite3VdbeAddOp2(tls, _p, i32(56), crt.VAInt32(&_ap), postInc1(&_iDest, int32(1))) + _sqlite3VdbeAddOp2(tls, _p, i32(56), crt.VAInt32(&_ap), postInc1(&_iDest, 1)) _7: _i += 1 goto _0 @@ -105263,21 +109655,24 @@ func init() { crt.Xstrncpy(nil, &_actionNameØ00__func__Ø000[0], str(122209), 11) } -// Turn parser tracing on by giving a stream to which to write the trace -// and a prompt to preface each trace message. Tracing is turned off -// by making either argument NULL -// -// Inputs: -// <ul> -// <li> A FILE* to which trace output should be written. -// If NULL, then tracing is turned off. -// <li> A prefix string written at the beginning of every -// line of trace output. If NULL, then tracing is -// turned off. -// </ul> -// -// Outputs: -// None. +// C comment +// /* +// ** Turn parser tracing on by giving a stream to which to write the trace +// ** and a prompt to preface each trace message. Tracing is turned off +// ** by making either argument NULL +// ** +// ** Inputs: +// ** <ul> +// ** <li> A FILE* to which trace output should be written. +// ** If NULL, then tracing is turned off. +// ** <li> A prefix string written at the beginning of every +// ** line of trace output. If NULL, then tracing is +// ** turned off. +// ** </ul> +// ** +// ** Outputs: +// ** None. +// */ func _sqlite3ParserTrace(tls *crt.TLS, _TraceFILE *crt.XFILE, _zTracePrompt *int8) { _yyTraceFILE = _TraceFILE bug20530(_yyTraceFILE) @@ -105295,9 +109690,12 @@ func _sqlite3ParserTrace(tls *crt.TLS, _TraceFILE *crt.XFILE, _zTracePrompt *int _2: } -// Register the built-in LIKE and GLOB functions. The caseSensitive -// parameter determines whether or not the LIKE operator is case -// sensitive. GLOB is always case sensitive. +// C comment +// /* +// ** Register the built-in LIKE and GLOB functions. The caseSensitive +// ** parameter determines whether or not the LIKE operator is case +// ** sensitive. GLOB is always case sensitive. +// */ func _sqlite3RegisterLikeFunctions(tls *crt.TLS, _db *Xsqlite3, _caseSensitive int32) { var _pInfo *TcompareInfo if _caseSensitive != 0 { @@ -105306,9 +109704,9 @@ func _sqlite3RegisterLikeFunctions(tls *crt.TLS, _db *Xsqlite3, _caseSensitive i } _pInfo = &_likeInfoNorm _1: - _sqlite3CreateFunc(tls, _db, str(7966), i32(2), i32(1), (unsafe.Pointer)(_pInfo), _likeFunc, nil, nil, nil) - _sqlite3CreateFunc(tls, _db, str(7966), i32(3), i32(1), (unsafe.Pointer)(_pInfo), _likeFunc, nil, nil, nil) - _sqlite3CreateFunc(tls, _db, str(7961), i32(2), i32(1), (unsafe.Pointer)(&_globInfo), _likeFunc, nil, nil, nil) + _sqlite3CreateFunc(tls, _db, str(7966), i32(2), i32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil) + _sqlite3CreateFunc(tls, _db, str(7966), i32(3), i32(1), unsafe.Pointer(_pInfo), _likeFunc, nil, nil, nil) + _sqlite3CreateFunc(tls, _db, str(7961), i32(2), i32(1), unsafe.Pointer(&_globInfo), _likeFunc, nil, nil, nil) _setLikeOptFlag(tls, _db, str(7961), uint8(i32(12))) _setLikeOptFlag(tls, _db, str(7966), uint8(func() int32 { if _caseSensitive != 0 { @@ -105318,16 +109716,19 @@ _1: }())) } -// Implementation of the like() SQL function. This function implements -// the build-in LIKE operator. The first argument to the function is the -// pattern and the second argument is the string. So, the SQL statements: -// -// A LIKE B -// -// is implemented as like(B,A). -// -// This same function (with a different compareInfo structure) computes -// the GLOB operator. +// C comment +// /* +// ** Implementation of the like() SQL function. This function implements +// ** the build-in LIKE operator. The first argument to the function is the +// ** pattern and the second argument is the string. So, the SQL statements: +// ** +// ** A LIKE B +// ** +// ** is implemented as like(B,A). +// ** +// ** This same function (with a different compareInfo structure) computes +// ** the GLOB operator. +// */ func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nPat int32 var _escape uint32 @@ -105336,15 +109737,15 @@ func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XM var _pInfo *TcompareInfo _db = Xsqlite3_context_db_handle(tls, _context) _pInfo = (*TcompareInfo)(Xsqlite3_user_data(tls, _context)) - _zB = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _zA = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) - _nPat = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - if _nPat > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(8))))) { + _zB = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _zA = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) + _nPat = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + if _nPat > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(8))))) { Xsqlite3_result_error(tls, _context, str(122220), i32(-1)) return } func() { - if _zB != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + if _zB != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106383), unsafe.Pointer((*int8)(unsafe.Pointer(&_likeFuncØ00__func__Ø000))), unsafe.Pointer(str(122253))) crt.X__builtin_abort(tls) } @@ -105352,7 +109753,7 @@ func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XM if _argc != i32(3) { goto _3 } - _2_zEsc = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) + _2_zEsc = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) if _2_zEsc == nil { return } @@ -105370,11 +109771,14 @@ _6: } } -// Extract the user data from a sqlite3_context structure and return a -// pointer to it. +// C comment +// /* +// ** Extract the user data from a sqlite3_context structure and return a +// ** pointer to it. +// */ func Xsqlite3_user_data(tls *crt.TLS, _p *Xsqlite3_context) (r0 unsafe.Pointer) { func() { - if _p == nil || (*XFuncDef)(_p.X1) == nil { + if _p == nil || _p.X1 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_user_dataØ00__func__Ø000))), unsafe.Pointer(str(122330))) crt.X__builtin_abort(tls) } @@ -105410,7 +109814,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_intØ00__func__Ø000[0], str(122371), 19) } -// Set the LIKEOPT flag on the 2-argument function with the given name. +// C comment +// /* +// ** Set the LIKEOPT flag on the 2-argument function with the given name. +// */ func _setLikeOptFlag(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _flagVal uint8) { var _pDef *XFuncDef _pDef = _sqlite3FindFunction(tls, _db, _zName, i32(2), uint8(i32(1)), uint8(i32(0))) @@ -105425,7 +109832,7 @@ func _setLikeOptFlag(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _flagVal uint8) }() }() != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pDef.X1))) + p := (*uint16)(unsafe.Pointer(&_pDef.X1)) *p = uint16(int32(*p) | int32(_flagVal)) sink14(*p) } @@ -105438,11 +109845,14 @@ func init() { crt.Xstrncpy(nil, &_setLikeOptFlagØ00__func__Ø000[0], str(122390), 15) } -// Helper subroutine for PRAGMA integrity_check: -// -// Generate code to output a single-column result row with the result -// held in register regResult. Decrement the result count and halt if -// the maximum number of result rows have been issued. +// C comment +// /* +// ** Helper subroutine for PRAGMA integrity_check: +// ** +// ** Generate code to output a single-column result row with the result +// ** held in register regResult. Decrement the result count and halt if +// ** the maximum number of result rows have been issued. +// */ func _integrityCheckResultRow(tls *crt.TLS, _v *TVdbe, _regResult int32) (r0 int32) { var _addr int32 _sqlite3VdbeAddOp2(tls, _v, i32(67), _regResult, i32(1)) @@ -105453,7 +109863,7 @@ func _integrityCheckResultRow(tls *crt.TLS, _v *TVdbe, _regResult int32) (r0 int func _sqlite3NoTempsInRange(tls *crt.TLS, _pParse *XParse, _iFirst int32, _iLast int32) (r0 int32) { var _i int32 - if (((_pParse.X14) > i32(0)) && (((_pParse.X15) + (_pParse.X14)) < _iLast)) && ((_pParse.X15) >= _iFirst) { + if ((_pParse.X14 > i32(0)) && ((_pParse.X15 + _pParse.X14) < _iLast)) && (_pParse.X15 >= _iFirst) { return i32(0) } _i = i32(0) @@ -105461,7 +109871,7 @@ _3: if _i >= int32(_pParse.X7) { goto _6 } - if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(_i)))) >= _iFirst) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(_i)))) <= _iLast) { + if ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(_i)))) >= _iFirst) && ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[8]int32)(unsafe.Pointer(&_pParse.X49)))) + 4*uintptr(_i)))) <= _iLast) { return i32(0) } _i += 1 @@ -105496,16 +109906,22 @@ func init() { _sqlite3PragmaØ00readCookieØ009 = [3]XVdbeOpList{XVdbeOpList{X0: u8(2), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(103), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(67), X1: i8(1), X2: i8(1), X3: i8(0)}} } -// Mark the VDBE as one that can only be run multiple times. +// C comment +// /* +// ** Mark the VDBE as one that can only be run multiple times. +// */ func _sqlite3VdbeReusable(tls *crt.TLS, _p *TVdbe) { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 32, 5) + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(0)), 32, 5) } -// Return the N-th compile-time option string. If N is out of range, -// return a NULL pointer. +// C comment +// /* +// ** Return the N-th compile-time option string. If N is out of range, +// ** return a NULL pointer. +// */ func Xsqlite3_compileoption_get(tls *crt.TLS, _N int32) (r0 *int8) { if (_N >= i32(0)) && (_N < i32(6)) { - return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 8*uintptr(_N))) + return *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azCompileOpt)) + 8*uintptr(_N))) } return nil } @@ -105516,15 +109932,18 @@ func init() { _azCompileOpt = [6]*int8{str(122463), str(122469), str(122491), str(122517), str(122534), str(122548)} } -// Configure an sqlite3_wal_hook() callback to automatically checkpoint -// a database after committing a transaction if there are nFrame or -// more frames in the log file. Passing zero or a negative value as the -// nFrame parameter disables automatic checkpoints entirely. -// -// The callback registered by this function replaces any existing callback -// registered using sqlite3_wal_hook(). Likewise, registering a callback -// using sqlite3_wal_hook() disables the automatic checkpoint mechanism -// configured by this function. +// C comment +// /* +// ** Configure an sqlite3_wal_hook() callback to automatically checkpoint +// ** a database after committing a transaction if there are nFrame or +// ** more frames in the log file. Passing zero or a negative value as the +// ** nFrame parameter disables automatic checkpoints entirely. +// ** +// ** The callback registered by this function replaces any existing callback +// ** registered using sqlite3_wal_hook(). Likewise, registering a callback +// ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism +// ** configured by this function. +// */ func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, _db *Xsqlite3, _nFrame int32) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(142507)) @@ -105538,8 +109957,11 @@ _2: return i32(0) } -// Register a callback to be invoked each time a transaction is written -// into the write-ahead-log by this database connection. +// C comment +// /* +// ** Register a callback to be invoked each time a transaction is written +// ** into the write-ahead-log by this database connection. +// */ func Xsqlite3_wal_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _pRet unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -105548,8 +109970,8 @@ func Xsqlite3_wal_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, un } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pRet = _db.X52 - *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&(_db.X51))))) = _xCallback - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X52))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&_db.X51)))) = _xCallback + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X52)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pRet } @@ -105563,14 +109985,20 @@ func _sqlite3WalDefaultHook(tls *crt.TLS, _pClientData unsafe.Pointer, _db *Xsql return i32(0) } -// Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points -// to contains a zero-length string, all attached databases are -// checkpointed. +// C comment +// /* +// ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points +// ** to contains a zero-length string, all attached databases are +// ** checkpointed. +// */ func Xsqlite3_wal_checkpoint(tls *crt.TLS, _db *Xsqlite3, _zDb *int8) (r0 int32) { return Xsqlite3_wal_checkpoint_v2(tls, _db, _zDb, i32(0), nil, nil) } -// Checkpoint database zDb. +// C comment +// /* +// ** Checkpoint database zDb. +// */ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) { var _rc, _iDb int32 _iDb = i32(10) @@ -105591,7 +110019,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode return i32(21) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - if (_zDb != nil) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDb)) + 1*uintptr(i32(0))))) != 0) { + if (_zDb != nil) && ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDb)) + 1*uintptr(i32(0))))) != 0) { _iDb = _sqlite3FindDbName(tls, _db, _zDb) } if _iDb < i32(0) { @@ -105599,20 +110027,23 @@ func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode _sqlite3ErrorWithMsg(tls, _db, i32(1), str(122561), unsafe.Pointer(_zDb)) goto _8 } - *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0) + *(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&_db.X71)).X2))) = i32(0) _rc = _sqlite3Checkpoint(tls, _db, _iDb, _eMode, _pnLog, _pnCkpt) _sqlite3Error(tls, _db, _rc) _8: _rc = _sqlite3ApiExit(tls, _db, _rc) - if (_db.X34) == i32(0) { - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0) + if _db.X34 == i32(0) { + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(0) } Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _rc } -// Free up as much memory as we can from the given database -// connection. +// C comment +// /* +// ** Free up as much memory as we can from the given database +// ** connection. +// */ func Xsqlite3_db_release_memory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _i int32 var _1_pBt *XBtree @@ -105624,7 +110055,7 @@ func Xsqlite3_db_release_memory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { _sqlite3BtreeEnterAll(tls, _db) _i = i32(0) _1: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _4 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -105640,20 +110071,26 @@ _4: return i32(0) } -// Free as much memory as possible from the pager. +// C comment +// /* +// ** Free as much memory as possible from the pager. +// */ func _sqlite3PagerShrink(tls *crt.TLS, _pPager *XPager) { _sqlite3PcacheShrink(tls, (*XPCache)(_pPager.X59)) } -// Free up as much memory as possible from the page cache. +// C comment +// /* +// ** Free up as much memory as possible from the page cache. +// */ func _sqlite3PcacheShrink(tls *crt.TLS, _pCache *XPCache) { func() { - if (_pCache.X12) == nil { + if _pCache.X12 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheShrinkØ00__func__Ø000))), unsafe.Pointer(str(15958))) crt.X__builtin_abort(tls) } }() - ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X12)(tls, _pCache.X12) + ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X12)(tls, _pCache.X12) } var _sqlite3PcacheShrinkØ00__func__Ø000 [20]int8 @@ -105662,8 +110099,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3PcacheShrinkØ00__func__Ø000[0], str(122582), 20) } -// Set the soft heap-size limit for the library. Passing a zero or -// negative value indicates no limit. +// C comment +// /* +// ** Set the soft heap-size limit for the library. Passing a zero or +// ** negative value indicates no limit. +// */ func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) { var _rc int32 var _priorLimit, _excess, _nUsed int64 @@ -105677,9 +110117,9 @@ func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) { Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) return _priorLimit } - *(*int64)(unsafe.Pointer(&(_mem0.X1))) = _n + *(*int64)(unsafe.Pointer(&_mem0.X1)) = _n _nUsed = _sqlite3StatusValue(tls, i32(0)) - *(*int32)(unsafe.Pointer(&(_mem0.X5))) = bool2int((_n > int64(i32(0))) && (_n <= _nUsed)) + *(*int32)(unsafe.Pointer(&_mem0.X5)) = bool2int((_n > int64(i32(0))) && (_n <= _nUsed)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0)) _excess = Xsqlite3_memory_used(tls) - _n if _excess > int64(i32(0)) { @@ -105688,7 +110128,10 @@ func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) { return _priorLimit } -// Return the amount of memory currently checked out. +// C comment +// /* +// ** Return the amount of memory currently checked out. +// */ func Xsqlite3_memory_used(tls *crt.TLS) (r0 int64) { var _res, _mx int64 Xsqlite3_status64(tls, i32(0), &_res, &_mx, i32(0)) @@ -105698,7 +110141,10 @@ func Xsqlite3_memory_used(tls *crt.TLS) (r0 int64) { panic(0) } -// Query status information. +// C comment +// /* +// ** Query status information. +// */ func Xsqlite3_status64(tls *crt.TLS, _op int32, _pCurrent *int64, _pHighwater *int64, _resetFlag int32) (r0 int32) { var _pMutex *Xsqlite3_mutex if (_op < i32(0)) || (_op >= i32(10)) { @@ -105708,29 +110154,32 @@ func Xsqlite3_status64(tls *crt.TLS, _op int32, _pCurrent *int64, _pHighwater *i return _sqlite3MisuseError(tls, i32(18619)) } _pMutex = func() *Xsqlite3_mutex { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_statMutex)) + 1*uintptr(_op)))) != 0 { return _sqlite3Pcache1Mutex(tls) } return _sqlite3MallocMutex(tls) }() Xsqlite3_mutex_enter(tls, _pMutex) - *_pCurrent = *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) - *_pHighwater = *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op))) + *_pCurrent = *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) + *_pHighwater = *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op))) if _resetFlag != 0 { - *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 8*uintptr(_op))) = *(*int64)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]int64)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 8*uintptr(_op))) + *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X1)))) + 8*uintptr(_op))) = *(*int64)(unsafe.Pointer(uintptr(unsafe.Pointer((*[10]int64)(unsafe.Pointer(&_sqlite3Stat.X0)))) + 8*uintptr(_op))) } Xsqlite3_mutex_leave(tls, _pMutex) return i32(0) } -// Change the value of a limit. Report the old value. -// If an invalid limit index is supplied, report -1. -// Make no changes but still report the old value if the -// new limit is negative. -// -// A new lower limit does not shrink existing constructs. -// It merely prevents new constructs that exceed the limit -// from forming. +// C comment +// /* +// ** Change the value of a limit. Report the old value. +// ** If an invalid limit index is supplied, report -1. +// ** Make no changes but still report the old value if the +// ** new limit is negative. +// ** +// ** A new lower limit does not shrink existing constructs. +// ** It merely prevents new constructs that exceed the limit +// ** from forming. +// */ func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32) (r0 int32) { var _oldLimit int32 if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -105738,73 +110187,73 @@ func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32 return i32(-1) } func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(0))))) != i32(1000000000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(0))))) != i32(1000000000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142965), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122602))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(1))))) != i32(1000000000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(1))))) != i32(1000000000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142966), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122653))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(2))))) != i32(2000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(2))))) != i32(2000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142967), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122712))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(3))))) != i32(1000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(3))))) != i32(1000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122763))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(4))))) != i32(500) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(4))))) != i32(500) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122822))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(5))))) != i32(250000000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(5))))) != i32(250000000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142970), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122891))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(6))))) != i32(127) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(6))))) != i32(127) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142971), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122944))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(7))))) != i32(10) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(7))))) != i32(10) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142972), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123007))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(8))))) != i32(50000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(8))))) != i32(50000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123062))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(9))))) != i32(999) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(9))))) != i32(999) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123140))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(10))))) != i32(1000) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(10))))) != i32(1000) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123209))) crt.X__builtin_abort(tls) } }() func() { - if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(11))))) != i32(8) { + if (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(i32(11))))) != i32(8) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142977), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123274))) crt.X__builtin_abort(tls) } @@ -105813,14 +110262,14 @@ func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32 if (_limitId < i32(0)) || (_limitId >= i32(12)) { return i32(-1) } - _oldLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(_limitId))) + _oldLimit = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(_limitId))) if _newLimit < i32(0) { goto _27 } - if _newLimit > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(_limitId)))) { - _newLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(_limitId))) + if _newLimit > (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(_limitId)))) { + _newLimit = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aHardLimit)) + 4*uintptr(_limitId))) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(_limitId))) = _newLimit + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(_limitId))) = _newLimit _27: return _oldLimit } @@ -105847,7 +110296,7 @@ func _sqlite3VdbeVerifyNoResultRow(tls *crt.TLS, _p *TVdbe) { var _i int32 _i = i32(0) _0: - if _i >= (_p.X27) { + if _i >= _p.X27 { goto _3 } func() { @@ -105867,8 +110316,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000[0], str(123419), 29) } -// This routine is called after all of the trigger actions have been parsed -// in order to complete the process of building the trigger. +// C comment +// /* +// ** This routine is called after all of the trigger actions have been parsed +// ** in order to complete the process of building the trigger. +// */ func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _pAll *XToken) { var _iDb int32 var _zName, _3_z *int8 @@ -105881,9 +110333,9 @@ func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerSt var _sFix XDbFixer _pTrig = (*XTrigger)(_pParse.X64) _db = (*Xsqlite3)(_pParse.X0) - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X64))))) = nil + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X64)))) = nil if func() int32 { - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -105896,10 +110348,10 @@ func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerSt } _zName = _pTrig.X0 _iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTrig.X6)) - *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrig.X8))))) = _pStepList + *(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrig.X8)))) = _pStepList _4: if _pStepList != nil { - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pStepList.X2))))) = _pTrig + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pStepList.X2)))) = _pTrig _pStepList = (*XTriggerStep)(_pStepList.X8) goto _4 } @@ -105908,7 +110360,7 @@ _4: if _sqlite3FixTriggerStep(tls, &_sFix, (*XTriggerStep)(_pTrig.X8)) != 0 || _sqlite3FixExpr(tls, &_sFix, (*XExpr)(_pTrig.X4)) != 0 { goto _triggerfinish_cleanup } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { goto _8 } _3_v = _sqlite3GetVdbe(tls, _pParse) @@ -105918,11 +110370,11 @@ _4: _sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb) _3_z = _sqlite3DbStrNDup(tls, _db, _pAll.X0, uint64(_pAll.X1)) _sqlite3NestedParse(tls, _pParse, str(123448), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_zName), unsafe.Pointer(_pTrig.X1), unsafe.Pointer(_3_z)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_3_z)) _sqlite3ChangeCookie(tls, _pParse, _iDb) _sqlite3VdbeAddParseSchemaOp(tls, _3_v, _iDb, _sqlite3MPrintf(tls, _db, str(123512), unsafe.Pointer(_zName))) _8: - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) == 0 { goto _triggerfinish_cleanup } _4_pLink = _pTrig @@ -105933,7 +110385,7 @@ _8: crt.X__builtin_abort(tls) } }() - _pTrig = (*XTrigger)(_sqlite3HashInsert(tls, _4_pHash, _zName, (unsafe.Pointer)(_pTrig))) + _pTrig = (*XTrigger)(_sqlite3HashInsert(tls, _4_pHash, _zName, unsafe.Pointer(_pTrig))) if _pTrig != nil { _sqlite3OomFault(tls, _db) goto _15 @@ -105946,14 +110398,14 @@ _8: crt.X__builtin_abort(tls) } }() - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pLink.X9))))) = (*XTrigger)(_6_pTab.X19) - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pTab.X19))))) = _4_pLink + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_pLink.X9)))) = (*XTrigger)(_6_pTab.X19) + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_pTab.X19)))) = _4_pLink } _15: _triggerfinish_cleanup: _sqlite3DeleteTrigger(tls, _db, _pTrig) func() { - if (*XTrigger)(_pParse.X64) != nil { + if _pParse.X64 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(123541))) crt.X__builtin_abort(tls) } @@ -105989,12 +110441,15 @@ _1: return i32(0) } -// This is called by the parser when it sees a CREATE TRIGGER statement -// up to the point of the BEGIN before the trigger actions. A Trigger -// structure is generated based on the information available and stored -// in pParse->pNewTrigger. After the trigger actions have been parsed, the -// sqlite3FinishTrigger() function is called to complete the trigger -// construction process. +// C comment +// /* +// ** This is called by the parser when it sees a CREATE TRIGGER statement +// ** up to the point of the BEGIN before the trigger actions. A Trigger +// ** structure is generated based on the information available and stored +// ** in pParse->pNewTrigger. After the trigger actions have been parsed, the +// ** sqlite3FinishTrigger() function is called to complete the trigger +// ** construction process. +// */ func _sqlite3BeginTrigger(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _tr_tm int32, _op int32, _pColumns *XIdList, _pTableName *XSrcList, _pWhen *XExpr, _isTemp int32, _noErr int32) { var _iDb, _19_iTabDb, _19_code int32 var _zName, _19_zDb, _19_zDbTrig *int8 @@ -106033,7 +110488,7 @@ func _sqlite3BeginTrigger(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName if _isTemp == 0 { goto _11 } - if (_pName2.X1) > uint32(i32(0)) { + if _pName2.X1 > uint32(i32(0)) { _sqlite3ErrorMsg(tls, _pParse, str(123657)) goto _trigger_cleanup } @@ -106046,22 +110501,22 @@ _11: goto _trigger_cleanup } _13: - if (_pTableName == nil) || ((_db.X17) != 0) { + if (_pTableName == nil) || (_db.X17 != 0) { goto _trigger_cleanup } - if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) && (_iDb != i32(1)) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2)))))+112*uintptr(i32(0)))).X1)) - *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2))))) + 112*uintptr(i32(0)))).X1))) = nil + if (((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0) && (_iDb != i32(1)) { + _sqlite3DbFree(tls, _db, unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTableName.X2))))+112*uintptr(i32(0)))).X1)) + *(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTableName.X2)))) + 112*uintptr(i32(0)))).X1))) = nil } _pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName) - if (((int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0)) && ((_pName2.X1) == uint32(i32(0)))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4)) { + if (((int32((*t21)(unsafe.Pointer(&_db.X33)).X2) == i32(0)) && (_pName2.X1 == uint32(i32(0)))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(1)))).X4)) { _iDb = i32(1) } - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _trigger_cleanup } func() { - if (_pTableName.X0) != i32(1) { + if _pTableName.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122793), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123703))) crt.X__builtin_abort(tls) } @@ -106074,12 +110529,12 @@ _13: if _pTab != nil { goto _27 } - if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) == i32(1) { - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X3))) = uint8(i32(1)) + if int32((*t21)(unsafe.Pointer(&_db.X33)).X1) == i32(1) { + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_db.X33)).X3))) = uint8(i32(1)) } goto _trigger_cleanup _27: - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3ErrorMsg(tls, _pParse, str(123723)) goto _trigger_cleanup } @@ -106101,7 +110556,7 @@ _27: goto _36 } func() { - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122830), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(112549))) crt.X__builtin_abort(tls) } @@ -106114,7 +110569,7 @@ _34: _sqlite3ErrorMsg(tls, _pParse, str(123790)) goto _trigger_cleanup } - if ((*XSelect)(_pTab.X3) != nil) && (_tr_tm != i32(48)) { + if (_pTab.X3 != nil) && (_tr_tm != i32(48)) { _sqlite3ErrorMsg(tls, _pParse, str(123828), unsafe.Pointer(func() *int8 { if _tr_tm == i32(34) { return str(25167) @@ -106123,7 +110578,7 @@ _34: }()), unsafe.Pointer(_pTableName), i32(0)) goto _trigger_cleanup } - if ((*XSelect)(_pTab.X3) == nil) && (_tr_tm == i32(48)) { + if (_pTab.X3 == nil) && (_tr_tm == i32(48)) { _sqlite3ErrorMsg(tls, _pParse, str(123865), unsafe.Pointer(_pTableName), i32(0)) goto _trigger_cleanup } @@ -106157,33 +110612,33 @@ _34: if _pTrigger == nil { goto _trigger_cleanup } - *(**int8)(unsafe.Pointer(&(_pTrigger.X0))) = _zName + *(**int8)(unsafe.Pointer(&_pTrigger.X0)) = _zName _zName = nil - *(**int8)(unsafe.Pointer(&(_pTrigger.X1))) = _sqlite3DbStrDup(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2)))))+112*uintptr(i32(0)))).X2) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X6))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X7))))) = (*XSchema)(_pTab.X20) - *(*uint8)(unsafe.Pointer(&(_pTrigger.X2))) = uint8(_op) - *(*uint8)(unsafe.Pointer(&(_pTrigger.X3))) = uint8(func() int32 { + *(**int8)(unsafe.Pointer(&_pTrigger.X1)) = _sqlite3DbStrDup(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pTableName.X2))))+112*uintptr(i32(0)))).X2) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X6)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X7)))) = (*XSchema)(_pTab.X20) + *(*uint8)(unsafe.Pointer(&_pTrigger.X2)) = uint8(_op) + *(*uint8)(unsafe.Pointer(&_pTrigger.X3)) = uint8(func() int32 { if _tr_tm == i32(34) { return i32(1) } return i32(2) }()) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X4))))) = _sqlite3ExprDup(tls, _db, _pWhen, i32(1)) - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X5))))) = _sqlite3IdListDup(tls, _db, _pColumns) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X4)))) = _sqlite3ExprDup(tls, _db, _pWhen, i32(1)) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTrigger.X5)))) = _sqlite3IdListDup(tls, _db, _pColumns) func() { if (*XTrigger)(_pParse.X64) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122893), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(24655))) crt.X__builtin_abort(tls) } }() - *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X64))))) = _pTrigger + *(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X64)))) = _pTrigger _trigger_cleanup: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) _sqlite3SrcListDelete(tls, _db, _pTableName) _sqlite3IdListDelete(tls, _db, _pColumns) _sqlite3ExprDelete(tls, _db, _pWhen) - if (*XTrigger)(_pParse.X64) == nil { + if _pParse.X64 == nil { _sqlite3DeleteTrigger(tls, _db, _pTrigger) goto _62 } @@ -106203,58 +110658,67 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BeginTriggerØ00__func__Ø000[0], str(123941), 20) } -// Construct a trigger step that implements an UPDATE statement and return -// a pointer to that trigger step. The parser calls this routine when it -// sees an UPDATE statement inside the body of a CREATE TRIGGER. +// C comment +// /* +// ** Construct a trigger step that implements an UPDATE statement and return +// ** a pointer to that trigger step. The parser calls this routine when it +// ** sees an UPDATE statement inside the body of a CREATE TRIGGER. +// */ func _sqlite3TriggerUpdateStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pEList *XExprList, _pWhere *XExpr, _orconf uint8) (r0 *XTriggerStep) { var _pTriggerStep *XTriggerStep _pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(110)), _pTableName) if _pTriggerStep != nil { - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X6))))) = _sqlite3ExprListDup(tls, _db, _pEList, i32(1)) - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X5))))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1)) - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = _orconf + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X6)))) = _sqlite3ExprListDup(tls, _db, _pEList, i32(1)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X5)))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1)) + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X1)) = _orconf } _sqlite3ExprListDelete(tls, _db, _pEList) _sqlite3ExprDelete(tls, _db, _pWhere) return _pTriggerStep } -// Allocate space to hold a new trigger step. The allocated space -// holds both the TriggerStep object and the TriggerStep.target.z string. -// -// If an OOM error occurs, NULL is returned and db->mallocFailed is set. +// C comment +// /* +// ** Allocate space to hold a new trigger step. The allocated space +// ** holds both the TriggerStep object and the TriggerStep.target.z string. +// ** +// ** If an OOM error occurs, NULL is returned and db->mallocFailed is set. +// */ func _triggerStepAllocate(tls *crt.TLS, _db *Xsqlite3, _op uint8, _pName *XToken) (r0 *XTriggerStep) { var _1_z *int8 var _pTriggerStep *XTriggerStep _pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, (u64(72)+uint64(_pName.X1))+uint64(i32(1)))) if _pTriggerStep != nil { - _1_z = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTriggerStep)) + 72*uintptr(i32(1)))))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_1_z), (unsafe.Pointer)(_pName.X0), uint64(_pName.X1)) + _1_z = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTriggerStep)) + 72*uintptr(i32(1)))))) + crt.Xmemcpy(tls, unsafe.Pointer(_1_z), unsafe.Pointer(_pName.X0), uint64(_pName.X1)) _sqlite3Dequote(tls, _1_z) - *(**int8)(unsafe.Pointer(&(_pTriggerStep.X4))) = _1_z - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X0))) = _op + *(**int8)(unsafe.Pointer(&_pTriggerStep.X4)) = _1_z + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X0)) = _op } return _pTriggerStep } -// Build a trigger step out of an INSERT statement. Return a pointer -// to the new trigger step. -// -// The parser calls this routine when it sees an INSERT inside the -// body of a trigger. +// C comment +// /* +// ** Build a trigger step out of an INSERT statement. Return a pointer +// ** to the new trigger step. +// ** +// ** The parser calls this routine when it sees an INSERT inside the +// ** body of a trigger. +// */ func _sqlite3TriggerInsertStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pColumn *XIdList, _pSelect *XSelect, _orconf uint8) (r0 *XTriggerStep) { var _pTriggerStep *XTriggerStep func() { - if _pSelect == nil && (_db.X17) == 0 { + if _pSelect == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123044), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggerInsertStepØ00__func__Ø000))), unsafe.Pointer(str(123961))) crt.X__builtin_abort(tls) } }() _pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(108)), _pTableName) if _pTriggerStep != nil { - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X3))))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1)) - *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X7))))) = _pColumn - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = _orconf + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X3)))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1)) + *(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X7)))) = _pColumn + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X1)) = _orconf goto _4 } _sqlite3IdListDelete(tls, _db, _pColumn) @@ -106269,25 +110733,31 @@ func init() { crt.Xstrncpy(nil, &_sqlite3TriggerInsertStepØ00__func__Ø000[0], str(123994), 25) } -// Construct a trigger step that implements a DELETE statement and return -// a pointer to that trigger step. The parser calls this routine when it -// sees a DELETE statement inside the body of a CREATE TRIGGER. +// C comment +// /* +// ** Construct a trigger step that implements a DELETE statement and return +// ** a pointer to that trigger step. The parser calls this routine when it +// ** sees a DELETE statement inside the body of a CREATE TRIGGER. +// */ func _sqlite3TriggerDeleteStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pWhere *XExpr) (r0 *XTriggerStep) { var _pTriggerStep *XTriggerStep _pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(109)), _pTableName) if _pTriggerStep != nil { - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X5))))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1)) - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = uint8(i32(10)) + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X5)))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1)) + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X1)) = uint8(i32(10)) } _sqlite3ExprDelete(tls, _db, _pWhere) return _pTriggerStep } -// Turn a SELECT statement (that the pSelect parameter points to) into -// a trigger step. Return a pointer to a TriggerStep structure. -// -// The parser calls this routine when it finds a SELECT statement in -// body of a TRIGGER. +// C comment +// /* +// ** Turn a SELECT statement (that the pSelect parameter points to) into +// ** a trigger step. Return a pointer to a TriggerStep structure. +// ** +// ** The parser calls this routine when it finds a SELECT statement in +// ** body of a TRIGGER. +// */ func _sqlite3TriggerSelectStep(tls *crt.TLS, _db *Xsqlite3, _pSelect *XSelect) (r0 *XTriggerStep) { var _pTriggerStep *XTriggerStep _pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, u64(72))) @@ -106295,19 +110765,21 @@ func _sqlite3TriggerSelectStep(tls *crt.TLS, _db *Xsqlite3, _pSelect *XSelect) ( _sqlite3SelectDelete(tls, _db, _pSelect) return nil } - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X0))) = uint8(i32(119)) - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X3))))) = _pSelect - *(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = uint8(i32(10)) + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X0)) = uint8(i32(119)) + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pTriggerStep.X3)))) = _pSelect + *(*uint8)(unsafe.Pointer(&_pTriggerStep.X1)) = uint8(i32(10)) return _pTriggerStep } -// This function is called to drop a trigger from the database schema. -// -// This may be called directly from the parser and therefore identifies -// the trigger by name. The sqlite3DropTriggerPtr() routine does the -// same job as this routine except it takes a pointer to the trigger -// instead of the trigger name. -// * +// C comment +// /* +// ** This function is called to drop a trigger from the database schema. +// ** +// ** This may be called directly from the parser and therefore identifies +// ** the trigger by name. The sqlite3DropTriggerPtr() routine does the +// ** same job as this routine except it takes a pointer to the trigger +// ** instead of the trigger name. +// **/ func _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr int32) { var _i, _2_j int32 var _zDb, _zName *int8 @@ -106315,20 +110787,20 @@ func _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr var _pTrigger *XTrigger _pTrigger = nil _db = (*Xsqlite3)(_pParse.X0) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _drop_trigger_cleanup } if i32(0) != _sqlite3ReadSchema(tls, _pParse) { goto _drop_trigger_cleanup } func() { - if (_pName.X0) != i32(1) { + if _pName.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123138), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000))), unsafe.Pointer(str(114791))) crt.X__builtin_abort(tls) } }() - _zDb = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2))))) + 112*uintptr(i32(0)))).X1 - _zName = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2))))) + 112*uintptr(i32(0)))).X2 + _zDb = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2)))) + 112*uintptr(i32(0)))).X1 + _zName = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pName.X2)))) + 112*uintptr(i32(0)))).X2 func() { if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123141), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000))), unsafe.Pointer(str(59917))) @@ -106337,7 +110809,7 @@ func _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr }() _i = i32(0) _7: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _10 } _2_j = func() int32 { @@ -106372,7 +110844,7 @@ _10: } _sqlite3CodeVerifyNamedSchema(tls, _pParse, _zDb) _20: - *(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pParse.X5)) = uint8(i32(1)) goto _drop_trigger_cleanup _18: _sqlite3DropTriggerPtr(tls, _pParse, _pTrigger) @@ -106386,15 +110858,21 @@ func init() { crt.Xstrncpy(nil, &_sqlite3DropTriggerØ00__func__Ø000[0], str(124039), 19) } -// Called by the parser to compile an ATTACH statement. -// -// ATTACH p AS pDbname KEY pKey +// C comment +// /* +// ** Called by the parser to compile an ATTACH statement. +// ** +// ** ATTACH p AS pDbname KEY pKey +// */ func _sqlite3Attach(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pDbname *XExpr, _pKey *XExpr) { _codeAttach(tls, _pParse, i32(24), &_sqlite3AttachØ00attach_funcØ001, _p, _p, _pDbname, _pKey) } -// This procedure generates VDBE code for a single invocation of either the -// sqlite_detach() or sqlite_attach() SQL user functions. +// C comment +// /* +// ** This procedure generates VDBE code for a single invocation of either the +// ** sqlite_detach() or sqlite_attach() SQL user functions. +// */ func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _pAuthArg *XExpr, _pFilename *XExpr, _pDbname *XExpr, _pKey *XExpr) { var _rc, _regArgs int32 var _2_zAuthArg *int8 @@ -106402,11 +110880,11 @@ func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _ var _v *TVdbe var _sName XNameContext _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X16) != 0 { + if _pParse.X16 != 0 { goto _attach_end } - crt.Xmemset(tls, (unsafe.Pointer)(&_sName), i32(0), u64(56)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sName.X0))))) = _pParse + crt.Xmemset(tls, unsafe.Pointer(&_sName), i32(0), u64(56)) + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_sName.X0)))) = _pParse if ((i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pFilename))) || (i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pDbname)))) || (i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pKey))) { goto _attach_end } @@ -106414,7 +110892,7 @@ func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _ goto _4 } if int32(_pAuthArg.X0) == i32(97) { - _2_zAuthArg = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pAuthArg.X3))))) + _2_zAuthArg = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&_pAuthArg.X3)))) goto _6 } _2_zAuthArg = nil @@ -106430,7 +110908,7 @@ _4: _sqlite3ExprCode(tls, _pParse, _pDbname, _regArgs+i32(1)) _sqlite3ExprCode(tls, _pParse, _pKey, _regArgs+i32(2)) func() { - if _v == nil && (_db.X17) == 0 { + if _v == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99197), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAttachØ00__func__Ø000))), unsafe.Pointer(str(124058))) crt.X__builtin_abort(tls) } @@ -106453,22 +110931,25 @@ _attach_end: _ = _sName } -// Resolve an expression that was part of an ATTACH or DETACH statement. This -// is slightly different from resolving a normal SQL expression, because simple -// identifiers are treated as strings, not possible column names or aliases. -// -// i.e. if the parser sees: -// -// ATTACH DATABASE abc AS def -// -// it treats the two expressions as literal strings 'abc' and 'def' instead of -// looking for columns of the same name. -// -// This only applies to the root node of pExpr, so the statement: -// -// ATTACH DATABASE abc||def AS 'db2' -// -// will fail because neither abc or def can be resolved. +// C comment +// /* +// ** Resolve an expression that was part of an ATTACH or DETACH statement. This +// ** is slightly different from resolving a normal SQL expression, because simple +// ** identifiers are treated as strings, not possible column names or aliases. +// ** +// ** i.e. if the parser sees: +// ** +// ** ATTACH DATABASE abc AS def +// ** +// ** it treats the two expressions as literal strings 'abc' and 'def' instead of +// ** looking for columns of the same name. +// ** +// ** This only applies to the root node of pExpr, so the statement: +// ** +// ** ATTACH DATABASE abc||def AS 'db2' +// ** +// ** will fail because neither abc or def can be resolved. +// */ func _resolveAttachExpr(tls *crt.TLS, _pName *XNameContext, _pExpr *XExpr) (r0 int32) { var _rc int32 _rc = i32(0) @@ -106479,7 +110960,7 @@ func _resolveAttachExpr(tls *crt.TLS, _pName *XNameContext, _pExpr *XExpr) (r0 i _rc = _sqlite3ResolveExprNames(tls, _pName, _pExpr) goto _2 } - *(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(97)) + *(*uint8)(unsafe.Pointer(&_pExpr.X0)) = uint8(i32(97)) _2: _0: return _rc @@ -106499,15 +110980,18 @@ func init() { }{_attachFunc})), X5: nil, X6: str(124142), X7: t12{}} } -// An SQL user-function registered to do the work of an ATTACH statement. The -// three arguments to the function come directly from an attach statement: -// -// ATTACH DATABASE x AS y KEY z -// -// SELECT sqlite_attach(x, y, z) -// -// If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the -// third argument. +// C comment +// /* +// ** An SQL user-function registered to do the work of an ATTACH statement. The +// ** three arguments to the function come directly from an attach statement: +// ** +// ** ATTACH DATABASE x AS y KEY z +// ** +// ** SELECT sqlite_attach(x, y, z) +// ** +// ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the +// ** third argument. +// */ func _attachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _i, _rc, _14_iDb int32 var _flags uint32 @@ -106522,25 +111006,25 @@ func _attachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv _zErr = nil _zErrDyn = nil - _zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) - _zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))))) + _zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) + _zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))))) if _zFile == nil { _zFile = str(0) } if _zName == nil { _zName = str(0) } - if (_db.X5) >= ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(7))))) + i32(2)) { - _zErrDyn = _sqlite3MPrintf(tls, _db, str(124156), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(7))))) + if _db.X5 >= ((*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(7))))) + i32(2)) { + _zErrDyn = _sqlite3MPrintf(tls, _db, str(124156), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(7))))) goto _attach_error } - if (_db.X15) == 0 { + if _db.X15 == 0 { _zErrDyn = _sqlite3MPrintf(tls, _db, str(124193)) goto _attach_error } _i = i32(0) _4: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _7 } _3_z = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X0 @@ -106557,24 +111041,24 @@ _4: _i += 1 goto _4 _7: - if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) { + if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72)))) { goto _12 } _aNew = (*XDb)(_sqlite3DbMallocRawNN(tls, _db, u64(96))) if _aNew == nil { return } - crt.Xmemcpy(tls, (unsafe.Pointer)(_aNew), _db.X4, u64(64)) + crt.Xmemcpy(tls, unsafe.Pointer(_aNew), _db.X4, u64(64)) goto _14 _12: - _aNew = (*XDb)(_sqlite3DbRealloc(tls, _db, _db.X4, u64(32)*uint64((_db.X5)+i32(1)))) + _aNew = (*XDb)(_sqlite3DbRealloc(tls, _db, _db.X4, u64(32)*uint64(_db.X5+i32(1)))) if _aNew == nil { return } _14: - *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = _aNew + *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X4)))) = _aNew _aNew = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_db.X5))) - crt.Xmemset(tls, (unsafe.Pointer)(_aNew), i32(0), u64(32)) + crt.Xmemset(tls, unsafe.Pointer(_aNew), i32(0), u64(32)) _flags = _db.X9 _rc = _sqlite3ParseUri(tls, (*Xsqlite3_vfs)(_db.X0).X4, _zFile, &_flags, &_pVfs, &_zPath, &_zErr) if _rc == i32(0) { @@ -106584,7 +111068,7 @@ _14: _sqlite3OomFault(tls, _db) } Xsqlite3_result_error(tls, _context, _zErr, i32(-1)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zErr)) + Xsqlite3_free(tls, unsafe.Pointer(_zErr)) return _16: func() { @@ -106598,10 +111082,10 @@ _16: *p = (*p) | uint32(i32(256)) sink5(*p) } - _rc = _sqlite3BtreeOpen(tls, _pVfs, _zPath, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_aNew.X1))))), i32(0), int32(_flags)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zPath)) - *(*int32)(unsafe.Pointer(&(_db.X5))) += 1 - *(*uint8)(unsafe.Pointer(&(_db.X25))) = uint8(i32(0)) + _rc = _sqlite3BtreeOpen(tls, _pVfs, _zPath, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_aNew.X1)))), i32(0), int32(_flags)) + Xsqlite3_free(tls, unsafe.Pointer(_zPath)) + *(*int32)(unsafe.Pointer(&_db.X5)) += 1 + *(*uint8)(unsafe.Pointer(&_db.X25)) = uint8(i32(0)) if _rc == i32(19) { _rc = i32(1) _zErrDyn = _sqlite3MPrintf(tls, _db, str(124281)) @@ -106610,8 +111094,8 @@ _16: if _rc != i32(0) { goto _22 } - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_aNew.X4))))) = _sqlite3SchemaGet(tls, _db, (*XBtree)(_aNew.X1)) - if (*XSchema)(_aNew.X4) == nil { + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_aNew.X4)))) = _sqlite3SchemaGet(tls, _db, (*XBtree)(_aNew.X1)) + if _aNew.X4 == nil { _rc = _sqlite3NomemError(tls, i32(98982)) goto _26 } @@ -106624,12 +111108,12 @@ _26: _9_pPager = _sqlite3BtreePager(tls, (*XBtree)(_aNew.X1)) _sqlite3PagerLockingMode(tls, _9_pPager, int32(_db.X19)) _sqlite3BtreeSecureDelete(tls, (*XBtree)(_aNew.X1), _sqlite3BtreeSecureDelete(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1), i32(-1))) - _sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_aNew.X1), uint32(i32(3)|((_db.X6)&i32(56)))) + _sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_aNew.X1), uint32(i32(3)|(_db.X6&i32(56)))) _sqlite3BtreeLeave(tls, (*XBtree)(_aNew.X1)) _22: - *(*uint8)(unsafe.Pointer(&(_aNew.X2))) = uint8(i32(3)) - *(**int8)(unsafe.Pointer(&(_aNew.X0))) = _sqlite3DbStrDup(tls, _db, _zName) - if (_rc == i32(0)) && ((_aNew.X0) == nil) { + *(*uint8)(unsafe.Pointer(&_aNew.X2)) = uint8(i32(3)) + *(**int8)(unsafe.Pointer(&_aNew.X0)) = _sqlite3DbStrDup(tls, _db, _zName) + if (_rc == i32(0)) && (_aNew.X0 == nil) { _rc = _sqlite3NomemError(tls, i32(99002)) } if _rc == i32(0) { @@ -106640,23 +111124,23 @@ _22: if _rc == 0 { goto _30 } - _14_iDb = (_db.X5) - i32(1) + _14_iDb = _db.X5 - i32(1) func() { if _14_iDb < i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99059), unsafe.Pointer((*int8)(unsafe.Pointer(&_attachFuncØ00__func__Ø000))), unsafe.Pointer(str(124310))) crt.X__builtin_abort(tls) } }() - if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_14_iDb))).X1) != nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_14_iDb))).X1) != nil { _sqlite3BtreeClose(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_14_iDb))).X1)) *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_14_iDb))).X1))))) = nil *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_14_iDb))).X4))))) = nil } _sqlite3ResetAllSchemasOfConnection(tls, _db) - *(*int32)(unsafe.Pointer(&(_db.X5))) = _14_iDb + *(*int32)(unsafe.Pointer(&_db.X5)) = _14_iDb if (_rc == i32(7)) || (_rc == i32(3082)) { _sqlite3OomFault(tls, _db) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrDyn)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn)) _zErrDyn = _sqlite3MPrintf(tls, _db, str(59419)) goto _37 } @@ -106670,7 +111154,7 @@ _30: _attach_error: if _zErrDyn != nil { Xsqlite3_result_error(tls, _context, _zErrDyn, i32(-1)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrDyn)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrDyn)) } if _rc != 0 { Xsqlite3_result_error_code(tls, _context, _rc) @@ -106683,28 +111167,31 @@ func init() { crt.Xstrncpy(nil, &_attachFuncØ00__func__Ø000[0], str(124345), 11) } -// This function is used to parse both URIs and non-URI filenames passed by the -// user to API functions sqlite3_open() or sqlite3_open_v2(), and for database -// URIs specified as part of ATTACH statements. -// -// The first argument to this function is the name of the VFS to use (or -// a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx" -// query parameter. The second argument contains the URI (or non-URI filename) -// itself. When this function is called the *pFlags variable should contain -// the default flags to open the database handle with. The value stored in -// *pFlags may be updated before returning if the URI filename contains -// "cache=xxx" or "mode=xxx" query parameters. -// -// If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to -// the VFS that should be used to open the database file. *pzFile is set to -// point to a buffer containing the name of the file to open. It is the -// responsibility of the caller to eventually call sqlite3_free() to release -// this buffer. -// -// If an error occurs, then an SQLite error code is returned and *pzErrMsg -// may be set to point to a buffer containing an English language error -// message. It is the responsibility of the caller to eventually release -// this buffer by calling sqlite3_free(). +// C comment +// /* +// ** This function is used to parse both URIs and non-URI filenames passed by the +// ** user to API functions sqlite3_open() or sqlite3_open_v2(), and for database +// ** URIs specified as part of ATTACH statements. +// ** +// ** The first argument to this function is the name of the VFS to use (or +// ** a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx" +// ** query parameter. The second argument contains the URI (or non-URI filename) +// ** itself. When this function is called the *pFlags variable should contain +// ** the default flags to open the database handle with. The value stored in +// ** *pFlags may be updated before returning if the URI filename contains +// ** "cache=xxx" or "mode=xxx" query parameters. +// ** +// ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to +// ** the VFS that should be used to open the database file. *pzFile is set to +// ** point to a buffer containing the name of the file to open. It is the +// ** responsibility of the caller to eventually call sqlite3_free() to release +// ** this buffer. +// ** +// ** If an error occurs, then an SQLite error code is returned and *pzErrMsg +// ** may be set to point to a buffer containing an English language error +// ** message. It is the responsibility of the caller to eventually release +// ** this buffer by calling sqlite3_free(). +// */ func _sqlite3ParseUri(tls *crt.TLS, _zDefaultVfs *int8, _zUri *int8, _pFlags *uint32, _ppVfs **Xsqlite3_vfs, _pzFile **int8, _pzErrMsg **int8) (r0 int32) { var _rc, _nUri, _1_eState, _1_iIn, _1_iOut, _5_octet, _13_nOpt, _13_nVal, _15_mask, _15_limit, _18_i, _18_mode int32 var _c int8 @@ -106722,7 +111209,7 @@ func _sqlite3ParseUri(tls *crt.TLS, _zDefaultVfs *int8, _zUri *int8, _pFlags *ui crt.X__builtin_abort(tls) } }() - if (_flags&uint32(i32(64))) == 0 && (_sqlite3Config.X3) == 0 || _nUri < i32(5) || crt.Xmemcmp(tls, (unsafe.Pointer)(_zUri), (unsafe.Pointer)(str(124369)), uint64(i32(5))) != i32(0) { + if (_flags&uint32(i32(64))) == 0 && _sqlite3Config.X3 == 0 || _nUri < i32(5) || crt.Xmemcmp(tls, unsafe.Pointer(_zUri), unsafe.Pointer(str(124369)), uint64(i32(5))) != i32(0) { goto _5 } _1_iOut = i32(0) @@ -106739,7 +111226,7 @@ _6: } { p := &_1_nByte - *p = (*p) + uint64(bool2int(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) == i32(38))) + *p = (*p) + uint64(bool2int(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn)))) == i32(38))) sink17(*p) } _1_iIn += 1 @@ -106750,34 +111237,34 @@ _9: return _sqlite3NomemError(tls, i32(143051)) } _1_iIn = i32(5) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(i32(5))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(i32(6))))) != i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(i32(5))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(i32(6))))) != i32(47) { goto _12 } _1_iIn = i32(7) _13: - if ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != i32(47)) { + if ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn)))) != i32(47)) { _1_iIn += 1 goto _13 } - if (_1_iIn != i32(7)) && ((_1_iIn != i32(16)) || crt.Xmemcmp(tls, (unsafe.Pointer)(str(124375)), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri))+1*uintptr(i32(7))))), uint64(i32(9))) != 0) { - *_pzErrMsg = Xsqlite3_mprintf(tls, str(124385), _1_iIn-i32(7), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri))+1*uintptr(i32(7)))))) + if (_1_iIn != i32(7)) && ((_1_iIn != i32(16)) || crt.Xmemcmp(tls, unsafe.Pointer(str(124375)), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri))+1*uintptr(i32(7))))), uint64(i32(9))) != 0) { + *_pzErrMsg = Xsqlite3_mprintf(tls, str(124385), _1_iIn-i32(7), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri))+1*uintptr(i32(7)))))) _rc = i32(1) goto _parse_uri_out } _12: _1_eState = i32(0) _19: - if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))) == i32(0) || int32(_c) == i32(35) { + if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn))))) == i32(0) || int32(_c) == i32(35) { goto _20 } _1_iIn += 1 - if int32(_c) != i32(37) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))))))&i32(8)) == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn+i32(1)))))))))&i32(8)) == 0 { + if int32(_c) != i32(37) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn))))))))&i32(8)) == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn+i32(1)))))))))&i32(8)) == 0 { goto _24 } - _5_octet = int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(postInc1(&_1_iIn, int32(1)))))))) << uint(i32(4)) + _5_octet = int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(postInc1(&_1_iIn, 1))))))) << uint(i32(4)) { p := &_5_octet - *p = (*p) + int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(postInc1(&_1_iIn, int32(1)))))))) + *p = (*p) + int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(postInc1(&_1_iIn, 1))))))) sink1(*p) } func() { @@ -106790,7 +111277,7 @@ _19: goto _28 } _29: - if ((((int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))) != i32(0)) && (int32(_c) != i32(35))) && ((_1_eState != i32(0)) || (int32(_c) != i32(63)))) && ((_1_eState != i32(1)) || ((int32(_c) != i32(61)) && (int32(_c) != i32(38))))) && ((_1_eState != i32(2)) || (int32(_c) != i32(38))) { + if ((((int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn))))) != i32(0)) && (int32(_c) != i32(35))) && ((_1_eState != i32(0)) || (int32(_c) != i32(63)))) && ((_1_eState != i32(1)) || ((int32(_c) != i32(61)) && (int32(_c) != i32(38))))) && ((_1_eState != i32(2)) || (int32(_c) != i32(38))) { _1_iIn += 1 goto _29 } @@ -106802,18 +111289,18 @@ _24: if _1_eState != i32(1) || int32(_c) != i32(38) && int32(_c) != i32(61) { goto _42 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_1_iOut-i32(1))))) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_1_iOut-i32(1))))) != i32(0) { goto _43 } _44: - if (((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != i32(35))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn-i32(1))))) != i32(38)) { + if (((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn)))) != i32(35))) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zUri)) + 1*uintptr(_1_iIn-i32(1))))) != i32(38)) { _1_iIn += 1 goto _44 } goto _19 _43: if int32(_c) == i32(38) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(postInc1(&_1_iOut, 1)))) = int8(i32(0)) goto _49 } _1_eState = i32(2) @@ -106826,23 +111313,23 @@ _42: _1_eState = i32(1) } _54: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = _c + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(postInc1(&_1_iOut, 1)))) = _c goto _19 _20: if _1_eState == i32(1) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(postInc1(&_1_iOut, 1)))) = int8(i32(0)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0)) - _1_zOpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_sqlite3Strlen30(tls, _zFile)+i32(1)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(postInc1(&_1_iOut, 1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(postInc1(&_1_iOut, 1)))) = int8(i32(0)) + _1_zOpt = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_sqlite3Strlen30(tls, _zFile)+i32(1)))) _56: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zOpt)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zOpt)) + 1*uintptr(i32(0))))) == 0 { goto _57 } _13_nOpt = _sqlite3Strlen30(tls, _1_zOpt) - _13_zVal = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zOpt)) + 1*uintptr(_13_nOpt+i32(1)))) + _13_zVal = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zOpt)) + 1*uintptr(_13_nOpt+i32(1)))) _13_nVal = _sqlite3Strlen30(tls, _13_zVal) - if (_13_nOpt == i32(3)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124435)), (unsafe.Pointer)(_1_zOpt), uint64(i32(3))) == i32(0)) { + if (_13_nOpt == i32(3)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124435)), unsafe.Pointer(_1_zOpt), uint64(i32(3))) == i32(0)) { _zVfs = _13_zVal goto _60 } @@ -106850,13 +111337,13 @@ _56: _15_zModeType = nil _15_mask = i32(0) _15_limit = i32(0) - if (_13_nOpt == i32(5)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124439)), (unsafe.Pointer)(_1_zOpt), uint64(i32(5))) == i32(0)) { + if (_13_nOpt == i32(5)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124439)), unsafe.Pointer(_1_zOpt), uint64(i32(5))) == i32(0)) { _15_mask = i32(393216) _15_aMode = (*TIdList_item)(unsafe.Pointer(&_sqlite3ParseUriØ00aCacheModeØ001)) _15_limit = _15_mask _15_zModeType = str(124439) } - if (_13_nOpt == i32(4)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124445)), (unsafe.Pointer)(_1_zOpt), uint64(i32(4))) == i32(0)) { + if (_13_nOpt == i32(4)) && (crt.Xmemcmp(tls, unsafe.Pointer(str(124445)), unsafe.Pointer(_1_zOpt), uint64(i32(4))) == i32(0)) { _15_mask = i32(135) _15_aMode = (*TIdList_item)(unsafe.Pointer(&_sqlite3ParseUriØ00aOpenModeØ002)) _15_limit = int32(uint32(_15_mask) & _flags) @@ -106868,12 +111355,12 @@ _56: _18_mode = i32(0) _18_i = i32(0) _66: - if ((*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 16*uintptr(_18_i))).X0) == nil { + if ((*TIdList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_aMode)) + 16*uintptr(_18_i))).X0) == nil { goto _69 } - _19_z = (*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 16*uintptr(_18_i))).X0 - if (_13_nVal == _sqlite3Strlen30(tls, _19_z)) && (i32(0) == crt.Xmemcmp(tls, (unsafe.Pointer)(_13_zVal), (unsafe.Pointer)(_19_z), uint64(_13_nVal))) { - _18_mode = (*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 16*uintptr(_18_i))).X1 + _19_z = (*TIdList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_aMode)) + 16*uintptr(_18_i))).X0 + if (_13_nVal == _sqlite3Strlen30(tls, _19_z)) && (i32(0) == crt.Xmemcmp(tls, unsafe.Pointer(_13_zVal), unsafe.Pointer(_19_z), uint64(_13_nVal))) { + _18_mode = (*TIdList_item)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_aMode)) + 16*uintptr(_18_i))).X1 goto _69 } _18_i += 1 @@ -106892,7 +111379,7 @@ _69: _flags = (_flags & uint32(^_15_mask)) | uint32(_18_mode) _65: _60: - _1_zOpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zVal)) + 1*uintptr(_13_nVal+i32(1)))) + _1_zOpt = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_13_zVal)) + 1*uintptr(_13_nVal+i32(1)))) goto _56 _57: goto _74 @@ -106902,10 +111389,10 @@ _5: return _sqlite3NomemError(tls, i32(143224)) } if _nUri != 0 { - crt.Xmemcpy(tls, (unsafe.Pointer)(_zFile), (unsafe.Pointer)(_zUri), uint64(_nUri)) + crt.Xmemcpy(tls, unsafe.Pointer(_zFile), unsafe.Pointer(_zUri), uint64(_nUri)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_nUri))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_nUri+i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_nUri))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(_nUri+i32(1)))) = int8(i32(0)) { p := &_flags *p = (*p) & uint32(i32(-65)) @@ -106919,7 +111406,7 @@ _74: } _parse_uri_out: if _rc != i32(0) { - Xsqlite3_free(tls, (unsafe.Pointer)(_zFile)) + Xsqlite3_free(tls, unsafe.Pointer(_zFile)) _zFile = nil } *_pFlags = _flags @@ -106945,8 +111432,11 @@ func init() { _sqlite3ParseUriØ00aOpenModeØ002 = [5]TIdList_item{TIdList_item{X0: str(124541), X1: i32(1)}, TIdList_item{X0: str(124544), X1: i32(2)}, TIdList_item{X0: str(124547), X1: i32(6)}, TIdList_item{X0: str(91155), X1: i32(128)}, TIdList_item{}} } -// Find and return the schema associated with a BTree. Create -// a new one if necessary. +// C comment +// /* +// ** Find and return the schema associated with a BTree. Create +// ** a new one if necessary. +// */ func _sqlite3SchemaGet(tls *crt.TLS, _db *Xsqlite3, _pBt *XBtree) (r0 *XSchema) { var _p *XSchema if _pBt != nil { @@ -106960,20 +111450,20 @@ _1: goto _4 } if i32(0) == int32(_p.X7) { - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X2)))) - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X3)))) - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X4)))) - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X5)))) - *(*uint8)(unsafe.Pointer(&(_p.X8))) = uint8(i32(1)) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_p.X2))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_p.X3))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_p.X4))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_p.X5))) + *(*uint8)(unsafe.Pointer(&_p.X8)) = uint8(i32(1)) } _4: return _p } func Xsqlite3_result_error_code(tls *crt.TLS, _pCtx *Xsqlite3_context, _errCode int32) { - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = _errCode - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) - if (*TVdbe)(_pCtx.X3) != nil { + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = _errCode + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) + if _pCtx.X3 != nil { *(*int32)(unsafe.Pointer(&((*TVdbe)(_pCtx.X3).X28))) = _errCode } if (int32((*XMem)(_pCtx.X0).X1) & i32(1)) != 0 { @@ -106981,9 +111471,12 @@ func Xsqlite3_result_error_code(tls *crt.TLS, _pCtx *Xsqlite3_context, _errCode } } -// Called by the parser to compile a DETACH statement. -// -// DETACH pDbname +// C comment +// /* +// ** Called by the parser to compile a DETACH statement. +// ** +// ** DETACH pDbname +// */ func _sqlite3Detach(tls *crt.TLS, _pParse *XParse, _pDbname *XExpr) { _codeAttach(tls, _pParse, i32(25), &_sqlite3DetachØ00detach_funcØ001, _pDbname, nil, nil, _pDbname) } @@ -106996,19 +111489,22 @@ func init() { }{_detachFunc})), X5: nil, X6: str(124551), X7: t12{}} } -// An SQL user-function registered to do the work of an DETACH statement. The -// three arguments to the function come directly from a detach statement: -// -// DETACH DATABASE x -// -// SELECT sqlite_detach(x) +// C comment +// /* +// ** An SQL user-function registered to do the work of an DETACH statement. The +// ** three arguments to the function come directly from a detach statement: +// ** +// ** DETACH DATABASE x +// ** +// ** SELECT sqlite_detach(x) +// */ func _detachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _i int32 var _zName *int8 var _db *Xsqlite3 var _pDb *XDb var _zErr [128]int8 - _zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) + _zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) _db = Xsqlite3_context_db_handle(tls, _context) _pDb = nil @@ -107017,7 +111513,7 @@ func _detachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv } _i = i32(0) _1: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _4 } _pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))) @@ -107031,7 +111527,7 @@ _2: _i += 1 goto _1 _4: - if _i >= (_db.X5) { + if _i >= _db.X5 { Xsqlite3_snprintf(tls, int32(u64(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124565), unsafe.Pointer(_zName)) goto _detach_error } @@ -107039,7 +111535,7 @@ _4: Xsqlite3_snprintf(tls, int32(u64(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124586), unsafe.Pointer(_zName)) goto _detach_error } - if (_db.X15) == 0 { + if _db.X15 == 0 { Xsqlite3_snprintf(tls, int32(u64(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124612)) goto _detach_error } @@ -107048,8 +111544,8 @@ _4: goto _detach_error } _sqlite3BtreeClose(tls, (*XBtree)(_pDb.X1)) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X1))))) = nil - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X4))))) = nil + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X1)))) = nil + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X4)))) = nil _sqlite3CollapseDatabaseArray(tls, _db) return _detach_error: @@ -107082,11 +111578,11 @@ func _sqlite3Reindex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XT }() } return i32(0) - }() == 0 && (_pName2.X0) != nil { + }() == 0 && _pName2.X0 != nil { goto _6 } func() { - if (_pName1.X0) == nil { + if _pName1.X0 == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000))), unsafe.Pointer(str(124676))) crt.X__builtin_abort(tls) } @@ -107098,10 +111594,10 @@ func _sqlite3Reindex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XT _pColl = _sqlite3FindCollSeq(tls, _db, _db.X14, _3_zColl, i32(0)) if _pColl != nil { _reindexDatabases(tls, _pParse, _3_zColl) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zColl)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl)) return } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zColl)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_3_zColl)) _6: _iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pObjName) if _iDb < i32(0) { @@ -107115,11 +111611,11 @@ _6: _pTab = _sqlite3FindTable(tls, _db, _z, _zDb) if _pTab != nil { _reindexTable(tls, _pParse, _pTab, nil) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) return } _pIndex = _sqlite3FindIndex(tls, _db, _z, _zDb) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) if _pIndex != nil { _sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb) _sqlite3RefillIndex(tls, _pParse, _pIndex, i32(-1)) @@ -107143,7 +111639,7 @@ func _reindexDatabases(tls *crt.TLS, _pParse *XParse, _zColl *int8) { }() *func() **XDb { _iDb = i32(0); return &_pDb }() = (*XDb)(_db.X4) _2: - if _iDb >= (_db.X5) { + if _iDb >= _db.X5 { goto _5 } func() { @@ -107205,14 +111701,14 @@ _2: if _i >= int32(_pIndex.X14) { goto _5 } - _1_z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 8*uintptr(_i))) + _1_z = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X8)) + 8*uintptr(_i))) func() { - if _1_z == nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0) { + if _1_z == nil && int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103923), unsafe.Pointer((*int8)(unsafe.Pointer(&_collationMatchØ00__func__Ø000))), unsafe.Pointer(str(124765))) crt.X__builtin_abort(tls) } }() - if (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0)) && (i32(0) == _sqlite3StrICmp(tls, _1_z, _zColl)) { + if (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0)) && (i32(0) == _sqlite3StrICmp(tls, _1_z, _zColl)) { return i32(1) } _i += 1 @@ -107233,16 +111729,19 @@ func init() { crt.Xstrncpy(nil, &_sqlite3ReindexØ00__func__Ø000[0], str(124810), 15) } -// Generate code for the ANALYZE command. The parser calls this routine -// when it recognizes an ANALYZE command. -// -// ANALYZE -- 1 -// ANALYZE <database> -- 2 -// ANALYZE ?<database>.?<tablename> -- 3 -// -// Form 1 causes all indices in all attached databases to be analyzed. -// Form 2 analyzes all indices the single database named. -// Form 3 analyzes all indices associated with the named table. +// C comment +// /* +// ** Generate code for the ANALYZE command. The parser calls this routine +// ** when it recognizes an ANALYZE command. +// ** +// ** ANALYZE -- 1 +// ** ANALYZE <database> -- 2 +// ** ANALYZE ?<database>.?<tablename> -- 3 +// ** +// ** Form 1 causes all indices in all attached databases to be analyzed. +// ** Form 2 analyzes all indices the single database named. +// ** Form 3 analyzes all indices associated with the named table. +// */ func _sqlite3Analyze(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) { var _iDb, _i int32 var _z, _zDb *int8 @@ -107272,7 +111771,7 @@ func _sqlite3Analyze(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XT } _i = i32(0) _7: - if _i >= (_db.X5) { + if _i >= _db.X5 { goto _10 } if _i == i32(1) { @@ -107285,7 +111784,7 @@ _8: _10: goto _15 _6: - if ((_pName2.X1) == uint32(i32(0))) && (store1(&_iDb, _sqlite3FindDb(tls, _db, _pName1)) >= i32(0)) { + if (_pName2.X1 == uint32(i32(0))) && (store1(&_iDb, _sqlite3FindDb(tls, _db, _pName1)) >= i32(0)) { _analyzeDatabase(tls, _pParse, _iDb) goto _15 } @@ -107294,7 +111793,7 @@ _6: goto _16 } _zDb = func() *int8 { - if (_pName2.X1) != 0 { + if _pName2.X1 != 0 { return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0) } return nil @@ -107311,7 +111810,7 @@ _6: _analyzeTable(tls, _pParse, _pTab, nil) } _22: - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_z)) _19: _16: _15: @@ -107326,7 +111825,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AnalyzeØ00__func__Ø000[0], str(124888), 15) } -// Generate code that will do an analysis of an entire database +// C comment +// /* +// ** Generate code that will do an analysis of an entire database +// */ func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) { var _iStatCur, _iMem, _iTab int32 var _db *Xsqlite3 @@ -107338,12 +111840,12 @@ func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) { _sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb) _iStatCur = _pParse.X17 { - p := (*int32)(unsafe.Pointer(&(_pParse.X17))) + p := (*int32)(unsafe.Pointer(&_pParse.X17)) *p = (*p) + i32(3) sink1(*p) } _openStatTable(tls, _pParse, _iDb, _iStatCur, nil, nil) - _iMem = (_pParse.X18) + i32(1) + _iMem = _pParse.X18 + i32(1) _iTab = _pParse.X17 func() { if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 { @@ -107351,7 +111853,7 @@ func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) { crt.X__builtin_abort(tls) } }() - _k = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X2))).X2) + _k = (*XHashElem)((*XHash)(unsafe.Pointer(&_pSchema.X2)).X2) _2: if _k == nil { goto _5 @@ -107364,17 +111866,20 @@ _5: _loadAnalysis(tls, _pParse, _iDb) } -// This routine generates code that opens the sqlite_statN tables. -// The sqlite_stat1 table is always relevant. sqlite_stat2 is now -// obsolete. sqlite_stat3 and sqlite_stat4 are only opened when -// appropriate compile-time options are provided. -// -// If the sqlite_statN tables do not previously exist, it is created. -// -// Argument zWhere may be a pointer to a buffer containing a table name, -// or it may be a NULL pointer. If it is not NULL, then all entries in -// the sqlite_statN tables associated with the named table are deleted. -// If zWhere==0, then code is generated to delete all stat table entries. +// C comment +// /* +// ** This routine generates code that opens the sqlite_statN tables. +// ** The sqlite_stat1 table is always relevant. sqlite_stat2 is now +// ** obsolete. sqlite_stat3 and sqlite_stat4 are only opened when +// ** appropriate compile-time options are provided. +// ** +// ** If the sqlite_statN tables do not previously exist, it is created. +// ** +// ** Argument zWhere may be a pointer to a buffer containing a table name, +// ** or it may be a NULL pointer. If it is not NULL, then all entries in +// ** the sqlite_statN tables associated with the named table are deleted. +// ** If zWhere==0, then code is generated to delete all stat table entries. +// */ func _openStatTable(tls *crt.TLS, _pParse *XParse, _iDb int32, _iStatCur int32, _zWhere *int8, _zWhereType *int8) { var _i int32 var _1_zTab *int8 @@ -107407,25 +111912,25 @@ _5: if _i >= i32(3) { goto _8 } - _1_zTab = (*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X0 + _1_zTab = (*t78)(unsafe.Pointer(uintptr(unsafe.Pointer(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X0 if store44(&_1_pStat, _sqlite3FindTable(tls, _db, _1_zTab, _pDb.X0)) != nil { goto _9 } - if ((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X1) != nil { - _sqlite3NestedParse(tls, _pParse, str(124924), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_1_zTab), unsafe.Pointer((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001))+16*uintptr(_i))).X1)) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))) = _pParse.X32 - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(16)) + if ((*t78)(unsafe.Pointer(uintptr(unsafe.Pointer(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X1) != nil { + _sqlite3NestedParse(tls, _pParse, str(124924), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_1_zTab), unsafe.Pointer((*t78)(unsafe.Pointer(uintptr(unsafe.Pointer(&_openStatTableØ00aTableØ001))+16*uintptr(_i))).X1)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aRoot)) + 4*uintptr(_i))) = _pParse.X32 + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(16)) } goto _11 _9: - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))) = _1_pStat.X7 - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(0)) - _sqlite3TableLock(tls, _pParse, _iDb, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), uint8(i32(1)), _1_zTab) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aRoot)) + 4*uintptr(_i))) = _1_pStat.X7 + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(0)) + _sqlite3TableLock(tls, _pParse, _iDb, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aRoot)) + 4*uintptr(_i))), uint8(i32(1)), _1_zTab) if _zWhere != nil { _sqlite3NestedParse(tls, _pParse, str(114976), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_1_zTab), unsafe.Pointer(_zWhereType), unsafe.Pointer(_zWhere)) goto _13 } - _sqlite3VdbeAddOp2(tls, _v, i32(134), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), _iDb) + _sqlite3VdbeAddOp2(tls, _v, i32(134), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aRoot)) + 4*uintptr(_i))), _iDb) _13: _11: _i += 1 @@ -107433,7 +111938,7 @@ _11: _8: _i = i32(0) _14: - if ((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X1) == nil { + if ((*t78)(unsafe.Pointer(uintptr(unsafe.Pointer(&_openStatTableØ00aTableØ001)) + 16*uintptr(_i))).X1) == nil { goto _17 } func() { @@ -107442,9 +111947,9 @@ _14: crt.X__builtin_abort(tls) } }() - _sqlite3VdbeAddOp4Int(tls, _v, i32(107), _iStatCur+_i, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), _iDb, i32(3)) - _sqlite3VdbeChangeP5(tls, _v, uint16(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i))))) - _sqlite3VdbeComment(tls, _v, (*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001))+16*uintptr(_i))).X0) + _sqlite3VdbeAddOp4Int(tls, _v, i32(107), _iStatCur+_i, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aRoot)) + 4*uintptr(_i))), _iDb, i32(3)) + _sqlite3VdbeChangeP5(tls, _v, uint16(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aCreateTbl)) + 1*uintptr(_i))))) + _sqlite3VdbeComment(tls, _v, (*t78)(unsafe.Pointer(uintptr(unsafe.Pointer(&_openStatTableØ00aTableØ001))+16*uintptr(_i))).X0) _i += 1 goto _14 _17: @@ -107476,8 +111981,11 @@ func init() { crt.Xstrncpy(nil, &_analyzeDatabaseØ00__func__Ø000[0], str(125020), 16) } -// Generate code to do an analysis of all indices associated with -// a single table. +// C comment +// /* +// ** Generate code to do an analysis of all indices associated with +// ** a single table. +// */ func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex, _iStatCur int32, _iMem int32, _iTab int32) { var _iIdxCur, _iTabCur, _i, _jZeroRows, _iDb, _regNewRowid, _regStat4, _regChng, _regTemp, _regTabname, _regIdxname, _regStat1, _regPrev, _5_nCol, _5_addrRewind, _5_addrNextRow, _5_nColTest, _8_endDistinctTest int32 var _8_aGotoChng *int32 @@ -107489,17 +111997,17 @@ func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *X _db = (*Xsqlite3)(_pParse.X0) _jZeroRows = i32(-1) _needTableCnt = u8(1) - _regNewRowid = postInc1(&_iMem, int32(1)) - _regStat4 = postInc1(&_iMem, int32(1)) - _regChng = postInc1(&_iMem, int32(1)) - _regTemp = postInc1(&_iMem, int32(1)) - _regTabname = postInc1(&_iMem, int32(1)) - _regIdxname = postInc1(&_iMem, int32(1)) - _regStat1 = postInc1(&_iMem, int32(1)) + _regNewRowid = postInc1(&_iMem, 1) + _regStat4 = postInc1(&_iMem, 1) + _regChng = postInc1(&_iMem, 1) + _regTemp = postInc1(&_iMem, 1) + _regTabname = postInc1(&_iMem, 1) + _regIdxname = postInc1(&_iMem, 1) + _regStat1 = postInc1(&_iMem, 1) _regPrev = _iMem - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 { - if (_pParse.X18) > _iMem { - return (_pParse.X18) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = func() int32 { + if _pParse.X18 > _iMem { + return _pParse.X18 } return _iMem }() @@ -107516,7 +112024,7 @@ func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *X }() != 0 { return } - if (_pTab.X7) == i32(0) { + if _pTab.X7 == i32(0) { return } if Xsqlite3_strlike(tls, str(125036), _pTab.X0, uint32(i32(0))) == i32(0) { @@ -107545,11 +112053,11 @@ func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *X return } _sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(i32(0)), _pTab.X0) - _iTabCur = postInc1(&_iTab, int32(1)) - _iIdxCur = postInc1(&_iTab, int32(1)) - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = func() int32 { - if (_pParse.X17) > _iTab { - return (_pParse.X17) + _iTabCur = postInc1(&_iTab, 1) + _iIdxCur = postInc1(&_iTab, 1) + *(*int32)(unsafe.Pointer(&_pParse.X17)) = func() int32 { + if _pParse.X17 > _iTab { + return _pParse.X17 } return _iTab }() @@ -107566,7 +112074,7 @@ _17: if (*XExpr)(_pIdx.X9) == nil { _needTableCnt = uint8(i32(0)) } - if (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) { + if ((_pTab.X9 & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pIdx.X16)<<uint(i32(30)))>>uint(i32(30))) == i32(2)) { _5_nCol = int32(_pIdx.X13) _5_zIdxName = _pTab.X0 _5_nColTest = _5_nCol - i32(1) @@ -107575,7 +112083,7 @@ _17: _5_nCol = int32(_pIdx.X14) _5_zIdxName = _pIdx.X0 _5_nColTest = func() int32 { - if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { + if ((uint32(_pIdx.X16>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 { return (int32(_pIdx.X13) - i32(1)) } return (_5_nCol - i32(1)) @@ -107583,9 +112091,9 @@ _17: _26: _sqlite3VdbeLoadString(tls, _v, _regIdxname, _5_zIdxName) _sqlite3VdbeComment(tls, _v, str(125045), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_5_zIdxName)) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 { - if (_pParse.X18) > (_regPrev + _5_nColTest) { - return (_pParse.X18) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = func() int32 { + if _pParse.X18 > (_regPrev + _5_nColTest) { + return _pParse.X18 } return (_regPrev + _5_nColTest) }() @@ -107623,10 +112131,10 @@ _38: if _i >= _5_nColTest { goto _41 } - _10_pColl = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 8*uintptr(_i)))))) + _10_pColl = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIdx.X8)) + 8*uintptr(_i)))))) _sqlite3VdbeAddOp2(tls, _v, i32(56), _i, _regChng) _sqlite3VdbeAddOp3(tls, _v, i32(99), _iIdxCur, _i, _regTemp) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aGotoChng)) + 4*uintptr(_i))) = _sqlite3VdbeAddOp4(tls, _v, i32(77), _regTemp, i32(0), _regPrev+_i, _10_pColl, i32(-3)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_aGotoChng)) + 4*uintptr(_i))) = _sqlite3VdbeAddOp4(tls, _v, i32(77), _regTemp, i32(0), _regPrev+_i, _10_pColl, i32(-3)) _sqlite3VdbeChangeP5(tls, _v, uint16(i32(128))) _i += 1 goto _38 @@ -107639,13 +112147,13 @@ _42: if _i >= _5_nColTest { goto _45 } - _sqlite3VdbeJumpHere(tls, _v, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aGotoChng)) + 4*uintptr(_i)))) + _sqlite3VdbeJumpHere(tls, _v, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_aGotoChng)) + 4*uintptr(_i)))) _sqlite3VdbeAddOp3(tls, _v, i32(99), _iIdxCur, _i, _regPrev+_i) _i += 1 goto _42 _45: _sqlite3VdbeResolveLabel(tls, _v, _8_endDistinctTest) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_8_aGotoChng)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_8_aGotoChng)) _33: func() { if _regChng != (_regStat4 + i32(1)) { @@ -107658,7 +112166,7 @@ _33: _sqlite3VdbeAddOp2(tls, _v, i32(7), _iIdxCur, _5_addrNextRow) _callStatGet(tls, _v, _regStat4, i32(0), _regStat1) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(str(125131))) + 1*uintptr(i32(0))))) != i32(66) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(str(125131))) + 1*uintptr(i32(0))))) != i32(66) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98143), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125135))) crt.X__builtin_abort(tls) } @@ -107678,7 +112186,7 @@ _20: _jZeroRows = _sqlite3VdbeAddOp1(tls, _v, i32(22), _regStat1) _sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regIdxname) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(str(125131))) + 1*uintptr(i32(0))))) != i32(66) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(str(125131))) + 1*uintptr(i32(0))))) != i32(66) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98205), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125135))) crt.X__builtin_abort(tls) } @@ -107705,33 +112213,36 @@ func init() { }{_statInit})), X5: nil, X6: str(125177), X7: t12{}} } -// Implementation of the stat_init(N,K,C) SQL function. The three parameters -// are: -// N: The number of columns in the index including the rowid/pk (note 1) -// K: The number of columns in the index excluding the rowid/pk. -// C: The number of rows in the index (note 2) -// -// Note 1: In the special case of the covering index that implements a -// WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the -// total number of columns in the table. -// -// Note 2: C is only used for STAT3 and STAT4. -// -// For indexes on ordinary rowid tables, N==K+1. But for indexes on -// WITHOUT ROWID tables, N=K+P where P is the number of columns in the -// PRIMARY KEY of the table. The covering index that implements the -// original WITHOUT ROWID table as N==K as a special case. -// -// This routine allocates the Stat4Accum object in heap memory. The return -// value is a pointer to the Stat4Accum object. The datatype of the -// return value is BLOB, but it is really just a pointer to the Stat4Accum -// object. +// C comment +// /* +// ** Implementation of the stat_init(N,K,C) SQL function. The three parameters +// ** are: +// ** N: The number of columns in the index including the rowid/pk (note 1) +// ** K: The number of columns in the index excluding the rowid/pk. +// ** C: The number of rows in the index (note 2) +// ** +// ** Note 1: In the special case of the covering index that implements a +// ** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the +// ** total number of columns in the table. +// ** +// ** Note 2: C is only used for STAT3 and STAT4. +// ** +// ** For indexes on ordinary rowid tables, N==K+1. But for indexes on +// ** WITHOUT ROWID tables, N=K+P where P is the number of columns in the +// ** PRIMARY KEY of the table. The covering index that implements the +// ** original WITHOUT ROWID table as N==K as a special case. +// ** +// ** This routine allocates the Stat4Accum object in heap memory. The return +// ** value is a pointer to the Stat4Accum object. The datatype of the +// ** return value is BLOB, but it is really just a pointer to the Stat4Accum +// ** object. +// */ func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nCol, _nKeyCol, _nColUp, _n int32 var _db *Xsqlite3 var _p *XStat4Accum - _nCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _nCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { if _nCol <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97333), unsafe.Pointer((*int8)(unsafe.Pointer(&_statInitØ00__func__Ø000))), unsafe.Pointer(str(125187))) @@ -107739,7 +112250,7 @@ func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XM } }() _nColUp = (_nCol + i32(1)) & i32(-2) - _nKeyCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _nKeyCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) func() { if _nKeyCol > _nCol { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97336), unsafe.Pointer((*int8)(unsafe.Pointer(&_statInitØ00__func__Ø000))), unsafe.Pointer(str(125194))) @@ -107759,13 +112270,13 @@ func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XM Xsqlite3_result_error_nomem(tls, _context) return } - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _db - *(*uint32)(unsafe.Pointer(&(_p.X0))) = uint32(i32(0)) - *(*int32)(unsafe.Pointer(&(_p.X2))) = _nCol - *(*int32)(unsafe.Pointer(&(_p.X3))) = _nKeyCol - *(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&(_p.X5))).X1))) = (*uint32)(unsafe.Pointer((*XStat4Accum)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 88*uintptr(i32(1)))))) - *(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&(_p.X5))).X0))) = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_nColUp))) - Xsqlite3_result_blob(tls, _context, (unsafe.Pointer)(_p), int32(u64(88)), _stat4Destructor) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X13)))) = _db + *(*uint32)(unsafe.Pointer(&_p.X0)) = uint32(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X2)) = _nCol + *(*int32)(unsafe.Pointer(&_p.X3)) = _nKeyCol + *(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&_p.X5)).X1))) = (*uint32)(unsafe.Pointer((*XStat4Accum)(unsafe.Pointer(uintptr(unsafe.Pointer(_p)) + 88*uintptr(i32(1)))))) + *(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&_p.X5)).X0))) = (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X1)) + 4*uintptr(_nColUp))) + Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), int32(u64(88)), _stat4Destructor) } var _statInitØ00__func__Ø000 [9]int8 @@ -107796,11 +112307,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_blobØ00__func__Ø000[0], str(125222), 20) } -// Reclaim all memory of a Stat4Accum structure. +// C comment +// /* +// ** Reclaim all memory of a Stat4Accum structure. +// */ func _stat4Destructor(tls *crt.TLS, _pOld unsafe.Pointer) { var _p *XStat4Accum _p = (*XStat4Accum)(_pOld) - _sqlite3DbFree(tls, (*Xsqlite3)(_p.X13), (unsafe.Pointer)(_p)) + _sqlite3DbFree(tls, (*Xsqlite3)(_p.X13), unsafe.Pointer(_p)) } var _statPushFuncdef XFuncDef @@ -107811,47 +112325,50 @@ func init() { }{_statPush})), X5: nil, X6: str(125242), X7: t12{}} } -// Implementation of the stat_push SQL function: stat_push(P,C,R) -// Arguments: -// -// P Pointer to the Stat4Accum object created by stat_init() -// C Index of left-most column to differ from previous row -// R Rowid for the current row. Might be a key record for -// WITHOUT ROWID tables. -// -// This SQL function always returns NULL. It's purpose it to accumulate -// statistical data and/or samples in the Stat4Accum object about the -// index being analyzed. The stat_get() SQL function will later be used to -// extract relevant information for constructing the sqlite_statN tables. -// -// The R parameter is only used for STAT3 and STAT4 +// C comment +// /* +// ** Implementation of the stat_push SQL function: stat_push(P,C,R) +// ** Arguments: +// ** +// ** P Pointer to the Stat4Accum object created by stat_init() +// ** C Index of left-most column to differ from previous row +// ** R Rowid for the current row. Might be a key record for +// ** WITHOUT ROWID tables. +// ** +// ** This SQL function always returns NULL. It's purpose it to accumulate +// ** statistical data and/or samples in the Stat4Accum object about the +// ** index being analyzed. The stat_get() SQL function will later be used to +// ** extract relevant information for constructing the sqlite_statN tables. +// ** +// ** The R parameter is only used for STAT3 and STAT4 +// */ func _statPush(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _i, _iChng int32 var _p *XStat4Accum - _p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) - _iChng = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) + _iChng = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) func() { - if (_p.X2) <= i32(0) { + if _p.X2 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97657), unsafe.Pointer((*int8)(unsafe.Pointer(&_statPushØ00__func__Ø000))), unsafe.Pointer(str(125252))) crt.X__builtin_abort(tls) } }() func() { - if _iChng >= (_p.X2) { + if _iChng >= _p.X2 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97658), unsafe.Pointer((*int8)(unsafe.Pointer(&_statPushØ00__func__Ø000))), unsafe.Pointer(str(125262))) crt.X__builtin_abort(tls) } }() - if (_p.X0) != uint32(i32(0)) { + if _p.X0 != uint32(i32(0)) { goto _4 } _i = i32(0) _5: - if _i >= (_p.X2) { + if _i >= _p.X2 { goto _8 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) = uint32(i32(1)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X0)) + 4*uintptr(_i))) = uint32(i32(1)) _i += 1 goto _5 _8: @@ -107863,22 +112380,22 @@ _10: if _i >= _iChng { goto _13 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) += 1 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X0)) + 4*uintptr(_i))) += 1 _i += 1 goto _10 _13: _i = _iChng _14: - if _i >= (_p.X2) { + if _i >= _p.X2 { goto _17 } - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_i))) += 1 - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) = uint32(i32(1)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X1)) + 4*uintptr(_i))) += 1 + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X0)) + 4*uintptr(_i))) = uint32(i32(1)) _i += 1 goto _14 _17: _9: - *(*uint32)(unsafe.Pointer(&(_p.X0))) += 1 + *(*uint32)(unsafe.Pointer(&_p.X0)) += 1 } var _statPushØ00__func__Ø000 [9]int8 @@ -107887,10 +112404,13 @@ func init() { crt.Xstrncpy(nil, &_statPushØ00__func__Ø000[0], str(125276), 9) } -// Field iChng of the index being scanned has changed. So at this point -// p->current contains a sample that reflects the previous row of the -// index. The value of anEq[iChng] and subsequent anEq[] elements are -// correct at this point. +// C comment +// /* +// ** Field iChng of the index being scanned has changed. So at this point +// ** p->current contains a sample that reflects the previous row of the +// ** index. The value of anEq[iChng] and subsequent anEq[] elements are +// ** correct at this point. +// */ func _samplePushPrevious(tls *crt.TLS, _p *XStat4Accum, _iChng int32) { } @@ -107925,36 +112445,39 @@ func init() { }{_statGet})), X5: nil, X6: str(125359), X7: t12{}} } -// Implementation of the stat_get(P,J) SQL function. This routine is -// used to query statistical information that has been gathered into -// the Stat4Accum object by prior calls to stat_push(). The P parameter -// has type BLOB but it is really just a pointer to the Stat4Accum object. -// The content to returned is determined by the parameter J -// which is one of the STAT_GET_xxxx values defined above. -// -// The stat_get(P,J) function is not available to generic SQL. It is -// inserted as part of a manually constructed bytecode program. (See -// the callStatGet() routine below.) It is guaranteed that the P -// parameter will always be a poiner to a Stat4Accum object, never a -// NULL. -// -// If neither STAT3 nor STAT4 are enabled, then J is always -// STAT_GET_STAT1 and is hence omitted and this routine becomes -// a one-parameter function, stat_get(P), that always returns the -// stat1 table entry information. +// C comment +// /* +// ** Implementation of the stat_get(P,J) SQL function. This routine is +// ** used to query statistical information that has been gathered into +// ** the Stat4Accum object by prior calls to stat_push(). The P parameter +// ** has type BLOB but it is really just a pointer to the Stat4Accum object. +// ** The content to returned is determined by the parameter J +// ** which is one of the STAT_GET_xxxx values defined above. +// ** +// ** The stat_get(P,J) function is not available to generic SQL. It is +// ** inserted as part of a manually constructed bytecode program. (See +// ** the callStatGet() routine below.) It is guaranteed that the P +// ** parameter will always be a poiner to a Stat4Accum object, never a +// ** NULL. +// ** +// ** If neither STAT3 nor STAT4 are enabled, then J is always +// ** STAT_GET_STAT1 and is hence omitted and this routine becomes +// ** a one-parameter function, stat_get(P), that always returns the +// ** stat1 table entry information. +// */ func _statGet(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _1_i int32 var _3_nDistinct, _3_iVal uint64 var _1_z, _1_zRet *int8 var _p *XStat4Accum - _p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + _p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) func() { if _argc != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97765), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125368))) crt.X__builtin_abort(tls) } }() - _1_zRet = (*int8)(_sqlite3MallocZero(tls, uint64(((_p.X3)+i32(1))*i32(25)))) + _1_zRet = (*int8)(_sqlite3MallocZero(tls, uint64((_p.X3+i32(1))*i32(25)))) if _1_zRet == nil { Xsqlite3_result_error_nomem(tls, _context) return @@ -107963,19 +112486,19 @@ func _statGet(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMe _1_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zRet)) + uintptr(_sqlite3Strlen30(tls, _1_zRet)))) _1_i = i32(0) _3: - if _1_i >= (_p.X3) { + if _1_i >= _p.X3 { goto _6 } - _3_nDistinct = uint64((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_1_i)))) + uint32(i32(1))) + _3_nDistinct = uint64((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X1)) + 4*uintptr(_1_i)))) + uint32(i32(1))) _3_iVal = ((uint64(_p.X0) + _3_nDistinct) - uint64(i32(1))) / _3_nDistinct Xsqlite3_snprintf(tls, i32(24), _1_z, str(125381), _3_iVal) { p := &_1_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _1_z)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _1_z)))) sink0(*p) } func() { - if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_1_i)))) == 0 { + if (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*t79)(unsafe.Pointer(&_p.X5)).X0)) + 4*uintptr(_1_i)))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97805), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125387))) crt.X__builtin_abort(tls) } @@ -107984,7 +112507,7 @@ _3: goto _3 _6: func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) != i32(0) || crt.P2U(unsafe.Pointer(_1_z)) <= crt.P2U(unsafe.Pointer(_1_zRet)) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) != i32(0) || crt.P2U(unsafe.Pointer(_1_z)) <= crt.P2U(unsafe.Pointer(_1_zRet)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97807), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125406))) crt.X__builtin_abort(tls) } @@ -107998,8 +112521,11 @@ func init() { crt.Xstrncpy(nil, &_statGetØ00__func__Ø000[0], str(125427), 8) } -// Generate code that will cause the most recent index analysis to -// be loaded into internal hash tables where is can be used. +// C comment +// /* +// ** Generate code that will cause the most recent index analysis to +// ** be loaded into internal hash tables where is can be used. +// */ func _loadAnalysis(tls *crt.TLS, _pParse *XParse, _iDb int32) { var _v *TVdbe _v = _sqlite3GetVdbe(tls, _pParse) @@ -108008,9 +112534,12 @@ func _loadAnalysis(tls *crt.TLS, _pParse *XParse, _iDb int32) { } } -// 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. +// C comment +// /* +// ** Generate code that will do an analysis of a single table in +// ** a database. If pOnlyIdx is not NULL then it is a single index +// ** in pTab that should be analyzed. +// */ func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex) { var _iDb, _iStatCur int32 func() { @@ -108029,7 +112558,7 @@ func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XInd _sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb) _iStatCur = _pParse.X17 { - p := (*int32)(unsafe.Pointer(&(_pParse.X17))) + p := (*int32)(unsafe.Pointer(&_pParse.X17)) *p = (*p) + i32(3) sink1(*p) } @@ -108039,7 +112568,7 @@ func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XInd } _openStatTable(tls, _pParse, _iDb, _iStatCur, _pTab.X0, str(61653)) _5: - _analyzeOneTable(tls, _pParse, _pTab, _pOnlyIdx, _iStatCur, (_pParse.X18)+i32(1), _pParse.X17) + _analyzeOneTable(tls, _pParse, _pTab, _pOnlyIdx, _iStatCur, _pParse.X18+i32(1), _pParse.X17) _loadAnalysis(tls, _pParse, _iDb) } @@ -108049,8 +112578,11 @@ func init() { crt.Xstrncpy(nil, &_analyzeTableØ00__func__Ø000[0], str(125435), 13) } -// Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" -// command. +// C comment +// /* +// ** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" +// ** command. +// */ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pName *XToken) { var _iDb, _nTabName, _savedDbFlags, _10_i int32 var _zDb, _zName, _zTabName, _zWhere *int8 @@ -108065,7 +112597,7 @@ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _p _pVTab = nil _savedDbFlags = _db.X6 if func() int32 { - if (_db.X17) != 0 { + if _db.X17 != 0 { return func() int32 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96518), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000))), unsafe.Pointer(str(4908))) crt.X__builtin_abort(tls) @@ -108077,7 +112609,7 @@ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _p goto _exit_rename_table } func() { - if (_pSrc.X0) != i32(1) { + if _pSrc.X0 != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96519), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000))), unsafe.Pointer(str(125448))) crt.X__builtin_abort(tls) } @@ -108088,14 +112620,14 @@ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _p crt.X__builtin_abort(tls) } }() - _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(i32(0))))) + _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(i32(0))))) if _pTab == nil { goto _exit_rename_table } _iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20)) _zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2097152) sink1(*p) } @@ -108113,7 +112645,7 @@ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _p if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) { goto _exit_rename_table } - if (*XSelect)(_pTab.X3) != nil { + if _pTab.X3 != nil { _sqlite3ErrorMsg(tls, _pParse, str(125521), unsafe.Pointer(_pTab.X0)) goto _exit_rename_table } @@ -108123,15 +112655,16 @@ func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _p if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 { goto _exit_rename_table } - if (_pTab.X16) == 0 { + if _pTab.X16 == 0 { goto _16 } _pVTab = _sqlite3GetVTable(tls, _db, _pTab) if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 - }{(*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) int32 - }{((*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.X2).X0).X19)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 { + v := (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.X2).X0).X19 + return *(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&v)) + }()})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *Xsqlite3_vtab, *int8) int32 }{nil})) { _pVTab = nil @@ -108144,19 +112677,19 @@ _16: _sqlite3BeginWriteOperation(tls, _pParse, bool2int(_pVTab != nil), _iDb) _sqlite3ChangeCookie(tls, _pParse, _iDb) if _pVTab != nil { - _10_i = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _10_i = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeLoadString(tls, _v, _10_i, _zName) _sqlite3VdbeAddOp4(tls, _v, i32(160), _10_i, i32(0), i32(0), (*int8)(unsafe.Pointer(_pVTab)), i32(-8)) _sqlite3MayAbort(tls, _pParse) } _zTabName = _pTab.X0 _nTabName = _sqlite3Utf8CharLen(tls, _zTabName, i32(-1)) - if ((_db.X6) & i32(524288)) == 0 { + if (_db.X6 & i32(524288)) == 0 { goto _20 } if store0(&_zWhere, _whereForeignKeys(tls, _pParse, _pTab)) != nil { _sqlite3NestedParse(tls, _pParse, str(125548), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), unsafe.Pointer(_zTabName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere)) } _20: _sqlite3NestedParse(tls, _pParse, str(125617), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), _nTabName, unsafe.Pointer(_zTabName)) @@ -108165,9 +112698,9 @@ _20: } if store0(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil { _sqlite3NestedParse(tls, _pParse, str(126059), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere)) } - if ((_db.X6) & i32(524288)) == 0 { + if (_db.X6 & i32(524288)) == 0 { goto _24 } _15_p = _sqlite3FkReferences(tls, _pTab) @@ -108186,8 +112719,8 @@ _24: _reloadTableSchema(tls, _pParse, _pTab, _zName) _exit_rename_table: _sqlite3SrcListDelete(tls, _db, _pSrc) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) - *(*int32)(unsafe.Pointer(&(_db.X6))) = _savedDbFlags + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) + *(*int32)(unsafe.Pointer(&_db.X6)) = _savedDbFlags } var _sqlite3AlterRenameTableØ00__func__Ø000 [24]int8 @@ -108196,12 +112729,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AlterRenameTableØ00__func__Ø000[0], str(126151), 24) } -// Parameter zName is the name of a table that is about to be altered -// (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN). -// If the table is a system table, this function leaves an error message -// in pParse->zErr (system tables may not be altered) and returns non-zero. -// -// Or, if zName is not a system table, zero is returned. +// C comment +// /* +// ** Parameter zName is the name of a table that is about to be altered +// ** (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN). +// ** If the table is a system table, this function leaves an error message +// ** in pParse->zErr (system tables may not be altered) and returns non-zero. +// ** +// ** Or, if zName is not a system table, zero is returned. +// */ func _isSystemTable(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) { if (_sqlite3Strlen30(tls, _zName) > i32(6)) && (i32(0) == Xsqlite3_strnicmp(tls, _zName, str(111644), i32(7))) { _sqlite3ErrorMsg(tls, _pParse, str(126175), unsafe.Pointer(_zName)) @@ -108210,10 +112746,13 @@ func _isSystemTable(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) { return i32(0) } -// Generate the text of a WHERE expression which can be used to select all -// tables that have foreign key constraints that refer to table pTab (i.e. -// constraints for which pTab is the parent table) from the sqlite_master -// table. +// C comment +// /* +// ** Generate the text of a WHERE expression which can be used to select all +// ** tables that have foreign key constraints that refer to table pTab (i.e. +// ** constraints for which pTab is the parent table) from the sqlite_master +// ** table. +// */ func _whereForeignKeys(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) { var _zWhere *int8 var _p *XFKey @@ -108230,20 +112769,23 @@ _3: return _zWhere } -// This function is used to create the text of expressions of the form: -// -// name=<constant1> OR name=<constant2> OR ... -// -// If argument zWhere is NULL, then a pointer string containing the text -// "name=<constant>" is returned, where <constant> is the quoted version -// of the string passed as argument zConstant. The returned buffer is -// allocated using sqlite3DbMalloc(). It is the responsibility of the -// caller to ensure that it is eventually freed. -// -// If argument zWhere is not NULL, then the string returned is -// "<where> OR name=<constant>", where <where> is the contents of zWhere. -// In this case zWhere is passed to sqlite3DbFree() before returning. -// +// C comment +// /* +// ** This function is used to create the text of expressions of the form: +// ** +// ** name=<constant1> OR name=<constant2> OR ... +// ** +// ** If argument zWhere is NULL, then a pointer string containing the text +// ** "name=<constant>" is returned, where <constant> is the quoted version +// ** of the string passed as argument zConstant. The returned buffer is +// ** allocated using sqlite3DbMalloc(). It is the responsibility of the +// ** caller to ensure that it is eventually freed. +// ** +// ** If argument zWhere is not NULL, then the string returned is +// ** "<where> OR name=<constant>", where <where> is the contents of zWhere. +// ** In this case zWhere is passed to sqlite3DbFree() before returning. +// ** +// */ func _whereOrName(tls *crt.TLS, _db *Xsqlite3, _zWhere *int8, _zConstant *int8) (r0 *int8) { var _zNew *int8 if _zWhere == nil { @@ -108251,15 +112793,18 @@ func _whereOrName(tls *crt.TLS, _db *Xsqlite3, _zWhere *int8, _zConstant *int8) goto _1 } _zNew = _sqlite3MPrintf(tls, _db, str(126211), unsafe.Pointer(_zWhere), unsafe.Pointer(_zConstant)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zWhere)) _1: return _zNew } -// Generate the text of a WHERE expression which can be used to select all -// temporary triggers on table pTab from the sqlite_temp_master table. If -// table pTab has no temporary triggers, or is itself stored in the -// temporary database, NULL is returned. +// C comment +// /* +// ** Generate the text of a WHERE expression which can be used to select all +// ** temporary triggers on table pTab from the sqlite_temp_master table. If +// ** table pTab has no temporary triggers, or is itself stored in the +// ** temporary database, NULL is returned. +// */ func _whereTempTriggers(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) { var _zWhere, _4_zNew *int8 var _1_db *Xsqlite3 @@ -108285,18 +112830,21 @@ _4: _0: if _zWhere != nil { _4_zNew = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(126225), unsafe.Pointer(_zWhere)) - _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zWhere)) + _sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), unsafe.Pointer(_zWhere)) _zWhere = _4_zNew } return _zWhere } -// Generate code to drop and reload the internal representation of table -// pTab from the database, including triggers and temporary triggers. -// Argument zName is the name of the table in the database schema at -// the time the generated code is executed. This can be different from -// pTab->zName if this function is being called to code part of an -// "ALTER TABLE RENAME TO" statement. +// C comment +// /* +// ** Generate code to drop and reload the internal representation of table +// ** pTab from the database, including triggers and temporary triggers. +// ** Argument zName is the name of the table in the database schema at +// ** the time the generated code is executed. This can be different from +// ** pTab->zName if this function is being called to code part of an +// ** "ALTER TABLE RENAME TO" statement. +// */ func _reloadTableSchema(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zName *int8) { var _iDb, _1_iTrigDb int32 var _zWhere *int8 @@ -108361,12 +112909,15 @@ func init() { crt.Xstrncpy(nil, &_reloadTableSchemaØ00__func__Ø000[0], str(126288), 18) } -// This function is called after an "ALTER TABLE ... ADD" statement -// has been parsed. Argument pColDef contains the text of the new -// column definition. -// -// The Table structure pParse->pNewTable was extended to include -// the new column during parsing. +// C comment +// /* +// ** This function is called after an "ALTER TABLE ... ADD" statement +// ** has been parsed. Argument pColDef contains the text of the new +// ** column definition. +// ** +// ** The Table structure pParse->pNewTable was extended to include +// ** the new column during parsing. +// */ func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToken) { var _iDb, _r1, _7_rc, _10_savedDbFlags int32 var _zDb, _zTab, _zCol, _10_zEnd *int8 @@ -108378,7 +112929,7 @@ func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToke var _pCol *XColumn _v = (*TVdbe)(_pParse.X2) _db = (*Xsqlite3)(_pParse.X0) - if (_pParse.X16) != 0 || ((_db.X17) != 0) { + if _pParse.X16 != 0 || (_db.X17 != 0) { return } func() { @@ -108402,7 +112953,7 @@ func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToke }() _iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pNew.X20)) _zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X0 - _zTab = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X0)) + 1*uintptr(i32(16)))) + _zTab = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew.X0)) + 1*uintptr(i32(16)))) _pCol = (*XColumn)(unsafe.Pointer(uintptr(_pNew.X1) + 32*uintptr(int32(_pNew.X11)-i32(1)))) _pDflt = (*XExpr)(_pCol.X1) _pTab = _sqlite3FindTable(tls, _db, _zTab, _zDb) @@ -108428,15 +112979,15 @@ func _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToke _sqlite3ErrorMsg(tls, _pParse, str(126342)) return } - if (*XIndex)(_pNew.X2) != nil { + if _pNew.X2 != nil { _sqlite3ErrorMsg(tls, _pParse, str(126374)) return } - if (((_db.X6)&i32(524288)) != 0 && ((*XFKey)(_pNew.X4) != nil)) && (_pDflt != nil) { + if ((_db.X6&i32(524288)) != 0 && (_pNew.X4 != nil)) && (_pDflt != nil) { _sqlite3ErrorMsg(tls, _pParse, str(126401)) return } - if ((_pCol.X3) != 0) && (_pDflt == nil) { + if (_pCol.X3 != 0) && (_pDflt == nil) { _sqlite3ErrorMsg(tls, _pParse, str(126460)) return } @@ -108470,21 +113021,21 @@ _23: if _zCol == nil { goto _31 } - _10_zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zCol)) + 1*uintptr((_pColDef.X1)-uint32(i32(1))))) + _10_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zCol)) + 1*uintptr(_pColDef.X1-uint32(i32(1))))) _10_savedDbFlags = _db.X6 _32: - if (crt.P2U(unsafe.Pointer(_10_zEnd)) > crt.P2U(unsafe.Pointer(_zCol))) && ((int32(*_10_zEnd) == i32(59)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_10_zEnd)))))&i32(1)) != 0) { + if (crt.P2U(unsafe.Pointer(_10_zEnd)) > crt.P2U(unsafe.Pointer(_zCol))) && ((int32(*_10_zEnd) == i32(59)) || (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_10_zEnd)))))&i32(1)) != 0) { *postInc0(&_10_zEnd, -1) = int8(i32(0)) goto _32 } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(2097152) sink1(*p) } - _sqlite3NestedParse(tls, _pParse, str(126581), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), _pNew.X15, unsafe.Pointer(_zCol), (_pNew.X15)+i32(1), unsafe.Pointer(_zTab)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zCol)) - *(*int32)(unsafe.Pointer(&(_db.X6))) = _10_savedDbFlags + _sqlite3NestedParse(tls, _pParse, str(126581), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), _pNew.X15, unsafe.Pointer(_zCol), _pNew.X15+i32(1), unsafe.Pointer(_zTab)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zCol)) + *(*int32)(unsafe.Pointer(&_db.X6)) = _10_savedDbFlags _31: _r1 = _sqlite3GetTempReg(tls, _pParse) _sqlite3VdbeAddOp3(tls, _v, i32(103), _iDb, _r1, i32(2)) @@ -108502,19 +113053,22 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AlterFinishAddColumnØ00__func__Ø000[0], str(126690), 28) } -// This function is called by the parser after the table-name in -// an "ALTER TABLE <table-name> ADD" statement is parsed. Argument -// pSrc is the full-name of the table being altered. -// -// This routine makes a (partial) copy of the Table structure -// for the table being altered and sets Parse.pNewTable to point -// to it. Routines called by the parser as the column definition -// is parsed (i.e. sqlite3AddColumn()) add the new Column data to -// the copy. The copy of the Table structure is deleted by tokenize.c -// after parsing is finished. -// -// Routine sqlite3AlterFinishAddColumn() will be called to complete -// coding the "ALTER TABLE ... ADD" statement. +// C comment +// /* +// ** This function is called by the parser after the table-name in +// ** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument +// ** pSrc is the full-name of the table being altered. +// ** +// ** This routine makes a (partial) copy of the Table structure +// ** for the table being altered and sets Parse.pNewTable to point +// ** to it. Routines called by the parser as the column definition +// ** is parsed (i.e. sqlite3AddColumn()) add the new Column data to +// ** the copy. The copy of the Table structure is deleted by tokenize.c +// ** after parsing is finished. +// ** +// ** Routine sqlite3AlterFinishAddColumn() will be called to complete +// ** coding the "ALTER TABLE ... ADD" statement. +// */ func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) { var _iDb, _i, _nAlloc int32 var _db *Xsqlite3 @@ -108534,18 +113088,18 @@ func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) crt.X__builtin_abort(tls) } }() - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _exit_begin_add_column } - _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+112*uintptr(i32(0))))) + _pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&_pSrc.X2))))+112*uintptr(i32(0))))) if _pTab == nil { goto _exit_begin_add_column } - if (_pTab.X16) != 0 { + if _pTab.X16 != 0 { _sqlite3ErrorMsg(tls, _pParse, str(126718)) goto _exit_begin_add_column } - if (*XSelect)(_pTab.X3) != nil { + if _pTab.X3 != nil { _sqlite3ErrorMsg(tls, _pParse, str(126752)) goto _exit_begin_add_column } @@ -108553,7 +113107,7 @@ func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) goto _exit_begin_add_column } func() { - if (_pTab.X15) <= i32(0) { + if _pTab.X15 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96872), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126782))) crt.X__builtin_abort(tls) } @@ -108563,9 +113117,9 @@ func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) if _pNew == nil { goto _exit_begin_add_column } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = _pNew - *(*uint32)(unsafe.Pointer(&(_pNew.X8))) = uint32(i32(1)) - *(*int16)(unsafe.Pointer(&(_pNew.X11))) = _pTab.X11 + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X63)))) = _pNew + *(*uint32)(unsafe.Pointer(&_pNew.X8)) = uint32(i32(1)) + *(*int16)(unsafe.Pointer(&_pNew.X11)) = _pTab.X11 func() { if int32(_pNew.X11) <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126803))) @@ -108579,11 +113133,11 @@ func _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) crt.X__builtin_abort(tls) } }() - *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = (*XColumn)(_sqlite3DbMallocZero(tls, _db, u64(32)*uint64(_nAlloc))) - *(**int8)(unsafe.Pointer(&(_pNew.X0))) = _sqlite3MPrintf(tls, _db, str(126873), unsafe.Pointer(_pTab.X0)) - if ((*XColumn)(_pNew.X1) == nil) || ((_pNew.X0) == nil) { + *(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X1)))) = (*XColumn)(_sqlite3DbMallocZero(tls, _db, u64(32)*uint64(_nAlloc))) + *(**int8)(unsafe.Pointer(&_pNew.X0)) = _sqlite3MPrintf(tls, _db, str(126873), unsafe.Pointer(_pTab.X0)) + if (_pNew.X1 == nil) || (_pNew.X0 == nil) { func() { - if (_db.X17) == 0 { + if _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96893), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(47848))) crt.X__builtin_abort(tls) } @@ -108597,15 +113151,15 @@ _22: goto _25 } _5_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pNew.X1) + 32*uintptr(_i))) - *(**int8)(unsafe.Pointer(&(_5_pCol.X0))) = _sqlite3DbStrDup(tls, _db, _5_pCol.X0) - *(**int8)(unsafe.Pointer(&(_5_pCol.X2))) = nil - *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pCol.X1))))) = nil + *(**int8)(unsafe.Pointer(&_5_pCol.X0)) = _sqlite3DbStrDup(tls, _db, _5_pCol.X0) + *(**int8)(unsafe.Pointer(&_5_pCol.X2)) = nil + *(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_5_pCol.X1)))) = nil _i += 1 goto _22 _25: - *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) - *(*int32)(unsafe.Pointer(&(_pNew.X15))) = _pTab.X15 - *(*uint32)(unsafe.Pointer(&(_pNew.X8))) = uint32(i32(1)) + *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X20)))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_iDb))).X4) + *(*int32)(unsafe.Pointer(&_pNew.X15)) = _pTab.X15 + *(*uint32)(unsafe.Pointer(&_pNew.X8)) = uint32(i32(1)) _sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb) _v = _sqlite3GetVdbe(tls, _pParse) if _v == nil { @@ -108622,8 +113176,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3AlterBeginAddColumnØ00__func__Ø000[0], str(126892), 27) } -// The parser calls this routine after the CREATE VIRTUAL TABLE statement -// has been completely parsed. +// C comment +// /* +// ** The parser calls this routine after the CREATE VIRTUAL TABLE statement +// ** has been completely parsed. +// */ func _sqlite3VtabFinishParse(tls *crt.TLS, _pParse *XParse, _pEnd *XToken) { var _1_iDb, _1_iReg int32 var _1_zStmt, _1_zWhere, _3_zName *int8 @@ -108637,26 +113194,26 @@ func _sqlite3VtabFinishParse(tls *crt.TLS, _pParse *XParse, _pEnd *XToken) { return } _addArgumentToVtab(tls, _pParse) - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0))) = nil - if (_pTab.X16) < i32(1) { + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X66)).X0))) = nil + if _pTab.X16 < i32(1) { return } - if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 { + if ((*t21)(unsafe.Pointer(&_db.X33)).X2) != 0 { goto _2 } if _pEnd != nil { - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X50))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer(_pEnd.X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0)))/1))) + (_pEnd.X1) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X50)).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer(_pEnd.X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X50)).X0)))/1))) + _pEnd.X1 } - _1_zStmt = _sqlite3MPrintf(tls, _db, str(126919), unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))))) + _1_zStmt = _sqlite3MPrintf(tls, _db, str(126919), unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X50)))) _1_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20)) _sqlite3NestedParse(tls, _pParse, str(126943), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_1_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_1_zStmt), _pParse.X31) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_zStmt)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_1_zStmt)) _1_v = _sqlite3GetVdbe(tls, _pParse) _sqlite3ChangeCookie(tls, _pParse, _1_iDb) _sqlite3VdbeAddOp0(tls, _1_v, i32(153)) _1_zWhere = _sqlite3MPrintf(tls, _db, str(127031), unsafe.Pointer(_pTab.X0)) _sqlite3VdbeAddParseSchemaOp(tls, _1_v, _1_iDb, _1_zWhere) - _1_iReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1) + _1_iReg = preInc1((*int32)(unsafe.Pointer(&_pParse.X18)), 1) _sqlite3VdbeLoadString(tls, _1_v, _1_iReg, _pTab.X0) _sqlite3VdbeAddOp2(tls, _1_v, i32(156), _1_iDb, _1_iReg) goto _4 @@ -108669,7 +113226,7 @@ _2: crt.X__builtin_abort(tls) } }() - _3_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_3_pSchema.X2))), _3_zName, (unsafe.Pointer)(_pTab))) + _3_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&_3_pSchema.X2)), _3_zName, unsafe.Pointer(_pTab))) if _3_pOld != nil { _sqlite3OomFault(tls, _db) func() { @@ -108680,20 +113237,23 @@ _2: }() return } - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = nil + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X63)))) = nil _4: } -// This routine takes the module argument that has been accumulating -// in pParse->zArg[] and appends it to the list of arguments on the -// virtual table currently under construction in pParse->pTable. +// C comment +// /* +// ** This routine takes the module argument that has been accumulating +// ** in pParse->zArg[] and appends it to the list of arguments on the +// ** virtual table currently under construction in pParse->pTable. +// */ func _addArgumentToVtab(tls *crt.TLS, _pParse *XParse) { var _1_n int32 var _1_z *int8 var _1_db *Xsqlite3 - if (((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0) != nil) && ((*XTable)(_pParse.X63) != nil) { - _1_z = (*XToken)(unsafe.Pointer(&(_pParse.X66))).X0 - _1_n = int32((*XToken)(unsafe.Pointer(&(_pParse.X66))).X1) + if (((*XToken)(unsafe.Pointer(&_pParse.X66)).X0) != nil) && (_pParse.X63 != nil) { + _1_z = (*XToken)(unsafe.Pointer(&_pParse.X66)).X0 + _1_n = int32((*XToken)(unsafe.Pointer(&_pParse.X66)).X1) _1_db = (*Xsqlite3)(_pParse.X0) _addModuleArgument(tls, _1_db, (*XTable)(_pParse.X63), _sqlite3DbStrNDup(tls, _1_db, _1_z, uint64(_1_n))) } @@ -108705,9 +113265,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabFinishParseØ00__func__Ø000[0], str(127108), 23) } -// The parser calls this routine when it first sees a CREATE VIRTUAL TABLE -// statement. The module name has been parsed, but the optional list -// of parameters that follow the module name are still pending. +// C comment +// /* +// ** The parser calls this routine when it first sees a CREATE VIRTUAL TABLE +// ** statement. The module name has been parsed, but the optional list +// ** of parameters that follow the module name are still pending. +// */ func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pModuleName *XToken, _ifNotExists int32) { var _iDb int32 var _db *Xsqlite3 @@ -108732,7 +113295,7 @@ func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pNa } }() func() { - if (_pTable.X16) != i32(0) { + if _pTable.X16 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125329), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(127149))) crt.X__builtin_abort(tls) } @@ -108741,14 +113304,14 @@ func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pNa _addModuleArgument(tls, _db, _pTable, nil) _addModuleArgument(tls, _db, _pTable, _sqlite3DbStrDup(tls, _db, _pTable.X0)) func() { - if (((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0) != (_pName2.X0) || (_pName2.X0) == nil) && (((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0) != (_pName1.X0) || (_pName2.X0) != nil) { + if (((*XToken)(unsafe.Pointer(&_pParse.X50)).X0) != _pName2.X0 || _pName2.X0 == nil) && (((*XToken)(unsafe.Pointer(&_pParse.X50)).X0) != _pName1.X0 || _pName2.X0 != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125333), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(127171))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X50))).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pModuleName.X0))+1*uintptr(_pModuleName.X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0))) / 1))) - if (_pTable.X17) != nil { - _sqlite3AuthCheck(tls, _pParse, i32(29), _pTable.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTable.X17)) + 8*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+32*uintptr(_iDb))).X0) + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X50)).X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pModuleName.X0))+1*uintptr(_pModuleName.X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&_pParse.X50)).X0))) / 1))) + if _pTable.X17 != nil { + _sqlite3AuthCheck(tls, _pParse, i32(29), _pTable.X0, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pTable.X17)) + 8*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+32*uintptr(_iDb))).X0) } } @@ -108758,22 +113321,28 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabBeginParseØ00__func__Ø000[0], str(127274), 22) } -// The parser calls this routine when it sees the first token -// of an argument to the module name in a CREATE VIRTUAL TABLE statement. +// C comment +// /* +// ** The parser calls this routine when it sees the first token +// ** of an argument to the module name in a CREATE VIRTUAL TABLE statement. +// */ func _sqlite3VtabArgInit(tls *crt.TLS, _pParse *XParse) { _addArgumentToVtab(tls, _pParse) - *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0))) = nil - *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X1))) = uint32(i32(0)) + *(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X66)).X0))) = nil + *(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&_pParse.X66)).X1))) = uint32(i32(0)) } -// The parser calls this routine for each token after the first token -// in an argument to the module name in a CREATE VIRTUAL TABLE statement. +// C comment +// /* +// ** The parser calls this routine for each token after the first token +// ** in an argument to the module name in a CREATE VIRTUAL TABLE statement. +// */ func _sqlite3VtabArgExtend(tls *crt.TLS, _pParse *XParse, _p *XToken) { var _pArg *XToken - _pArg = (*XToken)(unsafe.Pointer(&(_pParse.X66))) - if (_pArg.X0) == nil { - *(**int8)(unsafe.Pointer(&(_pArg.X0))) = _p.X0 - *(*uint32)(unsafe.Pointer(&(_pArg.X1))) = _p.X1 + _pArg = (*XToken)(unsafe.Pointer(&_pParse.X66)) + if _pArg.X0 == nil { + *(**int8)(unsafe.Pointer(&_pArg.X0)) = _p.X0 + *(*uint32)(unsafe.Pointer(&_pArg.X1)) = _p.X1 goto _1 } func() { @@ -108782,7 +113351,7 @@ func _sqlite3VtabArgExtend(tls *crt.TLS, _pParse *XParse, _p *XToken) { crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_pArg.X1))) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0))+1*uintptr(_p.X1))))) - uintptr(unsafe.Pointer(_pArg.X0))) / 1))) + *(*uint32)(unsafe.Pointer(&_pArg.X1)) = uint32(int32(int64((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0))+1*uintptr(_p.X1))))) - uintptr(unsafe.Pointer(_pArg.X0))) / 1))) _1: } @@ -108792,8 +113361,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3VtabArgExtendØ00__func__Ø000[0], str(127312), 21) } -// This routine is invoked once per CTE by the parser while parsing a -// WITH clause. +// C comment +// /* +// ** This routine is invoked once per CTE by the parser while parsing a +// ** WITH clause. +// */ func _sqlite3WithAdd(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _pName *XToken, _pArglist *XExprList, _pQuery *XSelect) (r0 *XWith) { var _1_i, _4_nByte int32 var _zName *int8 @@ -108806,10 +113378,10 @@ func _sqlite3WithAdd(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _pName *XToke } _1_i = i32(0) _2: - if _1_i >= (_pWith.X0) { + if _1_i >= _pWith.X0 { goto _5 } - if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2)))))+32*uintptr(_1_i))).X0) == i32(0) { + if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pWith.X2))))+32*uintptr(_1_i))).X0) == i32(0) { _sqlite3ErrorMsg(tls, _pParse, str(127333), unsafe.Pointer(_zName)) } _1_i += 1 @@ -108818,29 +113390,29 @@ _5: _1: if _pWith != nil { _4_nByte = int32(u64(48) + (u64(32) * uint64(_pWith.X0))) - _pNew = (*XWith)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pWith), uint64(_4_nByte))) + _pNew = (*XWith)(_sqlite3DbRealloc(tls, _db, unsafe.Pointer(_pWith), uint64(_4_nByte))) goto _8 } _pNew = (*XWith)(_sqlite3DbMallocZero(tls, _db, u64(48))) _8: func() { - if (_pNew == nil || _zName == nil) && (_db.X17) == 0 { + if (_pNew == nil || _zName == nil) && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WithAddØ00__func__Ø000))), unsafe.Pointer(str(127363))) crt.X__builtin_abort(tls) } }() - if (_db.X17) != 0 { + if _db.X17 != 0 { _sqlite3ExprListDelete(tls, _db, _pArglist) _sqlite3SelectDelete(tls, _db, _pQuery) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zName)) _pNew = _pWith goto _14 } - *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 32*uintptr(_pNew.X0))).X2))))) = _pQuery - *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 32*uintptr(_pNew.X0))).X1))))) = _pArglist - *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 32*uintptr(_pNew.X0))).X0))) = _zName - *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 32*uintptr(_pNew.X0))).X3))) = nil - *(*int32)(unsafe.Pointer(&(_pNew.X0))) += 1 + *(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pNew.X2)))) + 32*uintptr(_pNew.X0))).X2))))) = _pQuery + *(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pNew.X2)))) + 32*uintptr(_pNew.X0))).X1))))) = _pArglist + *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pNew.X2)))) + 32*uintptr(_pNew.X0))).X0))) = _zName + *(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]TCte)(unsafe.Pointer(&_pNew.X2)))) + 32*uintptr(_pNew.X0))).X3))) = nil + *(*int32)(unsafe.Pointer(&_pNew.X0)) += 1 _14: return _pNew } @@ -108851,8 +113423,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3WithAddØ00__func__Ø000[0], str(127405), 15) } -// Find the appropriate action for a parser given the non-terminal -// look-ahead token iLookAhead. +// C comment +// /* +// ** Find the appropriate action for a parser given the non-terminal +// ** look-ahead token iLookAhead. +// */ func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 int32) { var _i int32 func() { @@ -108861,7 +113436,7 @@ func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 crt.X__builtin_abort(tls) } }() - _i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_reduce_ofst)) + 2*uintptr(_stateno)))) + _i = int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_reduce_ofst)) + 2*uintptr(_stateno)))) func() { if _i == i32(-174) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137189), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127445))) @@ -108886,12 +113461,12 @@ func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 } }() func() { - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_i)))) != int32(_iLookAhead) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_lookahead)) + 1*uintptr(_i)))) != int32(_iLookAhead) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137198), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127493))) crt.X__builtin_abort(tls) } }() - return int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_i)))) + return int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(&_yy_action)) + 2*uintptr(_i)))) } var _yy_find_reduce_actionØ00__func__Ø000 [22]int8 @@ -108906,7 +113481,10 @@ func init() { _yy_reduce_ofst = [325]int16{i16(-119), i16(1014), i16(131), i16(1031), i16(-12), i16(225), i16(228), i16(300), i16(-40), i16(-45), i16(243), i16(256), i16(293), i16(129), i16(218), i16(418), i16(79), i16(376), i16(433), i16(298), i16(16), i16(137), i16(367), i16(323), i16(-38), i16(391), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(374), i16(437), i16(443), i16(508), i16(513), i16(522), i16(532), i16(582), i16(584), i16(620), i16(633), i16(635), i16(637), i16(644), i16(646), i16(648), i16(650), i16(652), i16(659), i16(661), i16(696), i16(709), i16(711), i16(714), i16(720), i16(722), i16(724), i16(726), i16(728), i16(733), i16(772), i16(784), i16(786), i16(822), i16(834), i16(836), i16(884), i16(886), i16(922), i16(934), i16(936), i16(986), i16(989), i16(1008), i16(1016), i16(1018), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(544), i16(-37), i16(274), i16(299), i16(501), i16(161), i16(-173), i16(193), i16(-173), i16(-173), i16(-173), i16(-173), i16(22), i16(22), i16(22), i16(64), i16(141), i16(212), i16(342), i16(208), i16(504), i16(504), i16(132), i16(494), i16(606), i16(677), i16(678), i16(750), i16(794), i16(796), i16(-58), i16(32), i16(383), i16(660), i16(737), i16(386), i16(787), i16(800), i16(441), i16(872), i16(224), i16(850), i16(803), i16(949), i16(624), i16(830), i16(669), i16(961), i16(979), i16(983), i16(1011), i16(1013), i16(1032), i16(753), i16(789), i16(321), i16(94), i16(116), i16(304), i16(375), i16(210), i16(388), i16(392), i16(478), i16(545), i16(649), i16(721), i16(727), i16(736), i16(752), i16(795), i16(853), i16(952), i16(958), i16(1004), i16(1040), i16(1046), i16(1049), i16(1050), i16(1056), i16(1059), i16(1067), i16(559), i16(774), i16(811), i16(1068), i16(1080), i16(938), i16(1082), i16(1083), i16(1088), i16(962), i16(1089), i16(1090), i16(1052), i16(1093), i16(1094), i16(1095), i16(388), i16(1096), i16(1103), i16(1104), i16(1105), i16(1106), i16(1107), i16(965), i16(998), i16(1055), i16(1057), i16(1058), i16(938), i16(1069), i16(1071), i16(1120), i16(1073), i16(1061), i16(1062), i16(1033), i16(1076), i16(1039), i16(1108), i16(1087), i16(1099), i16(1111), i16(1066), i16(1054), i16(1112), i16(1113), i16(1091), i16(1084), i16(1135), i16(1060), i16(1133), i16(1138), i16(1064), i16(1081), i16(1139), i16(1100), i16(1119), i16(1109), i16(1124), i16(1127), i16(1140), i16(1142), i16(1168), i16(1173), i16(1132), i16(1115), i16(1147), i16(1148), i16(1137), i16(1180), i16(1182), i16(1110), i16(1121), i16(1188), i16(1189), i16(1197), i16(1181), i16(1200), i16(1202), i16(1205), i16(1203), i16(1191), i16(1192), i16(1199), i16(1206), i16(1207), i16(1209), i16(1210), i16(1211), i16(1214), i16(1212), i16(1218), i16(1219), i16(1175), i16(1183), i16(1185), i16(1184), i16(1186), i16(1190), i16(1187), i16(1196), i16(1237), i16(1193), i16(1253), i16(1194), i16(1236), i16(1195), i16(1198), i16(1238), i16(1213), i16(1221), i16(1220), i16(1227), i16(1229), i16(1271), i16(1275), i16(1284), i16(1285), i16(1289), i16(1290), i16(1292), i16(1293), i16(1201), i16(1208), i16(1216), i16(1280), i16(1281), i16(1264), i16(1269), i16(1283)} } -// The following is executed when the parser accepts +// C comment +// /* +// ** The following is executed when the parser accepts +// */ func _yy_accept(tls *crt.TLS, _yypParser *XyyParser) { var _pParse *XParse _pParse = (*XParse)(_yypParser.X1) @@ -108914,12 +113492,12 @@ func _yy_accept(tls *crt.TLS, _yypParser *XyyParser) { crt.Xfprintf(tls, _yyTraceFILE, str(127543), unsafe.Pointer(_yyTracePrompt)) } func() { - if (*XyyStackEntry)(_yypParser.X0) != (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))) { + if (*XyyStackEntry)(_yypParser.X0) != (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_yypParser.X2)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138991), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_acceptØ00__func__Ø000))), unsafe.Pointer(str(127554))) crt.X__builtin_abort(tls) } }() - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X1)))) = _pParse } var _yy_acceptØ00__func__Ø000 [10]int8 @@ -108928,19 +113506,22 @@ func init() { crt.Xstrncpy(nil, &_yy_acceptØ00__func__Ø000[0], str(127591), 10) } -// The following code executes when a syntax error first occurs. +// C comment +// /* +// ** The following code executes when a syntax error first occurs. +// */ func _yy_syntax_error(tls *crt.TLS, _yypParser *XyyParser, _yymajor int32, _yyminor XToken) { var _pParse *XParse _pParse = (*XParse)(_yypParser.X1) func() { - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yyminor.X0)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_yyminor.X0)) + 1*uintptr(i32(0))))) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138970), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_syntax_errorØ00__func__Ø000))), unsafe.Pointer(str(127601))) crt.X__builtin_abort(tls) } }() _sqlite3ErrorMsg(tls, _pParse, str(27285), unsafe.Pointer(&_yyminor)) - *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse + *(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_yypParser.X1)))) = _pParse } var _yy_syntax_errorØ00__func__Ø000 [16]int8 @@ -108949,52 +113530,64 @@ func init() { crt.Xstrncpy(nil, &_yy_syntax_errorØ00__func__Ø000[0], str(127612), 16) } -// Clear all secondary memory allocations from the parser +// C comment +// /* +// ** Clear all secondary memory allocations from the parser +// */ func _sqlite3ParserFinalize(tls *crt.TLS, _p unsafe.Pointer) { var _pParser *XyyParser _pParser = (*XyyParser)(_p) _0: - if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))))) { + if crt.P2U(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) > crt.P2U(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&_pParser.X2)))))) { _yy_pop_parser_stack(tls, _pParser) goto _0 } } -// Enable or disable the shared pager and schema features. -// -// This routine has no effect on existing database connections. -// The shared cache setting effects only future calls to -// sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). +// C comment +// /* +// ** Enable or disable the shared pager and schema features. +// ** +// ** This routine has no effect on existing database connections. +// ** The shared cache setting effects only future calls to +// ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). +// */ func Xsqlite3_enable_shared_cache(tls *crt.TLS, _enable int32) (r0 int32) { - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X26))) = _enable + *(*int32)(unsafe.Pointer(&_sqlite3Config.X26)) = _enable return i32(0) } -// Return the most recent error code generated by an SQLite routine. If NULL is -// passed to this function, we assume a malloc() failed during sqlite3_open(). +// C comment +// /* +// ** Return the most recent error code generated by an SQLite routine. If NULL is +// ** passed to this function, we assume a malloc() failed during sqlite3_open(). +// */ func Xsqlite3_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) { return _sqlite3MisuseError(tls, i32(142777)) } - if (_db == nil) || ((_db.X17) != 0) { + if (_db == nil) || (_db.X17 != 0) { return _sqlite3NomemError(tls, i32(142780)) } - return (_db.X10) & (_db.X11) + return _db.X10 & _db.X11 } -// Return UTF-16 encoded English language explanation of the most recent -// error. +// C comment +// /* +// ** Return UTF-16 encoded English language explanation of the most recent +// ** error. +// */ func Xsqlite3_errmsg16(tls *crt.TLS, _db *Xsqlite3) (r0 unsafe.Pointer) { var _z unsafe.Pointer if _db == nil { - return (unsafe.Pointer)(&_sqlite3_errmsg16Ø00outOfMemØ001) + return unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001) } if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 { - return (unsafe.Pointer)(&_sqlite3_errmsg16Ø00misuseØ002) + return unsafe.Pointer(&_sqlite3_errmsg16Ø00misuseØ002) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - if (_db.X17) != 0 { - _z = (unsafe.Pointer)(&_sqlite3_errmsg16Ø00outOfMemØ001) + if _db.X17 != 0 { + _z = unsafe.Pointer(&_sqlite3_errmsg16Ø00outOfMemØ001) goto _3 } _z = Xsqlite3_value_text16(tls, (*XMem)(_db.X56)) @@ -109020,19 +113613,25 @@ func init() { _sqlite3_errmsg16Ø00misuseØ002 = [39]uint16{u16(108), u16(105), u16(98), u16(114), u16(97), u16(114), u16(121), u16(32), u16(114), u16(111), u16(117), u16(116), u16(105), u16(110), u16(101), u16(32), u16(99), u16(97), u16(108), u16(108), u16(101), u16(100), u16(32), u16(111), u16(117), u16(116), u16(32), u16(111), u16(102), u16(32), u16(115), u16(101), u16(113), u16(117), u16(101), u16(110), u16(99), u16(101), u16(0)} } -// Return TRUE (non-zero) of the statement supplied as an argument needs -// to be recompiled. A statement needs to be recompiled whenever the -// execution environment changes in a way that would alter the program -// that sqlite3_prepare() generates. For example, if new functions or -// collating sequences are registered or if an authorizer function is -// added or changed. +// C comment +// /* +// ** Return TRUE (non-zero) of the statement supplied as an argument needs +// ** to be recompiled. A statement needs to be recompiled whenever the +// ** execution environment changes in a way that would alter the program +// ** that sqlite3_prepare() generates. For example, if new functions or +// ** collating sequences are registered or if an authorizer function is +// ** added or changed. +// */ func Xsqlite3_expired(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _p *TVdbe _p = (*TVdbe)(_pStmt) return bool2int((_p == nil) || (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0)) } -// This routine frees the space the sqlite3_get_table() malloced. +// C comment +// /* +// ** This routine frees the space the sqlite3_get_table() malloced. +// */ func Xsqlite3_free_table(tls *crt.TLS, _azResult **int8) { var _1_i, _1_n int32 if _azResult == nil { @@ -109045,19 +113644,19 @@ func Xsqlite3_free_table(tls *crt.TLS, _azResult **int8) { crt.X__builtin_abort(tls) } }() - _1_n = int32(int64(crt.P2U(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 8*uintptr(i32(0)))))))) + _1_n = int32(int64(crt.P2U(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azResult)) + 8*uintptr(i32(0)))))))) _1_i = i32(1) _3: if _1_i >= _1_n { goto _6 } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 8*uintptr(_1_i)))) != nil { - Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 8*uintptr(_1_i))))) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azResult)) + 8*uintptr(_1_i)))) != nil { + Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azResult)) + 8*uintptr(_1_i))))) } _1_i += 1 goto _3 _6: - Xsqlite3_free(tls, (unsafe.Pointer)(_azResult)) + Xsqlite3_free(tls, unsafe.Pointer(_azResult)) _0: } @@ -109067,10 +113666,13 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_free_tableØ00__func__Ø000[0], str(127640), 19) } -// Test to see whether or not the database connection is in autocommit -// mode. Return TRUE if it is and FALSE if not. Autocommit mode is on -// by default. Autocommit is disabled by a BEGIN statement and reenabled -// by the next COMMIT or ROLLBACK. +// C comment +// /* +// ** Test to see whether or not the database connection is in autocommit +// ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on +// ** by default. Autocommit is disabled by a BEGIN statement and reenabled +// ** by the next COMMIT or ROLLBACK. +// */ func Xsqlite3_get_autocommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(143772)) @@ -109079,14 +113681,17 @@ func Xsqlite3_get_autocommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return int32(_db.X15) } -// Return the auxiliary data pointer, if any, for the iArg'th argument to -// the user-function defined by pCtx. -// -// The left-most argument is 0. -// -// Undocumented behavior: If iArg is negative then access a cache of -// auxiliary data pointers that is available to all functions within a -// single prepared statement. The iArg values must match. +// C comment +// /* +// ** Return the auxiliary data pointer, if any, for the iArg'th argument to +// ** the user-function defined by pCtx. +// ** +// ** The left-most argument is 0. +// ** +// ** Undocumented behavior: If iArg is negative then access a cache of +// ** auxiliary data pointers that is available to all functions within a +// ** single prepared statement. The iArg values must match. +// */ func Xsqlite3_get_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32) (r0 unsafe.Pointer) { var _pAuxData *XAuxData func() { @@ -109106,7 +113711,7 @@ _4: if _pAuxData == nil { goto _7 } - if ((_pAuxData.X1) == _iArg) && (((_pAuxData.X0) == (_pCtx.X4)) || (_iArg < i32(0))) { + if (_pAuxData.X1 == _iArg) && ((_pAuxData.X0 == _pCtx.X4) || (_iArg < i32(0))) { return _pAuxData.X2 } _pAuxData = (*XAuxData)(_pAuxData.X4) @@ -109121,14 +113726,17 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_get_auxdataØ00__func__Ø000[0], str(127674), 20) } -// Query the database. But instead of invoking a callback for each row, -// malloc() for space to hold the result and return the entire results -// at the conclusion of the call. -// -// The result that is written to ***pazResult is held in memory obtained -// from malloc(). But the caller cannot free this memory directly. -// Instead, the entire table should be passed to sqlite3_free_table() when -// the calling procedure is finished using it. +// C comment +// /* +// ** Query the database. But instead of invoking a callback for each row, +// ** malloc() for space to hold the result and return the entire results +// ** at the conclusion of the call. +// ** +// ** The result that is written to ***pazResult is held in memory obtained +// ** from malloc(). But the caller cannot free this memory directly. +// ** Instead, the entire table should be passed to sqlite3_free_table() when +// ** the calling procedure is finished using it. +// */ func Xsqlite3_get_table(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _pazResult ***int8, _pnRow *int32, _pnColumn *int32, _pzErrMsg **int8) (r0 int32) { var _rc int32 var _6_azNew **int8 @@ -109146,55 +113754,55 @@ func Xsqlite3_get_table(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _pazResult *** if _pzErrMsg != nil { *_pzErrMsg = nil } - *(**int8)(unsafe.Pointer(&(_res.X1))) = nil - *(*uint32)(unsafe.Pointer(&(_res.X3))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_res.X4))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(&(_res.X5))) = uint32(i32(1)) - *(*uint32)(unsafe.Pointer(&(_res.X2))) = uint32(i32(20)) - *(*int32)(unsafe.Pointer(&(_res.X6))) = i32(0) - *(***int8)(unsafe.Pointer(&(_res.X0))) = (**int8)(Xsqlite3_malloc64(tls, u64(8)*uint64(_res.X2))) - if (_res.X0) == nil { - *(*int32)(unsafe.Pointer(&(_db.X10))) = i32(7) + *(**int8)(unsafe.Pointer(&_res.X1)) = nil + *(*uint32)(unsafe.Pointer(&_res.X3)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_res.X4)) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(&_res.X5)) = uint32(i32(1)) + *(*uint32)(unsafe.Pointer(&_res.X2)) = uint32(i32(20)) + *(*int32)(unsafe.Pointer(&_res.X6)) = i32(0) + *(***int8)(unsafe.Pointer(&_res.X0)) = (**int8)(Xsqlite3_malloc64(tls, u64(8)*uint64(_res.X2))) + if _res.X0 == nil { + *(*int32)(unsafe.Pointer(&_db.X10)) = i32(7) return _sqlite3NomemError(tls, i32(122586)) } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 8*uintptr(i32(0)))) = nil - _rc = Xsqlite3_exec(tls, _db, _zSql, _sqlite3_get_table_cb, (unsafe.Pointer)(&_res), _pzErrMsg) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0)) + 8*uintptr(i32(0)))) = nil + _rc = Xsqlite3_exec(tls, _db, _zSql, _sqlite3_get_table_cb, unsafe.Pointer(&_res), _pzErrMsg) i32(0) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 8*uintptr(i32(0)))) = (*int8)((unsafe.Pointer)(crt.U2P(uintptr(int64(_res.X5))))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0)) + 8*uintptr(i32(0)))) = (*int8)(unsafe.Pointer(crt.U2P(uintptr(int64(_res.X5))))) if (_rc & i32(255)) != i32(4) { goto _6 } - Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+8*uintptr(i32(1))))) - if (_res.X1) == nil { + Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0))+8*uintptr(i32(1))))) + if _res.X1 == nil { goto _7 } if _pzErrMsg != nil { - Xsqlite3_free(tls, (unsafe.Pointer)(*_pzErrMsg)) + Xsqlite3_free(tls, unsafe.Pointer(*_pzErrMsg)) *_pzErrMsg = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(_res.X1)) } - Xsqlite3_free(tls, (unsafe.Pointer)(_res.X1)) + Xsqlite3_free(tls, unsafe.Pointer(_res.X1)) _7: - *(*int32)(unsafe.Pointer(&(_db.X10))) = _res.X6 + *(*int32)(unsafe.Pointer(&_db.X10)) = _res.X6 return _res.X6 _6: - Xsqlite3_free(tls, (unsafe.Pointer)(_res.X1)) + Xsqlite3_free(tls, unsafe.Pointer(_res.X1)) if _rc != i32(0) { - Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+8*uintptr(i32(1))))) + Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0))+8*uintptr(i32(1))))) return _rc } - if (_res.X2) <= (_res.X5) { + if _res.X2 <= _res.X5 { goto _10 } - _6_azNew = (**int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_res.X0), u64(8)*uint64(_res.X5))) + _6_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_res.X0), u64(8)*uint64(_res.X5))) if _6_azNew == nil { - Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+8*uintptr(i32(1))))) - *(*int32)(unsafe.Pointer(&(_db.X10))) = i32(7) + Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0))+8*uintptr(i32(1))))) + *(*int32)(unsafe.Pointer(&_db.X10)) = i32(7) return _sqlite3NomemError(tls, i32(122615)) } - *(***int8)(unsafe.Pointer(&(_res.X0))) = _6_azNew + *(***int8)(unsafe.Pointer(&_res.X0)) = _6_azNew _10: - *_pazResult = (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 8*uintptr(i32(1)))) + *_pazResult = (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_res.X0)) + 8*uintptr(i32(1)))) if _pnColumn != nil { *_pnColumn = int32(_res.X4) } @@ -109207,54 +113815,57 @@ _10: panic(0) } -// This routine is called once for each row in the result table. Its job -// is to fill in the TabResult structure appropriately, allocating new -// memory as necessary. +// C comment +// /* +// ** This routine is called once for each row in the result table. Its job +// ** is to fill in the TabResult structure appropriately, allocating new +// ** memory as necessary. +// */ func _sqlite3_get_table_cb(tls *crt.TLS, _pArg unsafe.Pointer, _nCol int32, _argv **int8, _colv **int8) (r0 int32) { var _need, _i, _10_n int32 var _z *int8 var _3_azNew **int8 var _p *XTabResult _p = (*XTabResult)(_pArg) - if ((_p.X3) == uint32(i32(0))) && (_argv != nil) { + if (_p.X3 == uint32(i32(0))) && (_argv != nil) { _need = _nCol * i32(2) goto _2 } _need = _nCol _2: - if ((_p.X5) + uint32(_need)) <= (_p.X2) { + if (_p.X5 + uint32(_need)) <= _p.X2 { goto _3 } - *(*uint32)(unsafe.Pointer(&(_p.X2))) = ((_p.X2) * uint32(i32(2))) + uint32(_need) - _3_azNew = (**int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_p.X0), u64(8)*uint64(_p.X2))) + *(*uint32)(unsafe.Pointer(&_p.X2)) = (_p.X2 * uint32(i32(2))) + uint32(_need) + _3_azNew = (**int8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_p.X0), u64(8)*uint64(_p.X2))) if _3_azNew == nil { goto _malloc_failed } - *(***int8)(unsafe.Pointer(&(_p.X0))) = _3_azNew + *(***int8)(unsafe.Pointer(&_p.X0)) = _3_azNew _3: - if (_p.X3) != uint32(i32(0)) { + if _p.X3 != uint32(i32(0)) { goto _5 } - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_nCol) + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(_nCol) _i = i32(0) _6: if _i >= _nCol { goto _9 } - _z = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_colv)) + 8*uintptr(_i))))) + _z = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_colv)) + 8*uintptr(_i))))) if _z == nil { goto _malloc_failed } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 8*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X5))), uint32(1))))) = _z + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0)) + 8*uintptr(postInc5((*uint32)(unsafe.Pointer(&_p.X5)), uint32(1))))) = _z _i += 1 goto _6 _9: goto _12 _5: if int32(_p.X4) != _nCol { - Xsqlite3_free(tls, (unsafe.Pointer)(_p.X1)) - *(**int8)(unsafe.Pointer(&(_p.X1))) = Xsqlite3_mprintf(tls, str(127694)) - *(*int32)(unsafe.Pointer(&(_p.X6))) = i32(1) + Xsqlite3_free(tls, unsafe.Pointer(_p.X1)) + *(**int8)(unsafe.Pointer(&_p.X1)) = Xsqlite3_mprintf(tls, str(127694)) + *(*int32)(unsafe.Pointer(&_p.X6)) = i32(1) return i32(1) } _12: @@ -109266,40 +113877,46 @@ _14: if _i >= _nCol { goto _17 } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) == nil { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) == nil { _z = nil goto _19 } - _10_n = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) + i32(1) + _10_n = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) + i32(1) _z = (*int8)(Xsqlite3_malloc64(tls, uint64(_10_n))) if _z == nil { goto _malloc_failed } - crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))), uint64(_10_n)) + crt.Xmemcpy(tls, unsafe.Pointer(_z), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))), uint64(_10_n)) _19: - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 8*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X5))), uint32(1))))) = _z + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0)) + 8*uintptr(postInc5((*uint32)(unsafe.Pointer(&_p.X5)), uint32(1))))) = _z _i += 1 goto _14 _17: - *(*uint32)(unsafe.Pointer(&(_p.X3))) += 1 + *(*uint32)(unsafe.Pointer(&_p.X3)) += 1 _13: return i32(0) _malloc_failed: - *(*int32)(unsafe.Pointer(&(_p.X6))) = _sqlite3NomemError(tls, i32(122545)) + *(*int32)(unsafe.Pointer(&_p.X6)) = _sqlite3NomemError(tls, i32(122545)) return i32(1) } -// Cause any pending operation to stop at its earliest opportunity. +// C comment +// /* +// ** Cause any pending operation to stop at its earliest opportunity. +// */ func Xsqlite3_interrupt(tls *crt.TLS, _db *Xsqlite3) { - if (_sqlite3SafetyCheckOk(tls, _db) == 0) && ((_db == nil) || ((_db.X28) != uint32(i32(1691352191)))) { + if (_sqlite3SafetyCheckOk(tls, _db) == 0) && ((_db == nil) || (_db.X28 != uint32(i32(1691352191)))) { _sqlite3MisuseError(tls, i32(142055)) return } - *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(1) + *(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&_db.X57)))) = i32(1) } -// Return the ROWID of the most recent insert +// C comment +// /* +// ** Return the ROWID of the most recent insert +// */ func Xsqlite3_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3) (r0 int64) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(141385)) @@ -109308,8 +113925,10 @@ func Xsqlite3_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3) (r0 int64) { return _db.X7 } -// IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns -// a pointer to the to the sqlite3_version[] string constant. +// C comment +// /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns +// ** a pointer to the to the sqlite3_version[] string constant. +// */ func Xsqlite3_libversion(tls *crt.TLS) (r0 *int8) { return (*int8)(unsafe.Pointer(&Xsqlite3_version)) } @@ -109320,20 +113939,28 @@ func init() { crt.Xstrncpy(nil, &Xsqlite3_version[0], str(127759), 7) } -// IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function -// returns an integer equal to SQLITE_VERSION_NUMBER. +// C comment +// /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function +// ** returns an integer equal to SQLITE_VERSION_NUMBER. +// */ func Xsqlite3_libversion_number(tls *crt.TLS) (r0 int32) { return i32(3019003) } -// Open a new database handle. +// C comment +// /* +// ** Open a new database handle. +// */ func Xsqlite3_open(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3) (r0 int32) { return _openDatabase(tls, _zFilename, _ppDb, uint32(i32(6)), nil) } -// This routine does the work of opening a database on behalf of -// sqlite3_open() and sqlite3_open16(). The database filename "zFilename" -// is UTF-8 encoded. +// C comment +// /* +// ** This routine does the work of opening a database on behalf of +// ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" +// ** is UTF-8 encoded. +// */ func _openDatabase(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3, _flags uint32, _zVfs *int8) (r0 int32) { var _rc, _isThreadsafe int32 var _zOpen, _zErrMsg *int8 @@ -109354,7 +113981,7 @@ func _openDatabase(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3, _flags uint if ((i32(1) << uint(int32(_flags&uint32(i32(7))))) & i32(70)) == i32(0) { return _sqlite3MisuseError(tls, i32(143292)) } - if (_sqlite3Config.X1) == i32(0) { + if _sqlite3Config.X1 == i32(0) { _isThreadsafe = i32(0) goto _8 } @@ -109376,7 +114003,7 @@ _8: } goto _11 } - if (_sqlite3Config.X26) != 0 { + if _sqlite3Config.X26 != 0 { { p := &_flags *p = (*p) | uint32(i32(131072)) @@ -109396,50 +114023,50 @@ _11: if _isThreadsafe == 0 { goto _13 } - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X3))))) = _sqlite3MutexAlloc(tls, i32(1)) + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X3)))) = _sqlite3MutexAlloc(tls, i32(1)) if (*Xsqlite3_mutex)(_db.X3) == nil { - Xsqlite3_free(tls, (unsafe.Pointer)(_db)) + Xsqlite3_free(tls, unsafe.Pointer(_db)) _db = nil goto _opendb_out } _13: Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*int32)(unsafe.Pointer(&(_db.X11))) = i32(255) - *(*int32)(unsafe.Pointer(&(_db.X5))) = i32(2) - *(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(4030429446) - *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) + *(*int32)(unsafe.Pointer(&_db.X11)) = i32(255) + *(*int32)(unsafe.Pointer(&_db.X5)) = i32(2) + *(*uint32)(unsafe.Pointer(&_db.X28)) = u32(4030429446) + *(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X4)))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&_db.X72)))) i32(0) - crt.Xmemcpy(tls, (unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31)))), (unsafe.Pointer)(&_aHardLimit), u64(48)) - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(11)))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1)) - *(*int8)(unsafe.Pointer(&(_db.X20))) = int8(i32(-1)) - *(*int64)(unsafe.Pointer(&(_db.X8))) = _sqlite3Config.X17 - *(*int32)(unsafe.Pointer(&(_db.X27))) = i32(0) - *(*int32)(unsafe.Pointer(&(_db.X32))) = i32(2147483647) - { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + crt.Xmemcpy(tls, unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31))), unsafe.Pointer(&_aHardLimit), u64(48)) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(11)))) = i32(0) + *(*uint8)(unsafe.Pointer(&_db.X15)) = uint8(i32(1)) + *(*int8)(unsafe.Pointer(&_db.X20)) = int8(i32(-1)) + *(*int64)(unsafe.Pointer(&_db.X8)) = _sqlite3Config.X17 + *(*int32)(unsafe.Pointer(&_db.X27)) = i32(0) + *(*int32)(unsafe.Pointer(&_db.X32)) = i32(2147483647) + { + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(17825888) sink1(*p) } - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_db.X70)))) - _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_db.X65)))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_db.X70))) + _sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&_db.X65))) _createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(1)), nil, _binCollFunc, nil) _createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(3)), nil, _binCollFunc, nil) _createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(2)), nil, _binCollFunc, nil) _createCollation(tls, _db, str(103035), uint8(i32(1)), nil, _nocaseCollatingFunc, nil) _createCollation(tls, _db, str(127766), uint8(i32(1)), crt.U2P(uintptr(u32(1))), _binCollFunc, nil) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _opendb_out } - *(**XCollSeq)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X2))))) = _sqlite3FindCollSeq(tls, _db, uint8(i32(1)), (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), i32(0)) + *(**XCollSeq)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X2)))) = _sqlite3FindCollSeq(tls, _db, uint8(i32(1)), (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), i32(0)) func() { if (*XCollSeq)(_db.X2) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143411), unsafe.Pointer((*int8)(unsafe.Pointer(&_openDatabaseØ00__func__Ø000))), unsafe.Pointer(str(127772))) crt.X__builtin_abort(tls) } }() - *(*uint32)(unsafe.Pointer(&(_db.X9))) = _flags - _rc = _sqlite3ParseUri(tls, _zVfs, _zFilename, &_flags, (**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X0))))), &_zOpen, &_zErrMsg) + *(*uint32)(unsafe.Pointer(&_db.X9)) = _flags + _rc = _sqlite3ParseUri(tls, _zVfs, _zFilename, &_flags, (**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_db.X0)))), &_zOpen, &_zErrMsg) if _rc == i32(0) { goto _18 } @@ -109452,7 +114079,7 @@ _13: } return nil }(), unsafe.Pointer(_zErrMsg)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg)) + Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) goto _opendb_out _18: _rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), _zOpen, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X1))))), i32(0), int32(_flags|uint32(i32(256)))) @@ -109467,8 +114094,8 @@ _18: _22: _sqlite3BtreeEnter(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1)) *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4))))) = _sqlite3SchemaGet(tls, _db, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1)) - if (_db.X17) == 0 { - *(*uint8)(unsafe.Pointer(&(_db.X14))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8 + if _db.X17 == 0 { + *(*uint8)(unsafe.Pointer(&_db.X14)) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X4).X8 } _sqlite3BtreeLeave(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(i32(0)))).X1)) *(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X4))))) = _sqlite3SchemaGet(tls, _db, nil) @@ -109476,8 +114103,8 @@ _22: *(*uint8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(0)))).X2))) = uint8(i32(3)) *(**int8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X0))) = str(23842) *(*uint8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(i32(1)))).X2))) = uint8(i32(1)) - *(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(2687084183) - if (_db.X17) != 0 { + *(*uint32)(unsafe.Pointer(&_db.X28)) = u32(2687084183) + if _db.X17 != 0 { goto _opendb_out } _sqlite3Error(tls, _db, i32(0)) @@ -109500,7 +114127,7 @@ _26: _opendb_out: if _db != nil { func() { - if (*Xsqlite3_mutex)(_db.X3) == nil && _isThreadsafe != i32(0) && (_sqlite3Config.X2) != i32(0) { + if (*Xsqlite3_mutex)(_db.X3) == nil && _isThreadsafe != i32(0) && _sqlite3Config.X2 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143544), unsafe.Pointer((*int8)(unsafe.Pointer(&_openDatabaseØ00__func__Ø000))), unsafe.Pointer(str(127789))) crt.X__builtin_abort(tls) } @@ -109520,19 +114147,22 @@ _opendb_out: goto _39 } if _rc != i32(0) { - *(*uint32)(unsafe.Pointer(&(_db.X28))) = uint32(i32(1266094736)) + *(*uint32)(unsafe.Pointer(&_db.X28)) = uint32(i32(1266094736)) } _39: *_ppDb = _db - Xsqlite3_free(tls, (unsafe.Pointer)(_zOpen)) + Xsqlite3_free(tls, unsafe.Pointer(_zOpen)) return _rc & i32(255) } -// This is the default collating function named "BINARY" which is always -// available. -// -// If the padFlag argument is not NULL then space padding at the end -// of strings is ignored. This implements the RTRIM collation. +// C comment +// /* +// ** This is the default collating function named "BINARY" which is always +// ** available. +// ** +// ** If the padFlag argument is not NULL then space padding at the end +// ** of strings is ignored. This implements the RTRIM collation. +// */ func _binCollFunc(tls *crt.TLS, _padFlag unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) { var _rc, _n int32 _n = func() int32 { @@ -109554,23 +114184,29 @@ _2: return _rc } -// Return true if the buffer z[0..n-1] contains all spaces. +// C comment +// /* +// ** Return true if the buffer z[0..n-1] contains all spaces. +// */ func _allSpaces(tls *crt.TLS, _z *int8, _n int32) (r0 int32) { _0: - if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))) == i32(32)) { + if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1))))) == i32(32)) { _n -= 1 goto _0 } return bool2int(_n == i32(0)) } -// Another built-in collating sequence: NOCASE. -// -// This collating sequence is intended to be used for "case independent -// comparison". SQLite's knowledge of upper and lower case equivalents -// extends only to the 26 characters used in the English language. -// -// At the moment there is only a UTF-8 implementation. +// C comment +// /* +// ** Another built-in collating sequence: NOCASE. +// ** +// ** This collating sequence is intended to be used for "case independent +// ** comparison". SQLite's knowledge of upper and lower case equivalents +// ** extends only to the 26 characters used in the English language. +// ** +// ** At the moment there is only a UTF-8 implementation. +// */ func _nocaseCollatingFunc(tls *crt.TLS, _NotUsed unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) { var _r int32 _r = Xsqlite3_strnicmp(tls, (*int8)(_pKey1), (*int8)(_pKey2), func() int32 { @@ -109592,9 +114228,12 @@ func init() { crt.Xstrncpy(nil, &_openDatabaseØ00__func__Ø000[0], str(127884), 13) } -// This routine does per-connection function registration. Most -// of the built-in functions above are part of the global function set. -// This routine only deals with those that are not global. +// C comment +// /* +// ** This routine does per-connection function registration. Most +// ** of the built-in functions above are part of the global function set. +// ** This routine only deals with those that are not global. +// */ func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, _db *Xsqlite3) { var _rc int32 _rc = Xsqlite3_overload_function(tls, _db, str(25276), i32(2)) @@ -109609,16 +114248,19 @@ func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, _db *Xsqlite3) } } -// Declare that a function has been overloaded by a virtual table. -// -// If the function already exists as a regular global function, then -// this routine is a no-op. If the function does not exist, then create -// a new one that always throws a run-time error. -// -// When virtual tables intend to provide an overloaded function, they -// should call this routine to make sure the global function exists. -// A global function must exist in order for name resolution to work -// properly. +// C comment +// /* +// ** Declare that a function has been overloaded by a virtual table. +// ** +// ** If the function already exists as a regular global function, then +// ** this routine is a no-op. If the function does not exist, then create +// ** a new one that always throws a run-time error. +// ** +// ** When virtual tables intend to provide an overloaded function, they +// ** should call this routine to make sure the global function exists. +// ** A global function must exist in order for name resolution to work +// ** properly. +// */ func Xsqlite3_overload_function(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32) (r0 int32) { var _rc int32 _rc = i32(0) @@ -109634,12 +114276,15 @@ func Xsqlite3_overload_function(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg return _rc } -// The following is the implementation of an SQL function that always -// fails with an error message stating that the function is used in the -// wrong context. The sqlite3_overload_function() API might construct -// SQL function that use this routine so that the functions will exist -// for name resolution but are actually overloaded by the xFindFunction -// method of virtual tables. +// C comment +// /* +// ** The following is the implementation of an SQL function that always +// ** fails with an error message stating that the function is used in the +// ** wrong context. The sqlite3_overload_function() API might construct +// ** SQL function that use this routine so that the functions will exist +// ** for name resolution but are actually overloaded by the xFindFunction +// ** method of virtual tables. +// */ func _sqlite3InvalidFunction(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { var _zName, _zErr *int8 _zName = (*XFuncDef)(_context.X1).X6 @@ -109647,7 +114292,7 @@ func _sqlite3InvalidFunction(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed _zErr = Xsqlite3_mprintf(tls, str(127931), unsafe.Pointer(_zName)) Xsqlite3_result_error(tls, _context, _zErr, i32(-1)) - Xsqlite3_free(tls, (unsafe.Pointer)(_zErr)) + Xsqlite3_free(tls, unsafe.Pointer(_zErr)) } var _sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000 [45]int8 @@ -109656,9 +114301,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000[0], str(127982), 45) } -// Load all automatic extensions. -// -// If anything goes wrong, set an error in the database connection. +// C comment +// /* +// ** Load all automatic extensions. +// ** +// ** If anything goes wrong, set an error in the database connection. +// */ func _sqlite3AutoLoadExtensions(tls *crt.TLS, _db *Xsqlite3) { var _go, _rc int32 var _i uint32 @@ -109667,7 +114315,7 @@ func _sqlite3AutoLoadExtensions(tls *crt.TLS, _db *Xsqlite3) { var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 var _2_pThunk *Xsqlite3_api_routines _go = i32(1) - if (_sqlite3Autoext.X0) == uint32(i32(0)) { + if _sqlite3Autoext.X0 == uint32(i32(0)) { return } _i = uint32(i32(0)) @@ -109678,12 +114326,15 @@ _1: _2_mutex = _sqlite3MutexAlloc(tls, i32(2)) _2_pThunk = &_sqlite3Apis Xsqlite3_mutex_enter(tls, _2_mutex) - if _i >= (_sqlite3Autoext.X0) { + if _i >= _sqlite3Autoext.X0 { _xInit = nil _go = i32(0) goto _6 } - _xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_i))))})) + _xInit = func() func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32 { + v := *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_i))) + return *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&v)) + }() _6: Xsqlite3_mutex_leave(tls, _2_mutex) _2_zErrmsg = nil @@ -109691,7 +114342,7 @@ _6: _sqlite3ErrorWithMsg(tls, _db, _rc, str(128027), unsafe.Pointer(_2_zErrmsg)) _go = i32(0) } - Xsqlite3_free(tls, (unsafe.Pointer)(_2_zErrmsg)) + Xsqlite3_free(tls, unsafe.Pointer(_2_zErrmsg)) _i += 1 goto _1 _4: @@ -109699,24 +114350,27 @@ _4: var _sqlite3Autoext Tsqlite3AutoExtList -// Set up the lookaside buffers for a database connection. -// Return SQLITE_OK on success. -// If lookaside is already active, return SQLITE_BUSY. -// -// The sz parameter is the number of bytes in each lookaside slot. -// The cnt parameter is the number of slots. If pStart is NULL the -// space for the lookaside memory is obtained from sqlite3_malloc(). -// If pStart is not NULL then it is sz*cnt bytes of memory to use for -// the lookaside memory. +// C comment +// /* +// ** Set up the lookaside buffers for a database connection. +// ** Return SQLITE_OK on success. +// ** If lookaside is already active, return SQLITE_BUSY. +// ** +// ** The sz parameter is the number of bytes in each lookaside slot. +// ** The cnt parameter is the number of slots. If pStart is NULL the +// ** space for the lookaside memory is obtained from sqlite3_malloc(). +// ** If pStart is not NULL then it is sz*cnt bytes of memory to use for +// ** the lookaside memory. +// */ func _setupLookaside(tls *crt.TLS, _db *Xsqlite3, _pBuf unsafe.Pointer, _sz int32, _cnt int32) (r0 int32) { var _6_i int32 var _pStart unsafe.Pointer var _6_p *Xsqlite3_file - if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) != 0 { + if ((*t7)(unsafe.Pointer(&_db.X58)).X3) != 0 { return i32(5) } - if ((*t7)(unsafe.Pointer(&(_db.X58))).X2) != 0 { - Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&(_db.X58))).X7) + if ((*t7)(unsafe.Pointer(&_db.X58)).X2) != 0 { + Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&_db.X58)).X7) } _sz = _sz & i32(-8) if _sz <= i32(8) { @@ -109743,9 +114397,9 @@ func _setupLookaside(tls *crt.TLS, _db *Xsqlite3, _pBuf unsafe.Pointer, _sz int3 _7: _pStart = _pBuf _9: - *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X7))) = _pStart - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = nil - *(*uint16)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X1))) = uint16(_sz) + *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X7))) = _pStart + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X6))))) = nil + *(*uint16)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X1))) = uint16(_sz) if _pStart == nil { goto _10 } @@ -109761,15 +114415,15 @@ _13: if _6_i < i32(0) { goto _16 } - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_p.X0))))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = _6_p - _6_p = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_p)) + 1*uintptr(_sz))))) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_6_p.X0)))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&_db.X58)).X6) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X6))))) = _6_p + _6_p = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_p)) + 1*uintptr(_sz))))) _6_i -= 1 goto _13 _16: - *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X8))) = (unsafe.Pointer)(_6_p) - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) = uint32(i32(0)) - *(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X2))) = uint8(func() int32 { + *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X8))) = unsafe.Pointer(_6_p) + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) = uint32(i32(0)) + *(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X2))) = uint8(func() int32 { if _pBuf == nil { return i32(1) } @@ -109777,10 +114431,10 @@ _16: }()) goto _19 _10: - *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X7))) = (unsafe.Pointer)(_db) - *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X8))) = (unsafe.Pointer)(_db) - *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) = uint32(i32(1)) - *(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X2))) = uint8(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X7))) = unsafe.Pointer(_db) + *(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X8))) = unsafe.Pointer(_db) + *(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X0))) = uint32(i32(1)) + *(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X2))) = uint8(i32(0)) _19: return i32(0) } @@ -109791,7 +114445,10 @@ func init() { crt.Xstrncpy(nil, &_setupLookasideØ00__func__Ø000[0], str(128099), 15) } -// Open a new database handle. +// C comment +// /* +// ** Open a new database handle. +// */ func Xsqlite3_open16(tls *crt.TLS, _zFilename unsafe.Pointer, _ppDb **Xsqlite3) (r0 int32) { var _rc int32 var _zFilename8 *int8 @@ -109805,7 +114462,7 @@ func Xsqlite3_open16(tls *crt.TLS, _zFilename unsafe.Pointer, _ppDb **Xsqlite3) return _rc } if _zFilename == nil { - _zFilename = (unsafe.Pointer)(str(128114)) + _zFilename = unsafe.Pointer(str(128114)) } _pVal = _sqlite3ValueNew(tls, nil) _sqlite3ValueSetStr(tls, _pVal, i32(-1), _zFilename, uint8(i32(2)), nil) @@ -109837,12 +114494,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_open16Ø00__func__Ø000[0], str(128143), 15) } -// Two versions of the official API. Legacy and new use. In the legacy -// version, the original SQL text is not saved in the prepared statement -// and so if a schema change occurs, SQLITE_SCHEMA is returned by -// sqlite3_step(). In the new version, the original SQL text is retained -// and the statement is automatically recompiled if an schema change -// occurs. +// C comment +// /* +// ** Two versions of the official API. Legacy and new use. In the legacy +// ** version, the original SQL text is not saved in the prepared statement +// ** and so if a schema change occurs, SQLITE_SCHEMA is returned by +// ** sqlite3_step(). In the new version, the original SQL text is retained +// ** and the statement is automatically recompiled if an schema change +// ** occurs. +// */ func Xsqlite3_prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) { var _rc int32 _rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, i32(0), _ppStmt, _pzTail) @@ -109855,7 +114515,10 @@ func Xsqlite3_prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nByt return _rc } -// Compile the UTF-16 encoded SQL statement zSql into a statement handle. +// C comment +// /* +// ** Compile the UTF-16 encoded SQL statement zSql into a statement handle. +// */ func _sqlite3Prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _saveSqlFlag int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) { var _rc, _2_sz, _5_chars_parsed int32 var _zSql8, _zTail8, _2_z *int8 @@ -109874,7 +114537,7 @@ func _sqlite3Prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nByte _2_z = (*int8)(_zSql) _2_sz = i32(0) _4: - if _2_sz >= _nBytes || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_z)) + 1*uintptr(_2_sz)))) == i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_z)) + 1*uintptr(_2_sz+i32(1))))) == i32(0) { + if _2_sz >= _nBytes || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_z)) + 1*uintptr(_2_sz)))) == i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_z)) + 1*uintptr(_2_sz+i32(1))))) == i32(0) { goto _9 } { @@ -109893,17 +114556,20 @@ _3: } if (_zTail8 != nil) && (_pzTail != nil) { _5_chars_parsed = _sqlite3Utf8CharLen(tls, _zSql8, int32(int64((uintptr(unsafe.Pointer(_zTail8))-uintptr(unsafe.Pointer(_zSql8)))/1))) - *_pzTail = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(_zSql))) + uintptr(_sqlite3Utf16ByteLen(tls, _zSql, _5_chars_parsed))))) + *_pzTail = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(_zSql))) + uintptr(_sqlite3Utf16ByteLen(tls, _zSql, _5_chars_parsed))))) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql8)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zSql8)) _rc = _sqlite3ApiExit(tls, _db, _rc) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _rc } -// zIn is a UTF-16 encoded unicode string at least nChar characters long. -// Return the number of bytes in the first nChar unicode characters -// in pZ. nChar must be non-negative. +// C comment +// /* +// ** zIn is a UTF-16 encoded unicode string at least nChar characters long. +// ** Return the number of bytes in the first nChar unicode characters +// ** in pZ. nChar must be non-negative. +// */ func _sqlite3Utf16ByteLen(tls *crt.TLS, _zIn unsafe.Pointer, _nChar int32) (r0 int32) { var _c, _n, _4_c2, _8_c2 int32 var _z *uint8 @@ -109945,12 +114611,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_prepare16Ø00__func__Ø000[0], str(128158), 18) } -// Register a profile function. The pArg from the previously registered -// profile function is returned. -// -// A NULL profile function means that no profiling is executes. A non-NULL -// profile is a pointer to a function that is invoked at the conclusion of -// each SQL statement that is run. +// C comment +// /* +// ** Register a profile function. The pArg from the previously registered +// ** profile function is returned. +// ** +// ** A NULL profile function means that no profiling is executes. A non-NULL +// ** profile is a pointer to a function that is invoked at the conclusion of +// ** each SQL statement that is run. +// */ func Xsqlite3_profile(tls *crt.TLS, _db *Xsqlite3, _xProfile func(*crt.TLS, unsafe.Pointer, *int8, uint64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _pOld unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -109959,15 +114628,18 @@ func Xsqlite3_profile(tls *crt.TLS, _db *Xsqlite3, _xProfile func(*crt.TLS, unsa } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pOld = _db.X44 - *(*func(*crt.TLS, unsafe.Pointer, *int8, uint64))(unsafe.Pointer(&(_db.X43))) = _xProfile - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X44))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer, *int8, uint64))(unsafe.Pointer(&_db.X43)) = _xProfile + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X44)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pOld } -// This routine sets the progress callback for an Sqlite database to the -// given callback function with the given argument. The progress callback will -// be invoked every nOps opcodes. +// C comment +// /* +// ** This routine sets the progress callback for an Sqlite database to the +// ** given callback function with the given argument. The progress callback will +// ** be invoked every nOps opcodes. +// */ func Xsqlite3_progress_handler(tls *crt.TLS, _db *Xsqlite3, _nOps int32, _xProgress func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(142013)) @@ -109975,20 +114647,23 @@ func Xsqlite3_progress_handler(tls *crt.TLS, _db *Xsqlite3, _nOps int32, _xProgr } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) if _nOps > i32(0) { - *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X61))) = _xProgress - *(*uint32)(unsafe.Pointer(&(_db.X63))) = uint32(_nOps) - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X62))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_db.X61)) = _xProgress + *(*uint32)(unsafe.Pointer(&_db.X63)) = uint32(_nOps) + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X62)) = _pArg goto _2 } - *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X61))) = nil - *(*uint32)(unsafe.Pointer(&(_db.X63))) = uint32(i32(0)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X62))) = nil + *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&_db.X61)) = nil + *(*uint32)(unsafe.Pointer(&_db.X63)) = uint32(i32(0)) + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X62)) = nil _2: Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) } -// The public interface to sqlite3Realloc. Make sure that the memory -// subsystem is initialized prior to invoking sqliteRealloc. +// C comment +// /* +// ** The public interface to sqlite3Realloc. Make sure that the memory +// ** subsystem is initialized prior to invoking sqliteRealloc. +// */ func Xsqlite3_realloc(tls *crt.TLS, _pOld unsafe.Pointer, _n int32) (r0 unsafe.Pointer) { if Xsqlite3_initialize(tls) != 0 { return nil @@ -110006,9 +114681,12 @@ func Xsqlite3_result_error16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Po crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(1) - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) - _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), (*int8)(_z), _n, uint8(i32(2)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = i32(1) + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) + _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), (*int8)(_z), _n, uint8(i32(2)), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } var _sqlite3_result_error16Ø00__func__Ø000 [23]int8 @@ -110097,8 +114775,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_text16leØ00__func__Ø000[0], str(128286), 24) } -// Register a callback to be invoked each time a transaction is rolled -// back by this database connection. +// C comment +// /* +// ** Register a callback to be invoked each time a transaction is rolled +// ** back by this database connection. +// */ func Xsqlite3_rollback_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer), _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _pRet unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -110107,76 +114788,82 @@ func Xsqlite3_rollback_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TL } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pRet = _db.X47 - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_db.X48))) = _xCallback - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X47))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_db.X48)) = _xCallback + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X47)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pRet } -// Set or clear the access authorization function. -// -// The access authorization function is be called during the compilation -// phase to verify that the user has read and/or write access permission on -// various fields of the database. The first argument to the auth function -// is a copy of the 3rd argument to this routine. The second argument -// to the auth function is one of these constants: -// -// SQLITE_CREATE_INDEX -// SQLITE_CREATE_TABLE -// SQLITE_CREATE_TEMP_INDEX -// SQLITE_CREATE_TEMP_TABLE -// SQLITE_CREATE_TEMP_TRIGGER -// SQLITE_CREATE_TEMP_VIEW -// SQLITE_CREATE_TRIGGER -// SQLITE_CREATE_VIEW -// SQLITE_DELETE -// SQLITE_DROP_INDEX -// SQLITE_DROP_TABLE -// SQLITE_DROP_TEMP_INDEX -// SQLITE_DROP_TEMP_TABLE -// SQLITE_DROP_TEMP_TRIGGER -// SQLITE_DROP_TEMP_VIEW -// SQLITE_DROP_TRIGGER -// SQLITE_DROP_VIEW -// SQLITE_INSERT -// SQLITE_PRAGMA -// SQLITE_READ -// SQLITE_SELECT -// SQLITE_TRANSACTION -// SQLITE_UPDATE -// -// The third and fourth arguments to the auth function are the name of -// the table and the column that are being accessed. The auth function -// should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If -// SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY -// means that the SQL statement will never-run - the sqlite3_exec() call -// will return with an error. SQLITE_IGNORE means that the SQL statement -// should run but attempts to read the specified column will return NULL -// and attempts to write the column will be ignored. -// -// Setting the auth function to NULL disables this hook. The default -// setting of the auth function is NULL. +// C comment +// /* +// ** Set or clear the access authorization function. +// ** +// ** The access authorization function is be called during the compilation +// ** phase to verify that the user has read and/or write access permission on +// ** various fields of the database. The first argument to the auth function +// ** is a copy of the 3rd argument to this routine. The second argument +// ** to the auth function is one of these constants: +// ** +// ** SQLITE_CREATE_INDEX +// ** SQLITE_CREATE_TABLE +// ** SQLITE_CREATE_TEMP_INDEX +// ** SQLITE_CREATE_TEMP_TABLE +// ** SQLITE_CREATE_TEMP_TRIGGER +// ** SQLITE_CREATE_TEMP_VIEW +// ** SQLITE_CREATE_TRIGGER +// ** SQLITE_CREATE_VIEW +// ** SQLITE_DELETE +// ** SQLITE_DROP_INDEX +// ** SQLITE_DROP_TABLE +// ** SQLITE_DROP_TEMP_INDEX +// ** SQLITE_DROP_TEMP_TABLE +// ** SQLITE_DROP_TEMP_TRIGGER +// ** SQLITE_DROP_TEMP_VIEW +// ** SQLITE_DROP_TRIGGER +// ** SQLITE_DROP_VIEW +// ** SQLITE_INSERT +// ** SQLITE_PRAGMA +// ** SQLITE_READ +// ** SQLITE_SELECT +// ** SQLITE_TRANSACTION +// ** SQLITE_UPDATE +// ** +// ** The third and fourth arguments to the auth function are the name of +// ** the table and the column that are being accessed. The auth function +// ** should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If +// ** SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY +// ** means that the SQL statement will never-run - the sqlite3_exec() call +// ** will return with an error. SQLITE_IGNORE means that the SQL statement +// ** should run but attempts to read the specified column will return NULL +// ** and attempts to write the column will be ignored. +// ** +// ** Setting the auth function to NULL disables this hook. The default +// ** setting of the auth function is NULL. +// */ func Xsqlite3_set_authorizer(tls *crt.TLS, _db *Xsqlite3, _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, _pArg unsafe.Pointer) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(99496)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _xAuth - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X60))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&_db.X59)) = _xAuth + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X60)) = _pArg _sqlite3ExpirePreparedStatements(tls, _db) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(0) } -// Set the auxiliary data pointer and delete function, for the iArg'th -// argument to the user-function defined by pCtx. Any previous value is -// deleted by calling the delete function specified when it was set. -// -// The left-most argument is 0. -// -// Undocumented behavior: If iArg is negative then make the data available -// to all functions within the current prepared statement using iArg as an -// access code. +// C comment +// /* +// ** Set the auxiliary data pointer and delete function, for the iArg'th +// ** argument to the user-function defined by pCtx. Any previous value is +// ** deleted by calling the delete function specified when it was set. +// ** +// ** The left-most argument is 0. +// ** +// ** Undocumented behavior: If iArg is negative then make the data available +// ** to all functions within the current prepared statement using iArg as an +// ** access code. +// */ func Xsqlite3_set_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32, _pAux unsafe.Pointer, _xDelete func(*crt.TLS, unsafe.Pointer)) { var _pVdbe *TVdbe var _pAuxData *XAuxData @@ -110198,7 +114885,7 @@ _4: if _pAuxData == nil { goto _7 } - if ((_pAuxData.X1) == _iArg) && (((_pAuxData.X0) == (_pCtx.X4)) || (_iArg < i32(0))) { + if (_pAuxData.X1 == _iArg) && ((_pAuxData.X0 == _pCtx.X4) || (_iArg < i32(0))) { goto _7 } _pAuxData = (*XAuxData)(_pAuxData.X4) @@ -110211,22 +114898,22 @@ _7: if _pAuxData == nil { goto _failed } - *(*int32)(unsafe.Pointer(&(_pAuxData.X0))) = _pCtx.X4 - *(*int32)(unsafe.Pointer(&(_pAuxData.X1))) = _iArg - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pAuxData.X4))))) = (*XAuxData)(_pVdbe.X43) - *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVdbe.X43))))) = _pAuxData + *(*int32)(unsafe.Pointer(&_pAuxData.X0)) = _pCtx.X4 + *(*int32)(unsafe.Pointer(&_pAuxData.X1)) = _iArg + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pAuxData.X4)))) = (*XAuxData)(_pVdbe.X43) + *(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVdbe.X43)))) = _pAuxData if int32(_pCtx.X7) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(0) - *(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pCtx.X5)) = i32(0) + *(*uint8)(unsafe.Pointer(&_pCtx.X7)) = uint8(i32(1)) } goto _15 _11: - if (_pAuxData.X3) != nil { - (_pAuxData.X3)(tls, _pAuxData.X2) + if _pAuxData.X3 != nil { + _pAuxData.X3(tls, _pAuxData.X2) } _15: - *(*unsafe.Pointer)(unsafe.Pointer(&(_pAuxData.X2))) = _pAux - *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pAuxData.X3))) = _xDelete + *(*unsafe.Pointer)(unsafe.Pointer(&_pAuxData.X2)) = _pAux + *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&_pAuxData.X3)) = _xDelete return _failed: if _xDelete != nil { @@ -110240,8 +114927,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_set_auxdataØ00__func__Ø000[0], str(128310), 20) } -// Return meta information about a specific column of a database table. -// See comment in sqlite3.h (sqlite.h.in) for details. +// C comment +// /* +// ** Return meta information about a specific column of a database table. +// ** See comment in sqlite3.h (sqlite.h.in) for details. +// */ func Xsqlite3_table_column_metadata(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _zTableName *int8, _zColumnName *int8, _pzDataType **int8, _pzCollSeq **int8, _pNotNull *int32, _pPrimaryKey *int32, _pAutoinc *int32) (r0 int32) { var _rc, _iCol, _notnull, _primarykey, _autoinc int32 var _zErrMsg, _zDataType, _zCollSeq *int8 @@ -110266,7 +114956,7 @@ func Xsqlite3_table_column_metadata(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, goto _error_out } _pTab = _sqlite3FindTable(tls, _db, _zTableName, _zDbName) - if (_pTab == nil) || ((*XSelect)(_pTab.X3) != nil) { + if (_pTab == nil) || (_pTab.X3 != nil) { _pTab = nil goto _error_out } @@ -110288,7 +114978,7 @@ _10: if _iCol != int32(_pTab.X11) { goto _12 } - if (((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) && _sqlite3IsRowid(tls, _zColumnName) != 0 { + if ((_pTab.X9 & uint32(i32(32))) == uint32(i32(0))) && _sqlite3IsRowid(tls, _zColumnName) != 0 { _iCol = int32(_pTab.X10) _pCol = func() *XColumn { if _iCol >= i32(0) { @@ -110308,7 +114998,7 @@ _6: _zCollSeq = _pCol.X2 _notnull = bool2int(int32(_pCol.X3) != i32(0)) _primarykey = bool2int((int32(_pCol.X6) & i32(1)) != i32(0)) - _autoinc = bool2int((int32(_pTab.X10) == _iCol) && (((_pTab.X9) & uint32(i32(8))) != uint32(i32(0)))) + _autoinc = bool2int((int32(_pTab.X10) == _iCol) && ((_pTab.X9 & uint32(i32(8))) != uint32(i32(0)))) goto _20 } _zDataType = str(25792) @@ -110335,7 +115025,7 @@ _error_out: *_pAutoinc = _autoinc } if (i32(0) == _rc) && (_pTab == nil) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg)) _zErrMsg = _sqlite3MPrintf(tls, _db, str(128330), unsafe.Pointer(_zTableName), unsafe.Pointer(_zColumnName)) _rc = i32(1) } @@ -110345,21 +115035,27 @@ _error_out: } return nil }(), unsafe.Pointer(_zErrMsg)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErrMsg)) _rc = _sqlite3ApiExit(tls, _db, _rc) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _rc } -// This is a convenience routine that makes sure that all thread-specific -// data for this thread has been deallocated. -// -// SQLite no longer uses thread-specific data so this routine is now a -// no-op. It is retained for historical compatibility. +// C comment +// /* +// ** This is a convenience routine that makes sure that all thread-specific +// ** data for this thread has been deallocated. +// ** +// ** SQLite no longer uses thread-specific data so this routine is now a +// ** no-op. It is retained for historical compatibility. +// */ func Xsqlite3_thread_cleanup(tls *crt.TLS) { } -// Return the number of changes since the database handle was opened. +// C comment +// /* +// ** Return the number of changes since the database handle was opened. +// */ func Xsqlite3_total_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(141426)) @@ -110376,30 +115072,34 @@ func Xsqlite3_trace(tls *crt.TLS, _db *Xsqlite3, _xTrace func(*crt.TLS, unsafe.P } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pOld = _db.X42 - *(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(func() int32 { + *(*uint8)(unsafe.Pointer(&_db.X24)) = uint8(func() int32 { if _xTrace != nil { return i32(128) } return i32(0) }()) - *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X41))) = *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) - }{_xTrace})) - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X42))) = _pArg + *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_db.X41)) = func() func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32 { + v := _xTrace + return *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }() + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X42)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pOld } -// Deprecated external interface. Internal/core SQLite code -// should call sqlite3TransferBindings. -// -// It is misuse to call this routine with statements from different -// database connections. But as this is a deprecated interface, we -// will not bother to check for that condition. -// -// If the two statements contain a different number of bindings, then -// an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise -// SQLITE_OK is returned. +// C comment +// /* +// ** Deprecated external interface. Internal/core SQLite code +// ** should call sqlite3TransferBindings. +// ** +// ** It is misuse to call this routine with statements from different +// ** database connections. But as this is a deprecated interface, we +// ** will not bother to check for that condition. +// ** +// ** If the two statements contain a different number of bindings, then +// ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise +// ** SQLITE_OK is returned. +// */ func Xsqlite3_transfer_bindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) { var _pFrom, _pTo *TVdbe _pFrom = (*TVdbe)(_pFromStmt) @@ -110408,22 +115108,22 @@ func Xsqlite3_transfer_bindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStm return i32(1) } func() { - if ((uint32((_pTo.X32)>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && (_pTo.X41) != uint32(i32(0)) { + if ((uint32(_pTo.X32>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && _pTo.X41 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77636), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000))), unsafe.Pointer(str(128358))) crt.X__builtin_abort(tls) } }() - if (_pTo.X41) != 0 { - storebits18((*int16)(unsafe.Pointer(&(_pTo.X32))), int16(i32(1)), 1, 0) + if _pTo.X41 != 0 { + storebits18((*int16)(unsafe.Pointer(&_pTo.X32)), int16(i32(1)), 1, 0) } func() { - if ((uint32((_pFrom.X32)>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && (_pFrom.X41) != uint32(i32(0)) { + if ((uint32(_pFrom.X32>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && _pFrom.X41 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000))), unsafe.Pointer(str(128394))) crt.X__builtin_abort(tls) } }() - if (_pFrom.X41) != 0 { - storebits18((*int16)(unsafe.Pointer(&(_pFrom.X32))), int16(i32(1)), 1, 0) + if _pFrom.X41 != 0 { + storebits18((*int16)(unsafe.Pointer(&_pFrom.X32)), int16(i32(1)), 1, 0) } return _sqlite3TransferBindings(tls, _pFromStmt, _pToStmt) } @@ -110434,8 +115134,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_transfer_bindingsØ00__func__Ø000[0], str(128434), 26) } -// Register a callback to be invoked each time a row is updated, -// inserted or deleted using this database connection. +// C comment +// /* +// ** Register a callback to be invoked each time a row is updated, +// ** inserted or deleted using this database connection. +// */ func Xsqlite3_update_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _pRet unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -110444,16 +115147,19 @@ func Xsqlite3_update_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _pRet = _db.X49 - *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64))(unsafe.Pointer(&(_db.X50))) = _xCallback - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X49))) = _pArg + *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64))(unsafe.Pointer(&_db.X50)) = _xCallback + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X49)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _pRet } -// Try to convert the type of a function argument or a result column -// into a numeric representation. Use either INTEGER or REAL whichever -// is appropriate. But only do the conversion if it is possible without -// loss of information and return the revised type of the argument. +// C comment +// /* +// ** Try to convert the type of a function argument or a result column +// ** into a numeric representation. Use either INTEGER or REAL whichever +// ** is appropriate. But only do the conversion if it is possible without +// ** loss of information and return the revised type of the argument. +// */ func Xsqlite3_value_numeric_type(tls *crt.TLS, _pVal *XMem) (r0 int32) { var _eType int32 var _1_pMem *XMem @@ -110492,7 +115198,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_prepare16_v2Ø00__func__Ø000[0], str(128460), 21) } -// Set all the parameters in the compiled SQL statement to NULL. +// C comment +// /* +// ** Set all the parameters in the compiled SQL statement to NULL. +// */ func Xsqlite3_clear_bindings(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { var _i, _rc int32 var _mutex *Xsqlite3_mutex @@ -110512,13 +115221,13 @@ _0: goto _0 _3: func() { - if ((uint32((_p.X32)>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && (_p.X41) != uint32(i32(0)) { + if ((uint32(_p.X32>>uint(i32(9)))<<uint(i32(31)))>>uint(i32(31))) == 0 && _p.X41 != uint32(i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76253), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_clear_bindingsØ00__func__Ø000))), unsafe.Pointer(str(8414))) crt.X__builtin_abort(tls) } }() - if (_p.X41) != 0 { - storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0) + if _p.X41 != 0 { + storebits18((*int16)(unsafe.Pointer(&_p.X32)), int16(i32(1)), 1, 0) } Xsqlite3_mutex_leave(tls, _mutex) return _rc @@ -110530,7 +115239,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_clear_bindingsØ00__func__Ø000[0], str(128481), 23) } -// External API function used to create a new virtual-table module. +// C comment +// /* +// ** External API function used to create a new virtual-table module. +// */ func Xsqlite3_create_module_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) { if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) { return _sqlite3MisuseError(tls, i32(125106)) @@ -110538,23 +115250,29 @@ func Xsqlite3_create_module_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModu return _createModule(tls, _db, _zName, _pModule, _pAux, _xDestroy) } -// Query a blob handle for the size of the data. -// -// The Incrblob.nByte field is fixed for the lifetime of the Incrblob -// so no mutex is required for access. +// C comment +// /* +// ** Query a blob handle for the size of the data. +// ** +// ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob +// ** so no mutex is required for access. +// */ func Xsqlite3_blob_bytes(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) { var _p *XIncrblob _p = (*XIncrblob)(_pBlob) return func() int32 { - if (_p != nil) && ((_p.X4) != nil) { - return (_p.X0) + if (_p != nil) && (_p.X4 != nil) { + return _p.X0 } return i32(0) }() } -// Close a blob handle that was previously created using -// sqlite3_blob_open(). +// C comment +// /* +// ** Close a blob handle that was previously created using +// ** sqlite3_blob_open(). +// */ func Xsqlite3_blob_close(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) { var _rc int32 var _db *Xsqlite3 @@ -110564,7 +115282,7 @@ func Xsqlite3_blob_close(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) { _db = (*Xsqlite3)(_p.X5) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) _rc = Xsqlite3_finalize(tls, _p.X4) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_p)) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) goto _1 } @@ -110573,7 +115291,10 @@ _1: return _rc } -// Open a blob handle. +// C comment +// /* +// ** Open a blob handle. +// */ func Xsqlite3_blob_open(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _zTable *int8, _zColumn *int8, _iRow int64, _wrFlag int32, _ppBlob *unsafe.Pointer) (r0 int32) { var _nAttempt, _iCol, _rc, _14_j, _17_j, _21_iDb int32 var _zErr, _12_zFault *int8 @@ -110607,38 +115328,38 @@ func Xsqlite3_blob_open(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _zTable *int8, goto _blob_open_out } _4: - crt.Xmemset(tls, (unsafe.Pointer)(_pParse), i32(0), u64(600)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X0))))) = _db - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + crt.Xmemset(tls, unsafe.Pointer(_pParse), i32(0), u64(600)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pParse.X0)))) = _db + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _zErr = nil _sqlite3BtreeEnterAll(tls, _db) _pTab = _sqlite3LocateTable(tls, _pParse, uint32(i32(0)), _zTable, _zDb) - if (_pTab != nil) && (_pTab.X16) != 0 { + if (_pTab != nil) && _pTab.X16 != 0 { _pTab = nil _sqlite3ErrorMsg(tls, _pParse, str(128504), unsafe.Pointer(_zTable)) } - if (_pTab != nil) && (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) { + if (_pTab != nil) && ((_pTab.X9 & uint32(i32(32))) != uint32(i32(0))) { _pTab = nil _sqlite3ErrorMsg(tls, _pParse, str(128534), unsafe.Pointer(_zTable)) } - if (_pTab != nil) && ((*XSelect)(_pTab.X3) != nil) { + if (_pTab != nil) && (_pTab.X3 != nil) { _pTab = nil _sqlite3ErrorMsg(tls, _pParse, str(128570), unsafe.Pointer(_zTable)) } if _pTab != nil { goto _12 } - if (_pParse.X1) != nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + if _pParse.X1 != nil { + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _zErr = _pParse.X1 - *(**int8)(unsafe.Pointer(&(_pParse.X1))) = nil + *(**int8)(unsafe.Pointer(&_pParse.X1)) = nil } _rc = i32(1) _sqlite3BtreeLeaveAll(tls, _db) goto _blob_open_out _12: - *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X7))))) = _pTab - *(**int8)(unsafe.Pointer(&(_pBlob.X6))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))))).X0 + *(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBlob.X7)))) = _pTab + *(**int8)(unsafe.Pointer(&_pBlob.X6)) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))))).X0 _iCol = i32(0) _14: if _iCol >= int32(_pTab.X11) { @@ -110651,7 +115372,7 @@ _14: goto _14 _17: if _iCol == int32(_pTab.X11) { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _zErr = _sqlite3MPrintf(tls, _db, str(128591), unsafe.Pointer(_zColumn)) _rc = i32(1) _sqlite3BtreeLeaveAll(tls, _db) @@ -110661,7 +115382,7 @@ _17: goto _20 } _12_zFault = nil - if ((_db.X6) & i32(524288)) == 0 { + if (_db.X6 & i32(524288)) == 0 { goto _21 } _13_pFKey = (*XFKey)(_pTab.X4) @@ -110671,13 +115392,13 @@ _22: } _14_j = i32(0) _26: - if _14_j >= (_13_pFKey.X5) { + if _14_j >= _13_pFKey.X5 { goto _29 } - if ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct { + if ((*t73)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]struct { X0 int32 X1 *int8 - })(unsafe.Pointer(&(_13_pFKey.X9))))) + 16*uintptr(_14_j))).X0) == _iCol { + })(unsafe.Pointer(&_13_pFKey.X9)))) + 16*uintptr(_14_j))).X0) == _iCol { _12_zFault = str(128612) } _14_j += 1 @@ -110697,7 +115418,7 @@ _35: if _17_j >= int32(_12_pIdx.X13) { goto _38 } - if (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == _iCol) || (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == i32(-2)) { + if (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == _iCol) || (int32(*(*int16)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == i32(-2)) { _12_zFault = str(128624) } _17_j += 1 @@ -110707,21 +115428,21 @@ _38: goto _31 _34: if _12_zFault != nil { - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _zErr = _sqlite3MPrintf(tls, _db, str(128632), unsafe.Pointer(_12_zFault)) _rc = i32(1) _sqlite3BtreeLeaveAll(tls, _db) goto _blob_open_out } _20: - *(*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X4))) = (unsafe.Pointer)(_sqlite3VdbeCreate(tls, _pParse)) + *(*unsafe.Pointer)(unsafe.Pointer(&_pBlob.X4)) = unsafe.Pointer(_sqlite3VdbeCreate(tls, _pParse)) func() { - if (_pBlob.X4) == nil && (_db.X17) == 0 { + if _pBlob.X4 == nil && _db.X17 == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85748), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_blob_openØ00__func__Ø000))), unsafe.Pointer(str(128666))) crt.X__builtin_abort(tls) } }() - if (_pBlob.X4) == nil { + if _pBlob.X4 == nil { goto _45 } _21_v = (*TVdbe)(_pBlob.X4) @@ -110737,32 +115458,32 @@ _20: crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(0)))).X3))) = _21_iDb - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(0)))).X4))) = _pTab.X7 - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(0)))).X5))) = _wrFlag + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(0)))).X3))) = _21_iDb + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(0)))).X4))) = _pTab.X7 + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(0)))).X5))) = _wrFlag _sqlite3VdbeChangeP4(tls, _21_v, i32(1), _pTab.X0, i32(0)) } if int32(_db.X17) != i32(0) { goto _49 } if _wrFlag != 0 { - *(*uint8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(1)))).X0))) = uint8(i32(107)) - } - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(1)))).X4))) = _pTab.X7 - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(1)))).X5))) = _21_iDb - *(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(1)))).X1))) = int8(i32(-11)) - *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(1)))).X6))))) = int32(_pTab.X11) + i32(1) - *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 32*uintptr(i32(3)))).X4))) = int32(_pTab.X11) - *(*int16)(unsafe.Pointer(&(_pParse.X52))) = int16(i32(0)) - *(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(1) - *(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(1) + *(*uint8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(1)))).X0))) = uint8(i32(107)) + } + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(1)))).X4))) = _pTab.X7 + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(1)))).X5))) = _21_iDb + *(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(1)))).X1))) = int8(i32(-11)) + *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(1)))).X6))))) = int32(_pTab.X11) + i32(1) + *(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(unsafe.Pointer(_21_aOp)) + 32*uintptr(i32(3)))).X4))) = int32(_pTab.X11) + *(*int16)(unsafe.Pointer(&_pParse.X52)) = int16(i32(0)) + *(*int32)(unsafe.Pointer(&_pParse.X18)) = i32(1) + *(*int32)(unsafe.Pointer(&_pParse.X17)) = i32(1) _sqlite3VdbeMakeReady(tls, _21_v, _pParse) _49: _45: - *(*uint16)(unsafe.Pointer(&(_pBlob.X2))) = uint16(_iCol) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X5))))) = _db + *(*uint16)(unsafe.Pointer(&_pBlob.X2)) = uint16(_iCol) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBlob.X5)))) = _db _sqlite3BtreeLeaveAll(tls, _db) - if (_db.X17) != 0 { + if _db.X17 != 0 { goto _blob_open_out } _rc = _blobSeekToRow(tls, _pBlob, _iRow, &_zErr) @@ -110771,13 +115492,13 @@ _45: } _blob_open_out: if (_rc == i32(0)) && (int32(_db.X17) == i32(0)) { - *_ppBlob = (unsafe.Pointer)(_pBlob) + *_ppBlob = unsafe.Pointer(_pBlob) goto _55 } - if (_pBlob != nil) && ((_pBlob.X4) != nil) { + if (_pBlob != nil) && (_pBlob.X4 != nil) { _sqlite3VdbeFinalize(tls, (*TVdbe)(_pBlob.X4)) } - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pBlob)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pBlob)) _55: _sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 { if _zErr != nil { @@ -110785,9 +115506,9 @@ _55: } return nil }(), unsafe.Pointer(_zErr)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_zErr)) _sqlite3ParserReset(tls, _pParse) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_pParse)) _rc = _sqlite3ApiExit(tls, _db, _rc) Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return _rc @@ -110810,21 +115531,24 @@ func init() { var _sqlite3_blob_openØ00iLnØ001 int32 -// This function is used by both blob_open() and blob_reopen(). It seeks -// the b-tree cursor associated with blob handle p to point to row iRow. -// If successful, SQLITE_OK is returned and subsequent calls to -// sqlite3_blob_read() or sqlite3_blob_write() access the specified row. -// -// If an error occurs, or if the specified row does not exist or does not -// contain a value of type TEXT or BLOB in the column nominated when the -// blob handle was opened, then an error code is returned and *pzErr may -// be set to point to a buffer containing an error message. It is the -// responsibility of the caller to free the error message buffer using -// sqlite3DbFree(). -// -// If an error does occur, then the b-tree cursor is closed. All subsequent -// calls to sqlite3_blob_read(), blob_write() or blob_reopen() will -// immediately return SQLITE_ABORT. +// C comment +// /* +// ** This function is used by both blob_open() and blob_reopen(). It seeks +// ** the b-tree cursor associated with blob handle p to point to row iRow. +// ** If successful, SQLITE_OK is returned and subsequent calls to +// ** sqlite3_blob_read() or sqlite3_blob_write() access the specified row. +// ** +// ** If an error occurs, or if the specified row does not exist or does not +// ** contain a value of type TEXT or BLOB in the column nominated when the +// ** blob handle was opened, then an error code is returned and *pzErr may +// ** be set to point to a buffer containing an error message. It is the +// ** responsibility of the caller to free the error message buffer using +// ** sqlite3DbFree(). +// ** +// ** If an error does occur, then the b-tree cursor is closed. All subsequent +// ** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will +// ** immediately return SQLITE_ABORT. +// */ func _blobSeekToRow(tls *crt.TLS, _p *XIncrblob, _iRow int64, _pzErr **int8) (r0 int32) { var _rc int32 var _3_type uint32 @@ -110835,8 +115559,8 @@ func _blobSeekToRow(tls *crt.TLS, _p *XIncrblob, _iRow int64, _pzErr **int8) (r0 _v = (*TVdbe)(_p.X4) *(*uint16)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(_v.X18) + 72*uintptr(i32(1)))).X1))) = uint16(i32(4)) *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(_v.X18) + 72*uintptr(i32(1)))).X0))))) = _iRow - if (_v.X9) > i32(3) { - *(*int32)(unsafe.Pointer(&(_v.X9))) = i32(3) + if _v.X9 > i32(3) { + *(*int32)(unsafe.Pointer(&_v.X9)) = i32(3) _rc = _sqlite3VdbeExec(tls, _v) goto _1 } @@ -110845,10 +115569,10 @@ _1: if _rc != i32(100) { goto _2 } - _3_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v.X23)) + 8*uintptr(i32(0)))) + _3_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr(unsafe.Pointer(_v.X23)) + 8*uintptr(i32(0)))) _3_type = func() uint32 { if int32(_3_pC.X19) > int32(_p.X2) { - return (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_3_pC.X25))))) + 4*uintptr(_p.X2)))) + return (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_3_pC.X25)))) + 4*uintptr(_p.X2)))) } return uint32(i32(0)) }() @@ -110866,12 +115590,12 @@ _1: }())) _rc = i32(1) Xsqlite3_finalize(tls, _p.X4) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = nil goto _10 } - *(*int32)(unsafe.Pointer(&(_p.X1))) = int32(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_3_pC.X25))))) + 4*uintptr(int32(_p.X2)+int32(_3_pC.X18))))) - *(*int32)(unsafe.Pointer(&(_p.X0))) = int32(_sqlite3VdbeSerialTypeLen(tls, _3_type)) - *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_3_pC.X14)))))) + *(*int32)(unsafe.Pointer(&_p.X1)) = int32(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[1]uint32)(unsafe.Pointer(&_3_pC.X25)))) + 4*uintptr(int32(_p.X2)+int32(_3_pC.X18))))) + *(*int32)(unsafe.Pointer(&_p.X0)) = int32(_sqlite3VdbeSerialTypeLen(tls, _3_type)) + *(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X3)))) = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&_3_pC.X14))))) _sqlite3BtreeIncrblobCursor(tls, (*XBtCursor)(_p.X3)) _10: _2: @@ -110879,11 +115603,11 @@ _2: _rc = i32(0) goto _13 } - if (_p.X4) == nil { + if _p.X4 == nil { goto _13 } _rc = Xsqlite3_finalize(tls, _p.X4) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = nil if _rc == i32(0) { _zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.X5), str(128758), _iRow) _rc = i32(1) @@ -110908,10 +115632,13 @@ _13: return _rc } -// Mark this cursor as an incremental blob cursor. +// C comment +// /* +// ** Mark this cursor as an incremental blob cursor. +// */ func _sqlite3BtreeIncrblobCursor(tls *crt.TLS, _pCur *XBtCursor) { { - p := (*uint8)(unsafe.Pointer(&(_pCur.X10))) + p := (*uint8)(unsafe.Pointer(&_pCur.X10)) *p = uint8(int32(*p) | i32(16)) sink2(*p) } @@ -110924,12 +115651,18 @@ func init() { crt.Xstrncpy(nil, &_blobSeekToRowØ00__func__Ø000[0], str(128837), 14) } -// Read data from a blob handle. +// C comment +// /* +// ** Read data from a blob handle. +// */ func Xsqlite3_blob_read(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) { return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePayloadChecked) } -// Perform a read or write operation on a blob +// C comment +// /* +// ** Perform a read or write operation on a blob +// */ func _blobReadWrite(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32, _xCall func(*crt.TLS, *XBtCursor, uint32, uint32, unsafe.Pointer) int32) (r0 int32) { var _rc int32 var _db *Xsqlite3 @@ -110957,14 +115690,14 @@ func _blobReadWrite(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n i } }() _sqlite3BtreeEnterCursor(tls, (*XBtCursor)(_p.X3)) - _rc = _xCall(tls, (*XBtCursor)(_p.X3), uint32(_iOffset+(_p.X1)), uint32(_n), _z) + _rc = _xCall(tls, (*XBtCursor)(_p.X3), uint32(_iOffset+_p.X1), uint32(_n), _z) _sqlite3BtreeLeaveCursor(tls, (*XBtCursor)(_p.X3)) if _rc == i32(4) { _sqlite3VdbeFinalize(tls, _v) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = nil goto _10 } - *(*int32)(unsafe.Pointer(&(_v.X10))) = _rc + *(*int32)(unsafe.Pointer(&_v.X10)) = _rc _10: _6: _sqlite3Error(tls, _db, _rc) @@ -110979,11 +115712,14 @@ func init() { crt.Xstrncpy(nil, &_blobReadWriteØ00__func__Ø000[0], str(128863), 14) } -// Enter a mutex on a Btree given a cursor owned by that Btree. -// -// These entry points are used by incremental I/O only. Enter() is required -// any time OMIT_SHARED_CACHE is not defined, regardless of whether or not -// the build is threadsafe. Leave() is only required by threadsafe builds. +// C comment +// /* +// ** Enter a mutex on a Btree given a cursor owned by that Btree. +// ** +// ** These entry points are used by incremental I/O only. Enter() is required +// ** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not +// ** the build is threadsafe. Leave() is only required by threadsafe builds. +// */ func _sqlite3BtreeEnterCursor(tls *crt.TLS, _pCur *XBtCursor) { _sqlite3BtreeEnter(tls, (*XBtree)(_pCur.X0)) } @@ -111037,19 +115773,25 @@ func init() { crt.Xstrncpy(nil, &_accessPayloadCheckedØ00__func__Ø000[0], str(128904), 21) } -// Write data to a blob handle. +// C comment +// /* +// ** Write data to a blob handle. +// */ func Xsqlite3_blob_write(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) { return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePutData) } -// Argument pCsr must be a cursor opened for writing on an -// INTKEY table currently pointing at a valid table entry. -// This function modifies the data stored as part of that entry. -// -// Only the data content may only be modified, it is not possible to -// change the length of the data stored. If this function is called with -// parameters that attempt to write past the end of the existing data, -// no modifications are made and SQLITE_CORRUPT is returned. +// C comment +// /* +// ** Argument pCsr must be a cursor opened for writing on an +// ** INTKEY table currently pointing at a valid table entry. +// ** This function modifies the data stored as part of that entry. +// ** +// ** Only the data content may only be modified, it is not possible to +// ** change the length of the data stored. If this function is called with +// ** parameters that attempt to write past the end of the existing data, +// ** no modifications are made and SQLITE_CORRUPT is returned. +// */ func _sqlite3BtreePutData(tls *crt.TLS, _pCsr *XBtCursor, _offset uint32, _amt uint32, _z unsafe.Pointer) (r0 int32) { var _rc int32 func() { @@ -111117,7 +115859,7 @@ func _sqlite3BtreePutData(tls *crt.TLS, _pCsr *XBtCursor, _offset uint32, _amt u } }() func() { - if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X19))))) + 8*uintptr(_pCsr.X14)))).X2) == 0 { + if ((*(**XMemPage)(unsafe.Pointer(uintptr(unsafe.Pointer((*[20]unsafe.Pointer)(unsafe.Pointer(&_pCsr.X19)))) + 8*uintptr(_pCsr.X14)))).X2) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129248))) crt.X__builtin_abort(tls) } @@ -111131,9 +115873,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3BtreePutDataØ00__func__Ø000[0], str(129282), 20) } -// Return the maximum amount of memory that has ever been -// checked out since either the beginning of this process -// or since the most recent reset. +// C comment +// /* +// ** Return the maximum amount of memory that has ever been +// ** checked out since either the beginning of this process +// ** or since the most recent reset. +// */ func Xsqlite3_memory_highwater(tls *crt.TLS, _resetFlag int32) (r0 int64) { var _res, _mx int64 Xsqlite3_status64(tls, i32(0), &_res, &_mx, _resetFlag) @@ -111143,7 +115888,10 @@ func Xsqlite3_memory_highwater(tls *crt.TLS, _resetFlag int32) (r0 int64) { panic(0) } -// Retrieve a pointer to a static mutex or allocate a new dynamic one. +// C comment +// /* +// ** Retrieve a pointer to a static mutex or allocate a new dynamic one. +// */ func Xsqlite3_mutex_alloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { if (_id <= i32(1)) && Xsqlite3_initialize(tls) != 0 { return nil @@ -111152,16 +115900,15 @@ func Xsqlite3_mutex_alloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) { return nil } func() { - if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) == nil { + if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X2) == nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22836), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_allocØ00__func__Ø000))), unsafe.Pointer(str(2292))) crt.X__builtin_abort(tls) } }() - return (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct { - f func(*crt.TLS, int32) unsafe.Pointer - }{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)})))(tls, _id) + return func() func(*crt.TLS, int32) *Xsqlite3_mutex { + v := (*Xsqlite3_mutex_methods)(unsafe.Pointer(&_sqlite3Config.X11)).X2 + return *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&v)) + }()(tls, _id) } var _sqlite3_mutex_allocØ00__func__Ø000 [20]int8 @@ -111174,7 +115921,10 @@ func Xsqlite3_open_v2(tls *crt.TLS, _filename *int8, _ppDb **Xsqlite3, _flags in return _openDatabase(tls, _filename, _ppDb, uint32(_flags), _zVfs) } -// Sleep for a little while. Return the amount of time slept. +// C comment +// /* +// ** Sleep for a little while. Return the amount of time slept. +// */ func Xsqlite3_sleep(tls *crt.TLS, _ms int32) (r0 int32) { var _rc int32 var _pVfs *Xsqlite3_vfs @@ -111193,9 +115943,12 @@ func Xsqlite3_soft_heap_limit(tls *crt.TLS, _n int32) { Xsqlite3_soft_heap_limit64(tls, int64(_n)) } -// Register a VFS with the system. It is harmless to register the same -// VFS multiple times. The new VFS becomes the default if makeDflt is -// true. +// C comment +// /* +// ** Register a VFS with the system. It is harmless to register the same +// ** VFS multiple times. The new VFS becomes the default if makeDflt is +// ** true. +// */ func Xsqlite3_vfs_register(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _makeDflt int32) (r0 int32) { var _rc int32 var _mutex *Xsqlite3_mutex @@ -111210,13 +115963,13 @@ func Xsqlite3_vfs_register(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _makeDflt int32) ( Xsqlite3_mutex_enter(tls, _mutex) _vfsUnlink(tls, _pVfs) if _makeDflt != 0 || (_vfsList == nil) { - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVfs.X3))))) = _vfsList + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVfs.X3)))) = _vfsList _vfsList = _pVfs bug20530(_vfsList) goto _4 } - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVfs.X3))))) = (*Xsqlite3_vfs)(_vfsList.X3) - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_vfsList.X3))))) = _pVfs + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pVfs.X3)))) = (*Xsqlite3_vfs)(_vfsList.X3) + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_vfsList.X3)))) = _pVfs _4: func() { if _vfsList == nil { @@ -111228,7 +115981,10 @@ _4: return i32(0) } -// Unlink a VFS from the linked list +// C comment +// /* +// ** Unlink a VFS from the linked list +// */ func _vfsUnlink(tls *crt.TLS, _pVfs *Xsqlite3_vfs) { var _3_p *Xsqlite3_vfs func() { @@ -111250,12 +116006,12 @@ func _vfsUnlink(tls *crt.TLS, _pVfs *Xsqlite3_vfs) { } _3_p = _vfsList _7: - if ((*Xsqlite3_vfs)(_3_p.X3) != nil) && ((*Xsqlite3_vfs)(_3_p.X3) != _pVfs) { + if (_3_p.X3 != nil) && ((*Xsqlite3_vfs)(_3_p.X3) != _pVfs) { _3_p = (*Xsqlite3_vfs)(_3_p.X3) goto _7 } if (*Xsqlite3_vfs)(_3_p.X3) == _pVfs { - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_p.X3))))) = (*Xsqlite3_vfs)(_pVfs.X3) + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_3_p.X3)))) = (*Xsqlite3_vfs)(_pVfs.X3) } _6: } @@ -111272,7 +116028,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_vfs_registerØ00__func__Ø000[0], str(129406), 21) } -// Unregister a VFS so that it is no longer accessible. +// C comment +// /* +// ** Unregister a VFS so that it is no longer accessible. +// */ func Xsqlite3_vfs_unregister(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) { var _mutex *Xsqlite3_mutex _mutex = _sqlite3MutexAlloc(tls, i32(2)) @@ -111282,9 +116041,11 @@ func Xsqlite3_vfs_unregister(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) { return i32(0) } -// IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns -// zero if and only if SQLite was compiled with mutexing code omitted due to -// the SQLITE_THREADSAFE compile-time option being set to 0. +// C comment +// /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns +// ** zero if and only if SQLite was compiled with mutexing code omitted due to +// ** the SQLITE_THREADSAFE compile-time option being set to 0. +// */ func Xsqlite3_threadsafe(tls *crt.TLS) (r0 int32) { return i32(1) } @@ -111305,7 +116066,10 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_zeroblobØ00__func__Ø000[0], str(129427), 24) } -// Interface to the testing logic. +// C comment +// /* +// ** Interface to the testing logic. +// */ func Xsqlite3_test_control(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) { var _rc, _5_sz, _10_x, _11_x, _13_x, _15_n, _16_sz int32 var _9_newVal uint32 @@ -111380,7 +116144,7 @@ _4: _rc = _sqlite3BitvecBuiltinTest(tls, _5_sz, _5_aProg) goto _22 _5: - *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&(_sqlite3Config.X37))) = crt.VAOther(&_ap).(func(*crt.TLS, int32) int32) + *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&_sqlite3Config.X37)) = crt.VAOther(&_ap).(func(*crt.TLS, int32) int32) _rc = _sqlite3FaultSim(tls, i32(0)) goto _22 _6: @@ -111431,7 +116195,7 @@ _11: goto _22 _12: _14_db = (*Xsqlite3)(crt.VAPointer(&_ap)) - *(*uint16)(unsafe.Pointer(&(_14_db.X13))) = uint16(crt.VAInt32(&_ap) & i32(65535)) + *(*uint16)(unsafe.Pointer(&_14_db.X13)) = uint16(crt.VAInt32(&_ap) & i32(65535)) goto _22 _13: _15_zWord = (*int8)(crt.VAPointer(&_ap)) @@ -111453,32 +116217,32 @@ _14: _sqlite3ScratchFree(tls, _16_pFree) goto _22 _15: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X38))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X38)) = crt.VAInt32(&_ap) goto _22 _16: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X6))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X6)) = crt.VAInt32(&_ap) goto _22 _17: - *(*int32)(unsafe.Pointer(&(_sqlite3Config.X39))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_sqlite3Config.X39)) = crt.VAInt32(&_ap) goto _22 _18: goto _22 _19: _21_db = (*Xsqlite3)(crt.VAPointer(&_ap)) - *(*int32)(unsafe.Pointer(&(_21_db.X32))) = crt.VAInt32(&_ap) + *(*int32)(unsafe.Pointer(&_21_db.X32)) = crt.VAInt32(&_ap) goto _22 _20: - if (_sqlite3Config.X28) == i32(0) { + if _sqlite3Config.X28 == i32(0) { _rc = i32(1) } goto _22 _21: _23_db = (*Xsqlite3)(crt.VAPointer(&_ap)) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_23_db.X3)) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X1))) = uint8(_sqlite3FindDbName(tls, _23_db, (*int8)(crt.VAPointer(&_ap)))) - *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X2))) = store2((*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X4))), uint8(crt.VAInt32(&_ap))) - *(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X0))) = crt.VAInt32(&_ap) - if (int32((*t21)(unsafe.Pointer(&(_23_db.X33))).X2) == i32(0)) && (((*t21)(unsafe.Pointer(&(_23_db.X33))).X0) > i32(0)) { + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_23_db.X33)).X1))) = uint8(_sqlite3FindDbName(tls, _23_db, (*int8)(crt.VAPointer(&_ap)))) + *(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_23_db.X33)).X2))) = store2((*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_23_db.X33)).X4))), uint8(crt.VAInt32(&_ap))) + *(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&_23_db.X33)).X0))) = crt.VAInt32(&_ap) + if (int32((*t21)(unsafe.Pointer(&_23_db.X33)).X2) == i32(0)) && (((*t21)(unsafe.Pointer(&_23_db.X33)).X0) > i32(0)) { _sqlite3ResetAllSchemasOfConnection(tls, _23_db) } Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_23_db.X3)) @@ -111489,43 +116253,46 @@ _22: } func _sqlite3PrngSaveState(tls *crt.TLS) { - crt.Xmemcpy(tls, (unsafe.Pointer)(&_sqlite3SavedPrng), (unsafe.Pointer)(&_sqlite3Prng), u64(259)) + crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3SavedPrng), unsafe.Pointer(&_sqlite3Prng), u64(259)) } var _sqlite3SavedPrng Tsqlite3PrngType func _sqlite3PrngRestoreState(tls *crt.TLS) { - crt.Xmemcpy(tls, (unsafe.Pointer)(&_sqlite3Prng), (unsafe.Pointer)(&_sqlite3SavedPrng), u64(259)) -} - -// This routine runs an extensive test of the Bitvec code. -// -// The input is an array of integers that acts as a program -// to test the Bitvec. The integers are opcodes followed -// by 0, 1, or 3 operands, depending on the opcode. Another -// opcode follows immediately after the last operand. -// -// There are 6 opcodes numbered from 0 through 5. 0 is the -// "halt" opcode and causes the test to end. -// -// 0 Halt and return the number of errors -// 1 N S X Set N bits beginning with S and incrementing by X -// 2 N S X Clear N bits beginning with S and incrementing by X -// 3 N Set N randomly chosen bits -// 4 N Clear N randomly chosen bits -// 5 N S X Set N bits from S increment X in array only, not in bitvec -// -// The opcodes 1 through 4 perform set and clear operations are performed -// on both a Bitvec object and on a linear array of bits obtained from malloc. -// Opcode 5 works on the linear array only, not on the Bitvec. -// Opcode 5 is used to deliberately induce a fault in order to -// confirm that error detection works. -// -// At the conclusion of the test the linear array is compared -// against the Bitvec object. If there are any differences, -// an error is returned. If they are the same, zero is returned. -// -// If a memory allocation error occurs, return -1. + crt.Xmemcpy(tls, unsafe.Pointer(&_sqlite3Prng), unsafe.Pointer(&_sqlite3SavedPrng), u64(259)) +} + +// C comment +// /* +// ** This routine runs an extensive test of the Bitvec code. +// ** +// ** The input is an array of integers that acts as a program +// ** to test the Bitvec. The integers are opcodes followed +// ** by 0, 1, or 3 operands, depending on the opcode. Another +// ** opcode follows immediately after the last operand. +// ** +// ** There are 6 opcodes numbered from 0 through 5. 0 is the +// ** "halt" opcode and causes the test to end. +// ** +// ** 0 Halt and return the number of errors +// ** 1 N S X Set N bits beginning with S and incrementing by X +// ** 2 N S X Clear N bits beginning with S and incrementing by X +// ** 3 N Set N randomly chosen bits +// ** 4 N Clear N randomly chosen bits +// ** 5 N S X Set N bits from S increment X in array only, not in bitvec +// ** +// ** The opcodes 1 through 4 perform set and clear operations are performed +// ** on both a Bitvec object and on a linear array of bits obtained from malloc. +// ** Opcode 5 works on the linear array only, not on the Bitvec. +// ** Opcode 5 is used to deliberately induce a fault in order to +// ** confirm that error detection works. +// ** +// ** At the conclusion of the test the linear array is compared +// ** against the Bitvec object. If there are any differences, +// ** an error is returned. If they are the same, zero is returned. +// ** +// ** If a memory allocation error occurs, return -1. +// */ func _sqlite3BitvecBuiltinTest(tls *crt.TLS, _sz int32, _aOp *int32) (r0 int32) { var _rc, _i, _nx, _pc, _op int32 var _pTmpSpace unsafe.Pointer @@ -111544,7 +116311,7 @@ func _sqlite3BitvecBuiltinTest(tls *crt.TLS, _sz int32, _aOp *int32) (r0 int32) _sqlite3BitvecClear(tls, nil, uint32(i32(1)), _pTmpSpace) _pc = i32(0) _3: - if store1(&_op, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc)))) == i32(0) { + if store1(&_op, *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 4*uintptr(_pc)))) == i32(0) { goto _4 } switch _op { @@ -111564,19 +116331,19 @@ _3: _6: _nx = i32(4) - _i = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(2))))) - i32(1) + _i = (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 4*uintptr(_pc+i32(2))))) - i32(1) { - p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(2)))) - *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(3))))) + p := (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 4*uintptr(_pc+i32(2)))) + *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp)) + 4*uintptr(_pc+i32(3))))) sink1(*p) } goto _12 _9: _nx = i32(2) - Xsqlite3_randomness(tls, int32(u64(4)), (unsafe.Pointer)(&_i)) + Xsqlite3_randomness(tls, int32(u64(4)), unsafe.Pointer(&_i)) goto _12 _12: - if preInc1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+4*uintptr(_pc+i32(1)))), -1) > i32(0) { + if preInc1((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aOp))+4*uintptr(_pc+i32(1)))), -1) > i32(0) { _nx = i32(0) } { @@ -111589,7 +116356,7 @@ _12: goto _14 } { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3))))) *p = uint8(int32(*p) | (i32(1) << uint((_i+i32(1))&i32(7)))) sink2(*p) } @@ -111603,7 +116370,7 @@ _15: goto _17 _14: { - p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3))))) + p := (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3))))) *p = uint8(int32(*p) & (^(i32(1) << uint((_i+i32(1))&i32(7))))) sink2(*p) } @@ -111617,7 +116384,7 @@ _18: if _i > _sz { goto _bitvec_end } - if bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr(_i>>uint(i32(3))))))&(i32(1)<<uint(_i&i32(7)))) != i32(0)) != _sqlite3BitvecTest(tls, _pBitvec, uint32(_i)) { + if bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pV)) + 1*uintptr(_i>>uint(i32(3))))))&(i32(1)<<uint(_i&i32(7)))) != i32(0)) != _sqlite3BitvecTest(tls, _pBitvec, uint32(_i)) { _rc = _i goto _bitvec_end } @@ -111625,16 +116392,19 @@ _18: goto _18 _bitvec_end: Xsqlite3_free(tls, _pTmpSpace) - Xsqlite3_free(tls, (unsafe.Pointer)(_pV)) + Xsqlite3_free(tls, unsafe.Pointer(_pV)) _sqlite3BitvecDestroy(tls, _pBitvec) return _rc } -// Register hooks to call when sqlite3BeginBenignMalloc() and -// sqlite3EndBenignMalloc() are called, respectively. +// C comment +// /* +// ** Register hooks to call when sqlite3BeginBenignMalloc() and +// ** sqlite3EndBenignMalloc() are called, respectively. +// */ func _sqlite3BenignMallocHooks(tls *crt.TLS, _xBenignBegin func(*crt.TLS), _xBenignEnd func(*crt.TLS)) { - *(*func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Hooks.X0))) = _xBenignBegin - *(*func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Hooks.X1))) = _xBenignEnd + *(*func(*crt.TLS))(unsafe.Pointer(&_sqlite3Hooks.X0)) = _xBenignBegin + *(*func(*crt.TLS))(unsafe.Pointer(&_sqlite3Hooks.X1)) = _xBenignEnd } var _sqlite3_test_controlØ00__func__Ø000 [21]int8 @@ -111643,13 +116413,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_test_controlØ00__func__Ø000[0], str(129475), 21) } -// Enable or disable the extended result codes. +// C comment +// /* +// ** Enable or disable the extended result codes. +// */ func Xsqlite3_extended_result_codes(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(143970)) } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*int32)(unsafe.Pointer(&(_db.X11))) = int32(func() uint32 { + *(*int32)(unsafe.Pointer(&_db.X11)) = int32(func() uint32 { if _onoff != 0 { return u32(4294967295) } @@ -111659,10 +116432,13 @@ func Xsqlite3_extended_result_codes(tls *crt.TLS, _db *Xsqlite3, _onoff int32) ( return i32(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. +// C comment +// /* +// ** 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 *crt.TLS, _pDb *Xsqlite3, _pStmt unsafe.Pointer) (r0 unsafe.Pointer) { var _pNext unsafe.Pointer if _sqlite3SafetyCheckOk(tls, _pDb) == 0 { @@ -111696,12 +116472,15 @@ func Xsqlite3_status(tls *crt.TLS, _op int32, _pCurrent *int32, _pHighwater *int return _rc } -// Create an sqlite3_backup process to copy the contents of zSrcDb from -// connection handle pSrcDb to zDestDb in pDestDb. If successful, return -// a pointer to the new sqlite3_backup object. -// -// If an error occurs, NULL is returned and an error code and error message -// stored in database handle pDestDb. +// C comment +// /* +// ** Create an sqlite3_backup process to copy the contents of zSrcDb from +// ** connection handle pSrcDb to zDestDb in pDestDb. If successful, return +// ** a pointer to the new sqlite3_backup object. +// ** +// ** If an error occurs, NULL is returned and an error code and error message +// ** stored in database handle pDestDb. +// */ func Xsqlite3_backup_init(tls *crt.TLS, _pDestDb *Xsqlite3, _zDestDb *int8, _pSrcDb *Xsqlite3, _zSrcDb *int8) (r0 *Xsqlite3_backup) { var _p *Xsqlite3_backup if (_sqlite3SafetyCheckOk(tls, _pSrcDb) == 0) || (_sqlite3SafetyCheckOk(tls, _pDestDb) == 0) { @@ -111723,14 +116502,14 @@ _3: if _p == nil { goto _5 } - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = _findBtree(tls, _pDestDb, _pSrcDb, _zSrcDb) - *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _findBtree(tls, _pDestDb, _pDestDb, _zDestDb) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pDestDb - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = _pSrcDb - *(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(i32(1)) - *(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0) + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X6)))) = _findBtree(tls, _pDestDb, _pSrcDb, _zSrcDb) + *(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = _findBtree(tls, _pDestDb, _pDestDb, _zDestDb) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _pDestDb + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X5)))) = _pSrcDb + *(*uint32)(unsafe.Pointer(&_p.X4)) = uint32(i32(1)) + *(*int32)(unsafe.Pointer(&_p.X10)) = i32(0) if ((nil == (*XBtree)(_p.X6)) || (nil == (*XBtree)(_p.X1))) || (_checkReadTransaction(tls, _pDestDb, (*XBtree)(_p.X1)) != i32(0)) { - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) _p = nil } _5: @@ -111742,13 +116521,16 @@ _5: return _p } -// Return a pointer corresponding to database zDb (i.e. "main", "temp") -// in connection handle pDb. If such a database cannot be found, return -// a NULL pointer and write an error message to pErrorDb. -// -// 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. +// C comment +// /* +// ** Return a pointer corresponding to database zDb (i.e. "main", "temp") +// ** in connection handle pDb. If such a database cannot be found, return +// ** a NULL pointer and write an error message to pErrorDb. +// ** +// ** 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 *crt.TLS, _pErrorDb *Xsqlite3, _pDb *Xsqlite3, _zDb *int8) (r0 *XBtree) { var _i, _1_rc int32 var _1_sParse XParse @@ -111757,13 +116539,13 @@ func _findBtree(tls *crt.TLS, _pErrorDb *Xsqlite3, _pDb *Xsqlite3, _zDb *int8) ( goto _0 } _1_rc = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_1_sParse), i32(0), u64(600)) - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_sParse.X0))))) = _pDb + crt.Xmemset(tls, unsafe.Pointer(&_1_sParse), i32(0), u64(600)) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_sParse.X0)))) = _pDb if _sqlite3OpenTempDatabase(tls, &_1_sParse) != 0 { _sqlite3ErrorWithMsg(tls, _pErrorDb, _1_sParse.X3, str(24576), unsafe.Pointer(_1_sParse.X1)) _1_rc = i32(1) } - _sqlite3DbFree(tls, _pErrorDb, (unsafe.Pointer)(_1_sParse.X1)) + _sqlite3DbFree(tls, _pErrorDb, unsafe.Pointer(_1_sParse.X1)) _sqlite3ParserReset(tls, &_1_sParse) if _1_rc != 0 { return nil @@ -111779,10 +116561,13 @@ _0: panic(0) } -// Check that there is no open read-transaction on the b-tree passed as the -// 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. +// C comment +// /* +// ** Check that there is no open read-transaction on the b-tree passed as the +// ** 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 *crt.TLS, _db *Xsqlite3, _p *XBtree) (r0 int32) { if _sqlite3BtreeIsInReadTrans(tls, _p) != 0 { _sqlite3ErrorWithMsg(tls, _db, i32(1), str(129556)) @@ -111791,8 +116576,11 @@ func _checkReadTransaction(tls *crt.TLS, _db *Xsqlite3, _p *XBtree) (r0 int32) { return i32(0) } -// Return the total number of pages in the source database as of the most -// recent call to sqlite3_backup_step(). +// C comment +// /* +// ** 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 *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { if _p == nil { _sqlite3MisuseError(tls, i32(69569)) @@ -111801,8 +116589,11 @@ func Xsqlite3_backup_pagecount(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { return int32(_p.X9) } -// Return the number of pages still to be backed up as of the most recent -// call to sqlite3_backup_step(). +// C comment +// /* +// ** 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 *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { if _p == nil { _sqlite3MisuseError(tls, i32(69555)) @@ -111811,11 +116602,14 @@ func Xsqlite3_backup_remaining(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) { return int32(_p.X8) } -// Given the name of a compile-time option, return true if that option -// was used and false if not. -// -// The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix -// is not required for a match. +// C comment +// /* +// ** Given the name of a compile-time option, return true if that option +// ** was used and false if not. +// ** +// ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix +// ** is not required for a match. +// */ func Xsqlite3_compileoption_used(tls *crt.TLS, _zOptName *int8) (r0 int32) { var _i, _n int32 if _zOptName == nil { @@ -111825,7 +116619,7 @@ func Xsqlite3_compileoption_used(tls *crt.TLS, _zOptName *int8) (r0 int32) { if Xsqlite3_strnicmp(tls, _zOptName, str(129587), i32(7)) == i32(0) { { p := &_zOptName - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(7)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(7)))) sink0(*p) } } @@ -111835,7 +116629,7 @@ _2: if _i >= i32(6) { goto _5 } - if (Xsqlite3_strnicmp(tls, _zOptName, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 8*uintptr(_i))), _n) == i32(0)) && (_sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 8*uintptr(_i))))) + 1*uintptr(_n))))) == i32(0)) { + if (Xsqlite3_strnicmp(tls, _zOptName, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azCompileOpt)) + 8*uintptr(_i))), _n) == i32(0)) && (_sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azCompileOpt)) + 8*uintptr(_i))))) + 1*uintptr(_n))))) == i32(0)) { return i32(1) } _i += 1 @@ -111845,10 +116639,13 @@ _5: } func _sqlite3IsIdChar(tls *crt.TLS, _c uint8) (r0 int32) { - return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(_c)))) & i32(70)) != i32(0)) + return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(_c)))) & i32(70)) != i32(0)) } -// Configuration settings for an individual database connection +// C comment +// /* +// ** Configuration settings for an individual database connection +// */ func Xsqlite3_db_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) { var _rc, _3_sz, _3_cnt, _6_onoff, _6_oldFlags int32 var _4_i uint32 @@ -111882,7 +116679,7 @@ _5: if _4_i >= uint32(i32(5)) { goto _8 } - if ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X0) != _op { + if ((*t80)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X0) != _op { goto _9 } _6_onoff = crt.VAInt32(&_ap) @@ -111890,25 +116687,25 @@ _5: _6_oldFlags = _db.X6 if _6_onoff > i32(0) { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) - *p = int32(uint32(*p) | ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)) + p := (*int32)(unsafe.Pointer(&_db.X6)) + *p = int32(uint32(*p) | ((*t80)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)) sink1(*p) } goto _12 } if _6_onoff == i32(0) { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) - *p = int32(uint32(*p) & (^((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1))) + p := (*int32)(unsafe.Pointer(&_db.X6)) + *p = int32(uint32(*p) & (^((*t80)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1))) sink1(*p) } } _12: - if _6_oldFlags != (_db.X6) { + if _6_oldFlags != _db.X6 { _sqlite3ExpirePreparedStatements(tls, _db) } if _6_pRes != nil { - *_6_pRes = bool2int((uint32(_db.X6) & ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)) != uint32(i32(0))) + *_6_pRes = bool2int((uint32(_db.X6) & ((*t80)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)) != uint32(i32(0))) } _rc = i32(0) goto _8 @@ -111934,7 +116731,10 @@ func init() { }{t80{X0: i32(1002), X1: u32(524288)}, t80{X0: i32(1003), X1: u32(16777216)}, t80{X0: i32(1004), X1: u32(1073741824)}, t80{X0: i32(1005), X1: u32(4194304)}, t80{X0: i32(1006), X1: u32(2147483648)}} } -// Return the mutex associated with a database connection. +// C comment +// /* +// ** Return the mutex associated with a database connection. +// */ func Xsqlite3_db_mutex(tls *crt.TLS, _db *Xsqlite3) (r0 *Xsqlite3_mutex) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(141191)) @@ -111943,7 +116743,10 @@ func Xsqlite3_db_mutex(tls *crt.TLS, _db *Xsqlite3) (r0 *Xsqlite3_mutex) { return (*Xsqlite3_mutex)(_db.X3) } -// Query status information for a single database connection +// C comment +// /* +// ** Query status information for a single database connection +// */ func Xsqlite3_db_status(tls *crt.TLS, _db *Xsqlite3, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) { var _rc, _7_totalUsed, _7_i, _9_nByte, _11_i, _11_nByte, _16_nByte, _18_i, _18_nRet int32 var _8_pBt *XBtree @@ -111986,10 +116789,10 @@ func Xsqlite3_db_status(tls *crt.TLS, _db *Xsqlite3, _op int32, _pCurrent *int32 } _4: - *_pCurrent = (*t7)(unsafe.Pointer(&(_db.X58))).X3 - *_pHighwater = (*t7)(unsafe.Pointer(&(_db.X58))).X4 + *_pCurrent = (*t7)(unsafe.Pointer(&_db.X58)).X3 + *_pHighwater = (*t7)(unsafe.Pointer(&_db.X58)).X4 if _resetFlag != 0 { - *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X4))) = (*t7)(unsafe.Pointer(&(_db.X58))).X3 + *(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X4))) = (*t7)(unsafe.Pointer(&_db.X58)).X3 } goto _18 _5: @@ -112006,9 +116809,9 @@ _5: } }() *_pCurrent = i32(0) - *_pHighwater = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(_op-i32(4)))) + *_pHighwater = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X5))))) + 4*uintptr(_op-i32(4)))) if _resetFlag != 0 { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(_op-i32(4)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&_db.X58)).X5))))) + 4*uintptr(_op-i32(4)))) = i32(0) } goto _18 _8: @@ -112016,7 +116819,7 @@ _8: _sqlite3BtreeEnterAll(tls, _db) _7_i = i32(0) _24: - if _7_i >= (_db.X5) { + if _7_i >= _db.X5 { goto _27 } _8_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_7_i))).X1) @@ -112044,10 +116847,10 @@ _27: _10: _11_nByte = i32(0) _sqlite3BtreeEnterAll(tls, _db) - *(**int32)(unsafe.Pointer(&(_db.X79))) = &_11_nByte + *(**int32)(unsafe.Pointer(&_db.X79)) = &_11_nByte _11_i = i32(0) _30: - if _11_i >= (_db.X5) { + if _11_i >= _db.X5 { goto _33 } _12_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_11_i))).X4) @@ -112065,30 +116868,30 @@ _30: } { p := &_11_nByte - *p = int32(uint32(*p) + (uint32(((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, int32(u64(32)))) * (((((*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X1) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X1)) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X3))).X1)) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X5))).X1)))) + *p = int32(uint32(*p) + (uint32(((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X4)(tls, int32(u64(32)))) * (((((*XHash)(unsafe.Pointer(&_12_pSchema.X2)).X1) + ((*XHash)(unsafe.Pointer(&_12_pSchema.X4)).X1)) + ((*XHash)(unsafe.Pointer(&_12_pSchema.X3)).X1)) + ((*XHash)(unsafe.Pointer(&_12_pSchema.X5)).X1)))) sink1(*p) } { p := &_11_nByte - *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X3)) + *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&_12_pSchema.X2)).X3)) sink1(*p) } { p := &_11_nByte - *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X3)) + *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&_12_pSchema.X4)).X3)) sink1(*p) } { p := &_11_nByte - *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X3))).X3)) + *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&_12_pSchema.X3)).X3)) sink1(*p) } { p := &_11_nByte - *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X5))).X3)) + *p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&_12_pSchema.X5)).X3)) sink1(*p) } - _13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X2) + _13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&_12_pSchema.X4)).X2) _37: if _13_p == nil { goto _40 @@ -112097,7 +116900,7 @@ _37: _13_p = (*XHashElem)(_13_p.X0) goto _37 _40: - _13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X2) + _13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&_12_pSchema.X2)).X2) _41: if _13_p == nil { goto _44 @@ -112110,25 +116913,25 @@ _36: _11_i += 1 goto _30 _33: - *(**int32)(unsafe.Pointer(&(_db.X79))) = nil + *(**int32)(unsafe.Pointer(&_db.X79)) = nil _sqlite3BtreeLeaveAll(tls, _db) *_pHighwater = i32(0) *_pCurrent = _11_nByte goto _18 _11: _16_nByte = i32(0) - *(**int32)(unsafe.Pointer(&(_db.X79))) = &_16_nByte + *(**int32)(unsafe.Pointer(&_db.X79)) = &_16_nByte _16_pVdbe = (*TVdbe)(_db.X1) _45: if _16_pVdbe == nil { goto _48 } _sqlite3VdbeClearObject(tls, _db, _16_pVdbe) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_16_pVdbe)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_16_pVdbe)) _16_pVdbe = (*TVdbe)(_16_pVdbe.X2) goto _45 _48: - *(**int32)(unsafe.Pointer(&(_db.X79))) = nil + *(**int32)(unsafe.Pointer(&_db.X79)) = nil *_pHighwater = i32(0) *_pCurrent = _16_nByte goto _18 @@ -112138,10 +116941,10 @@ _12: i32(0) _18_i = i32(0) _49: - if _18_i >= (_db.X5) { + if _18_i >= _db.X5 { goto _52 } - if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_18_i))).X1) != nil { + if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_18_i))).X1) != nil { _20_pPager = _sqlite3BtreePager(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+32*uintptr(_18_i))).X1)) _sqlite3PagerCacheStat(tls, _20_pPager, _op, _resetFlag, &_18_nRet) } @@ -112153,7 +116956,7 @@ _52: goto _18 _15: *_pHighwater = i32(0) - *_pCurrent = bool2int(((_db.X78) > int64(i32(0))) || ((_db.X77) > int64(i32(0)))) + *_pCurrent = bool2int((_db.X78 > int64(i32(0))) || (_db.X77 > int64(i32(0)))) goto _18 _16: _rc = i32(1) @@ -112168,12 +116971,15 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_db_statusØ00__func__Ø000[0], str(129670), 18) } -// Return the approximate number of bytes of memory currently -// used by the pager and its associated cache. +// C comment +// /* +// ** Return the approximate number of bytes of memory currently +// ** used by the pager and its associated cache. +// */ func _sqlite3PagerMemUsed(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _perPageSize int32 - _perPageSize = int32((uint64((_pPager.X48)+int32(_pPager.X44)) + u64(72)) + u64(40)) - return ((_perPageSize * _sqlite3PcachePagecount(tls, (*XPCache)(_pPager.X59))) + _sqlite3MallocSize(tls, (unsafe.Pointer)(_pPager))) + (_pPager.X48) + _perPageSize = int32((uint64(_pPager.X48+int32(_pPager.X44)) + u64(72)) + u64(40)) + return ((_perPageSize * _sqlite3PcachePagecount(tls, (*XPCache)(_pPager.X59))) + _sqlite3MallocSize(tls, unsafe.Pointer(_pPager))) + _pPager.X48 } func Xsqlite3_msize(tls *crt.TLS, _p unsafe.Pointer) (r0 uint64) { @@ -112181,17 +116987,20 @@ func Xsqlite3_msize(tls *crt.TLS, _p unsafe.Pointer) (r0 uint64) { i32(0) return uint64(func() int32 { if _p != nil { - return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p) + return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&_sqlite3Config.X10)).X3)(tls, _p) } return i32(0) }()) } -// Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or -// SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the -// current cache hit or miss count, according to the value of eStat. If the -// reset parameter is non-zero, the cache hit or miss count is zeroed before -// returning. +// C comment +// /* +// ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or +// ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the +// ** current cache hit or miss count, according to the value of eStat. If the +// ** reset parameter is non-zero, the cache hit or miss count is zeroed before +// ** returning. +// */ func _sqlite3PagerCacheStat(tls *crt.TLS, _pPager *XPager, _eStat int32, _reset int32, _pnVal *int32) { func() { if _eStat != i32(7) && _eStat != i32(8) && _eStat != i32(9) { @@ -112204,11 +117013,11 @@ func _sqlite3PagerCacheStat(tls *crt.TLS, _pPager *XPager, _eStat int32, _reset i32(0) { p := _pnVal - *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(_eStat-i32(7))))) + *p = (*p) + (*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(_eStat-i32(7))))) sink1(*p) } if _reset != 0 { - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(_eStat-i32(7)))) = i32(0) + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]int32)(unsafe.Pointer(&_pPager.X55)))) + 4*uintptr(_eStat-i32(7)))) = i32(0) } } @@ -112222,13 +117031,16 @@ func Xsqlite3_extended_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) { return _sqlite3MisuseError(tls, i32(142786)) } - if (_db == nil) || ((_db.X17) != 0) { + if (_db == nil) || (_db.X17 != 0) { return _sqlite3NomemError(tls, i32(142789)) } return _db.X10 } -// Return the value of a status counter for a prepared statement +// C comment +// /* +// ** Return the value of a status counter for a prepared statement +// */ func Xsqlite3_stmt_status(tls *crt.TLS, _pStmt unsafe.Pointer, _op int32, _resetFlag int32) (r0 int32) { var _v uint32 var _pVdbe *TVdbe @@ -112237,21 +117049,24 @@ func Xsqlite3_stmt_status(tls *crt.TLS, _pStmt unsafe.Pointer, _op int32, _reset _sqlite3MisuseError(tls, i32(77706)) return i32(0) } - _v = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pVdbe.X35))))) + 4*uintptr(_op))) + _v = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pVdbe.X35)))) + 4*uintptr(_op))) if _resetFlag != 0 { - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pVdbe.X35))))) + 4*uintptr(_op))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[5]uint32)(unsafe.Pointer(&_pVdbe.X35)))) + 4*uintptr(_op))) = uint32(i32(0)) } return int32(_v) } -// Move an existing blob handle to point to a different row of the same -// database table. -// -// If an error occurs, or if the specified row does not exist or does not -// contain a blob or text value, then an error code is returned and the -// database handle error code and message set. If this happens, then all -// subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) -// immediately return SQLITE_ABORT. +// C comment +// /* +// ** Move an existing blob handle to point to a different row of the same +// ** database table. +// ** +// ** If an error occurs, or if the specified row does not exist or does not +// ** contain a blob or text value, then an error code is returned and the +// ** database handle error code and message set. If this happens, then all +// ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) +// ** immediately return SQLITE_ABORT. +// */ func Xsqlite3_blob_reopen(tls *crt.TLS, _pBlob unsafe.Pointer, _iRow int64) (r0 int32) { var _rc int32 var _2_zErr *int8 @@ -112275,7 +117090,7 @@ func Xsqlite3_blob_reopen(tls *crt.TLS, _pBlob unsafe.Pointer, _iRow int64) (r0 } return nil }(), unsafe.Pointer(_2_zErr)) - _sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_zErr)) + _sqlite3DbFree(tls, _db, unsafe.Pointer(_2_zErr)) } func() { if _rc == i32(17) { @@ -112301,9 +117116,12 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_blob_reopenØ00__func__Ø000[0], str(129865), 20) } -// Call from within the xCreate() or xConnect() methods to provide -// the SQLite core with additional information about the behavior -// of the virtual table being implemented. +// C comment +// /* +// ** Call from within the xCreate() or xConnect() methods to provide +// ** the SQLite core with additional information about the behavior +// ** of the virtual table being implemented. +// */ func Xsqlite3_vtab_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) { var _rc int32 var _ap []interface{} @@ -112354,11 +117172,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_vtab_configØ00__func__Ø000[0], str(129918), 20) } -// Return the ON CONFLICT resolution mode in effect for the virtual -// table update operation currently in progress. -// -// The results of this routine are undefined unless it is called from -// within an xUpdate method. +// C comment +// /* +// ** Return the ON CONFLICT resolution mode in effect for the virtual +// ** table update operation currently in progress. +// ** +// ** The results of this routine are undefined unless it is called from +// ** within an xUpdate method. +// */ func Xsqlite3_vtab_on_conflict(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(126182)) @@ -112371,7 +117192,7 @@ func Xsqlite3_vtab_on_conflict(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { crt.X__builtin_abort(tls) } }() - return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_vtab_on_conflictØ00aMapØ001)) + 1*uintptr(int32(_db.X22)-i32(1))))) + return int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_vtab_on_conflictØ00aMapØ001)) + 1*uintptr(int32(_db.X22)-i32(1))))) } var _sqlite3_vtab_on_conflictØ00__func__Ø000 [25]int8 @@ -112390,8 +117211,11 @@ func Xsqlite3_close_v2(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return _sqlite3Close(tls, _db, i32(1)) } -// Return the filename of the database associated with a database -// connection. +// C comment +// /* +// ** Return the filename of the database associated with a database +// ** connection. +// */ func Xsqlite3_db_filename(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *int8) { var _pBt *XBtree if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -112407,8 +117231,11 @@ func Xsqlite3_db_filename(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *int8 }() } -// Return 1 if database is read-only or 0 if read/write. Return -1 if -// no such database exists. +// C comment +// /* +// ** Return 1 if database is read-only or 0 if read/write. Return -1 if +// ** no such database exists. +// */ func Xsqlite3_db_readonly(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 int32) { var _pBt *XBtree if _sqlite3SafetyCheckOk(tls, _db) == 0 { @@ -112424,15 +117251,21 @@ func Xsqlite3_db_readonly(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 int32 }() } -// Return a string that describes the kind of error specified in the -// argument. For now, this simply calls the internal sqlite3ErrStr() -// function. +// C comment +// /* +// ** Return a string that describes the kind of error specified in the +// ** argument. For now, this simply calls the internal sqlite3ErrStr() +// ** function. +// */ func Xsqlite3_errstr(tls *crt.TLS, _rc int32) (r0 *int8) { return _sqlite3ErrStr(tls, _rc) } -// Return true if the prepared statement is guaranteed to not modify the -// database. +// C comment +// /* +// ** Return true if the prepared statement is guaranteed to not modify the +// ** database. +// */ func Xsqlite3_stmt_readonly(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { return int32(func() uint32 { if _pStmt != nil { @@ -112442,7 +117275,10 @@ func Xsqlite3_stmt_readonly(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) { }()) } -// Return a 64-bit integer value for a query parameter. +// C comment +// /* +// ** Return a 64-bit integer value for a query parameter. +// */ func Xsqlite3_uri_int64(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int64) (r0 int64) { var _v int64 var _z *int8 @@ -112453,8 +117289,11 @@ func Xsqlite3_uri_int64(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt in return _bDflt } -// Register a statically linked extension that is automatically -// loaded by every new database connection. +// C comment +// /* +// ** Register a statically linked extension that is automatically +// ** loaded by every new database connection. +// */ func Xsqlite3_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) { var _rc int32 var _2_i uint32 @@ -112470,27 +117309,27 @@ func Xsqlite3_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) { Xsqlite3_mutex_enter(tls, _2_mutex) _2_i = uint32(i32(0)) _2: - if _2_i >= (_sqlite3Autoext.X0) { + if _2_i >= _sqlite3Autoext.X0 { goto _5 } - if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_2_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) { + if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_2_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) { goto _5 } _2_i += 1 goto _2 _5: - if _2_i != (_sqlite3Autoext.X0) { + if _2_i != _sqlite3Autoext.X0 { goto _7 } - _4_nByte = uint64((_sqlite3Autoext.X0)+uint32(i32(1))) * u64(8) - _4_aNew = (*func(*crt.TLS))(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_sqlite3Autoext.X1), _4_nByte)) + _4_nByte = uint64(_sqlite3Autoext.X0+uint32(i32(1))) * u64(8) + _4_aNew = (*func(*crt.TLS))(Xsqlite3_realloc64(tls, unsafe.Pointer(_sqlite3Autoext.X1), _4_nByte)) if _4_aNew == nil { _rc = _sqlite3NomemError(tls, i32(112498)) goto _9 } - *(**func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Autoext.X1))) = _4_aNew - *(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_sqlite3Autoext.X0))) = _xInit - *(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) += 1 + *(**func(*crt.TLS))(unsafe.Pointer(&_sqlite3Autoext.X1)) = _4_aNew + *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_sqlite3Autoext.X0))) = _xInit + *(*uint32)(unsafe.Pointer(&_sqlite3Autoext.X0)) += 1 _9: _7: Xsqlite3_mutex_leave(tls, _2_mutex) @@ -112515,9 +117354,10 @@ func Xsqlite3_bind_blob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77435), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_bind_blob64Ø00__func__Ø000))), unsafe.Pointer(str(130033))) crt.X__builtin_abort(tls) } @@ -112540,9 +117380,10 @@ func _invokeValueDestructor(tls *crt.TLS, _p unsafe.Pointer, _xDel func(*crt.TLS f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76411), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeValueDestructorØ00__func__Ø000))), unsafe.Pointer(str(130033))) crt.X__builtin_abort(tls) } @@ -112558,7 +117399,10 @@ func _invokeValueDestructor(tls *crt.TLS, _p unsafe.Pointer, _xDel func(*crt.TLS f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { goto _5 } _xDel(tls, _p) @@ -112581,20 +117425,21 @@ func Xsqlite3_bind_text64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77491), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_bind_text64Ø00__func__Ø000))), unsafe.Pointer(str(130033))) crt.X__builtin_abort(tls) } }() if _nData > uint64(i32(2147483647)) { - return _invokeValueDestructor(tls, (unsafe.Pointer)(_zData), _xDel, nil) + return _invokeValueDestructor(tls, unsafe.Pointer(_zData), _xDel, nil) } if int32(_enc) == i32(4) { _enc = uint8(i32(2)) } - return _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_zData), int32(_nData), _xDel, _enc) + return _bindText(tls, _pStmt, _i, unsafe.Pointer(_zData), int32(_nData), _xDel, _enc) } var _sqlite3_bind_text64Ø00__func__Ø000 [20]int8 @@ -112603,13 +117448,16 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_bind_text64Ø00__func__Ø000[0], str(130096), 20) } -// Cancel a prior call to sqlite3_auto_extension. Remove xInit from the -// set of routines that is invoked for each new database connection, if it -// is currently on the list. If xInit is not on the list, then this -// routine is a no-op. -// -// Return 1 if xInit was found on the list and removed. Return 0 if xInit -// was not on the list. +// C comment +// /* +// ** Cancel a prior call to sqlite3_auto_extension. Remove xInit from the +// ** set of routines that is invoked for each new database connection, if it +// ** is currently on the list. If xInit is not on the list, then this +// ** routine is a no-op. +// ** +// ** Return 1 if xInit was found on the list and removed. Return 0 if xInit +// ** was not on the list. +// */ func Xsqlite3_cancel_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) { var _i, _n int32 var _mutex *Xsqlite3_mutex @@ -112621,9 +117469,9 @@ _0: if _i < i32(0) { goto _3 } - if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) { - *(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) -= 1 - *(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_i))) = *(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 8*uintptr(_sqlite3Autoext.X0))) + if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) { + *(*uint32)(unsafe.Pointer(&_sqlite3Autoext.X0)) -= 1 + *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_i))) = *(*func(*crt.TLS))(unsafe.Pointer(uintptr(unsafe.Pointer(_sqlite3Autoext.X1)) + 8*uintptr(_sqlite3Autoext.X0))) _n += 1 goto _3 } @@ -112634,15 +117482,18 @@ _3: return _n } -// Reset the automatic extension loading mechanism. +// C comment +// /* +// ** Reset the automatic extension loading mechanism. +// */ func Xsqlite3_reset_auto_extension(tls *crt.TLS) { var _1_mutex *Xsqlite3_mutex if Xsqlite3_initialize(tls) == i32(0) { _1_mutex = _sqlite3MutexAlloc(tls, i32(2)) Xsqlite3_mutex_enter(tls, _1_mutex) - Xsqlite3_free(tls, (unsafe.Pointer)(_sqlite3Autoext.X1)) - *(**func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Autoext.X1))) = nil - *(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) = uint32(i32(0)) + Xsqlite3_free(tls, unsafe.Pointer(_sqlite3Autoext.X1)) + *(**func(*crt.TLS))(unsafe.Pointer(&_sqlite3Autoext.X1)) = nil + *(*uint32)(unsafe.Pointer(&_sqlite3Autoext.X0)) = uint32(i32(0)) Xsqlite3_mutex_leave(tls, _1_mutex) } } @@ -112659,9 +117510,10 @@ func Xsqlite3_result_blob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Poi f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76439), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_blob64Ø00__func__Ø000))), unsafe.Pointer(str(130033))) crt.X__builtin_abort(tls) } @@ -112692,9 +117544,10 @@ func Xsqlite3_result_text64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n f func(*crt.TLS, unsafe.Pointer) }{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) - }{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize})))})) { + }{func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()})) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text64Ø00__func__Ø000))), unsafe.Pointer(str(130033))) crt.X__builtin_abort(tls) } @@ -112703,7 +117556,7 @@ func Xsqlite3_result_text64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n _enc = uint8(i32(2)) } if _n > uint64(i32(2147483647)) { - _invokeValueDestructor(tls, (unsafe.Pointer)(_z), _xDel, _pCtx) + _invokeValueDestructor(tls, unsafe.Pointer(_z), _xDel, _pCtx) goto _6 } _setResultStrOrError(tls, _pCtx, _z, int32(_n), _enc, _xDel) @@ -112716,7 +117569,9 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_text64Ø00__func__Ø000[0], str(130138), 22) } -// Make a copy of an sqlite3_value object +// C comment +// /* Make a copy of an sqlite3_value object +// */ func Xsqlite3_value_dup(tls *crt.TLS, _pOrig *XMem) (r0 *XMem) { var _pNew *XMem if _pOrig == nil { @@ -112726,24 +117581,24 @@ func Xsqlite3_value_dup(tls *crt.TLS, _pOrig *XMem) (r0 *XMem) { if _pNew == nil { return nil } - crt.Xmemset(tls, (unsafe.Pointer)(_pNew), i32(0), u64(72)) - crt.Xmemcpy(tls, (unsafe.Pointer)(_pNew), (unsafe.Pointer)(_pOrig), u64(24)) + crt.Xmemset(tls, unsafe.Pointer(_pNew), i32(0), u64(72)) + crt.Xmemcpy(tls, unsafe.Pointer(_pNew), unsafe.Pointer(_pOrig), u64(24)) { - p := (*uint16)(unsafe.Pointer(&(_pNew.X1))) + p := (*uint16)(unsafe.Pointer(&_pNew.X1)) *p = uint16(int32(*p) & i32(-1025)) sink14(*p) } - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X9))))) = nil + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X9)))) = nil if (int32(_pNew.X1) & i32(18)) == 0 { goto _2 } { - p := (*uint16)(unsafe.Pointer(&(_pNew.X1))) + p := (*uint16)(unsafe.Pointer(&_pNew.X1)) *p = uint16(int32(*p) & i32(-3073)) sink14(*p) } { - p := (*uint16)(unsafe.Pointer(&(_pNew.X1))) + p := (*uint16)(unsafe.Pointer(&_pNew.X1)) *p = uint16(int32(*p) | i32(4096)) sink14(*p) } @@ -112755,8 +117610,10 @@ _2: return _pNew } -// Destroy an sqlite3_value object previously obtained from -// sqlite3_value_dup(). +// C comment +// /* Destroy an sqlite3_value object previously obtained from +// ** sqlite3_value_dup(). +// */ func Xsqlite3_value_free(tls *crt.TLS, _pOld *XMem) { _sqlite3ValueFree(tls, _pOld) } @@ -112770,7 +117627,7 @@ func Xsqlite3_result_zeroblob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _n uint64 crt.X__builtin_abort(tls) } }() - if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pOut.X9).X31))))) + 4*uintptr(i32(0))))) { + if _n > uint64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pOut.X9).X31))))) + 4*uintptr(i32(0))))) { return i32(18) } _sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.X0), int32(_n)) @@ -112788,7 +117645,7 @@ func Xsqlite3_bind_zeroblob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n var _p *TVdbe _p = (*TVdbe)(_pStmt) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) - if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(0))))) { + if _n > uint64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(0))))) { _rc = i32(18) goto _1 } @@ -112831,9 +117688,9 @@ func Xsqlite3_result_subtype(tls *crt.TLS, _pCtx *Xsqlite3_context, _eSubtype ui crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pOut.X3))) = uint8(_eSubtype & uint32(i32(255))) + *(*uint8)(unsafe.Pointer(&_pOut.X3)) = uint8(_eSubtype & uint32(i32(255))) { - p := (*uint16)(unsafe.Pointer(&(_pOut.X1))) + p := (*uint16)(unsafe.Pointer(&_pOut.X1)) *p = uint16(int32(*p) | i32(32768)) sink14(*p) } @@ -112845,8 +117702,11 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_result_subtypeØ00__func__Ø000[0], str(130266), 23) } -// Flush any dirty pages in the pager-cache for any attached database -// to disk. +// C comment +// /* +// ** Flush any dirty pages in the pager-cache for any attached database +// ** to disk. +// */ func Xsqlite3_db_cacheflush(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { var _i, _rc, _bSeenBusy int32 var _1_pBt *XBtree @@ -112860,7 +117720,7 @@ func Xsqlite3_db_cacheflush(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { _sqlite3BtreeEnterAll(tls, _db) _i = i32(0) _1: - if _rc != i32(0) || _i >= (_db.X5) { + if _rc != i32(0) || _i >= _db.X5 { goto _5 } _1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 32*uintptr(_i))).X1) @@ -112887,12 +117747,15 @@ _5: }() } -// Flush all unreferenced dirty pages to disk. +// C comment +// /* +// ** Flush all unreferenced dirty pages to disk. +// */ func _sqlite3PagerFlush(tls *crt.TLS, _pPager *XPager) (r0 int32) { var _rc int32 var _1_pList, _2_pNext *XPgHdr _rc = _pPager.X26 - if (_pPager.X13) != 0 { + if _pPager.X13 != 0 { goto _0 } _1_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59)) @@ -112908,7 +117771,7 @@ _3: } _2_pNext = (*XPgHdr)(_1_pList.X3) if int32(_1_pList.X7) == i32(0) { - _rc = _pagerStress(tls, (unsafe.Pointer)(_pPager), _1_pList) + _rc = _pagerStress(tls, unsafe.Pointer(_pPager), _1_pList) } _1_pList = _2_pNext goto _3 @@ -112926,13 +117789,15 @@ func init() { func Xsqlite3_system_errno(tls *crt.TLS, _db *Xsqlite3) (r0 int32) { return func() int32 { if _db != nil { - return (_db.X12) + return _db.X12 } return i32(0) }() } -// Register a trace callback using the version-2 interface. +// C comment +// /* Register a trace callback using the version-2 interface. +// */ func Xsqlite3_trace_v2(tls *crt.TLS, _db *Xsqlite3, _mTrace uint32, _xTrace func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 int32) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { return _sqlite3MisuseError(tls, i32(142326)) @@ -112948,20 +117813,23 @@ func Xsqlite3_trace_v2(tls *crt.TLS, _db *Xsqlite3, _mTrace uint32, _xTrace func }{nil})) { _mTrace = uint32(i32(0)) } - *(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(_mTrace) - *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X41))) = _xTrace - *(*unsafe.Pointer)(unsafe.Pointer(&(_db.X42))) = _pArg + *(*uint8)(unsafe.Pointer(&_db.X24)) = uint8(_mTrace) + *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&_db.X41)) = _xTrace + *(*unsafe.Pointer)(unsafe.Pointer(&_db.X42)) = _pArg Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) return i32(0) } -// Return the SQL associated with a prepared statement with -// bound parameters expanded. Space to hold the returned string is -// obtained from sqlite3_malloc(). The caller is responsible for -// freeing the returned string by passing it to sqlite3_free(). -// -// The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of -// expanded bound parameters. +// C comment +// /* +// ** Return the SQL associated with a prepared statement with +// ** bound parameters expanded. Space to hold the returned string is +// ** obtained from sqlite3_malloc(). The caller is responsible for +// ** freeing the returned string by passing it to sqlite3_free(). +// ** +// ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of +// ** expanded bound parameters. +// */ func Xsqlite3_expanded_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) { var _z, _zSql *int8 var _1_p *TVdbe @@ -112976,14 +117844,17 @@ func Xsqlite3_expanded_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) { return _z } -// Set the value returned by the sqlite3_last_insert_rowid() API function. +// C comment +// /* +// ** Set the value returned by the sqlite3_last_insert_rowid() API function. +// */ func Xsqlite3_set_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3, _iRowid int64) { if _sqlite3SafetyCheckOk(tls, _db) == 0 { _sqlite3MisuseError(tls, i32(141398)) return } Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) - *(*int64)(unsafe.Pointer(&(_db.X7))) = _iRowid + *(*int64)(unsafe.Pointer(&_db.X7)) = _iRowid Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3)) } @@ -112996,7 +117867,7 @@ func _compileoptionusedFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int3 } }() - if store0(&_zOptName, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))))) != nil { + if store0(&_zOptName, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))))) != nil { Xsqlite3_result_int(tls, _context, Xsqlite3_compileoption_used(tls, _zOptName)) } } @@ -113016,7 +117887,7 @@ func _compileoptiongetFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32 } }() - _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) Xsqlite3_result_text(tls, _context, Xsqlite3_compileoption_get(tls, _n), i32(-1), nil) } @@ -113026,32 +117897,38 @@ func init() { crt.Xstrncpy(nil, &_compileoptiongetFuncØ00__func__Ø000[0], str(130329), 21) } -// Implementation of the sqlite_version() function. The result is the version -// of the SQLite library that is running. +// C comment +// /* +// ** Implementation of the sqlite_version() function. The result is the version +// ** of the SQLite library that is running. +// */ func _versionFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { _ = _NotUsed2 Xsqlite3_result_text(tls, _context, Xsqlite3_libversion(tls), i32(-1), nil) } -// Implementation of the TRIM(), LTRIM(), and RTRIM() functions. -// The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both. +// C comment +// /* +// ** Implementation of the TRIM(), LTRIM(), and RTRIM() functions. +// ** The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both. +// */ func _trimFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nIn, _flags, _i, _nChar, _17_len, _20_len int32 var _zIn, _zCharSet, _aLen, _4_z *uint8 var _azChar **uint8 _aLen = nil _azChar = nil - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == i32(5) { return } - _zIn = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _zIn = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _zIn == nil { return } - _nIn = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _nIn = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _zIn != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + if _zIn != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106818), unsafe.Pointer((*int8)(unsafe.Pointer(&_trimFuncØ00__func__Ø000))), unsafe.Pointer(str(130350))) crt.X__builtin_abort(tls) } @@ -113063,7 +117940,7 @@ func _trimFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XM _zCharSet = nil goto _7 } - if store13(&_zCharSet, Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))))) == nil { + if store13(&_zCharSet, Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))))) == nil { return } *func() *int32 { _4_z = _zCharSet; return &_nChar }() = i32(0) @@ -113090,13 +117967,13 @@ _11: if _azChar == nil { return } - _aLen = (*uint8)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 8*uintptr(_nChar))))) + _aLen = (*uint8)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azChar)) + 8*uintptr(_nChar))))) *func() *int32 { _4_z = _zCharSet; return &_nChar }() = i32(0) _17: if (*_4_z) == 0 { goto _20 } - *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 8*uintptr(_nChar))) = _4_z + *(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azChar)) + 8*uintptr(_nChar))) = _4_z if int32(*postInc13(&_4_z, 1)) < i32(192) { goto _21 } @@ -113106,7 +117983,7 @@ _22: goto _22 } _21: - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_nChar))) = uint8(int64((uintptr(unsafe.Pointer(_4_z)) - uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 8*uintptr(_nChar)))))) / 1)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLen)) + 1*uintptr(_nChar))) = uint8(int64((uintptr(unsafe.Pointer(_4_z)) - uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azChar)) + 8*uintptr(_nChar)))))) / 1)) _nChar += 1 goto _17 _20: @@ -113129,8 +118006,8 @@ _28: if _i >= _nChar { goto _31 } - _17_len = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_i)))) - if (_17_len <= _nIn) && (crt.Xmemcmp(tls, (unsafe.Pointer)(_zIn), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 8*uintptr(_i)))), uint64(_17_len)) == i32(0)) { + _17_len = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLen)) + 1*uintptr(_i)))) + if (_17_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer(_zIn), unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azChar)) + 8*uintptr(_i)))), uint64(_17_len)) == i32(0)) { goto _31 } _i += 1 @@ -113141,7 +118018,7 @@ _31: } { p := &_zIn - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_17_len))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_17_len))) sink13(*p) } { @@ -113165,8 +118042,8 @@ _38: if _i >= _nChar { goto _41 } - _20_len = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_i)))) - if (_20_len <= _nIn) && (crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn))+1*uintptr(_nIn-_20_len)))), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 8*uintptr(_i)))), uint64(_20_len)) == i32(0)) { + _20_len = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aLen)) + 1*uintptr(_i)))) + if (_20_len <= _nIn) && (crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn))+1*uintptr(_nIn-_20_len)))), unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azChar)) + 8*uintptr(_i)))), uint64(_20_len)) == i32(0)) { goto _41 } _i += 1 @@ -113184,10 +118061,13 @@ _41: _37: _35: if _zCharSet != nil { - Xsqlite3_free(tls, (unsafe.Pointer)(_azChar)) + Xsqlite3_free(tls, unsafe.Pointer(_azChar)) } _24: - Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zIn)), _nIn, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zIn)), _nIn, func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } var _trimFuncØ00__func__Ø000 [9]int8 @@ -113208,11 +118088,14 @@ func init() { _trimFuncØ00azOneØ002 = [1]*uint8{(*byte)(unsafe.Pointer(str(119934)))} } -// Allocate nByte bytes of space using sqlite3Malloc(). If the -// allocation fails, call sqlite3_result_error_nomem() to notify -// the database handle that malloc() has failed and return NULL. -// If nByte is larger than the maximum string or blob length, then -// raise an SQLITE_TOOBIG exception and return NULL. +// C comment +// /* +// ** Allocate nByte bytes of space using sqlite3Malloc(). If the +// ** allocation fails, call sqlite3_result_error_nomem() to notify +// ** the database handle that malloc() has failed and return NULL. +// ** If nByte is larger than the maximum string or blob length, then +// ** raise an SQLITE_TOOBIG exception and return NULL. +// */ func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 unsafe.Pointer) { var _z *int8 var _db *Xsqlite3 @@ -113223,7 +118106,7 @@ func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 crt.X__builtin_abort(tls) } }() - if _nByte > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) { + if _nByte > int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) { Xsqlite3_result_error_toobig(tls, _context) _z = nil goto _3 @@ -113233,7 +118116,7 @@ func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 Xsqlite3_result_error_nomem(tls, _context) } _3: - return (unsafe.Pointer)(_z) + return unsafe.Pointer(_z) } var _contextMallocØ00__func__Ø000 [14]int8 @@ -113242,7 +118125,10 @@ func init() { crt.Xstrncpy(nil, &_contextMallocØ00__func__Ø000[0], str(130400), 14) } -// Implementation of the non-aggregate min() and max() functions +// C comment +// /* +// ** Implementation of the non-aggregate min() and max() functions +// */ func _minmaxFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _i, _mask, _iBest int32 var _pColl *XCollSeq @@ -113272,7 +118158,7 @@ func _minmaxFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** } }() _iBest = i32(0) - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == i32(5) { return } _i = i32(1) @@ -113280,16 +118166,16 @@ _10: if _i >= _argc { goto _13 } - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) == i32(5) { return } - if (_sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_iBest))), *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))), _pColl) ^ _mask) >= i32(0) { + if (_sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_iBest))), *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))), _pColl) ^ _mask) >= i32(0) { _iBest = _i } _i += 1 goto _10 _13: - Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_iBest)))) + Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_iBest)))) } var _minmaxFuncØ00__func__Ø000 [11]int8 @@ -113298,7 +118184,10 @@ func init() { crt.Xstrncpy(nil, &_minmaxFuncØ00__func__Ø000[0], str(130447), 11) } -// Return the collating function associated with a function. +// C comment +// /* +// ** Return the collating function associated with a function. +// */ func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XCollSeq) { var _pOp *XVdbeOp func() { @@ -113307,7 +118196,7 @@ func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XColl crt.X__builtin_abort(tls) } }() - _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*TVdbe)(_context.X3).X17) + 32*uintptr((_context.X4)-i32(1)))) + _pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*TVdbe)(_context.X3).X17) + 32*uintptr(_context.X4-i32(1)))) func() { if int32(_pOp.X0) != i32(68) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105568), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000))), unsafe.Pointer(str(130476))) @@ -113320,7 +118209,7 @@ func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XColl crt.X__builtin_abort(tls) } }() - return (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) + return (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&_pOp.X6))))) } var _sqlite3GetFuncCollSeqØ00__func__Ø000 [22]int8 @@ -113329,26 +118218,29 @@ func init() { crt.Xstrncpy(nil, &_sqlite3GetFuncCollSeqØ00__func__Ø000[0], str(130500), 22) } -// Routines to implement min() and max() aggregate functions. +// C comment +// /* +// ** Routines to implement min() and max() aggregate functions. +// */ func _minmaxStep(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _2_max, _2_cmp int32 var _pArg, _pBest *XMem var _2_pColl *XCollSeq - _pArg = *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))) + _pArg = *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))) _pBest = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(u64(72)))) if _pBest == nil { return } - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) != i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) != i32(5) { goto _1 } - if (_pBest.X1) != 0 { + if _pBest.X1 != 0 { _sqlite3SkipAccumulatorLoad(tls, _context) } goto _10 _1: - if (_pBest.X1) == 0 { + if _pBest.X1 == 0 { goto _4 } _2_pColl = _sqlite3GetFuncCollSeq(tls, _context) @@ -113362,15 +118254,18 @@ _1: _9: goto _10 _4: - *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBest.X9))))) = Xsqlite3_context_db_handle(tls, _context) + *(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pBest.X9)))) = Xsqlite3_context_db_handle(tls, _context) _sqlite3VdbeMemCopy(tls, _pBest, _pArg) _10: } -// Indicate that the accumulator load should be skipped on this -// iteration of the aggregate loop. +// C comment +// /* +// ** Indicate that the accumulator load should be skipped on this +// ** iteration of the aggregate loop. +// */ func _sqlite3SkipAccumulatorLoad(tls *crt.TLS, _context *Xsqlite3_context) { - *(*uint8)(unsafe.Pointer(&(_context.X6))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_context.X6)) = uint8(i32(1)) } func _minMaxFinalize(tls *crt.TLS, _context *Xsqlite3_context) { @@ -113379,19 +118274,22 @@ func _minMaxFinalize(tls *crt.TLS, _context *Xsqlite3_context) { if _pRes == nil { goto _0 } - if (_pRes.X1) != 0 { + if _pRes.X1 != 0 { Xsqlite3_result_value(tls, _context, _pRes) } _sqlite3VdbeMemRelease(tls, _pRes) _0: } -// Return the type of the argument. +// C comment +// /* +// ** Return the type of the argument. +// */ func _typeofFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _z *int8 _z = nil - switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { case i32(1): goto _1 case i32(2): @@ -113423,7 +118321,10 @@ _6: Xsqlite3_result_text(tls, _context, _z, i32(-1), nil) } -// Implementation of the length() function +// C comment +// /* +// ** Implementation of the length() function +// */ func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _len int32 var _3_z *uint8 @@ -113434,7 +118335,7 @@ func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** } }() - switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { case i32(1): goto _3 case i32(2): @@ -113448,10 +118349,10 @@ func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** } _3: - Xsqlite3_result_int(tls, _context, Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + Xsqlite3_result_int(tls, _context, Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) goto _8 _6: - _3_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _3_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _3_z == nil { return } @@ -113486,52 +118387,55 @@ func init() { crt.Xstrncpy(nil, &_lengthFuncØ00__func__Ø000[0], str(130522), 11) } -// Implementation of the instr() function. -// -// instr(haystack,needle) finds the first occurrence of needle -// in haystack and returns the number of previous characters plus 1, -// or 0 if needle does not occur within haystack. -// -// If both haystack and needle are BLOBs, then the result is one more than -// the number of bytes in haystack prior to the first occurrence of needle, -// or 0 if needle never occurs in haystack. +// C comment +// /* +// ** Implementation of the instr() function. +// ** +// ** instr(haystack,needle) finds the first occurrence of needle +// ** in haystack and returns the number of previous characters plus 1, +// ** or 0 if needle does not occur within haystack. +// ** +// ** If both haystack and needle are BLOBs, then the result is one more than +// ** the number of bytes in haystack prior to the first occurrence of needle, +// ** or 0 if needle never occurs in haystack. +// */ func _instrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nHaystack, _nNeedle, _typeHaystack, _typeNeedle, _N, _isText int32 var _zHaystack, _zNeedle *uint8 _N = i32(1) - _typeHaystack = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _typeNeedle = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _typeHaystack = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _typeNeedle = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) if (_typeHaystack == i32(5)) || (_typeNeedle == i32(5)) { return } - _nHaystack = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _nNeedle = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _nHaystack = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _nNeedle = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) if _nNeedle <= i32(0) { goto _2 } if (_typeHaystack == i32(4)) && (_typeNeedle == i32(4)) { - _zHaystack = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) - _zNeedle = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))))) + _zHaystack = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) + _zNeedle = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))))) _isText = i32(0) goto _5 } - _zHaystack = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _zNeedle = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _zHaystack = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _zNeedle = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) _isText = i32(1) _5: if (_zNeedle == nil) || (_nHaystack != 0 && (_zHaystack == nil)) { return } _8: - if _nNeedle > _nHaystack || crt.Xmemcmp(tls, (unsafe.Pointer)(_zHaystack), (unsafe.Pointer)(_zNeedle), uint64(_nNeedle)) == i32(0) { + if _nNeedle > _nHaystack || crt.Xmemcmp(tls, unsafe.Pointer(_zHaystack), unsafe.Pointer(_zNeedle), uint64(_nNeedle)) == i32(0) { goto _10 } _N += 1 _12: _nHaystack -= 1 *(*uintptr)(unsafe.Pointer(&_zHaystack)) += uintptr(1) - if _isText != 0 && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHaystack)) + 1*uintptr(i32(0))))) & i32(192)) == i32(128)) { + if _isText != 0 && ((int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zHaystack)) + 1*uintptr(i32(0))))) & i32(192)) == i32(128)) { goto _12 } goto _8 @@ -113543,7 +118447,10 @@ _2: Xsqlite3_result_int(tls, _context, _N) } -// Implementation of the printf() function. +// C comment +// /* +// ** Implementation of the printf() function. +// */ func _printfFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _n int32 var _zFormat *int8 @@ -113551,36 +118458,43 @@ func _printfFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** var _str XStrAccum var _x XPrintfArguments _db = Xsqlite3_context_db_handle(tls, _context) - if (_argc >= i32(1)) && (store0(&_zFormat, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))))) != nil) { - *(*int32)(unsafe.Pointer(&(_x.X0))) = _argc - i32(1) - *(*int32)(unsafe.Pointer(&(_x.X1))) = i32(0) - *(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_x.X2))))) = (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(8))))))))))) - _sqlite3StrAccumInit(tls, &_str, _db, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) - *(*uint8)(unsafe.Pointer(&(_str.X7))) = uint8(i32(2)) + if (_argc >= i32(1)) && (store0(&_zFormat, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))))) != nil) { + *(*int32)(unsafe.Pointer(&_x.X0)) = _argc - i32(1) + *(*int32)(unsafe.Pointer(&_x.X1)) = i32(0) + *(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&_x.X2)))) = (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(i32(1))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(8))))))))))) + _sqlite3StrAccumInit(tls, &_str, _db, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_db.X31)))) + 4*uintptr(i32(0))))) + *(*uint8)(unsafe.Pointer(&_str.X7)) = uint8(i32(2)) _sqlite3XPrintf(tls, &_str, _zFormat, unsafe.Pointer(&_x)) _n = int32(_str.X3) - Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, &_str), _n, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{_sqlite3MallocSize}))) + Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, &_str), _n, func() func(*crt.TLS, unsafe.Pointer) { + v := _sqlite3MallocSize + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) } _ = _x _ = _str } -// The unicode() function. Return the integer unicode code-point value -// for the first character of the input string. +// C comment +// /* +// ** The unicode() function. Return the integer unicode code-point value +// ** for the first character of the input string. +// */ func _unicodeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _z *uint8 - _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) - if (_z != nil) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != 0) { + if (_z != nil) && ((*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != 0) { Xsqlite3_result_int(tls, _context, int32(_sqlite3Utf8Read(tls, &_z))) } } -// The char() function takes zero or more arguments, each of which is -// an integer. It constructs a string where each character of the string -// is the unicode character for the corresponding integer argument. +// C comment +// /* +// ** The char() function takes zero or more arguments, each of which is +// ** an integer. It constructs a string where each character of the string +// ** is the unicode character for the corresponding integer argument. +// */ func _charFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _i int32 var _2_x int64 @@ -113596,7 +118510,7 @@ _1: if _i >= _argc { goto _4 } - _2_x = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) + _2_x = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) if (_2_x < int64(i32(0))) || (_2_x > int64(i32(1114111))) { _2_x = int64(i32(65533)) } @@ -113627,10 +118541,13 @@ _4: Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int64((uintptr(unsafe.Pointer(_zOut))-uintptr(unsafe.Pointer(_z)))/1)), Xsqlite3_free, uint8(i32(1))) } -// Implementation of the abs() function. -// -// IMP: R-23979-26855 The abs(X) function returns the absolute value of -// the numeric argument X. +// C comment +// /* +// ** Implementation of the abs() function. +// ** +// ** IMP: R-23979-26855 The abs(X) function returns the absolute value of +// ** the numeric argument X. +// */ func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _2_iVal int64 var _6_rVal float64 @@ -113641,7 +118558,7 @@ func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMe } }() - switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { case i32(1): goto _3 case i32(5): @@ -113651,7 +118568,7 @@ func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMe } _3: - _2_iVal = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _2_iVal = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _2_iVal >= int64(i32(0)) { goto _6 } @@ -113667,7 +118584,7 @@ _4: Xsqlite3_result_null(tls, _context) goto _8 _5: - _6_rVal = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _6_rVal = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _6_rVal < float64(i32(0)) { _6_rVal = -_6_rVal } @@ -113696,10 +118613,10 @@ func _roundFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **X if _argc != i32(2) { goto _3 } - if i32(5) == Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) { + if i32(5) == Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) { return } - _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) if _n > i32(30) { _n = i32(30) } @@ -113707,10 +118624,10 @@ func _roundFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **X _n = i32(0) } _3: - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == i32(5) { return } - _r = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _r = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if ((_n == i32(0)) && (_r >= float64(i32(0)))) && (_r < float64(i64(9223372036854775806))) { _r = float64(int64(_r + (0.5))) goto _15 @@ -113725,7 +118642,7 @@ _3: return } _sqlite3AtoF(tls, _zBuf, &_r, _sqlite3Strlen30(tls, _zBuf), uint8(i32(1))) - Xsqlite3_free(tls, (unsafe.Pointer)(_zBuf)) + Xsqlite3_free(tls, unsafe.Pointer(_zBuf)) _15: Xsqlite3_result_double(tls, _context, _r) } @@ -113736,15 +118653,18 @@ func init() { crt.Xstrncpy(nil, &_roundFuncØ00__func__Ø000[0], str(130582), 10) } -// Implementation of the upper() and lower() SQL functions. +// C comment +// /* +// ** Implementation of the upper() and lower() SQL functions. +// */ func _upperFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _i, _n int32 var _z1, _z2 *int8 - _z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) - _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) + _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) { + if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105970), unsafe.Pointer((*int8)(unsafe.Pointer(&_upperFuncØ00__func__Ø000))), unsafe.Pointer(str(130592))) crt.X__builtin_abort(tls) } @@ -113761,7 +118681,7 @@ _4: if _i >= _n { goto _7 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z1)) + 1*uintptr(_i))) = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i)))) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i)))))))) & i32(32)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z1)) + 1*uintptr(_i))) = int8(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z2)) + 1*uintptr(_i)))) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z2)) + 1*uintptr(_i)))))))) & i32(32)))) _i += 1 goto _4 _7: @@ -113780,10 +118700,10 @@ func _lowerFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **X var _i, _n int32 var _z1, _z2 *int8 - _z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) - _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) + _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) { + if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105989), unsafe.Pointer((*int8)(unsafe.Pointer(&_lowerFuncØ00__func__Ø000))), unsafe.Pointer(str(130592))) crt.X__builtin_abort(tls) } @@ -113800,7 +118720,7 @@ _4: if _i >= _n { goto _7 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z1)) + 1*uintptr(_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i)))))))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z1)) + 1*uintptr(_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z2)) + 1*uintptr(_i)))))))) _i += 1 goto _4 _7: @@ -113815,8 +118735,11 @@ func init() { crt.Xstrncpy(nil, &_lowerFuncØ00__func__Ø000[0], str(130641), 10) } -// The hex() function. Interpret the argument as a blob. Return -// a hexadecimal rendering as text. +// C comment +// /* +// ** The hex() function. Interpret the argument as a blob. Return +// ** a hexadecimal rendering as text. +// */ func _hexFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _i, _n int32 var _zHex, _z *int8 @@ -113829,10 +118752,10 @@ func _hexFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMe } }() - _pBlob = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) - _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _pBlob = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) + _n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _pBlob != (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) { + if _pBlob != (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106675), unsafe.Pointer((*int8)(unsafe.Pointer(&_hexFuncØ00__func__Ø000))), unsafe.Pointer(str(130651))) crt.X__builtin_abort(tls) } @@ -113847,8 +118770,8 @@ _5: goto _8 } _2_c = *_pBlob - *postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr((int32(_2_c)>>uint(i32(4)))&i32(15)))) - *postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr(int32(_2_c)&i32(15)))) + *postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_hexdigits)) + 1*uintptr((int32(_2_c)>>uint(i32(4)))&i32(15)))) + *postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_hexdigits)) + 1*uintptr(int32(_2_c)&i32(15)))) *(*uintptr)(unsafe.Pointer(func() **uint8 { _i += 1; return &_pBlob }())) += uintptr(1) goto _5 _8: @@ -113869,20 +118792,26 @@ func init() { _hexdigits = [16]int8{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70} } -// Implementation of random(). Return a random integer. +// C comment +// /* +// ** Implementation of random(). Return a random integer. +// */ func _randomFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { var _r int64 _ = _NotUsed2 - Xsqlite3_randomness(tls, int32(u64(8)), (unsafe.Pointer)(&_r)) + Xsqlite3_randomness(tls, int32(u64(8)), unsafe.Pointer(&_r)) if _r < int64(i32(0)) { _r = -(_r & i64(9223372036854775807)) } Xsqlite3_result_int64(tls, _context, _r) } -// Implementation of randomblob(N). Return a random blob -// that is N bytes long. +// C comment +// /* +// ** Implementation of randomblob(N). Return a random blob +// ** that is N bytes long. +// */ func _randomBlob(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _n int32 var _p *uint8 @@ -113893,14 +118822,14 @@ func _randomBlob(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** } }() - _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _n < i32(1) { _n = i32(1) } _p = (*uint8)(_contextMalloc(tls, _context, int64(_n))) if _p != nil { - Xsqlite3_randomness(tls, _n, (unsafe.Pointer)(_p)) - Xsqlite3_result_blob(tls, _context, (unsafe.Pointer)(_p), _n, Xsqlite3_free) + Xsqlite3_randomness(tls, _n, unsafe.Pointer(_p)) + Xsqlite3_result_blob(tls, _context, unsafe.Pointer(_p), _n, Xsqlite3_free) } } @@ -113910,39 +118839,51 @@ func init() { crt.Xstrncpy(nil, &_randomBlobØ00__func__Ø000[0], str(130694), 11) } -// Implementation of the NULLIF(x,y) function. The result is the first -// argument if the arguments are different. The result is NULL if the -// arguments are equal to each other. +// C comment +// /* +// ** Implementation of the NULLIF(x,y) function. The result is the first +// ** argument if the arguments are different. The result is NULL if the +// ** arguments are equal to each other. +// */ func _nullifFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) { var _pColl *XCollSeq _pColl = _sqlite3GetFuncCollSeq(tls, _context) - if _sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))), _pColl) != i32(0) { - Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + if _sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))), _pColl) != i32(0) { + Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) } } -// Implementation of the sqlite_source_id() function. The result is a string -// that identifies the particular version of the source code used to build -// SQLite. +// C comment +// /* +// ** Implementation of the sqlite_source_id() function. The result is a string +// ** that identifies the particular version of the source code used to build +// ** SQLite. +// */ func _sourceidFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { _ = _NotUsed2 Xsqlite3_result_text(tls, _context, Xsqlite3_sourceid(tls), i32(-1), nil) } -// Implementation of the sqlite_log() function. This is a wrapper around -// sqlite3_log(). The return value is NULL. The function exists purely for -// its side-effects. +// C comment +// /* +// ** Implementation of the sqlite_log() function. This is a wrapper around +// ** sqlite3_log(). The return value is NULL. The function exists purely for +// ** its side-effects. +// */ func _errlogFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))), str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))), str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))))) } -// Implementation of the QUOTE() function. This function takes a single -// argument. If the argument is numeric, the return value is the same as -// the argument. If the argument is NULL, the return value is the string -// "NULL". Otherwise, the argument is enclosed in single quotes with -// single-quote escapes. +// C comment +// /* +// ** Implementation of the QUOTE() function. This function takes a single +// ** argument. If the argument is numeric, the return value is the same as +// ** the argument. If the argument is NULL, the return value is the string +// ** "NULL". Otherwise, the argument is enclosed in single quotes with +// ** single-quote escapes. +// */ func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _5_nBlob, _6_i, _8_i, _8_j int32 var _8_n uint64 @@ -113957,7 +118898,7 @@ func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **X } }() - switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { case i32(1): goto _4 case i32(2): @@ -113971,23 +118912,26 @@ func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **X } _3: - _2_r1 = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _2_r1 = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) Xsqlite3_snprintf(tls, int32(u64(50)), (*int8)(unsafe.Pointer(&_2_zBuf)), str(6367), _2_r1) _sqlite3AtoF(tls, (*int8)(unsafe.Pointer(&_2_zBuf)), &_2_r2, i32(20), uint8(i32(1))) if _2_r1 != _2_r2 { Xsqlite3_snprintf(tls, int32(u64(50)), (*int8)(unsafe.Pointer(&_2_zBuf)), str(130705), _2_r1) } - Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_2_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_2_zBuf)), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) goto _9 _4: - Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) goto _9 _5: _5_zText = nil - _5_zBlob = (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) - _5_nBlob = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _5_zBlob = (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) + _5_nBlob = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _5_zBlob != (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) { + if _5_zBlob != (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106555), unsafe.Pointer((*int8)(unsafe.Pointer(&_quoteFuncØ00__func__Ø000))), unsafe.Pointer(str(130712))) crt.X__builtin_abort(tls) } @@ -114001,30 +118945,33 @@ _13: if _6_i >= _5_nBlob { goto _16 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(2)))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zBlob)) + 1*uintptr(_6_i))))>>uint(i32(4)))&i32(15)))) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(3)))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zBlob)) + 1*uintptr(_6_i))))&i32(15)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(2)))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_hexdigits)) + 1*uintptr((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zBlob)) + 1*uintptr(_6_i))))>>uint(i32(4)))&i32(15)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(3)))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_hexdigits)) + 1*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zBlob)) + 1*uintptr(_6_i))))&i32(15)))) _6_i += 1 goto _13 _16: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(2)))) = int8(i32(39)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(3)))) = int8(i32(0)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr(i32(0)))) = int8(i32(88)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr(i32(1)))) = int8(i32(39)) - Xsqlite3_result_text(tls, _context, _5_zText, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) - Xsqlite3_free(tls, (unsafe.Pointer)(_5_zText)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(2)))) = int8(i32(39)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(3)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr(i32(0)))) = int8(i32(88)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_5_zText)) + 1*uintptr(i32(1)))) = int8(i32(39)) + Xsqlite3_result_text(tls, _context, _5_zText, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) + Xsqlite3_free(tls, unsafe.Pointer(_5_zText)) _12: goto _9 _6: - _8_zArg = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _8_zArg = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _8_zArg == nil { return } *func() *uint64 { _8_i = i32(0); return &_8_n }() = uint64(i32(0)) _18: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_zArg)) + 1*uintptr(_8_i)))) == 0 { goto _21 } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) { _8_n += 1 } _8_i += 1 @@ -114034,27 +118981,27 @@ _21: if _8_z == nil { goto _23 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(i32(0)))) = int8(i32(39)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_z)) + 1*uintptr(i32(0)))) = int8(i32(39)) *func() *int32 { _8_i = i32(0); return &_8_j }() = i32(1) _24: - if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == 0 { + if (*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_zArg)) + 1*uintptr(_8_i)))) == 0 { goto _27 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(i32(39)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_z)) + 1*uintptr(postInc1(&_8_j, 1)))) = int8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_zArg)) + 1*uintptr(_8_i)))) + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_z)) + 1*uintptr(postInc1(&_8_j, 1)))) = int8(i32(39)) } _8_i += 1 goto _24 _27: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(i32(39)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(_8_j))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_z)) + 1*uintptr(postInc1(&_8_j, 1)))) = int8(i32(39)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_8_z)) + 1*uintptr(_8_j))) = int8(i32(0)) Xsqlite3_result_text(tls, _context, _8_z, _8_j, Xsqlite3_free) _23: goto _9 _7: func() { - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) != i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) != i32(5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106596), unsafe.Pointer((*int8)(unsafe.Pointer(&_quoteFuncØ00__func__Ø000))), unsafe.Pointer(str(130747))) crt.X__builtin_abort(tls) } @@ -114071,8 +119018,11 @@ func init() { crt.Xstrncpy(nil, &_quoteFuncØ00__func__Ø000[0], str(130788), 10) } -// Implementation of the last_insert_rowid() SQL function. The return -// value is the same as the sqlite3_last_insert_rowid() API function. +// C comment +// /* +// ** Implementation of the last_insert_rowid() SQL function. The return +// ** value is the same as the sqlite3_last_insert_rowid() API function. +// */ func _last_insert_rowid(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { var _db *Xsqlite3 _db = Xsqlite3_context_db_handle(tls, _context) @@ -114081,11 +119031,14 @@ func _last_insert_rowid(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32 Xsqlite3_result_int64(tls, _context, Xsqlite3_last_insert_rowid(tls, _db)) } -// Implementation of the changes() SQL function. -// -// IMP: R-62073-11209 The changes() SQL function is a wrapper -// around the sqlite3_changes() C/C++ function and hence follows the same -// rules for counting changes. +// C comment +// /* +// ** Implementation of the changes() SQL function. +// ** +// ** IMP: R-62073-11209 The changes() SQL function is a wrapper +// ** around the sqlite3_changes() C/C++ function and hence follows the same +// ** rules for counting changes. +// */ func _changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { var _db *Xsqlite3 _db = Xsqlite3_context_db_handle(tls, _context) @@ -114094,8 +119047,11 @@ func _changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed Xsqlite3_result_int(tls, _context, Xsqlite3_changes(tls, _db)) } -// Implementation of the total_changes() SQL function. The return value is -// the same as the sqlite3_total_changes() API function. +// C comment +// /* +// ** Implementation of the total_changes() SQL function. The return value is +// ** the same as the sqlite3_total_changes() API function. +// */ func _total_changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) { var _db *Xsqlite3 _db = Xsqlite3_context_db_handle(tls, _context) @@ -114104,10 +119060,13 @@ func _total_changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _N Xsqlite3_result_int(tls, _context, Xsqlite3_total_changes(tls, _db)) } -// The replace() function. Three arguments are all strings: call -// them A, B, and C. The result is also a string which is derived -// from A by replacing every occurrence of B with C. The match -// must be exact. Collating sequences are not used. +// C comment +// /* +// ** The replace() function. Three arguments are all strings: call +// ** them A, B, and C. The result is also a string which is derived +// ** from A by replacing every occurrence of B with C. The match +// ** must be exact. Collating sequences are not used. +// */ func _replaceFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nStr, _nPattern, _nRep, _loopLimit, _i, _j int32 var _nOut int64 @@ -114120,51 +119079,51 @@ func _replaceFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv * } }() - _zStr = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _zStr = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _zStr == nil { return } - _nStr = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _nStr = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) func() { - if _zStr != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + if _zStr != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106735), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130798))) crt.X__builtin_abort(tls) } }() - _zPattern = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _zPattern = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) if _zPattern == nil { func() { - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) != i32(5) && (Xsqlite3_context_db_handle(tls, _context).X17) == 0 { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) != i32(5) && (Xsqlite3_context_db_handle(tls, _context).X17) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106738), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130832))) crt.X__builtin_abort(tls) } }() return } - if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) { + if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) { func() { - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) == i32(5) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106743), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130925))) crt.X__builtin_abort(tls) } }() - Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) return } - _nPattern = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _nPattern = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) func() { - if _zPattern != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) { + if _zPattern != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106748), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130966))) crt.X__builtin_abort(tls) } }() - _zRep = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) + _zRep = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) if _zRep == nil { return } - _nRep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) + _nRep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) func() { - if _zRep != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) { + if _zRep != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106752), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(131004))) crt.X__builtin_abort(tls) } @@ -114186,8 +119145,8 @@ _20: if _i > _loopLimit { goto _23 } - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0)))))) || crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr))+1*uintptr(_i)))), (unsafe.Pointer)(_zPattern), uint64(_nPattern)) != 0 { - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(postInc1(&_j, int32(1))))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr)) + 1*uintptr(_i))) + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStr)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPattern)) + 1*uintptr(i32(0)))))) || crt.Xmemcmp(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStr))+1*uintptr(_i)))), unsafe.Pointer(_zPattern), uint64(_nPattern)) != 0 { + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(postInc1(&_j, 1)))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStr)) + 1*uintptr(_i))) goto _26 } _6_db = Xsqlite3_context_db_handle(tls, _context) @@ -114196,19 +119155,19 @@ _20: *p = (*p) + int64(_nRep-_nPattern) sink6(*p) } - if (_nOut - int64(i32(1))) > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_6_db.X31))))) + 4*uintptr(i32(0))))) { + if (_nOut - int64(i32(1))) > int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_6_db.X31)))) + 4*uintptr(i32(0))))) { Xsqlite3_result_error_toobig(tls, _context) - Xsqlite3_free(tls, (unsafe.Pointer)(_zOut)) + Xsqlite3_free(tls, unsafe.Pointer(_zOut)) return } _6_zOld = _zOut - _zOut = (*uint8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_zOut), uint64(int32(_nOut)))) + _zOut = (*uint8)(Xsqlite3_realloc64(tls, unsafe.Pointer(_zOut), uint64(int32(_nOut)))) if _zOut == nil { Xsqlite3_result_error_nomem(tls, _context) - Xsqlite3_free(tls, (unsafe.Pointer)(_6_zOld)) + Xsqlite3_free(tls, unsafe.Pointer(_6_zOld)) return } - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_j)))), (unsafe.Pointer)(_zRep), uint64(_nRep)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_j)))), unsafe.Pointer(_zRep), uint64(_nRep)) { p := &_j *p = (*p) + _nRep @@ -114229,7 +119188,7 @@ _23: crt.X__builtin_abort(tls) } }() - crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_j)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr))+1*uintptr(_i)))), uint64(_nStr-_i)) + crt.Xmemcpy(tls, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_j)))), unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zStr))+1*uintptr(_i)))), uint64(_nStr-_i)) { p := &_j *p = (*p) + (_nStr - _i) @@ -114241,7 +119200,7 @@ _23: crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_j))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_j))) = uint8(i32(0)) Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zOut)), _j, Xsqlite3_free) } @@ -114251,7 +119210,10 @@ func init() { crt.Xstrncpy(nil, &_replaceFuncØ00__func__Ø000[0], str(131086), 12) } -// The zeroblob(N) function returns a zero-filled blob of size N bytes. +// C comment +// /* +// ** The zeroblob(N) function returns a zero-filled blob of size N bytes. +// */ func _zeroblobFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _rc int32 var _n int64 @@ -114262,7 +119224,7 @@ func _zeroblobFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv } }() - _n = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _n = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _n < int64(i32(0)) { _n = int64(i32(0)) } @@ -114278,16 +119240,19 @@ func init() { crt.Xstrncpy(nil, &_zeroblobFuncØ00__func__Ø000[0], str(131098), 13) } -// Implementation of the substr() function. -// -// substr(x,p1,p2) returns p2 characters of x[] beginning with p1. -// p1 is 1-indexed. So substr(x,1,1) returns the first character -// of x. If x is text, then we actually count UTF-8 characters. -// If x is a blob, then we count bytes. -// -// If p1 is negative, then we begin abs(p1) from the end of x[]. -// -// If p2 is negative, return the p2 characters preceding p1. +// C comment +// /* +// ** Implementation of the substr() function. +// ** +// ** substr(x,p1,p2) returns p2 characters of x[] beginning with p1. +// ** p1 is 1-indexed. So substr(x,1,1) returns the first character +// ** of x. If x is text, then we actually count UTF-8 characters. +// ** If x is a blob, then we count bytes. +// ** +// ** If p1 is negative, then we begin abs(p1) from the end of x[]. +// ** +// ** If p2 is negative, return the p2 characters preceding p1. +// */ func _substrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _len, _p0type, _negP2 int32 var _p1, _p2 int64 @@ -114299,28 +119264,28 @@ func _substrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv ** crt.X__builtin_abort(tls) } }() - if (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) == i32(5)) || ((_argc == i32(3)) && (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) == i32(5))) { + if (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) == i32(5)) || ((_argc == i32(3)) && (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) == i32(5))) { return } - _p0type = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _p1 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))))) + _p0type = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _p1 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))))) if _p0type != i32(4) { goto _6 } - _len = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) - _z = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + _len = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) + _z = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) if _z == nil { return } func() { - if _len != Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) { + if _len != Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105829), unsafe.Pointer((*int8)(unsafe.Pointer(&_substrFuncØ00__func__Ø000))), unsafe.Pointer(str(131130))) crt.X__builtin_abort(tls) } }() goto _10 _6: - _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _z == nil { return } @@ -114350,14 +119315,14 @@ _10: if _argc != i32(3) { goto _20 } - _p2 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2)))))) + _p2 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2)))))) if _p2 < int64(i32(0)) { _p2 = -_p2 _negP2 = i32(1) } goto _22 _20: - _p2 = int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(Xsqlite3_context_db_handle(tls, _context).X31))))) + 4*uintptr(i32(0))))) + _p2 = int64(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&(Xsqlite3_context_db_handle(tls, _context).X31))))) + 4*uintptr(i32(0))))) _22: if _p1 >= int64(i32(0)) { goto _23 @@ -114449,7 +119414,10 @@ _47: _p2 -= 1 goto _42 _46: - Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int64((uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))/1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)})), uint8(i32(1))) + Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int64((uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))/1)), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }(), uint8(i32(1))) goto _50 _35: if (_p1 + _p2) <= int64(_len) { @@ -114460,7 +119428,10 @@ _35: _p2 = int64(i32(0)) } _51: - Xsqlite3_result_blob64(tls, _context, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_p1)))), uint64(_p2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + Xsqlite3_result_blob64(tls, _context, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+1*uintptr(_p1)))), uint64(_p2), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _50: } @@ -114470,14 +119441,17 @@ func init() { crt.Xstrncpy(nil, &_substrFuncØ00__func__Ø000[0], str(131179), 11) } -// Routines used to compute the sum, average, and total. -// -// The SUM() function follows the (broken) SQL standard which means -// that it returns NULL if it sums over no inputs. TOTAL returns -// 0.0 in that case. In addition, TOTAL always returns a float where -// SUM might return an integer if it never encounters a floating point -// value. TOTAL never fails, but SUM might through an exception if -// it overflows an integer. +// C comment +// /* +// ** Routines used to compute the sum, average, and total. +// ** +// ** The SUM() function follows the (broken) SQL standard which means +// ** that it returns NULL if it sums over no inputs. TOTAL returns +// ** 0.0 in that case. In addition, TOTAL always returns a float where +// ** SUM might return an integer if it never encounters a floating point +// ** value. TOTAL never fails, but SUM might through an exception if +// ** it overflows an integer. +// */ func _sumStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _type int32 var _2_v int64 @@ -114490,31 +119464,31 @@ func _sumStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMe }() _p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(u64(32)))) - _type = Xsqlite3_value_numeric_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _type = Xsqlite3_value_numeric_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _p == nil || _type == i32(5) { goto _3 } - *(*int64)(unsafe.Pointer(&(_p.X2))) += 1 + *(*int64)(unsafe.Pointer(&_p.X2)) += 1 if _type != i32(1) { goto _4 } - _2_v = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _2_v = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) { - p := (*float64)(unsafe.Pointer(&(_p.X0))) + p := (*float64)(unsafe.Pointer(&_p.X0)) *p = (*p) + float64(_2_v) sink4(*p) } - if ((int32(_p.X4) | int32(_p.X3)) == i32(0)) && _sqlite3AddInt64(tls, (*int64)(unsafe.Pointer(&(_p.X1))), _2_v) != 0 { - *(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1)) + if ((int32(_p.X4) | int32(_p.X3)) == i32(0)) && _sqlite3AddInt64(tls, (*int64)(unsafe.Pointer(&_p.X1)), _2_v) != 0 { + *(*uint8)(unsafe.Pointer(&_p.X3)) = uint8(i32(1)) } goto _7 _4: { - p := (*float64)(unsafe.Pointer(&(_p.X0))) - *p = (*p) + Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + p := (*float64)(unsafe.Pointer(&_p.X0)) + *p = (*p) + Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) sink4(*p) } - *(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_p.X4)) = uint8(i32(1)) _7: _3: } @@ -114528,14 +119502,14 @@ func init() { func _sumFinalize(tls *crt.TLS, _context *Xsqlite3_context) { var _p *XSumCtx _p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0))) - if _p == nil || (_p.X2) <= int64(i32(0)) { + if _p == nil || _p.X2 <= int64(i32(0)) { goto _1 } - if (_p.X3) != 0 { + if _p.X3 != 0 { Xsqlite3_result_error(tls, _context, str(130533), i32(-1)) goto _5 } - if (_p.X4) != 0 { + if _p.X4 != 0 { Xsqlite3_result_double(tls, _context, _p.X0) goto _5 } @@ -114549,7 +119523,7 @@ func _totalFinalize(tls *crt.TLS, _context *Xsqlite3_context) { _p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0))) Xsqlite3_result_double(tls, _context, func() float64 { if _p != nil { - return (_p.X0) + return _p.X0 } return float64(0) }()) @@ -114558,20 +119532,23 @@ func _totalFinalize(tls *crt.TLS, _context *Xsqlite3_context) { func _avgFinalize(tls *crt.TLS, _context *Xsqlite3_context) { var _p *XSumCtx _p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0))) - if (_p != nil) && ((_p.X2) > int64(i32(0))) { - Xsqlite3_result_double(tls, _context, (_p.X0)/float64(_p.X2)) + if (_p != nil) && (_p.X2 > int64(i32(0))) { + Xsqlite3_result_double(tls, _context, _p.X0/float64(_p.X2)) } } -// Routines to implement the count() aggregate function. +// C comment +// /* +// ** Routines to implement the count() aggregate function. +// */ func _countStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _p *XCountCtx _p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(u64(8)))) - if ((_argc == i32(0)) || (i32(5) != Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) && (_p != nil) { - *(*int64)(unsafe.Pointer(&(_p.X0))) += 1 + if ((_argc == i32(0)) || (i32(5) != Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) && (_p != nil) { + *(*int64)(unsafe.Pointer(&_p.X0)) += 1 } func() { - if _argc != i32(1) && _p != nil && (_p.X0) <= int64(i32(2147483647)) && (_p.X0) != int64(Xsqlite3_aggregate_count(tls, _context)) { + if _argc != i32(1) && _p != nil && _p.X0 <= int64(i32(2147483647)) && _p.X0 != int64(Xsqlite3_aggregate_count(tls, _context)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107085), unsafe.Pointer((*int8)(unsafe.Pointer(&_countStepØ00__func__Ø000))), unsafe.Pointer(str(131198))) crt.X__builtin_abort(tls) } @@ -114589,13 +119566,16 @@ func _countFinalize(tls *crt.TLS, _context *Xsqlite3_context) { _p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0))) Xsqlite3_result_int64(tls, _context, func() int64 { if _p != nil { - return (_p.X0) + return _p.X0 } return int64(i32(0)) }()) } -// group_concat(EXPR, ?SEPARATOR?) +// C comment +// /* +// ** group_concat(EXPR, ?SEPARATOR?) +// */ func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) { var _nVal, _nSep, _1_firstTerm int32 var _zVal, _zSep *int8 @@ -114607,7 +119587,7 @@ func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _ar crt.X__builtin_abort(tls) } }() - if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) == i32(5) { + if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) == i32(5) { return } _pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(u64(40)))) @@ -114615,14 +119595,14 @@ func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _ar goto _4 } _1_db = Xsqlite3_context_db_handle(tls, _context) - _1_firstTerm = bool2int((_pAccum.X5) == uint32(i32(0))) - *(*uint32)(unsafe.Pointer(&(_pAccum.X5))) = uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_1_db.X31))))) + 4*uintptr(i32(0))))) + _1_firstTerm = bool2int(_pAccum.X5 == uint32(i32(0))) + *(*uint32)(unsafe.Pointer(&_pAccum.X5)) = uint32(*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[12]int32)(unsafe.Pointer(&_1_db.X31)))) + 4*uintptr(i32(0))))) if _1_firstTerm != 0 { goto _5 } if _argc == i32(2) { - _zSep = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))))) - _nSep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1))))) + _zSep = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))))) + _nSep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1))))) goto _7 } _zSep = str(107763) @@ -114632,8 +119612,8 @@ _7: _sqlite3StrAccumAppend(tls, _pAccum, _zSep, _nSep) } _5: - _zVal = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))))) - _nVal = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _zVal = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))))) + _nVal = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) if _zVal != nil { _sqlite3StrAccumAppend(tls, _pAccum, _zVal, _nVal) } @@ -114665,25 +119645,30 @@ _4: _0: } -// ************************************************** General Interfaces ****** -// -// Initialize and shutdown the page cache subsystem. Neither of these -// functions are threadsafe. +// C comment +// /*************************************************** General Interfaces ****** +// ** +// ** Initialize and shutdown the page cache subsystem. Neither of these +// ** functions are threadsafe. +// */ func _sqlite3PcacheInitialize(tls *crt.TLS) (r0 int32) { if *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 - }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, unsafe.Pointer) int32 }{nil})) { _sqlite3PCacheSetDefault(tls) } - return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)(tls, (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X1) + return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X2)(tls, (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&_sqlite3Config.X12)).X1) } -// This function is a wrapper around the OS specific implementation of -// sqlite3_os_init(). The purpose of the wrapper is to provide the -// ability to simulate a malloc failure, so that the handling of an -// error in sqlite3_os_init() by the upper layers can be tested. +// C comment +// /* +// ** This function is a wrapper around the OS specific implementation of +// ** sqlite3_os_init(). The purpose of the wrapper is to provide the +// ** ability to simulate a malloc failure, so that the handling of an +// ** error in sqlite3_os_init() by the upper layers can be tested. +// */ func _sqlite3OsInit(tls *crt.TLS) (r0 int32) { var _p unsafe.Pointer _p = Xsqlite3_malloc(tls, i32(10)) @@ -114694,17 +119679,20 @@ func _sqlite3OsInit(tls *crt.TLS) (r0 int32) { return Xsqlite3_os_init(tls) } -// Initialize the operating system interface. -// -// This routine registers all VFS implementations for unix-like operating -// systems. This routine, and the sqlite3_os_end() routine that follows, -// should be the only routines in this file that are visible from other -// files. -// -// This routine is called once during SQLite initialization and by a -// single thread. The memory allocation and mutex subsystems have not -// necessarily been initialized when this routine is called, and so they -// should not be used. +// C comment +// /* +// ** Initialize the operating system interface. +// ** +// ** This routine registers all VFS implementations for unix-like operating +// ** systems. This routine, and the sqlite3_os_end() routine that follows, +// ** should be the only routines in this file that are visible from other +// ** files. +// ** +// ** This routine is called once during SQLite initialization and by a +// ** single thread. The memory allocation and mutex subsystems have not +// ** necessarily been initialized when this routine is called, and so they +// ** should not be used. +// */ func Xsqlite3_os_init(tls *crt.TLS) (r0 int32) { var _i uint32 i32(0) @@ -114713,7 +119701,7 @@ _0: if uint64(_i) >= u64(4) { goto _3 } - Xsqlite3_vfs_register(tls, (*Xsqlite3_vfs)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_os_initØ00aVfsØ001))+168*uintptr(_i))), bool2int(_i == uint32(i32(0)))) + Xsqlite3_vfs_register(tls, (*Xsqlite3_vfs)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3_os_initØ00aVfsØ001))+168*uintptr(_i))), bool2int(_i == uint32(i32(0)))) _i += 1 goto _0 _3: @@ -114860,9 +119848,12 @@ func init() { _posixIoFinder = _posixIoFinderImpl } -// Here are all of the sqlite3_io_methods objects for each of the -// locking strategies. Functions that return pointers to these methods -// are also created. +// C comment +// /* +// ** Here are all of the sqlite3_io_methods objects for each of the +// ** locking strategies. Functions that return pointers to these methods +// ** are also created. +// */ func _posixIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) { return &_posixIoMethods } @@ -114909,7 +119900,10 @@ func init() { }{_unixUnfetch}))} } -// Close a file. +// C comment +// /* +// ** Close a file. +// */ func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { var _rc int32 var _pFile *XunixFile @@ -114925,7 +119919,7 @@ func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { } }() if func() int32 { - if (*XunixInodeInfo)(_pFile.X2) != nil { + if _pFile.X2 != nil { return i32(1) } return func() int32 { @@ -114942,29 +119936,35 @@ func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { return _rc } -// Check a unixFile that is a database. Verify the following: -// -// (1) There is exactly one hard link on the file -// (2) The file is not a symbolic link -// (3) The file has not been renamed or unlinked -// -// Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right. +// C comment +// /* +// ** Check a unixFile that is a database. Verify the following: +// ** +// ** (1) There is exactly one hard link on the file +// ** (2) The file is not a symbolic link +// ** (3) The file has not been renamed or unlinked +// ** +// ** Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right. +// */ func _verifyDbFile(tls *crt.TLS, _pFile *XunixFile) { var _rc int32 var _buf crt.Xstruct_stat64 if (int32(_pFile.X5) & i32(128)) != 0 { return } - _rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _pFile.X3, &_buf) + _rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X3, &_buf) if _rc != i32(0) { Xsqlite3_log(tls, i32(28), str(131396), unsafe.Pointer(_pFile.X9)) return } - if (_buf.X2) == uint64(i32(0)) { + if _buf.X2 == uint64(i32(0)) { Xsqlite3_log(tls, i32(28), str(131420), unsafe.Pointer(_pFile.X9)) return } - if (_buf.X2) > uint64(i32(1)) { + if _buf.X2 > uint64(i32(1)) { Xsqlite3_log(tls, i32(28), str(131449), unsafe.Pointer(_pFile.X9)) return } @@ -115015,37 +120015,43 @@ func init() { }{crt.Xlstat64})), X2: nil}} } -// Different Unix systems declare open() in different ways. Same use -// open(const char*,int,mode_t). Others use open(const char*,int,...). -// The difference is important when using a pointer to the function. -// -// The safest way to deal with the problem is to always use this wrapper -// which always has the same well-defined interface. +// C comment +// /* +// ** Different Unix systems declare open() in different ways. Same use +// ** open(const char*,int,mode_t). Others use open(const char*,int,...). +// ** The difference is important when using a pointer to the function. +// ** +// ** The safest way to deal with the problem is to always use this wrapper +// ** which always has the same well-defined interface. +// */ func _posixOpen(tls *crt.TLS, _zFile *int8, _flags int32, _mode int32) (r0 int32) { return crt.Xopen64(tls, _zFile, _flags, _mode) } -// Open a file descriptor to the directory containing file zFilename. -// If successful, *pFd is set to the opened file descriptor and -// SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM -// or SQLITE_CANTOPEN is returned and *pFd is set to an undefined -// value. -// -// The directory file descriptor is used for only one thing - to -// fsync() a directory to make sure file creation and deletion events -// are flushed to disk. Such fsyncs are not needed on newer -// journaling filesystems, but are required on older filesystems. -// -// This routine can be overridden using the xSetSysCall interface. -// The ability to override this routine was added in support of the -// chromium sandbox. Opening a directory is a security risk (we are -// told) so making it overrideable allows the chromium sandbox to -// replace this routine with a harmless no-op. To make this routine -// a no-op, replace it with a stub that returns SQLITE_OK but leaves -// *pFd set to a negative number. -// -// If SQLITE_OK is returned, the caller is responsible for closing -// the file descriptor *pFd using close(). +// C comment +// /* +// ** Open a file descriptor to the directory containing file zFilename. +// ** If successful, *pFd is set to the opened file descriptor and +// ** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM +// ** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined +// ** value. +// ** +// ** The directory file descriptor is used for only one thing - to +// ** fsync() a directory to make sure file creation and deletion events +// ** are flushed to disk. Such fsyncs are not needed on newer +// ** journaling filesystems, but are required on older filesystems. +// ** +// ** This routine can be overridden using the xSetSysCall interface. +// ** The ability to override this routine was added in support of the +// ** chromium sandbox. Opening a directory is a security risk (we are +// ** told) so making it overrideable allows the chromium sandbox to +// ** replace this routine with a harmless no-op. To make this routine +// ** a no-op, replace it with a stub that returns SQLITE_OK but leaves +// ** *pFd set to a negative number. +// ** +// ** If SQLITE_OK is returned, the caller is responsible for closing +// ** the file descriptor *pFd using close(). +// */ func _openDirectory(tls *crt.TLS, _zFilename *int8, _pFd *int32) (r0 int32) { var _ii, _fd int32 var _zDirname [513]int8 @@ -115053,20 +120059,20 @@ func _openDirectory(tls *crt.TLS, _zFilename *int8, _pFd *int32) (r0 int32) { Xsqlite3_snprintf(tls, i32(512), (*int8)(unsafe.Pointer(&_zDirname)), str(24576), unsafe.Pointer(_zFilename)) _ii = int32(crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zDirname)))) _0: - if _ii <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(_ii)))) == i32(47) { + if _ii <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDirname)) + 1*uintptr(_ii)))) == i32(47) { goto _4 } _ii -= 1 goto _0 _4: if _ii > i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(_ii))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDirname)) + 1*uintptr(_ii))) = int8(i32(0)) goto _6 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(0))))) != i32(47) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(0)))) = int8(i32(46)) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDirname)) + 1*uintptr(i32(0))))) != i32(47) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDirname)) + 1*uintptr(i32(0)))) = int8(i32(46)) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zDirname)) + 1*uintptr(i32(1)))) = int8(i32(0)) _6: _fd = _robust_open(tls, (*int8)(unsafe.Pointer(&_zDirname)), i32(0), uint32(i32(0))) if _fd >= i32(0) { @@ -115081,21 +120087,24 @@ _6: panic(0) } -// Invoke open(). Do so multiple times, until it either succeeds or -// fails for some reason other than EINTR. -// -// If the file creation mode "m" is 0 then set it to the default for -// SQLite. The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally -// 0644) as modified by the system umask. If m is not 0, then -// make the file creation mode be exactly m ignoring the umask. -// -// The m parameter will be non-zero only when creating -wal, -journal, -// and -shm files. We want those files to have *exactly* the same -// permissions as their original database, unadulterated by the umask. -// In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a -// transaction crashes and leaves behind hot journals, then any -// process that is able to write to the database will also be able to -// recover the hot journals. +// C comment +// /* +// ** Invoke open(). Do so multiple times, until it either succeeds or +// ** fails for some reason other than EINTR. +// ** +// ** If the file creation mode "m" is 0 then set it to the default for +// ** SQLite. The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally +// ** 0644) as modified by the system umask. If m is not 0, then +// ** make the file creation mode be exactly m ignoring the umask. +// ** +// ** The m parameter will be non-zero only when creating -wal, -journal, +// ** and -shm files. We want those files to have *exactly* the same +// ** permissions as their original database, unadulterated by the umask. +// ** In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a +// ** transaction crashes and leaves behind hot journals, then any +// ** process that is able to write to the database will also be able to +// ** recover the hot journals. +// */ func _robust_open(tls *crt.TLS, _z *int8, _f int32, _m uint32) (r0 int32) { var _fd int32 var _m2 uint32 @@ -115107,7 +120116,10 @@ func _robust_open(tls *crt.TLS, _z *int8, _f int32, _m uint32) (r0 int32) { return uint32(i32(420)) }() _2: - _fd = (*(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(0)))).X1)})))(tls, _z, _f, int32(_m2)) + _fd = func() func(*crt.TLS, *int8, int32, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(0)))).X1 + return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _z, _f, int32(_m2)) if _fd >= i32(0) { goto _4 } @@ -115119,10 +120131,16 @@ _4: if _fd >= i32(3) { goto _3 } - (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(1)))).X1)})))(tls, _fd) + func() func(*crt.TLS, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(1)))).X1 + return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _fd) Xsqlite3_log(tls, i32(28), str(131701), unsafe.Pointer(_z), _fd) _fd = i32(-1) - if (*(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(0)))).X1)})))(tls, str(131744), _f, int32(_m)) < i32(0) { + if func() func(*crt.TLS, *int8, int32, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(0)))).X1 + return *(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&v)) + }()(tls, str(131744), _f, int32(_m)) < i32(0) { goto _3 } goto _2 @@ -115133,11 +120151,23 @@ _3: if _m == uint32(i32(0)) { goto _9 } - if (((*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _fd, &_4_statbuf) == i32(0)) && ((_4_statbuf.X8) == int64(i32(0)))) && (((_4_statbuf.X3) & uint32(i32(511))) != _m) { - (*(*func(*crt.TLS, int32, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(14)))).X1)})))(tls, _fd, _m) + if ((func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, &_4_statbuf) == i32(0)) && (_4_statbuf.X8 == int64(i32(0)))) && ((_4_statbuf.X3 & uint32(i32(511))) != _m) { + func() func(*crt.TLS, int32, uint32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(14)))).X1 + return *(*func(*crt.TLS, int32, uint32) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, _m) } _9: - (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _fd, i32(2), (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _fd, i32(1), i32(0))|i32(1)) + func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, i32(2), func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, i32(1), i32(0))|i32(1)) _8: return _fd @@ -115157,28 +120187,40 @@ func _unixLogErrorAtLine(tls *crt.TLS, _errcode int32, _zFunc *int8, _zPath *int return _errcode } -// Return the system page size. -// -// This function should not be called directly by other code in this file. -// Instead, it should be called via macro osGetpagesize(). +// C comment +// /* +// ** Return the system page size. +// ** +// ** This function should not be called directly by other code in this file. +// ** Instead, it should be called via macro osGetpagesize(). +// */ func _unixGetpagesize(tls *crt.TLS) (r0 int32) { return int32(crt.Xsysconf(tls, i32(30))) } -// Return TRUE if pFile has been renamed or unlinked since it was first opened. +// C comment +// /* +// ** Return TRUE if pFile has been renamed or unlinked since it was first opened. +// */ func _fileHasMoved(tls *crt.TLS, _pFile *XunixFile) (r0 int32) { var _buf crt.Xstruct_stat64 - return bool2int(((*XunixInodeInfo)(_pFile.X2) != nil) && (((*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(4)))).X1)})))(tls, _pFile.X9, &_buf) != i32(0)) || ((_buf.X1) != ((*TunixFileId)(unsafe.Pointer(&((*XunixInodeInfo)(_pFile.X2).X0))).X1)))) + return bool2int(((*XunixInodeInfo)(_pFile.X2) != nil) && ((func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(4)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X9, &_buf) != i32(0)) || (_buf.X1 != ((*TunixFileId)(unsafe.Pointer(&((*XunixInodeInfo)(_pFile.X2).X0))).X1)))) _ = _buf panic(0) } -// Lower the locking level on file descriptor pFile to eFileLock. eFileLock -// must be either NO_LOCK or SHARED_LOCK. -// -// If the locking level of the file descriptor is already at or below -// the requested locking level, this routine is a no-op. +// C comment +// /* +// ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock +// ** must be either NO_LOCK or SHARED_LOCK. +// ** +// ** If the locking level of the file descriptor is already at or below +// ** the requested locking level, this routine is a no-op. +// */ func _unixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) { func() { if _eFileLock != i32(1) && ((*XunixFile)(unsafe.Pointer(_id)).X12) != i32(0) { @@ -115195,17 +120237,20 @@ func init() { crt.Xstrncpy(nil, &_unixUnlockØ00__func__Ø000[0], str(131842), 11) } -// Lower the locking level on file descriptor pFile to eFileLock. eFileLock -// must be either NO_LOCK or SHARED_LOCK. -// -// If the locking level of the file descriptor is already at or below -// the requested locking level, this routine is a no-op. -// -// If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED -// the byte range is divided into 2 parts and the first part is unlocked then -// set to a read lock, then the other part is simply unlocked. This works -// around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to -// remove the write lock on a region when a read lock is set. +// C comment +// /* +// ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock +// ** must be either NO_LOCK or SHARED_LOCK. +// ** +// ** If the locking level of the file descriptor is already at or below +// ** the requested locking level, this routine is a no-op. +// ** +// ** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED +// ** the byte range is divided into 2 parts and the first part is unlocked then +// ** set to a read lock, then the other part is simply unlocked. This works +// ** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to +// ** remove the write lock on a region when a read lock is set. +// */ func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFSUnlock int32) (r0 int32) { var _rc int32 var _pInode *XunixInodeInfo @@ -115231,7 +120276,7 @@ func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFS _unixEnterMutex(tls) _pInode = (*XunixInodeInfo)(_pFile.X2) func() { - if (_pInode.X1) == i32(0) { + if _pInode.X1 == i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31657), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131876))) crt.X__builtin_abort(tls) } @@ -115245,7 +120290,7 @@ func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFS crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pFile.X19))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pFile.X19)) = uint8(i32(0)) if _eFileLock != i32(1) { goto _10 } @@ -115256,20 +120301,20 @@ func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFS crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(0)) - *(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2)) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510)) + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(i32(0)) + *(*int16)(unsafe.Pointer(&_lock.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte + i32(2)) + *(*int64)(unsafe.Pointer(&_lock.X3)) = int64(i32(510)) if _unixFileLock(tls, _pFile, &_lock) != 0 { _rc = i32(2314) _storeLastErrno(tls, _pFile, *crt.X__errno_location(tls)) goto _end_unlock } _10: - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2)) - *(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = i64(2) + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(i32(2)) + *(*int16)(unsafe.Pointer(&_lock.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte) + *(*int64)(unsafe.Pointer(&_lock.X3)) = i64(2) func() { if (_sqlite3PendingByte + i32(1)) != (_sqlite3PendingByte + i32(1)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31747), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131950))) @@ -115277,7 +120322,7 @@ _10: } }() if _unixFileLock(tls, _pFile, &_lock) == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pInode.X2)) = uint8(i32(1)) goto _17 } _rc = i32(2058) @@ -115288,37 +120333,37 @@ _7: if _eFileLock != i32(0) { goto _end_unlock } - *(*int32)(unsafe.Pointer(&(_pInode.X1))) -= 1 - if (_pInode.X1) != i32(0) { + *(*int32)(unsafe.Pointer(&_pInode.X1)) -= 1 + if _pInode.X1 != i32(0) { goto _19 } - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2)) - *(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_lock.X2))) = store6((*int64)(unsafe.Pointer(&(_lock.X3))), i64(0)) + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(i32(2)) + *(*int16)(unsafe.Pointer(&_lock.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = store6((*int64)(unsafe.Pointer(&_lock.X3)), i64(0)) if _unixFileLock(tls, _pFile, &_lock) == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pInode.X2)) = uint8(i32(0)) goto _21 } _rc = i32(2058) _storeLastErrno(tls, _pFile, *crt.X__errno_location(tls)) - *(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pInode.X2)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(0)) _21: _19: - *(*int32)(unsafe.Pointer(&(_pInode.X6))) -= 1 + *(*int32)(unsafe.Pointer(&_pInode.X6)) -= 1 func() { - if (_pInode.X6) < i32(0) { + if _pInode.X6 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31781), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131980))) crt.X__builtin_abort(tls) } }() - if (_pInode.X6) == i32(0) { + if _pInode.X6 == i32(0) { _closePendingFds(tls, _pFile) } _end_unlock: _unixLeaveMutex(tls) if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(_eFileLock) } return _rc @@ -115332,39 +120377,45 @@ func init() { crt.Xstrncpy(nil, &_posixUnlockØ00__func__Ø000[0], str(131997), 12) } -// Helper functions to obtain and relinquish the global mutex. The -// global mutex is used to protect the unixInodeInfo and -// vxworksFileId objects used by this file, all of which may be -// shared by multiple threads. -// -// Function unixMutexHeld() is used to assert() that the global mutex -// is held when required. This function is only used as part of assert() -// statements. e.g. -// -// unixEnterMutex() -// assert( unixMutexHeld() ); -// unixEnterLeave() +// C comment +// /* +// ** Helper functions to obtain and relinquish the global mutex. The +// ** global mutex is used to protect the unixInodeInfo and +// ** vxworksFileId objects used by this file, all of which may be +// ** shared by multiple threads. +// ** +// ** Function unixMutexHeld() is used to assert() that the global mutex +// ** is held when required. This function is only used as part of assert() +// ** statements. e.g. +// ** +// ** unixEnterMutex() +// ** assert( unixMutexHeld() ); +// ** unixEnterLeave() +// */ func _unixEnterMutex(tls *crt.TLS) { Xsqlite3_mutex_enter(tls, _sqlite3MutexAlloc(tls, i32(11))) } -// Attempt to set a system-lock on the file pFile. The lock is -// described by pLock. -// -// If the pFile was opened read/write from unix-excl, then the only lock -// ever obtained is an exclusive lock, and it is obtained exactly once -// the first time any lock is attempted. All subsequent system locking -// operations become no-ops. Locking operations still happen internally, -// in order to coordinate access between separate database connections -// within this process, but all of that is handled in memory and the -// operating system does not participate. -// -// This function is a pass-through to fcntl(F_SETLK) if pFile is using -// any VFS other than "unix-excl" or if pFile is opened on "unix-excl" -// and is read-only. -// -// Zero is returned if the call completes successfully, or -1 if a call -// to fcntl() fails. In this case, errno is set appropriately (by fcntl()). +// C comment +// /* +// ** Attempt to set a system-lock on the file pFile. The lock is +// ** described by pLock. +// ** +// ** If the pFile was opened read/write from unix-excl, then the only lock +// ** ever obtained is an exclusive lock, and it is obtained exactly once +// ** the first time any lock is attempted. All subsequent system locking +// ** operations become no-ops. Locking operations still happen internally, +// ** in order to coordinate access between separate database connections +// ** within this process, but all of that is handled in memory and the +// ** operating system does not participate. +// ** +// ** This function is a pass-through to fcntl(F_SETLK) if pFile is using +// ** any VFS other than "unix-excl" or if pFile is opened on "unix-excl" +// ** and is read-only. +// ** +// ** Zero is returned if the call completes successfully, or -1 if a call +// ** to fcntl() fails. In this case, errno is set appropriately (by fcntl()). +// */ func _unixFileLock(tls *crt.TLS, _pFile *XunixFile, _pLock *Tflock) (r0 int32) { var _rc int32 var _pInode *XunixInodeInfo @@ -115389,28 +120440,34 @@ func _unixFileLock(tls *crt.TLS, _pFile *XunixFile, _pLock *Tflock) (r0 int32) { goto _5 } func() { - if (_pInode.X6) != i32(0) { + if _pInode.X6 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31349), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFileLockØ00__func__Ø000))), unsafe.Pointer(str(132035))) crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_2_lock.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_2_lock.X2))) = int64(_sqlite3PendingByte + i32(2)) - *(*int64)(unsafe.Pointer(&(_2_lock.X3))) = int64(i32(510)) - *(*int16)(unsafe.Pointer(&(_2_lock.X0))) = int16(i32(1)) - _rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(6), unsafe.Pointer(&_2_lock)) + *(*int16)(unsafe.Pointer(&_2_lock.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_2_lock.X2)) = int64(_sqlite3PendingByte + i32(2)) + *(*int64)(unsafe.Pointer(&_2_lock.X3)) = int64(i32(510)) + *(*int16)(unsafe.Pointer(&_2_lock.X0)) = int16(i32(1)) + _rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X3, i32(6), unsafe.Pointer(&_2_lock)) if _rc < i32(0) { return _rc } - *(*uint8)(unsafe.Pointer(&(_pInode.X3))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1 + *(*uint8)(unsafe.Pointer(&_pInode.X3)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pInode.X6)) += 1 goto _9 _5: _rc = i32(0) _9: goto _10 _4: - _rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(6), unsafe.Pointer(_pLock)) + _rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X3, i32(6), unsafe.Pointer(_pLock)) _10: return _rc @@ -115428,10 +120485,13 @@ func init() { crt.Xstrncpy(nil, &_unixFileLockØ00__func__Ø000[0], str(132052), 13) } -// Set the pFile->lastErrno. Do this in a subroutine as that provides -// a convenient place to set a breakpoint. +// C comment +// /* +// ** Set the pFile->lastErrno. Do this in a subroutine as that provides +// ** a convenient place to set a breakpoint. +// */ func _storeLastErrno(tls *crt.TLS, _pFile *XunixFile, _error int32) { - *(*int32)(unsafe.Pointer(&(_pFile.X6))) = _error + *(*int32)(unsafe.Pointer(&_pFile.X6)) = _error } func _closePendingFds(tls *crt.TLS, _pFile *XunixFile) { @@ -115445,29 +120505,35 @@ _0: } _pNext = (*XUnixUnusedFd)(_p.X2) _robust_close(tls, _pFile, _p.X0, i32(31098)) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) _p = _pNext goto _0 _3: - *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X7))))) = nil -} - -// Close a file descriptor. -// -// We assume that close() almost always works, since it is only in a -// very sick application or on a very sick platform that it might fail. -// If it does fail, simply leak the file descriptor, but do log the -// error. -// -// Note that it is not safe to retry close() after EINTR since the -// file descriptor might have already been reused by another thread. -// So we don't even try to recover from an EINTR. Just log the error -// and move on. + *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInode.X7)))) = nil +} + +// C comment +// /* +// ** Close a file descriptor. +// ** +// ** We assume that close() almost always works, since it is only in a +// ** very sick application or on a very sick platform that it might fail. +// ** If it does fail, simply leak the file descriptor, but do log the +// ** error. +// ** +// ** Note that it is not safe to retry close() after EINTR since the +// ** file descriptor might have already been reused by another thread. +// ** So we don't even try to recover from an EINTR. Just log the error +// ** and move on. +// */ func _robust_close(tls *crt.TLS, _pFile *XunixFile, _h int32, _lineno int32) { - if (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(1)))).X1)})))(tls, _h) != 0 { + if func() func(*crt.TLS, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(1)))).X1 + return *(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _h) != 0 { _unixLogErrorAtLine(tls, i32(4106), str(131509), func() *int8 { if _pFile != nil { - return (_pFile.X9) + return _pFile.X9 } return nil }(), _lineno) @@ -115484,23 +120550,29 @@ func init() { crt.Xstrncpy(nil, &_unixCloseØ00__func__Ø000[0], str(132065), 10) } -// Add the file descriptor used by file handle pFile to the corresponding -// pUnused list. +// C comment +// /* +// ** Add the file descriptor used by file handle pFile to the corresponding +// ** pUnused list. +// */ func _setPendingFd(tls *crt.TLS, _pFile *XunixFile) { var _pInode *XunixInodeInfo var _p *XUnixUnusedFd _pInode = (*XunixInodeInfo)(_pFile.X2) _p = (*XUnixUnusedFd)(_pFile.X8) - *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*XUnixUnusedFd)(_pInode.X7) - *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X7))))) = _p - *(*int32)(unsafe.Pointer(&(_pFile.X3))) = i32(-1) - *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFile.X8))))) = nil -} - -// Release a unixInodeInfo structure previously allocated by findInodeInfo(). -// -// The mutex entered using the unixEnterMutex() function must be held -// when this function is called. + *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X2)))) = (*XUnixUnusedFd)(_pInode.X7) + *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInode.X7)))) = _p + *(*int32)(unsafe.Pointer(&_pFile.X3)) = i32(-1) + *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pFile.X8)))) = nil +} + +// C comment +// /* +// ** Release a unixInodeInfo structure previously allocated by findInodeInfo(). +// ** +// ** The mutex entered using the unixEnterMutex() function must be held +// ** when this function is called. +// */ func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) { var _pInode *XunixInodeInfo _pInode = (*XunixInodeInfo)(_pFile.X2) @@ -115522,8 +120594,8 @@ func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) { }() == 0 { goto _4 } - *(*int32)(unsafe.Pointer(&(_pInode.X4))) -= 1 - if (_pInode.X4) != i32(0) { + *(*int32)(unsafe.Pointer(&_pInode.X4)) -= 1 + if _pInode.X4 != i32(0) { goto _5 } func() { @@ -115533,7 +120605,7 @@ func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) { } }() _closePendingFds(tls, _pFile) - if (*XunixInodeInfo)(_pInode.X9) != nil { + if _pInode.X9 != nil { func() { if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.X9).X8) != _pInode { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31119), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132095))) @@ -115552,7 +120624,7 @@ func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) { _inodeList = (*XunixInodeInfo)(_pInode.X8) bug20530(_inodeList) _11: - if (*XunixInodeInfo)(_pInode.X8) != nil { + if _pInode.X8 != nil { func() { if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.X8).X9) != _pInode { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31126), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132142))) @@ -115561,7 +120633,7 @@ _11: }() *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.X8).X9))))) = (*XunixInodeInfo)(_pInode.X9) } - Xsqlite3_free(tls, (unsafe.Pointer)(_pInode)) + Xsqlite3_free(tls, unsafe.Pointer(_pInode)) _5: _4: } @@ -115574,40 +120646,49 @@ func init() { var _inodeList *XunixInodeInfo -// This function performs the parts of the "close file" operation -// common to all locking schemes. It closes the directory and file -// handles, if they are valid, and sets all fields of the unixFile -// structure to 0. -// -// It is *not* necessary to hold the mutex when this routine is called, -// even on VxWorks. A mutex will be acquired on VxWorks by the -// vxworksReleaseFileId() routine. +// C comment +// /* +// ** This function performs the parts of the "close file" operation +// ** common to all locking schemes. It closes the directory and file +// ** handles, if they are valid, and sets all fields of the unixFile +// ** structure to 0. +// ** +// ** It is *not* necessary to hold the mutex when this routine is called, +// ** even on VxWorks. A mutex will be acquired on VxWorks by the +// ** vxworksReleaseFileId() routine. +// */ func _closeUnixFile(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { var _pFile *XunixFile _pFile = (*XunixFile)(unsafe.Pointer(_id)) _unixUnmapfile(tls, _pFile) - if (_pFile.X3) >= i32(0) { + if _pFile.X3 >= i32(0) { _robust_close(tls, _pFile, _pFile.X3, i32(31828)) - *(*int32)(unsafe.Pointer(&(_pFile.X3))) = i32(-1) + *(*int32)(unsafe.Pointer(&_pFile.X3)) = i32(-1) } Xsqlite3_free(tls, _pFile.X8) - crt.Xmemset(tls, (unsafe.Pointer)(_pFile), i32(0), u64(120)) + crt.Xmemset(tls, unsafe.Pointer(_pFile), i32(0), u64(120)) return i32(0) } -// If it is currently memory mapped, unmap file pFd. +// C comment +// /* +// ** If it is currently memory mapped, unmap file pFd. +// */ func _unixUnmapfile(tls *crt.TLS, _pFd *XunixFile) { func() { - if (_pFd.X12) != i32(0) { + if _pFd.X12 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34596), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnmapfileØ00__func__Ø000))), unsafe.Pointer(str(132188))) crt.X__builtin_abort(tls) } }() - if (_pFd.X16) != nil { - (*(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(23)))).X1)})))(tls, _pFd.X16, uint64(_pFd.X14)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pFd.X16))) = nil - *(*int64)(unsafe.Pointer(&(_pFd.X13))) = int64(i32(0)) - *(*int64)(unsafe.Pointer(&(_pFd.X14))) = int64(i32(0)) + if _pFd.X16 != nil { + func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(23)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, _pFd.X16, uint64(_pFd.X14)) + *(*unsafe.Pointer)(unsafe.Pointer(&_pFd.X16)) = nil + *(*int64)(unsafe.Pointer(&_pFd.X13)) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pFd.X14)) = int64(i32(0)) } } @@ -115617,9 +120698,12 @@ func init() { crt.Xstrncpy(nil, &_unixUnmapfileØ00__func__Ø000[0], str(132206), 14) } -// Read data from a file into a buffer. Return SQLITE_OK if all -// bytes were read successfully and SQLITE_IOERR if anything goes -// wrong. +// C comment +// /* +// ** Read data from a file into a buffer. Return SQLITE_OK if all +// ** bytes were read successfully and SQLITE_IOERR if anything goes +// ** wrong. +// */ func _unixRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) { var _got, _3_nCopy int32 var _pFile *XunixFile @@ -115642,16 +120726,16 @@ func _unixRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int3 crt.X__builtin_abort(tls) } }() - if _offset >= (_pFile.X13) { + if _offset >= _pFile.X13 { goto _6 } - if (_offset + int64(_amt)) <= (_pFile.X13) { - crt.Xmemcpy(tls, _pBuf, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint64(_amt)) + if (_offset + int64(_amt)) <= _pFile.X13 { + crt.Xmemcpy(tls, _pBuf, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint64(_amt)) return i32(0) } - _3_nCopy = int32((_pFile.X13) - _offset) - crt.Xmemcpy(tls, _pBuf, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint64(_3_nCopy)) - _pBuf = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_3_nCopy)))) + _3_nCopy = int32(_pFile.X13 - _offset) + crt.Xmemcpy(tls, _pBuf, unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint64(_3_nCopy)) + _pBuf = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_3_nCopy)))) { p := &_amt *p = (*p) - _3_nCopy @@ -115671,7 +120755,7 @@ _6: return i32(266) } _storeLastErrno(tls, _pFile, i32(0)) - crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(_got)))), i32(0), uint64(_amt-_got)) + crt.Xmemset(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(_got)))), i32(0), uint64(_amt-_got)) return i32(522) } @@ -115681,17 +120765,20 @@ func init() { crt.Xstrncpy(nil, &_unixReadØ00__func__Ø000[0], str(132236), 9) } -// Seek to the offset passed as the second argument, then read cnt -// bytes into pBuf. Return the number of bytes actually read. -// -// NB: If you define USE_PREAD or USE_PREAD64, then it might also -// be necessary to define _XOPEN_SOURCE to be 500. This varies from -// one system to another. Since SQLite does not define USE_PREAD -// in any form by default, we will not attempt to define _XOPEN_SOURCE. -// See tickets #2741 and #2681. -// -// To avoid stomping the errno value on a failed read the lastErrno value -// is set before returning. +// C comment +// /* +// ** Seek to the offset passed as the second argument, then read cnt +// ** bytes into pBuf. Return the number of bytes actually read. +// ** +// ** NB: If you define USE_PREAD or USE_PREAD64, then it might also +// ** be necessary to define _XOPEN_SOURCE to be 500. This varies from +// ** one system to another. Since SQLite does not define USE_PREAD +// ** in any form by default, we will not attempt to define _XOPEN_SOURCE. +// ** See tickets #2741 and #2681. +// ** +// ** To avoid stomping the errno value on a failed read the lastErrno value +// ** is set before returning. +// */ func _seekAndRead(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) { var _got, _prior int32 var _newOffset int64 @@ -115703,7 +120790,7 @@ func _seekAndRead(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Poin } }() func() { - if (_id.X3) <= i32(2) { + if _id.X3 <= i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33014), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndReadØ00__func__Ø000))), unsafe.Pointer(str(132264))) crt.X__builtin_abort(tls) } @@ -115714,7 +120801,10 @@ _4: _storeLastErrno(tls, _id, *crt.X__errno_location(tls)) return i32(-1) } - _got = int32((*(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(8)))).X1)})))(tls, _id.X3, _pBuf, uint64(_cnt))) + _got = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(8)))).X1 + return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v)) + }()(tls, _id.X3, _pBuf, uint64(_cnt))) if _got == _cnt { goto _7 } @@ -115745,7 +120835,7 @@ _8: *p = (*p) + _got sink1(*p) } - _pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_got) + uintptr(unsafe.Pointer((*int8)(_pBuf)))))) + _pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_got) + uintptr(unsafe.Pointer((*int8)(_pBuf)))))) } if _got > i32(0) { goto _4 @@ -115760,8 +120850,11 @@ func init() { crt.Xstrncpy(nil, &_seekAndReadØ00__func__Ø000[0], str(132272), 12) } -// Write data from a buffer into a file. Return SQLITE_OK on success -// or some other error code on failure. +// C comment +// /* +// ** Write data from a buffer into a file. Return SQLITE_OK on success +// ** or some other error code on failure. +// */ func _unixWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) { var _wrote, _2_rc int32 var _2_oldCntr [4]int8 @@ -115780,16 +120873,16 @@ func _unixWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int crt.X__builtin_abort(tls) } }() - if (_pFile.X19) == 0 { + if _pFile.X19 == 0 { goto _4 } - *(*uint8)(unsafe.Pointer(&(_pFile.X18))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pFile.X18)) = uint8(i32(1)) if _offset > int64(i32(24)) || (_offset+int64(_amt)) < int64(i32(27)) { goto _6 } - _2_rc = _seekAndRead(tls, _pFile, int64(i32(24)), (unsafe.Pointer)(&_2_oldCntr), i32(4)) - if (_2_rc != i32(4)) || (crt.Xmemcmp(tls, (unsafe.Pointer)(&_2_oldCntr), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(int64(i32(24))-_offset)))), uint64(i32(4))) != i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(1)) + _2_rc = _seekAndRead(tls, _pFile, int64(i32(24)), unsafe.Pointer(&_2_oldCntr), i32(4)) + if (_2_rc != i32(4)) || (crt.Xmemcmp(tls, unsafe.Pointer(&_2_oldCntr), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(int64(i32(24))-_offset)))), uint64(i32(4))) != i32(0)) { + *(*uint8)(unsafe.Pointer(&_pFile.X17)) = uint8(i32(1)) } _6: _4: @@ -115804,13 +120897,13 @@ _4: *p = (*p) + int64(_wrote) sink6(*p) } - _pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_wrote)))) + _pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_wrote)))) goto _4 } if _amt <= _wrote { goto _12 } - if (_wrote < i32(0)) && ((_pFile.X6) != i32(28)) { + if (_wrote < i32(0)) && (_pFile.X6 != i32(28)) { return i32(778) } _storeLastErrno(tls, _pFile, i32(0)) @@ -115829,20 +120922,26 @@ func init() { crt.Xstrncpy(nil, &_unixWriteØ00__func__Ø000[0], str(132284), 10) } -// Seek to the offset in id->offset then read cnt bytes into pBuf. -// Return the number of bytes actually read. Update the offset. -// -// To avoid stomping the errno value on a failed write the lastErrno value -// is set before returning. +// C comment +// /* +// ** Seek to the offset in id->offset then read cnt bytes into pBuf. +// ** Return the number of bytes actually read. Update the offset. +// ** +// ** To avoid stomping the errno value on a failed write the lastErrno value +// ** is set before returning. +// */ func _seekAndWrite(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) { - return _seekAndWriteFd(tls, _id.X3, _offset, _pBuf, _cnt, (*int32)(unsafe.Pointer(&(_id.X6)))) + return _seekAndWriteFd(tls, _id.X3, _offset, _pBuf, _cnt, (*int32)(unsafe.Pointer(&_id.X6))) } -// Attempt to seek the file-descriptor passed as the first argument to -// absolute offset iOff, then attempt to write nBuf bytes of data from -// pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, -// return the actual number of bytes written (which may be less than -// nBuf). +// C comment +// /* +// ** Attempt to seek the file-descriptor passed as the first argument to +// ** absolute offset iOff, then attempt to write nBuf bytes of data from +// ** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, +// ** return the actual number of bytes written (which may be less than +// ** nBuf). +// */ func _seekAndWriteFd(tls *crt.TLS, _fd int32, _iOff int64, _pBuf unsafe.Pointer, _nBuf int32, _piErrno *int32) (r0 int32) { var _rc int32 var _1_iSeek int64 @@ -115876,7 +120975,10 @@ _6: _rc = i32(-1) goto _8 } - _rc = int32((*(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(11)))).X1)})))(tls, _fd, _pBuf, uint64(_nBuf))) + _rc = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(11)))).X1 + return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v)) + }()(tls, _fd, _pBuf, uint64(_nBuf))) if (_rc < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) { goto _6 } @@ -115893,7 +120995,10 @@ func init() { crt.Xstrncpy(nil, &_seekAndWriteFdØ00__func__Ø000[0], str(132331), 15) } -// Truncate an open file to a specified size +// C comment +// /* +// ** Truncate an open file to a specified size +// */ func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) { var _rc int32 var _pFile *XunixFile @@ -115904,7 +121009,7 @@ func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) { crt.X__builtin_abort(tls) } }() - if (_pFile.X11) > i32(0) { + if _pFile.X11 > i32(0) { _nByte = (((_nByte + int64(_pFile.X11)) - int64(i32(1))) / int64(_pFile.X11)) * int64(_pFile.X11) } _rc = _robust_ftruncate(tls, _pFile.X3, _nByte) @@ -115912,11 +121017,11 @@ func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) { _storeLastErrno(tls, _pFile, *crt.X__errno_location(tls)) return _unixLogErrorAtLine(tls, i32(1546), str(131533), _pFile.X9, i32(33505)) } - if ((_pFile.X19) != 0) && (_nByte == int64(i32(0))) { - *(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(1)) + if (_pFile.X19 != 0) && (_nByte == int64(i32(0))) { + *(*uint8)(unsafe.Pointer(&_pFile.X17)) = uint8(i32(1)) } - if _nByte < (_pFile.X13) { - *(*int64)(unsafe.Pointer(&(_pFile.X13))) = _nByte + if _nByte < _pFile.X13 { + *(*int64)(unsafe.Pointer(&_pFile.X13)) = _nByte } return i32(0) } @@ -115927,34 +121032,43 @@ func init() { crt.Xstrncpy(nil, &_unixTruncateØ00__func__Ø000[0], str(132346), 13) } -// Retry ftruncate() calls that fail due to EINTR -// -// All calls to ftruncate() within this file should be made through -// this wrapper. On the Android platform, bypassing the logic below -// could lead to a corrupt database. +// C comment +// /* +// ** Retry ftruncate() calls that fail due to EINTR +// ** +// ** All calls to ftruncate() within this file should be made through +// ** this wrapper. On the Android platform, bypassing the logic below +// ** could lead to a corrupt database. +// */ func _robust_ftruncate(tls *crt.TLS, _h int32, _sz int64) (r0 int32) { var _rc int32 _0: - _rc = (*(*func(*crt.TLS, int32, int64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(6)))).X1)})))(tls, _h, _sz) + _rc = func() func(*crt.TLS, int32, int64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(6)))).X1 + return *(*func(*crt.TLS, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _h, _sz) if (_rc < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) { goto _0 } return _rc } -// Make sure all writes to a particular file are committed to disk. -// -// If dataOnly==0 then both the file itself and its metadata (file -// size, access time, etc) are synced. If dataOnly!=0 then only the -// file data is synced. -// -// Under Unix, also make sure that the directory entry for the file -// has been created by fsync-ing the directory that contains the file. -// If we do not do this and we encounter a power failure, the directory -// entry for the journal might not exist after we reboot. The next -// SQLite to access the file will not know that the journal exists (because -// the directory entry for the journal was never created) and the transaction -// will not roll back - possibly leading to database corruption. +// C comment +// /* +// ** Make sure all writes to a particular file are committed to disk. +// ** +// ** If dataOnly==0 then both the file itself and its metadata (file +// ** size, access time, etc) are synced. If dataOnly!=0 then only the +// ** file data is synced. +// ** +// ** Under Unix, also make sure that the directory entry for the file +// ** has been created by fsync-ing the directory that contains the file. +// ** If we do not do this and we encounter a power failure, the directory +// ** entry for the journal might not exist after we reboot. The next +// ** SQLite to access the file will not know that the journal exists (because +// ** the directory entry for the journal was never created) and the transaction +// ** will not roll back - possibly leading to database corruption. +// */ func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) { var _rc, _isDataOnly, _isFullsync, _2_dirfd int32 var _pFile *XunixFile @@ -115981,7 +121095,10 @@ func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) { if (int32(_pFile.X5) & i32(8)) == 0 { goto _6 } - _rc = (*(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(17)))).X1)})))(tls, _pFile.X9, &_2_dirfd) + _rc = func() func(*crt.TLS, *int8, *int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(17)))).X1 + return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X9, &_2_dirfd) if _rc == i32(0) { _full_fsync(tls, _2_dirfd, i32(0), i32(0)) _robust_close(tls, _pFile, _2_dirfd, i32(33474)) @@ -115996,7 +121113,7 @@ func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) { _rc = i32(0) _8: { - p := (*uint16)(unsafe.Pointer(&(_pFile.X5))) + p := (*uint16)(unsafe.Pointer(&_pFile.X5)) *p = uint16(int32(*p) & i32(-9)) sink14(*p) } @@ -116010,28 +121127,31 @@ func init() { crt.Xstrncpy(nil, &_unixSyncØ00__func__Ø000[0], str(132457), 9) } -// The fsync() system call does not work as advertised on many -// unix systems. The following procedure is an attempt to make -// it work better. -// -// The SQLITE_NO_SYNC macro disables all fsync()s. This is useful -// for testing when we want to run through the test suite quickly. -// You are strongly advised *not* to deploy with SQLITE_NO_SYNC -// enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash -// or power failure will likely corrupt the database file. -// -// SQLite sets the dataOnly flag if the size of the file is unchanged. -// The idea behind dataOnly is that it should only write the file content -// to disk, not the inode. We only set dataOnly if the file size is -// unchanged since the file size is part of the inode. However, -// Ted Ts'o tells us that fdatasync() will also write the inode if the -// file size has changed. The only real difference between fdatasync() -// and fsync(), Ted tells us, is that fdatasync() will not flush the -// inode if the mtime or owner or other inode attributes have changed. -// We only care about the file size, not the other file attributes, so -// as far as SQLite is concerned, an fdatasync() is always adequate. -// So, we always use fdatasync() if it is available, regardless of -// the value of the dataOnly flag. +// C comment +// /* +// ** The fsync() system call does not work as advertised on many +// ** unix systems. The following procedure is an attempt to make +// ** it work better. +// ** +// ** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful +// ** for testing when we want to run through the test suite quickly. +// ** You are strongly advised *not* to deploy with SQLITE_NO_SYNC +// ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash +// ** or power failure will likely corrupt the database file. +// ** +// ** SQLite sets the dataOnly flag if the size of the file is unchanged. +// ** The idea behind dataOnly is that it should only write the file content +// ** to disk, not the inode. We only set dataOnly if the file size is +// ** unchanged since the file size is part of the inode. However, +// ** Ted Ts'o tells us that fdatasync() will also write the inode if the +// ** file size has changed. The only real difference between fdatasync() +// ** and fsync(), Ted tells us, is that fdatasync() will not flush the +// ** inode if the mtime or owner or other inode attributes have changed. +// ** We only care about the file size, not the other file attributes, so +// ** as far as SQLite is concerned, an fdatasync() is always adequate. +// ** So, we always use fdatasync() if it is available, regardless of +// ** the value of the dataOnly flag. +// */ func _full_fsync(tls *crt.TLS, _fd int32, _fullSync int32, _dataOnly int32) (r0 int32) { var _rc int32 @@ -116041,7 +121161,10 @@ _0: return _rc } -// Determine the current size of a file in bytes +// C comment +// /* +// ** Determine the current size of a file in bytes +// */ func _unixFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) { var _rc int32 var _buf crt.Xstruct_stat64 @@ -116051,7 +121174,10 @@ func _unixFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) { crt.X__builtin_abort(tls) } }() - _rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, (*XunixFile)(unsafe.Pointer(_id)).X3, &_buf) + _rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, (*XunixFile)(unsafe.Pointer(_id)).X3, &_buf) if _rc != i32(0) { _storeLastErrno(tls, (*XunixFile)(unsafe.Pointer(_id)), *crt.X__errno_location(tls)) return i32(1802) @@ -116072,28 +121198,31 @@ func init() { crt.Xstrncpy(nil, &_unixFileSizeØ00__func__Ø000[0], str(132466), 13) } -// Lock the file with the lock specified by parameter eFileLock - one -// of the following: -// -// (1) SHARED_LOCK -// (2) RESERVED_LOCK -// (3) PENDING_LOCK -// (4) EXCLUSIVE_LOCK -// -// Sometimes when requesting one lock state, additional lock states -// are inserted in between. The locking might fail on one of the later -// transitions leaving the lock state different from what it started but -// still short of its goal. The following chart shows the allowed -// transitions and the inserted intermediate states: -// -// UNLOCKED -> SHARED -// SHARED -> RESERVED -// SHARED -> (PENDING) -> EXCLUSIVE -// RESERVED -> (PENDING) -> EXCLUSIVE -// PENDING -> EXCLUSIVE -// -// This routine will only increase a lock. Use the sqlite3OsUnlock() -// routine to lower a locking level. +// C comment +// /* +// ** Lock the file with the lock specified by parameter eFileLock - one +// ** of the following: +// ** +// ** (1) SHARED_LOCK +// ** (2) RESERVED_LOCK +// ** (3) PENDING_LOCK +// ** (4) EXCLUSIVE_LOCK +// ** +// ** Sometimes when requesting one lock state, additional lock states +// ** are inserted in between. The locking might fail on one of the later +// ** transitions leaving the lock state different from what it started but +// ** still short of its goal. The following chart shows the allowed +// ** transitions and the inserted intermediate states: +// ** +// ** UNLOCKED -> SHARED +// ** SHARED -> RESERVED +// ** SHARED -> (PENDING) -> EXCLUSIVE +// ** RESERVED -> (PENDING) -> EXCLUSIVE +// ** PENDING -> EXCLUSIVE +// ** +// ** This routine will only increase a lock. Use the sqlite3OsUnlock() +// ** routine to lower a locking level. +// */ func _unixLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) { var _rc, _tErrno int32 var _pInode *XunixInodeInfo @@ -116149,28 +121278,28 @@ func _unixLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) { } }() func() { - if (_pInode.X1) <= i32(0) { + if _pInode.X1 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31485), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132656))) crt.X__builtin_abort(tls) } }() - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_pInode.X1))) += 1 - *(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1 + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pInode.X1)) += 1 + *(*int32)(unsafe.Pointer(&_pInode.X6)) += 1 goto _end_lock } - *(*int64)(unsafe.Pointer(&(_lock.X3))) = i64(1) - *(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_lock.X3)) = i64(1) + *(*int16)(unsafe.Pointer(&_lock.X1)) = int16(i32(0)) if _eFileLock != i32(1) && (_eFileLock != i32(4) || int32(_pFile.X4) >= i32(3)) { goto _25 } - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(func() int32 { + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(func() int32 { if _eFileLock == i32(1) { return i32(0) } return i32(1) }()) - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte) if _unixFileLock(tls, _pFile, &_lock) == 0 { goto _28 } @@ -116186,7 +121315,7 @@ _25: goto _30 } func() { - if (_pInode.X1) != i32(0) { + if _pInode.X1 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31519), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132674))) crt.X__builtin_abort(tls) } @@ -116203,15 +121332,15 @@ _25: crt.X__builtin_abort(tls) } }() - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2)) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte + i32(2)) + *(*int64)(unsafe.Pointer(&_lock.X3)) = int64(i32(510)) if _unixFileLock(tls, _pFile, &_lock) != 0 { _tErrno = *crt.X__errno_location(tls) _rc = _sqliteErrorFromPosixError(tls, _tErrno, i32(3850)) } - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = i64(1) - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte) + *(*int64)(unsafe.Pointer(&_lock.X3)) = i64(1) + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(i32(2)) if _unixFileLock(tls, _pFile, &_lock) != 0 && (_rc == i32(0)) { _tErrno = *crt.X__errno_location(tls) _rc = i32(2058) @@ -116224,12 +121353,12 @@ _25: } goto _end_lock _40: - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1)) - *(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1 - *(*int32)(unsafe.Pointer(&(_pInode.X1))) = i32(1) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(1)) + *(*int32)(unsafe.Pointer(&_pInode.X6)) += 1 + *(*int32)(unsafe.Pointer(&_pInode.X1)) = i32(1) goto _46 _30: - if (_eFileLock == i32(4)) && ((_pInode.X1) > i32(1)) { + if (_eFileLock == i32(4)) && (_pInode.X1 > i32(1)) { _rc = i32(5) goto _46 } @@ -116239,7 +121368,7 @@ _30: crt.X__builtin_abort(tls) } }() - *(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(1)) + *(*int16)(unsafe.Pointer(&_lock.X0)) = int16(i32(1)) func() { if _eFileLock != i32(2) && _eFileLock != i32(4) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31563), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132734))) @@ -116247,12 +121376,12 @@ _30: } }() if _eFileLock == i32(2) { - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(1)) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = i64(1) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte + i32(1)) + *(*int64)(unsafe.Pointer(&_lock.X3)) = i64(1) goto _53 } - *(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2)) - *(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510)) + *(*int64)(unsafe.Pointer(&_lock.X2)) = int64(_sqlite3PendingByte + i32(2)) + *(*int64)(unsafe.Pointer(&_lock.X3)) = int64(i32(510)) _53: if _unixFileLock(tls, _pFile, &_lock) == 0 { goto _54 @@ -116265,18 +121394,18 @@ _53: _54: _46: if ((_rc == i32(0)) && (int32(_pFile.X4) <= i32(1))) && (_eFileLock == i32(2)) { - *(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pFile.X18))) = uint8(i32(0)) - *(*uint8)(unsafe.Pointer(&(_pFile.X19))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pFile.X17)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pFile.X18)) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pFile.X19)) = uint8(i32(1)) } if _rc == i32(0) { - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock) - *(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(_eFileLock) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(_eFileLock) + *(*uint8)(unsafe.Pointer(&_pInode.X2)) = uint8(_eFileLock) goto _end_lock } if _eFileLock == i32(4) { - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(3)) - *(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(3)) + *(*uint8)(unsafe.Pointer(&_pInode.X2)) = uint8(i32(3)) } _end_lock: _unixLeaveMutex(tls) @@ -116292,14 +121421,17 @@ func init() { crt.Xstrncpy(nil, &_unixLockØ00__func__Ø000[0], str(132788), 9) } -// This routine translates a standard POSIX errno code into something -// useful to the clients of the sqlite3 functions. Specifically, it is -// intended to translate a variety of "try again" errors into SQLITE_BUSY -// and a variety of "please close the file descriptor NOW" errors into -// SQLITE_IOERR -// -// Errors during initialization of locks, or file system support for locks, -// should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. +// C comment +// /* +// ** This routine translates a standard POSIX errno code into something +// ** useful to the clients of the sqlite3 functions. Specifically, it is +// ** intended to translate a variety of "try again" errors into SQLITE_BUSY +// ** and a variety of "please close the file descriptor NOW" errors into +// ** SQLITE_IOERR +// ** +// ** Errors during initialization of locks, or file system support for locks, +// ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. +// */ func _sqliteErrorFromPosixError(tls *crt.TLS, _posixError int32, _sqliteIOErr int32) (r0 int32) { func() { if _sqliteIOErr != i32(3850) && _sqliteIOErr != i32(2058) && _sqliteIOErr != i32(2314) && _sqliteIOErr != i32(3594) { @@ -116342,10 +121474,13 @@ func init() { crt.Xstrncpy(nil, &_sqliteErrorFromPosixErrorØ00__func__Ø000[0], str(132963), 26) } -// This routine checks if there is a RESERVED lock held on the specified -// file by this or any other process. If such a lock is held, set *pResOut -// to a non-zero value otherwise *pResOut is set to zero. The return value -// is set to SQLITE_OK unless an I/O error occurs during lock checking. +// C comment +// /* +// ** This routine checks if there is a RESERVED lock held on the specified +// ** file by this or any other process. If such a lock is held, set *pResOut +// ** to a non-zero value otherwise *pResOut is set to zero. The return value +// ** is set to SQLITE_OK unless an I/O error occurs during lock checking. +// */ func _unixCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) { var _rc, _reserved int32 var _pFile *XunixFile @@ -116372,11 +121507,14 @@ func _unixCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) ( if _reserved != 0 || ((*XunixInodeInfo)(_pFile.X2).X3) != 0 { goto _6 } - *(*int16)(unsafe.Pointer(&(_2_lock.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_2_lock.X2))) = int64(_sqlite3PendingByte + i32(1)) - *(*int64)(unsafe.Pointer(&(_2_lock.X3))) = int64(i32(1)) - *(*int16)(unsafe.Pointer(&(_2_lock.X0))) = int16(i32(1)) - if (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(5), unsafe.Pointer(&_2_lock)) != 0 { + *(*int16)(unsafe.Pointer(&_2_lock.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_2_lock.X2)) = int64(_sqlite3PendingByte + i32(1)) + *(*int64)(unsafe.Pointer(&_2_lock.X3)) = int64(i32(1)) + *(*int16)(unsafe.Pointer(&_2_lock.X0)) = int16(i32(1)) + if func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X3, i32(5), unsafe.Pointer(&_2_lock)) != 0 { _rc = i32(3594) _storeLastErrno(tls, _pFile, *crt.X__errno_location(tls)) goto _9 @@ -116400,7 +121538,10 @@ func init() { crt.Xstrncpy(nil, &_unixCheckReservedLockØ00__func__Ø000[0], str(133019), 22) } -// Information and control of an open file handle. +// C comment +// /* +// ** Information and control of an open file handle. +// */ func _unixFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) { var _5_rc, _12_rc int32 var _12_newLimit int64 @@ -116443,7 +121584,7 @@ _2: return i32(0) _3: - *(*int32)(unsafe.Pointer(&(_pFile.X11))) = *(*int32)(_pArg) + *(*int32)(unsafe.Pointer(&_pFile.X11)) = *(*int32)(_pArg) return i32(0) _4: @@ -116477,15 +121618,15 @@ _9: _10: _12_newLimit = *(*int64)(_pArg) _12_rc = i32(0) - if _12_newLimit > (_sqlite3Config.X18) { + if _12_newLimit > _sqlite3Config.X18 { _12_newLimit = _sqlite3Config.X18 } *(*int64)(_pArg) = _pFile.X15 - if _12_newLimit < int64(i32(0)) || _12_newLimit == (_pFile.X15) || (_pFile.X12) != i32(0) { + if _12_newLimit < int64(i32(0)) || _12_newLimit == _pFile.X15 || _pFile.X12 != i32(0) { goto _17 } - *(*int64)(unsafe.Pointer(&(_pFile.X15))) = _12_newLimit - if (_pFile.X13) > int64(i32(0)) { + *(*int64)(unsafe.Pointer(&_pFile.X15)) = _12_newLimit + if _pFile.X13 > int64(i32(0)) { _unixUnmapfile(tls, _pFile) _12_rc = _unixMapfile(tls, _pFile, int64(i32(-1))) } @@ -116500,29 +121641,35 @@ _12: return i32(12) } -// This function is called to handle the SQLITE_FCNTL_SIZE_HINT -// file-control operation. Enlarge the database to nBytes in size -// (rounded up to the next chunk-size). If the database is already -// nBytes or larger, this routine is a no-op. +// C comment +// /* +// ** This function is called to handle the SQLITE_FCNTL_SIZE_HINT +// ** file-control operation. Enlarge the database to nBytes in size +// ** (rounded up to the next chunk-size). If the database is already +// ** nBytes or larger, this routine is a no-op. +// */ func _fcntlSizeHint(tls *crt.TLS, _pFile *XunixFile, _nByte int64) (r0 int32) { var _3_nBlk, _3_nWrite, _5_rc int32 var _1_nSize, _3_iWrite int64 var _1_buf crt.Xstruct_stat64 - if (_pFile.X11) <= i32(0) { + if _pFile.X11 <= i32(0) { goto _0 } - if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _pFile.X3, &_1_buf) != 0 { + if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pFile.X3, &_1_buf) != 0 { return i32(1802) } _1_nSize = (((_nByte + int64(_pFile.X11)) - int64(i32(1))) / int64(_pFile.X11)) * int64(_pFile.X11) - if _1_nSize <= (_1_buf.X8) { + if _1_nSize <= _1_buf.X8 { goto _2 } _3_nBlk = int32(_1_buf.X9) _3_nWrite = i32(0) - _3_iWrite = ((((_1_buf.X8) / int64(_3_nBlk)) * int64(_3_nBlk)) + int64(_3_nBlk)) - int64(i32(1)) + _3_iWrite = (((_1_buf.X8 / int64(_3_nBlk)) * int64(_3_nBlk)) + int64(_3_nBlk)) - int64(i32(1)) func() { - if _3_iWrite < (_1_buf.X8) { + if _3_iWrite < _1_buf.X8 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33609), unsafe.Pointer((*int8)(unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000))), unsafe.Pointer(str(133041))) crt.X__builtin_abort(tls) } @@ -116540,7 +121687,7 @@ _7: if _3_iWrite >= _1_nSize { _3_iWrite = _1_nSize - int64(i32(1)) } - _3_nWrite = _seekAndWrite(tls, _pFile, _3_iWrite, (unsafe.Pointer)(str(0)), i32(1)) + _3_nWrite = _seekAndWrite(tls, _pFile, _3_iWrite, unsafe.Pointer(str(0)), i32(1)) if _3_nWrite != i32(1) { return i32(778) } @@ -116553,10 +121700,10 @@ _7: _10: _2: _0: - if (_pFile.X15) <= int64(i32(0)) || _nByte <= (_pFile.X13) { + if _pFile.X15 <= int64(i32(0)) || _nByte <= _pFile.X13 { goto _14 } - if (_pFile.X11) > i32(0) { + if _pFile.X11 > i32(0) { goto _15 } if _robust_ftruncate(tls, _pFile.X3, _nByte) != 0 { @@ -116580,55 +121727,61 @@ func init() { crt.Xstrncpy(nil, &_fcntlSizeHintØ00__func__Ø000[0], str(133082), 14) } -// Memory map or remap the file opened by file-descriptor pFd (if the file -// is already mapped, the existing mapping is replaced by the new). Or, if -// there already exists a mapping for this file, and there are still -// outstanding xFetch() references to it, this function is a no-op. -// -// If parameter nByte is non-negative, then it is the requested size of -// the mapping to create. Otherwise, if nByte is less than zero, then the -// requested size is the size of the file on disk. The actual size of the -// created mapping is either the requested size or the value configured -// using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller. -// -// SQLITE_OK is returned if no error occurs (even if the mapping is not -// recreated as a result of outstanding references) or an SQLite error -// code otherwise. +// C comment +// /* +// ** Memory map or remap the file opened by file-descriptor pFd (if the file +// ** is already mapped, the existing mapping is replaced by the new). Or, if +// ** there already exists a mapping for this file, and there are still +// ** outstanding xFetch() references to it, this function is a no-op. +// ** +// ** If parameter nByte is non-negative, then it is the requested size of +// ** the mapping to create. Otherwise, if nByte is less than zero, then the +// ** requested size is the size of the file on disk. The actual size of the +// ** created mapping is either the requested size or the value configured +// ** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller. +// ** +// ** SQLITE_OK is returned if no error occurs (even if the mapping is not +// ** recreated as a result of outstanding references) or an SQLite error +// ** code otherwise. +// */ func _unixMapfile(tls *crt.TLS, _pFd *XunixFile, _nMap int64) (r0 int32) { var _1_statbuf crt.Xstruct_stat64 func() { - if _nMap < int64(i32(0)) && (_pFd.X12) != i32(0) { + if _nMap < int64(i32(0)) && _pFd.X12 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34713), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133096))) crt.X__builtin_abort(tls) } }() func() { - if _nMap <= int64(i32(0)) && ((_pFd.X13) != int64(i32(0)) || _pFd.X16 != nil) { + if _nMap <= int64(i32(0)) && (_pFd.X13 != int64(i32(0)) || _pFd.X16 != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34714), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133125))) crt.X__builtin_abort(tls) } }() - if (_pFd.X12) > i32(0) { + if _pFd.X12 > i32(0) { return i32(0) } if _nMap >= int64(i32(0)) { goto _8 } - if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _pFd.X3, &_1_statbuf) != 0 { + if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pFd.X3, &_1_statbuf) != 0 { return i32(1802) } _nMap = _1_statbuf.X8 _8: - if _nMap > (_pFd.X15) { + if _nMap > _pFd.X15 { _nMap = _pFd.X15 } func() { - if _nMap <= int64(i32(0)) && ((_pFd.X13) != int64(i32(0)) || _pFd.X16 != nil) { + if _nMap <= int64(i32(0)) && (_pFd.X13 != int64(i32(0)) || _pFd.X16 != nil) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34728), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133125))) crt.X__builtin_abort(tls) } }() - if _nMap != (_pFd.X13) { + if _nMap != _pFd.X13 { _unixRemapfile(tls, _pFd, _nMap) } return i32(0) @@ -116643,19 +121796,22 @@ func init() { crt.Xstrncpy(nil, &_unixMapfileØ00__func__Ø000[0], str(133176), 12) } -// Attempt to set the size of the memory mapping maintained by file -// descriptor pFd to nNew bytes. Any existing mapping is discarded. -// -// If successful, this function sets the following variables: -// -// unixFile.pMapRegion -// unixFile.mmapSize -// unixFile.mmapSizeActual -// -// If unsuccessful, an error message is logged via sqlite3_log() and -// the three variables above are zeroed. In this case SQLite should -// continue accessing the database using the xRead() and xWrite() -// methods. +// C comment +// /* +// ** Attempt to set the size of the memory mapping maintained by file +// ** descriptor pFd to nNew bytes. Any existing mapping is discarded. +// ** +// ** If successful, this function sets the following variables: +// ** +// ** unixFile.pMapRegion +// ** unixFile.mmapSize +// ** unixFile.mmapSizeActual +// ** +// ** If unsuccessful, an error message is logged via sqlite3_log() and +// ** the three variables above are zeroed. In this case SQLite should +// ** continue accessing the database using the xRead() and xWrite() +// ** methods. +// */ func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) { var _h, _flags, _1_szSyspage int32 var _nOrig, _1_nReuse int64 @@ -116668,19 +121824,19 @@ func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) { _pNew = nil _flags = i32(1) func() { - if (_pFd.X12) != i32(0) { + if _pFd.X12 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34631), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(132188))) crt.X__builtin_abort(tls) } }() func() { - if _nNew <= (_pFd.X13) { + if _nNew <= _pFd.X13 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34632), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133188))) crt.X__builtin_abort(tls) } }() func() { - if _nNew > (_pFd.X15) { + if _nNew > _pFd.X15 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34633), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133207))) crt.X__builtin_abort(tls) } @@ -116692,7 +121848,7 @@ func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) { } }() func() { - if (_pFd.X14) < (_pFd.X13) { + if _pFd.X14 < _pFd.X13 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34635), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133230))) crt.X__builtin_abort(tls) } @@ -116706,18 +121862,30 @@ func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) { if _pOrig == nil { goto _12 } - _1_szSyspage = (*(*func(*crt.TLS) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(25)))).X1)})))(tls) - _1_nReuse = (_pFd.X13) & int64(^(_1_szSyspage - i32(1))) - _1_pReq = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOrig)) + 1*uintptr(_1_nReuse))) + _1_szSyspage = func() func(*crt.TLS) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(25)))).X1 + return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v)) + }()(tls) + _1_nReuse = _pFd.X13 & int64(^(_1_szSyspage - i32(1))) + _1_pReq = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pOrig)) + 1*uintptr(_1_nReuse))) if _1_nReuse != _nOrig { - (*(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_1_pReq), uint64(_nOrig-_1_nReuse)) - } - _pNew = (*uint8)((*(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(22)))).X1)})))(tls, (unsafe.Pointer)(_1_pReq), uint64(_nNew-_1_nReuse), _flags, i32(1), _h, _1_nReuse)) + func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(23)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, unsafe.Pointer(_1_pReq), uint64(_nOrig-_1_nReuse)) + } + _pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(22)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, unsafe.Pointer(_1_pReq), uint64(_nNew-_1_nReuse), _flags, i32(1), _h, _1_nReuse)) if _pNew == (*uint8)(crt.U2P(uintptr(u64(18446744073709551615)))) { goto _14 } if _pNew != _1_pReq { - (*(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_pNew), uint64(_nNew-_1_nReuse)) + func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(23)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, unsafe.Pointer(_pNew), uint64(_nNew-_1_nReuse)) _pNew = nil goto _16 } @@ -116725,20 +121893,26 @@ func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) { _16: _14: if (_pNew == (*uint8)(crt.U2P(uintptr(u64(18446744073709551615))))) || (_pNew == nil) { - (*(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_pOrig), uint64(_1_nReuse)) + func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(23)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, unsafe.Pointer(_pOrig), uint64(_1_nReuse)) } _12: if _pNew == nil { - _pNew = (*uint8)((*(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(22)))).X1)})))(tls, nil, uint64(_nNew), _flags, i32(1), _h, int64(i32(0)))) + _pNew = (*uint8)(func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(22)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, nil, uint64(_nNew), _flags, i32(1), _h, int64(i32(0)))) } if _pNew == (*uint8)(crt.U2P(uintptr(u64(18446744073709551615)))) { _pNew = nil _nNew = int64(i32(0)) _unixLogErrorAtLine(tls, i32(0), _zErr, _pFd.X9, i32(34685)) - *(*int64)(unsafe.Pointer(&(_pFd.X15))) = int64(i32(0)) + *(*int64)(unsafe.Pointer(&_pFd.X15)) = int64(i32(0)) } - *(*unsafe.Pointer)(unsafe.Pointer(&(_pFd.X16))) = (unsafe.Pointer)(_pNew) - *(*int64)(unsafe.Pointer(&(_pFd.X13))) = store6((*int64)(unsafe.Pointer(&(_pFd.X14))), _nNew) + *(*unsafe.Pointer)(unsafe.Pointer(&_pFd.X16)) = unsafe.Pointer(_pNew) + *(*int64)(unsafe.Pointer(&_pFd.X13)) = store6((*int64)(unsafe.Pointer(&_pFd.X14)), _nNew) } var _unixRemapfileØ00__func__Ø000 [14]int8 @@ -116747,10 +121921,13 @@ func init() { crt.Xstrncpy(nil, &_unixRemapfileØ00__func__Ø000[0], str(133279), 14) } -// If *pArg is initially negative then this is a query. Set *pArg to -// 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set. -// -// If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags. +// C comment +// /* +// ** If *pArg is initially negative then this is a query. Set *pArg to +// ** 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set. +// ** +// ** If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags. +// */ func _unixModeBit(tls *crt.TLS, _pFile *XunixFile, _mask uint8, _pArg *int32) { if (*_pArg) < i32(0) { *_pArg = bool2int((int32(_pFile.X5) & int32(_mask)) != i32(0)) @@ -116758,47 +121935,53 @@ func _unixModeBit(tls *crt.TLS, _pFile *XunixFile, _mask uint8, _pArg *int32) { } if (*_pArg) == i32(0) { { - p := (*uint16)(unsafe.Pointer(&(_pFile.X5))) + p := (*uint16)(unsafe.Pointer(&_pFile.X5)) *p = uint16(int32(*p) & (^int32(_mask))) sink14(*p) } goto _3 } { - p := (*uint16)(unsafe.Pointer(&(_pFile.X5))) + p := (*uint16)(unsafe.Pointer(&_pFile.X5)) *p = uint16(int32(*p) | int32(_mask)) sink14(*p) } _3: } -// Create a temporary file name in zBuf. zBuf must be allocated -// by the calling process and must be big enough to hold at least -// pVfs->mxPathname bytes. +// C comment +// /* +// ** Create a temporary file name in zBuf. zBuf must be allocated +// ** by the calling process and must be big enough to hold at least +// ** pVfs->mxPathname bytes. +// */ func _unixGetTempname(tls *crt.TLS, _nBuf int32, _zBuf *int8) (r0 int32) { var _iLimit int32 var _1_r uint64 var _zDir *int8 _iLimit = i32(0) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0)) _zDir = _unixTempFileDir(tls) if _zDir == nil { return i32(6410) } _0: - Xsqlite3_randomness(tls, int32(u64(8)), (unsafe.Pointer)(&_1_r)) + Xsqlite3_randomness(tls, int32(u64(8)), unsafe.Pointer(&_1_r)) func() { if _nBuf <= i32(2) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35347), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixGetTempnameØ00__func__Ø000))), unsafe.Pointer(str(133293))) crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_nBuf-i32(2)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(_nBuf-i32(2)))) = int8(i32(0)) Xsqlite3_snprintf(tls, _nBuf, _zBuf, str(133300), unsafe.Pointer(_zDir), _1_r, i32(0)) - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_nBuf-i32(2))))) != i32(0)) || (postInc1(&_iLimit, int32(1)) > i32(10)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(_nBuf-i32(2))))) != i32(0)) || (postInc1(&_iLimit, 1) > i32(10)) { return i32(1) } - if (*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(2)))).X1)})))(tls, _zBuf, i32(0)) == i32(0) { + if func() func(*crt.TLS, *int8, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(2)))).X1 + return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _zBuf, i32(0)) == i32(0) { goto _0 } return i32(0) @@ -116807,28 +121990,37 @@ _0: panic(0) } -// Return the name of a directory in which to put temporary files. -// If no suitable temporary file directory can be found, return NULL. +// C comment +// /* +// ** Return the name of a directory in which to put temporary files. +// ** If no suitable temporary file directory can be found, return NULL. +// */ func _unixTempFileDir(tls *crt.TLS) (r0 *int8) { var _i uint32 var _zDir *int8 var _buf crt.Xstruct_stat64 _i = u32(0) _zDir = Xsqlite3_temp_directory - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(0))))) == nil { - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(0)))) = crt.Xgetenv(tls, str(133317)) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(0))))) == nil { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(0)))) = crt.Xgetenv(tls, str(133317)) } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(1))))) == nil { - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(1)))) = crt.Xgetenv(tls, str(133331)) + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(1))))) == nil { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(i32(1)))) = crt.Xgetenv(tls, str(133331)) } _1: - if (((_zDir != nil) && ((*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(4)))).X1)})))(tls, _zDir, &_buf) == i32(0))) && (((_buf.X3) & uint32(i32(61440))) == uint32(i32(16384)))) && ((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(2)))).X1)})))(tls, _zDir, i32(3)) == i32(0)) { + if (((_zDir != nil) && (func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(4)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _zDir, &_buf) == i32(0))) && ((_buf.X3 & uint32(i32(61440))) == uint32(i32(16384)))) && (func() func(*crt.TLS, *int8, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(2)))).X1 + return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _zDir, i32(3)) == i32(0)) { return _zDir } if uint64(_i) >= u64(6) { goto _3 } - _zDir = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(postInc5(&_i, uint32(1))))) + _zDir = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_unixTempFileDirØ00azDirsØ001)) + 8*uintptr(postInc5(&_i, uint32(1))))) goto _1 _3: return nil @@ -116853,17 +122045,20 @@ func _unixSectorSize(tls *crt.TLS, _NotUsed *Xsqlite3_file) (r0 int32) { return i32(4096) } -// Return the device characteristics for the file. -// -// This VFS is set up to return SQLITE_IOCAP_POWERSAFE_OVERWRITE by default. -// However, that choice is controversial since technically the underlying -// file system does not always provide powersafe overwrites. (In other -// words, after a power-loss event, parts of the file that were never -// written might end up being altered.) However, non-PSOW behavior is very, -// very rare. And asserting PSOW makes a large reduction in the amount -// of required I/O for journaling, since a lot of padding is eliminated. -// Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control -// available to turn it off and URI query parameter available to turn it off. +// C comment +// /* +// ** Return the device characteristics for the file. +// ** +// ** This VFS is set up to return SQLITE_IOCAP_POWERSAFE_OVERWRITE by default. +// ** However, that choice is controversial since technically the underlying +// ** file system does not always provide powersafe overwrites. (In other +// ** words, after a power-loss event, parts of the file that were never +// ** written might end up being altered.) However, non-PSOW behavior is very, +// ** very rare. And asserting PSOW makes a large reduction in the amount +// ** of required I/O for journaling, since a lot of padding is eliminated. +// ** Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control +// ** available to turn it off and URI query parameter available to turn it off. +// */ func _unixDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { var _rc int32 var _p *XunixFile @@ -116879,23 +122074,26 @@ func _unixDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { return _rc } -// This function is called to obtain a pointer to region iRegion of the -// shared-memory associated with the database file fd. Shared-memory regions -// are numbered starting from zero. Each shared-memory region is szRegion -// bytes in size. -// -// If an error occurs, an error code is returned and *pp is set to NULL. -// -// Otherwise, if the bExtend parameter is 0 and the requested shared-memory -// region has not been allocated (by any client, including one running in a -// separate process), then *pp is set to NULL and SQLITE_OK returned. If -// bExtend is non-zero and the requested shared-memory region has not yet -// been allocated, it is allocated by this function. -// -// If the shared-memory region has already been allocated or is allocated by -// this call as described above, then it is mapped into this processes -// address space (if it is not already), *pp is set to point to the mapped -// memory and SQLITE_OK returned. +// C comment +// /* +// ** This function is called to obtain a pointer to region iRegion of the +// ** shared-memory associated with the database file fd. Shared-memory regions +// ** are numbered starting from zero. Each shared-memory region is szRegion +// ** bytes in size. +// ** +// ** If an error occurs, an error code is returned and *pp is set to NULL. +// ** +// ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory +// ** region has not been allocated (by any client, including one running in a +// ** separate process), then *pp is set to NULL and SQLITE_OK returned. If +// ** bExtend is non-zero and the requested shared-memory region has not yet +// ** been allocated, it is allocated by this function. +// ** +// ** If the shared-memory region has already been allocated or is allocated by +// ** this call as described above, then it is mapped into this processes +// ** address space (if it is not already), *pp is set to point to the mapped +// ** memory and SQLITE_OK returned. +// */ func _unixShmMap(tls *crt.TLS, _fd *Xsqlite3_file, _iRegion int32, _szRegion int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) { var _rc, _nShmPerMap, _nReqRegion, _2_nByte, _7_iPg, _8_x, _11_nMap, _11_i int32 var _9_zFile *int8 @@ -116920,7 +122118,7 @@ _0: _pShmNode = (*XunixShmNode)(_p.X0) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) func() { - if _szRegion != (_pShmNode.X4) && int32(_pShmNode.X5) != i32(0) { + if _szRegion != _pShmNode.X4 && int32(_pShmNode.X5) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34296), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133377))) crt.X__builtin_abort(tls) } @@ -116932,13 +122130,13 @@ _0: } }() func() { - if (_pShmNode.X3) < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) { + if _pShmNode.X3 < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34298), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133462))) crt.X__builtin_abort(tls) } }() func() { - if (_pShmNode.X3) >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) { + if _pShmNode.X3 >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34299), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133511))) crt.X__builtin_abort(tls) } @@ -116948,15 +122146,18 @@ _0: goto _shmpage_out } _2_nByte = _nReqRegion * _szRegion - *(*int32)(unsafe.Pointer(&(_pShmNode.X4))) = _szRegion - if (_pShmNode.X3) < i32(0) { + *(*int32)(unsafe.Pointer(&_pShmNode.X4)) = _szRegion + if _pShmNode.X3 < i32(0) { goto _14 } - if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _pShmNode.X3, &_2_sStat) != 0 { + if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pShmNode.X3, &_2_sStat) != 0 { _rc = i32(4874) goto _shmpage_out } - if (_2_sStat.X8) >= int64(_2_nByte) { + if _2_sStat.X8 >= int64(_2_nByte) { goto _16 } if _bExtend == 0 { @@ -116968,13 +122169,13 @@ _0: crt.X__builtin_abort(tls) } }() - _7_iPg = int32((_2_sStat.X8) / int64(_unixShmMapØ00pgszØ001)) + _7_iPg = int32(_2_sStat.X8 / int64(_unixShmMapØ00pgszØ001)) _21: if _7_iPg >= (_2_nByte / _unixShmMapØ00pgszØ001) { goto _24 } _8_x = i32(0) - if _seekAndWriteFd(tls, _pShmNode.X3, int64(((_7_iPg*_unixShmMapØ00pgszØ001)+_unixShmMapØ00pgszØ001)-i32(1)), (unsafe.Pointer)(str(0)), i32(1), &_8_x) != i32(1) { + if _seekAndWriteFd(tls, _pShmNode.X3, int64(((_7_iPg*_unixShmMapØ00pgszØ001)+_unixShmMapØ00pgszØ001)-i32(1)), unsafe.Pointer(str(0)), i32(1), &_8_x) != i32(1) { _9_zFile = _pShmNode.X2 _rc = _unixLogErrorAtLine(tls, i32(4874), str(131568), _9_zFile, i32(34346)) goto _shmpage_out @@ -116984,22 +122185,25 @@ _21: _24: _16: _14: - _2_apNew = (**int8)(Xsqlite3_realloc(tls, (unsafe.Pointer)(_pShmNode.X7), int32(uint64(_nReqRegion)*u64(8)))) + _2_apNew = (**int8)(Xsqlite3_realloc(tls, unsafe.Pointer(_pShmNode.X7), int32(uint64(_nReqRegion)*u64(8)))) if _2_apNew == nil { _rc = _sqlite3IoerrnomemError(tls, i32(34359)) goto _shmpage_out } - *(***int8)(unsafe.Pointer(&(_pShmNode.X7))) = _2_apNew + *(***int8)(unsafe.Pointer(&_pShmNode.X7)) = _2_apNew _27: if int32(_pShmNode.X5) >= _nReqRegion { goto _28 } _11_nMap = _szRegion * _nShmPerMap - if (_pShmNode.X3) < i32(0) { + if _pShmNode.X3 < i32(0) { goto _29 } - _11_pMem = (*(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(22)))).X1)})))(tls, nil, uint64(_11_nMap), func() int32 { - if (_pShmNode.X6) != 0 { + _11_pMem = func() func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(22)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, nil, uint64(_11_nMap), func() int32 { + if _pShmNode.X6 != 0 { return i32(1) } return i32(3) @@ -117022,12 +122226,12 @@ _35: if _11_i >= _nShmPerMap { goto _38 } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode.X7)) + 8*uintptr(int32(_pShmNode.X5)+_11_i))) = (*int8)(unsafe.Pointer(uintptr(_11_pMem) + 1*uintptr(_szRegion*_11_i))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pShmNode.X7)) + 8*uintptr(int32(_pShmNode.X5)+_11_i))) = (*int8)(unsafe.Pointer(uintptr(_11_pMem) + 1*uintptr(_szRegion*_11_i))) _11_i += 1 goto _35 _38: { - p := (*uint16)(unsafe.Pointer(&(_pShmNode.X5))) + p := (*uint16)(unsafe.Pointer(&_pShmNode.X5)) *p = uint16(int32(*p) + _nShmPerMap) sink14(*p) } @@ -117035,12 +122239,12 @@ _38: _28: _shmpage_out: if int32(_pShmNode.X5) > _iRegion { - *_pp = (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode.X7)) + 8*uintptr(_iRegion)))) + *_pp = unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pShmNode.X7)) + 8*uintptr(_iRegion)))) goto _40 } *_pp = nil _40: - if ((_pShmNode.X6) != 0) && (_rc == i32(0)) { + if (_pShmNode.X6 != 0) && (_rc == i32(0)) { _rc = i32(8) } Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) @@ -117051,17 +122255,23 @@ _40: panic(0) } -// Return the minimum number of 32KB shm regions that should be mapped at -// a time, assuming that each mapping must be an integer multiple of the -// current system page-size. -// -// Usually, this is 1. The exception seems to be systems that are configured -// to use 64KB pages - in this case each mapping must cover at least two -// shm regions. +// C comment +// /* +// ** Return the minimum number of 32KB shm regions that should be mapped at +// ** a time, assuming that each mapping must be an integer multiple of the +// ** current system page-size. +// ** +// ** Usually, this is 1. The exception seems to be systems that are configured +// ** to use 64KB pages - in this case each mapping must cover at least two +// ** shm regions. +// */ func _unixShmRegionPerMap(tls *crt.TLS) (r0 int32) { var _shmsz, _pgsz int32 _shmsz = i32(32768) - _pgsz = (*(*func(*crt.TLS) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(25)))).X1)})))(tls) + _pgsz = func() func(*crt.TLS) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(25)))).X1 + return *(*func(*crt.TLS) int32)(unsafe.Pointer(&v)) + }()(tls) func() { if ((_pgsz - i32(1)) & _pgsz) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34053), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmRegionPerMapØ00__func__Ø000))), unsafe.Pointer(str(133577))) @@ -117080,39 +122290,42 @@ func init() { crt.Xstrncpy(nil, &_unixShmRegionPerMapØ00__func__Ø000[0], str(133596), 20) } -// Open a shared-memory area associated with open database file pDbFd. -// This particular implementation uses mmapped files. -// -// The file used to implement shared-memory is in the same directory -// as the open database file and has the same name as the open database -// file with the "-shm" suffix added. For example, if the database file -// is "/home/user1/config.db" then the file that is created and mmapped -// for shared memory will be called "/home/user1/config.db-shm". -// -// Another approach to is to use files in /dev/shm or /dev/tmp or an -// some other tmpfs mount. But if a file in a different directory -// from the database file is used, then differing access permissions -// or a chroot() might cause two different processes on the same -// database to end up using different files for shared memory - -// meaning that their memory would not really be shared - resulting -// in database corruption. Nevertheless, this tmpfs file usage -// can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm" -// or the equivalent. The use of the SQLITE_SHM_DIRECTORY compile-time -// option results in an incompatible build of SQLite; builds of SQLite -// that with differing SQLITE_SHM_DIRECTORY settings attempt to use the -// same database file at the same time, database corruption will likely -// result. The SQLITE_SHM_DIRECTORY compile-time option is considered -// "unsupported" and may go away in a future SQLite release. -// -// When opening a new shared-memory file, if no other instances of that -// file are currently open, in this process or in other processes, then -// the file must be truncated to zero length or have its header cleared. -// -// If the original database file (pDbFd) is using the "unix-excl" VFS -// that means that an exclusive lock is held on the database file and -// that no other processes are able to read or write the database. In -// that case, we do not really need shared memory. No shared memory -// file is created. The shared memory will be simulated with heap memory. +// C comment +// /* +// ** Open a shared-memory area associated with open database file pDbFd. +// ** This particular implementation uses mmapped files. +// ** +// ** The file used to implement shared-memory is in the same directory +// ** as the open database file and has the same name as the open database +// ** file with the "-shm" suffix added. For example, if the database file +// ** is "/home/user1/config.db" then the file that is created and mmapped +// ** for shared memory will be called "/home/user1/config.db-shm". +// ** +// ** Another approach to is to use files in /dev/shm or /dev/tmp or an +// ** some other tmpfs mount. But if a file in a different directory +// ** from the database file is used, then differing access permissions +// ** or a chroot() might cause two different processes on the same +// ** database to end up using different files for shared memory - +// ** meaning that their memory would not really be shared - resulting +// ** in database corruption. Nevertheless, this tmpfs file usage +// ** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm" +// ** or the equivalent. The use of the SQLITE_SHM_DIRECTORY compile-time +// ** option results in an incompatible build of SQLite; builds of SQLite +// ** that with differing SQLITE_SHM_DIRECTORY settings attempt to use the +// ** same database file at the same time, database corruption will likely +// ** result. The SQLITE_SHM_DIRECTORY compile-time option is considered +// ** "unsupported" and may go away in a future SQLite release. +// ** +// ** When opening a new shared-memory file, if no other instances of that +// ** file are currently open, in this process or in other processes, then +// ** the file must be truncated to zero length or have its header cleared. +// ** +// ** If the original database file (pDbFd) is using the "unix-excl" VFS +// ** that means that an exclusive lock is held on the database file and +// ** that no other processes are able to read or write the database. In +// ** that case, we do not really need shared memory. No shared memory +// ** file is created. The shared memory will be simulated with heap memory. +// */ func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) { var _rc, _nShmFilename, _6_openFlags int32 var _zShmFilename, _1_zBasePath *int8 @@ -117125,7 +122338,7 @@ func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) { if _p == nil { return _sqlite3NomemError(tls, i32(34134)) } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(24)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(24)) func() { if (*TunixShm)(_pDbFd.X10) != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34136), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenSharedMemoryØ00__func__Ø000))), unsafe.Pointer(str(133616))) @@ -117139,7 +122352,10 @@ func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) { goto _3 } _1_zBasePath = _pDbFd.X9 - if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _pDbFd.X3, &_1_sStat) != 0 { + if func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _pDbFd.X3, &_1_sStat) != 0 { _rc = i32(1802) goto _shm_open_err } @@ -117149,16 +122365,16 @@ func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) { _rc = _sqlite3NomemError(tls, i32(34166)) goto _shm_open_err } - crt.Xmemset(tls, (unsafe.Pointer)(_pShmNode), i32(0), u64(72)+uint64(_nShmFilename)) - _zShmFilename = store0((**int8)(unsafe.Pointer(&(_pShmNode.X2))), (*int8)(unsafe.Pointer((*XunixShmNode)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode))+72*uintptr(i32(1))))))) + crt.Xmemset(tls, unsafe.Pointer(_pShmNode), i32(0), u64(72)+uint64(_nShmFilename)) + _zShmFilename = store0((**int8)(unsafe.Pointer(&_pShmNode.X2)), (*int8)(unsafe.Pointer((*XunixShmNode)(unsafe.Pointer(uintptr(unsafe.Pointer(_pShmNode))+72*uintptr(i32(1))))))) Xsqlite3_snprintf(tls, _nShmFilename, _zShmFilename, str(133631), unsafe.Pointer(_1_zBasePath)) - *(*int32)(unsafe.Pointer(&(_pShmNode.X3))) = i32(-1) + *(*int32)(unsafe.Pointer(&_pShmNode.X3)) = i32(-1) *(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_pDbFd.X2).X5))))) = _pShmNode - *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X0))))) = (*XunixInodeInfo)(_pDbFd.X2) - if (_sqlite3Config.X1) == 0 { + *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pShmNode.X0)))) = (*XunixInodeInfo)(_pDbFd.X2) + if _sqlite3Config.X1 == 0 { goto _6 } - *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X1))))) = Xsqlite3_mutex_alloc(tls, i32(0)) + *(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pShmNode.X1)))) = Xsqlite3_mutex_alloc(tls, i32(0)) if (*Xsqlite3_mutex)(_pShmNode.X1) == nil { _rc = _sqlite3NomemError(tls, i32(34185)) goto _shm_open_err @@ -117170,10 +122386,10 @@ _6: _6_openFlags = i32(66) if Xsqlite3_uri_boolean(tls, _pDbFd.X9, str(133638), i32(0)) != 0 { _6_openFlags = i32(0) - *(*uint8)(unsafe.Pointer(&(_pShmNode.X6))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pShmNode.X6)) = uint8(i32(1)) } - *(*int32)(unsafe.Pointer(&(_pShmNode.X3))) = _robust_open(tls, _zShmFilename, _6_openFlags, (_1_sStat.X3)&uint32(i32(511))) - if (_pShmNode.X3) < i32(0) { + *(*int32)(unsafe.Pointer(&_pShmNode.X3)) = _robust_open(tls, _zShmFilename, _6_openFlags, _1_sStat.X3&uint32(i32(511))) + if _pShmNode.X3 < i32(0) { _rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(34198)), str(131504), _zShmFilename, i32(34198)) goto _shm_open_err } @@ -117194,20 +122410,20 @@ _11: } _8: _3: - *(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pShmNode - *(*uint8)(unsafe.Pointer(&(_p.X3))) = postInc2((*uint8)(unsafe.Pointer(&(_pShmNode.X12))), uint8(1)) - *(*int32)(unsafe.Pointer(&(_pShmNode.X8))) += 1 - *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDbFd.X10))))) = _p + *(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X0)))) = _pShmNode + *(*uint8)(unsafe.Pointer(&_p.X3)) = postInc2((*uint8)(unsafe.Pointer(&_pShmNode.X12)), byte(1)) + *(*int32)(unsafe.Pointer(&_pShmNode.X8)) += 1 + *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDbFd.X10)))) = _p _unixLeaveMutex(tls) Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) - *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*TunixShm)(_pShmNode.X9) - *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X9))))) = _p + *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X1)))) = (*TunixShm)(_pShmNode.X9) + *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pShmNode.X9)))) = _p Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) return i32(0) _shm_open_err: _unixShmPurge(tls, _pDbFd) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) _unixLeaveMutex(tls) return _rc @@ -117221,22 +122437,34 @@ func init() { crt.Xstrncpy(nil, &_unixOpenSharedMemoryØ00__func__Ø000[0], str(133651), 21) } -// On some systems, calls to fchown() will trigger a message in a security -// log if they come from non-root processes. So avoid calling fchown() if -// we are not running as root. +// C comment +// /* +// ** On some systems, calls to fchown() will trigger a message in a security +// ** log if they come from non-root processes. So avoid calling fchown() if +// ** we are not running as root. +// */ func _robustFchown(tls *crt.TLS, _fd int32, _uid uint32, _gid uint32) (r0 int32) { return func() int32 { - if (*(*func(*crt.TLS) uint32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(21)))).X1)})))(tls) != 0 { + if func() func(*crt.TLS) uint32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(21)))).X1 + return *(*func(*crt.TLS) uint32)(unsafe.Pointer(&v)) + }()(tls) != 0 { return i32(0) } - return (*(*func(*crt.TLS, int32, uint32, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(20)))).X1)})))(tls, _fd, _uid, _gid) + return func() func(*crt.TLS, int32, uint32, uint32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(20)))).X1 + return *(*func(*crt.TLS, int32, uint32, uint32) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, _uid, _gid) }() } -// Apply posix advisory locks for all bytes from ofst through ofst+n-1. -// -// Locks block if the mask is exactly UNIX_SHM_C and are non-blocking -// otherwise. +// C comment +// /* +// ** Apply posix advisory locks for all bytes from ofst through ofst+n-1. +// ** +// ** Locks block if the mask is exactly UNIX_SHM_C and are non-blocking +// ** otherwise. +// */ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst int32, _n int32) (r0 int32) { var _rc int32 var _2_mask uint16 @@ -117245,7 +122473,7 @@ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst _rc = i32(0) _pShmNode = (*XunixShmNode)((*XunixInodeInfo)(_pFile.X2).X5) func() { - if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) == 0 && (_pShmNode.X8) != i32(0) { + if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) == 0 && _pShmNode.X8 != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33983), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133672))) crt.X__builtin_abort(tls) } @@ -117262,13 +122490,16 @@ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst crt.X__builtin_abort(tls) } }() - if (_pShmNode.X3) >= i32(0) { - crt.Xmemset(tls, (unsafe.Pointer)(&_f), i32(0), u64(32)) - *(*int16)(unsafe.Pointer(&(_f.X0))) = int16(_lockType) - *(*int16)(unsafe.Pointer(&(_f.X1))) = int16(i32(0)) - *(*int64)(unsafe.Pointer(&(_f.X2))) = int64(_ofst) - *(*int64)(unsafe.Pointer(&(_f.X3))) = int64(_n) - _rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(7)))).X1)})))(tls, _pShmNode.X3, i32(6), unsafe.Pointer(&_f)) + if _pShmNode.X3 >= i32(0) { + crt.Xmemset(tls, unsafe.Pointer(&_f), i32(0), u64(32)) + *(*int16)(unsafe.Pointer(&_f.X0)) = int16(_lockType) + *(*int16)(unsafe.Pointer(&_f.X1)) = int16(i32(0)) + *(*int64)(unsafe.Pointer(&_f.X2)) = int64(_ofst) + *(*int64)(unsafe.Pointer(&_f.X3)) = int64(_n) + _rc = func() func(*crt.TLS, int32, int32, ...interface{}) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(7)))).X1 + return *(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&v)) + }()(tls, _pShmNode.X3, i32(6), unsafe.Pointer(&_f)) _rc = func() int32 { if _rc != i32(-1) { return i32(0) @@ -117287,12 +122518,12 @@ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst } if _lockType == i32(2) { { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X10)) *p = uint8(int32(*p) & (^int32(_2_mask))) sink2(*p) } { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X11)) *p = uint8(int32(*p) & (^int32(_2_mask))) sink2(*p) } @@ -117300,12 +122531,12 @@ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst } if _lockType == i32(0) { { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X10)) *p = uint8(int32(*p) & (^int32(_2_mask))) sink2(*p) } { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X11)) *p = uint8(int32(*p) | int32(_2_mask)) sink2(*p) } @@ -117318,12 +122549,12 @@ func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst } }() { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X10)) *p = uint8(int32(*p) | int32(_2_mask)) sink2(*p) } { - p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11))) + p := (*uint8)(unsafe.Pointer(&_pShmNode.X11)) *p = uint8(int32(*p) & (^int32(_2_mask))) sink2(*p) } @@ -117356,10 +122587,13 @@ func init() { crt.Xstrncpy(nil, &_unixShmSystemLockØ00__func__Ø000[0], str(133801), 18) } -// Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0. -// -// This is not a VFS shared-memory method; it is a utility function called -// by VFS shared-memory methods. +// C comment +// /* +// ** Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0. +// ** +// ** This is not a VFS shared-memory method; it is a utility function called +// ** by VFS shared-memory methods. +// */ func _unixShmPurge(tls *crt.TLS, _pFd *XunixFile) { var _1_nShmPerMap, _1_i int32 var _p *XunixShmNode @@ -117371,7 +122605,7 @@ func _unixShmPurge(tls *crt.TLS, _pFd *XunixFile) { } }() if _p == nil || func() int32 { - if (_p.X8) == i32(0) { + if _p.X8 == i32(0) { return i32(1) } return func() int32 { @@ -117395,11 +122629,14 @@ _8: if _1_i >= int32(_p.X5) { goto _11 } - if (_p.X3) >= i32(0) { - (*(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 8*uintptr(_1_i)))), uint64(_p.X4)) + if _p.X3 >= i32(0) { + func() func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(23)))).X1 + return *(*func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X7)) + 8*uintptr(_1_i)))), uint64(_p.X4)) goto _13 } - Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 8*uintptr(_1_i))))) + Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X7)) + 8*uintptr(_1_i))))) _13: { p := &_1_i @@ -117408,13 +122645,13 @@ _13: } goto _8 _11: - Xsqlite3_free(tls, (unsafe.Pointer)(_p.X7)) - if (_p.X3) >= i32(0) { + Xsqlite3_free(tls, unsafe.Pointer(_p.X7)) + if _p.X3 >= i32(0) { _robust_close(tls, _pFd, _p.X3, i32(34081)) - *(*int32)(unsafe.Pointer(&(_p.X3))) = i32(-1) + *(*int32)(unsafe.Pointer(&_p.X3)) = i32(-1) } *(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_p.X0).X5))))) = nil - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + Xsqlite3_free(tls, unsafe.Pointer(_p)) _5: } @@ -117436,12 +122673,15 @@ func init() { _unixShmMapØ00pgszØ001 = i32(4096) } -// Change the lock state for a shared-memory segment. -// -// Note that the relationship between SHAREd and EXCLUSIVE locks is a little -// different here than in posix. In xShmLock(), one can go from unlocked -// to shared and back or from unlocked to exclusive and back. But one may -// not go from shared to exclusive or from exclusive to shared. +// C comment +// /* +// ** Change the lock state for a shared-memory segment. +// ** +// ** Note that the relationship between SHAREd and EXCLUSIVE locks is a little +// ** different here than in posix. In xShmLock(), one can go from unlocked +// ** to shared and back or from unlocked to exclusive and back. But one may +// ** not go from shared to exclusive or from exclusive to shared. +// */ func _unixShmLock(tls *crt.TLS, _fd *Xsqlite3_file, _ofst int32, _n int32, _flags int32) (r0 int32) { var _rc int32 var _mask, _1_allMask, _6_allShared uint16 @@ -117489,13 +122729,13 @@ func _unixShmLock(tls *crt.TLS, _fd *Xsqlite3_file, _ofst int32, _n int32, _flag } }() func() { - if (_pShmNode.X3) < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) { + if _pShmNode.X3 < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34433), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133462))) crt.X__builtin_abort(tls) } }() func() { - if (_pShmNode.X3) >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) { + if _pShmNode.X3 >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34434), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133511))) crt.X__builtin_abort(tls) } @@ -117543,12 +122783,12 @@ _30: _35: if _rc == i32(0) { { - p := (*uint16)(unsafe.Pointer(&(_p.X5))) + p := (*uint16)(unsafe.Pointer(&_p.X5)) *p = uint16(int32(*p) & (^int32(_mask))) sink14(*p) } { - p := (*uint16)(unsafe.Pointer(&(_p.X4))) + p := (*uint16)(unsafe.Pointer(&_p.X4)) *p = uint16(int32(*p) & (^int32(_mask))) sink14(*p) } @@ -117588,7 +122828,7 @@ _46: _44: if _rc == i32(0) { { - p := (*uint16)(unsafe.Pointer(&(_p.X4))) + p := (*uint16)(unsafe.Pointer(&_p.X4)) *p = uint16(int32(*p) | int32(_mask)) sink14(*p) } @@ -117619,7 +122859,7 @@ _52: } }() { - p := (*uint16)(unsafe.Pointer(&(_p.X5))) + p := (*uint16)(unsafe.Pointer(&_p.X5)) *p = uint16(int32(*p) | int32(_mask)) sink14(*p) } @@ -117636,21 +122876,27 @@ func init() { crt.Xstrncpy(nil, &_unixShmLockØ00__func__Ø000[0], str(134279), 12) } -// Implement a memory barrier or memory fence on shared memory. -// -// All loads and stores begun before the barrier must complete before -// any load or store begun after the barrier. +// C comment +// /* +// ** Implement a memory barrier or memory fence on shared memory. +// ** +// ** All loads and stores begun before the barrier must complete before +// ** any load or store begun after the barrier. +// */ func _unixShmBarrier(tls *crt.TLS, _fd *Xsqlite3_file) { _sqlite3MemoryBarrier(tls) _unixEnterMutex(tls) _unixLeaveMutex(tls) } -// Close a connection to shared-memory. Delete the underlying -// storage if deleteFlag is true. -// -// If there is no shared memory associated with the connection then this -// routine is a harmless no-op. +// C comment +// /* +// ** Close a connection to shared-memory. Delete the underlying +// ** storage if deleteFlag is true. +// ** +// ** If there is no shared memory associated with the connection then this +// ** routine is a harmless no-op. +// */ func _unixShmUnmap(tls *crt.TLS, _fd *Xsqlite3_file, _deleteFlag int32) (r0 int32) { var _pDbFd *XunixFile var _pShmNode *XunixShmNode @@ -117675,7 +122921,7 @@ func _unixShmUnmap(tls *crt.TLS, _fd *Xsqlite3_file, _deleteFlag int32) (r0 int3 } }() Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) - _pp = (**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X9))))) + _pp = (**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pShmNode.X9)))) _5: if (*_pp) == _p { goto _8 @@ -117684,22 +122930,25 @@ _5: goto _5 _8: *_pp = (*TunixShm)(_p.X1) - Xsqlite3_free(tls, (unsafe.Pointer)(_p)) - *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDbFd.X10))))) = nil + Xsqlite3_free(tls, unsafe.Pointer(_p)) + *(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDbFd.X10)))) = nil Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) _unixEnterMutex(tls) func() { - if (_pShmNode.X8) <= i32(0) { + if _pShmNode.X8 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34570), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmUnmapØ00__func__Ø000))), unsafe.Pointer(str(134291))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pShmNode.X8))) -= 1 - if (_pShmNode.X8) != i32(0) { + *(*int32)(unsafe.Pointer(&_pShmNode.X8)) -= 1 + if _pShmNode.X8 != i32(0) { goto _11 } - if _deleteFlag != 0 && ((_pShmNode.X3) >= i32(0)) { - (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(16)))).X1)})))(tls, _pShmNode.X2) + if _deleteFlag != 0 && (_pShmNode.X3 >= i32(0)) { + func() func(*crt.TLS, *int8) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(16)))).X1 + return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _pShmNode.X2) } _unixShmPurge(tls, _pDbFd) _11: @@ -117713,22 +122962,25 @@ func init() { crt.Xstrncpy(nil, &_unixShmUnmapØ00__func__Ø000[0], str(134308), 13) } -// If possible, return a pointer to a mapping of file fd starting at offset -// iOff. The mapping must be valid for at least nAmt bytes. -// -// If such a pointer can be obtained, store it in *pp and return SQLITE_OK. -// Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK. -// Finally, if an error does occur, return an SQLite error code. The final -// value of *pp is undefined in this case. -// -// If this function does return a pointer, the caller must eventually -// release the reference by calling unixUnfetch(). +// C comment +// /* +// ** If possible, return a pointer to a mapping of file fd starting at offset +// ** iOff. The mapping must be valid for at least nAmt bytes. +// ** +// ** If such a pointer can be obtained, store it in *pp and return SQLITE_OK. +// ** Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK. +// ** Finally, if an error does occur, return an SQLite error code. The final +// ** value of *pp is undefined in this case. +// ** +// ** If this function does return a pointer, the caller must eventually +// ** release the reference by calling unixUnfetch(). +// */ func _unixFetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _nAmt int32, _pp *unsafe.Pointer) (r0 int32) { var _2_rc int32 var _pFd *XunixFile _pFd = (*XunixFile)(unsafe.Pointer(_fd)) *_pp = nil - if (_pFd.X15) <= int64(i32(0)) { + if _pFd.X15 <= int64(i32(0)) { goto _0 } if _pFd.X16 != nil { @@ -117739,46 +122991,49 @@ func _unixFetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _nAmt int32, _pp return _2_rc } _1: - if (_pFd.X13) >= (_iOff + int64(_nAmt)) { - *_pp = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFd.X16) + 1*uintptr(_iOff)))) - *(*int32)(unsafe.Pointer(&(_pFd.X12))) += 1 + if _pFd.X13 >= (_iOff + int64(_nAmt)) { + *_pp = unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pFd.X16) + 1*uintptr(_iOff)))) + *(*int32)(unsafe.Pointer(&_pFd.X12)) += 1 } _0: return i32(0) } -// If the third argument is non-NULL, then this function releases a -// reference obtained by an earlier call to unixFetch(). The second -// argument passed to this function must be the same as the corresponding -// argument that was passed to the unixFetch() invocation. -// -// Or, if the third argument is NULL, then this function is being called -// to inform the VFS layer that, according to POSIX, any existing mapping -// may now be invalid and should be unmapped. +// C comment +// /* +// ** If the third argument is non-NULL, then this function releases a +// ** reference obtained by an earlier call to unixFetch(). The second +// ** argument passed to this function must be the same as the corresponding +// ** argument that was passed to the unixFetch() invocation. +// ** +// ** Or, if the third argument is NULL, then this function is being called +// ** to inform the VFS layer that, according to POSIX, any existing mapping +// ** may now be invalid and should be unmapped. +// */ func _unixUnfetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) { var _pFd *XunixFile _pFd = (*XunixFile)(unsafe.Pointer(_fd)) func() { - if (_p == nil) != ((_pFd.X12) == i32(0)) { + if (_p == nil) != (_pFd.X12 == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34788), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134321))) crt.X__builtin_abort(tls) } }() func() { - if _p != nil && _p != (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFd.X16)+1*uintptr(_iOff)))) { + if _p != nil && _p != unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pFd.X16)+1*uintptr(_iOff)))) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34791), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134349))) crt.X__builtin_abort(tls) } }() if _p != nil { - *(*int32)(unsafe.Pointer(&(_pFd.X12))) -= 1 + *(*int32)(unsafe.Pointer(&_pFd.X12)) -= 1 goto _6 } _unixUnmapfile(tls, _pFd) _6: func() { - if (_pFd.X12) < i32(0) { + if _pFd.X12 < i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34799), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134391))) crt.X__builtin_abort(tls) } @@ -117792,26 +123047,29 @@ func init() { crt.Xstrncpy(nil, &_unixUnfetchØ00__func__Ø000[0], str(134409), 12) } -// Open the file zPath. -// -// Previously, the SQLite OS layer used three functions in place of this -// one: -// -// sqlite3OsOpenReadWrite(); -// sqlite3OsOpenReadOnly(); -// sqlite3OsOpenExclusive(); -// -// These calls correspond to the following combinations of flags: -// -// ReadWrite() -> (READWRITE | CREATE) -// ReadOnly() -> (READONLY) -// OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE) -// -// The old OpenExclusive() accepted a boolean argument - "delFlag". If -// true, the file was configured to be automatically deleted when the -// file handle closed. To achieve the same effect using this new -// interface, add the DELETEONCLOSE flag to those specified above for -// OpenExclusive(). +// C comment +// /* +// ** Open the file zPath. +// ** +// ** Previously, the SQLite OS layer used three functions in place of this +// ** one: +// ** +// ** sqlite3OsOpenReadWrite(); +// ** sqlite3OsOpenReadOnly(); +// ** sqlite3OsOpenExclusive(); +// ** +// ** These calls correspond to the following combinations of flags: +// ** +// ** ReadWrite() -> (READWRITE | CREATE) +// ** ReadOnly() -> (READONLY) +// ** OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE) +// ** +// ** The old OpenExclusive() accepted a boolean argument - "delFlag". If +// ** true, the file was configured to be automatically deleted when the +// ** file handle closed. To achieve the same effect using this new +// ** interface, add the DELETEONCLOSE flag to those specified above for +// ** OpenExclusive(). +// */ func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) { var _fd, _openFlags, _eType, _noLock, _rc, _ctrlFlags, _isExclusive, _isDelete, _isCreate, _isReadonly, _isReadWrite, _syncDir int32 var _8_openMode, _8_uid, _8_gid uint32 @@ -117891,7 +123149,7 @@ func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3 bug20530(_randomnessPid) Xsqlite3_randomness(tls, i32(0), nil) } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(120)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(120)) if _eType != i32(256) { goto _43 } @@ -117905,9 +123163,9 @@ func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3 return _sqlite3NomemError(tls, i32(35636)) } _45: - *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _2_pUnused + *(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X8)))) = _2_pUnused func() { - if (_flags&i32(64)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint64(i32(1)))))) != i32(0) { + if (_flags&i32(64)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint64(i32(1)))))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35644), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135034))) crt.X__builtin_abort(tls) } @@ -117929,7 +123187,7 @@ _43: } _zName = (*int8)(unsafe.Pointer(&_zTmpname)) func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint64(i32(1)))))) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint64(i32(1)))))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35657), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135110))) crt.X__builtin_abort(tls) } @@ -117974,7 +123232,7 @@ _51: _rc = _findCreateFileMode(tls, _zName, _flags, &_8_openMode, &_8_uid, &_8_gid) if _rc != i32(0) { func() { - if (*XUnixUnusedFd)(_p.X8) != nil { + if _p.X8 != nil { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35676), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135136))) crt.X__builtin_abort(tls) } @@ -118035,12 +123293,15 @@ _62: if _pOutFlags != nil { *_pOutFlags = _flags } - if (*XUnixUnusedFd)(_p.X8) != nil { + if _p.X8 != nil { *(*int32)(unsafe.Pointer(&((*XUnixUnusedFd)(_p.X8).X0))) = _fd *(*int32)(unsafe.Pointer(&((*XUnixUnusedFd)(_p.X8).X1))) = _flags } if _isDelete != 0 { - (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(16)))).X1)})))(tls, _zName) + func() func(*crt.TLS, *int8) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(16)))).X1 + return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _zName) } if _isDelete != 0 { { @@ -118097,40 +123358,46 @@ func init() { var _randomnessPid int32 -// Search for an unused file descriptor that was opened on the database -// file (not a journal or master-journal file) identified by pathname -// zPath with SQLITE_OPEN_XXX flags matching those passed as the second -// argument to this function. -// -// Such a file descriptor may exist if a database connection was closed -// but the associated file descriptor could not be closed because some -// other file descriptor open on the same file is holding a file-lock. -// Refer to comments in the unixClose() function and the lengthy comment -// describing "Posix Advisory Locking" at the start of this file for -// further details. Also, ticket #4018. -// -// If a suitable file descriptor is found, then it is returned. If no -// such file descriptor is located, -1 is returned. +// C comment +// /* +// ** Search for an unused file descriptor that was opened on the database +// ** file (not a journal or master-journal file) identified by pathname +// ** zPath with SQLITE_OPEN_XXX flags matching those passed as the second +// ** argument to this function. +// ** +// ** Such a file descriptor may exist if a database connection was closed +// ** but the associated file descriptor could not be closed because some +// ** other file descriptor open on the same file is holding a file-lock. +// ** Refer to comments in the unixClose() function and the lengthy comment +// ** describing "Posix Advisory Locking" at the start of this file for +// ** further details. Also, ticket #4018. +// ** +// ** If a suitable file descriptor is found, then it is returned. If no +// ** such file descriptor is located, -1 is returned. +// */ func _findReusableFd(tls *crt.TLS, _zPath *int8, _flags int32) (r0 *XUnixUnusedFd) { var _sStat crt.Xstruct_stat64 var _1_pInode *XunixInodeInfo var _pUnused *XUnixUnusedFd var _3_pp **XUnixUnusedFd _pUnused = nil - if i32(0) != (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(4)))).X1)})))(tls, _zPath, &_sStat) { + if i32(0) != func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(4)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _zPath, &_sStat) { goto _0 } _unixEnterMutex(tls) _1_pInode = _inodeList _1: - if (_1_pInode != nil) && ((((*TunixFileId)(unsafe.Pointer(&(_1_pInode.X0))).X0) != (_sStat.X0)) || (((*TunixFileId)(unsafe.Pointer(&(_1_pInode.X0))).X1) != (_sStat.X1))) { + if (_1_pInode != nil) && ((((*TunixFileId)(unsafe.Pointer(&_1_pInode.X0)).X0) != _sStat.X0) || (((*TunixFileId)(unsafe.Pointer(&_1_pInode.X0)).X1) != _sStat.X1)) { _1_pInode = (*XunixInodeInfo)(_1_pInode.X8) goto _1 } if _1_pInode == nil { goto _5 } - _3_pp = (**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInode.X7))))) + _3_pp = (**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_pInode.X7)))) _6: if (*_3_pp) == nil || ((*_3_pp).X1) == _flags { goto _10 @@ -118151,25 +123418,28 @@ _0: panic(0) } -// This function is called by unixOpen() to determine the unix permissions -// to create new files with. If no error occurs, then SQLITE_OK is returned -// and a value suitable for passing as the third argument to open(2) is -// written to *pMode. If an IO error occurs, an SQLite error code is -// returned and the value of *pMode is not modified. -// -// In most cases, this routine sets *pMode to 0, which will become -// an indication to robust_open() to create the file using -// SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask. -// But if the file being opened is a WAL or regular journal file, then -// this function queries the file-system for the permissions on the -// corresponding database file and sets *pMode to this value. Whenever -// possible, WAL and journal files are created using the same permissions -// as the associated database file. -// -// If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the -// original filename is unavailable. But 8_3_NAMES is only used for -// FAT filesystems and permissions do not matter there, so just use -// the default permissions. +// C comment +// /* +// ** This function is called by unixOpen() to determine the unix permissions +// ** to create new files with. If no error occurs, then SQLITE_OK is returned +// ** and a value suitable for passing as the third argument to open(2) is +// ** written to *pMode. If an IO error occurs, an SQLite error code is +// ** returned and the value of *pMode is not modified. +// ** +// ** In most cases, this routine sets *pMode to 0, which will become +// ** an indication to robust_open() to create the file using +// ** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask. +// ** But if the file being opened is a WAL or regular journal file, then +// ** this function queries the file-system for the permissions on the +// ** corresponding database file and sets *pMode to this value. Whenever +// ** possible, WAL and journal files are created using the same permissions +// ** as the associated database file. +// ** +// ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the +// ** original filename is unavailable. But 8_3_NAMES is only used for +// ** FAT filesystems and permissions do not matter there, so just use +// ** the default permissions. +// */ func _findCreateFileMode(tls *crt.TLS, _zPath *int8, _flags int32, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) { var _rc, _1_nDb int32 var _4_z *int8 @@ -118183,7 +123453,7 @@ func _findCreateFileMode(tls *crt.TLS, _zPath *int8, _flags int32, _pMode *uint3 } _1_nDb = _sqlite3Strlen30(tls, _zPath) - i32(1) _1: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(_1_nDb)))) != i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPath)) + 1*uintptr(_1_nDb)))) != i32(45) { func() { if _1_nDb <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35497), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000))), unsafe.Pointer(str(135262))) @@ -118191,7 +123461,7 @@ _1: } }() func() { - if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(_1_nDb)))))))) & i32(6)) == 0 { + if (int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPath)) + 1*uintptr(_1_nDb)))))))) & i32(6)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35498), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000))), unsafe.Pointer(str(135268))) crt.X__builtin_abort(tls) } @@ -118199,8 +123469,8 @@ _1: _1_nDb -= 1 goto _1 } - crt.Xmemcpy(tls, (unsafe.Pointer)(&_1_zDb), (unsafe.Pointer)(_zPath), uint64(_1_nDb)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_zDb)) + 1*uintptr(_1_nDb))) = int8(i32(0)) + crt.Xmemcpy(tls, unsafe.Pointer(&_1_zDb), unsafe.Pointer(_zPath), uint64(_1_nDb)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_zDb)) + 1*uintptr(_1_nDb))) = int8(i32(0)) _rc = _getFileMode(tls, (*int8)(unsafe.Pointer(&_1_zDb)), _pMode, _pUid, _pGid) goto _10 _0: @@ -118228,13 +123498,19 @@ func init() { crt.Xstrncpy(nil, &_findCreateFileModeØ00__func__Ø000[0], str(135302), 19) } -// Find the mode, uid and gid of file zFile. +// C comment +// /* +// ** Find the mode, uid and gid of file zFile. +// */ func _getFileMode(tls *crt.TLS, _zFile *int8, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) { var _rc int32 var _sStat crt.Xstruct_stat64 _rc = i32(0) - if i32(0) == (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(4)))).X1)})))(tls, _zFile, &_sStat) { - *_pMode = (_sStat.X3) & uint32(i32(511)) + if i32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(4)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _zFile, &_sStat) { + *_pMode = _sStat.X3 & uint32(i32(511)) *_pUid = _sStat.X4 *_pGid = _sStat.X5 goto _1 @@ -118247,7 +123523,10 @@ _1: panic(0) } -// Initialize the contents of the unixFile structure pointed to by pId. +// C comment +// /* +// ** Initialize the contents of the unixFile structure pointed to by pId. +// */ func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3_file, _zFilename *int8, _ctrlFlags int32) (r0 int32) { var _rc, _7_nFilename int32 var _7_zLockFile *int8 @@ -118262,7 +123541,7 @@ func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3 } }() func() { - if _zFilename != nil && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) != i32(47) { + if _zFilename != nil && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(i32(0))))) != i32(47) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35131), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000))), unsafe.Pointer(str(135340))) crt.X__builtin_abort(tls) } @@ -118273,11 +123552,11 @@ func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3 crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_pNew.X3))) = _h - *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = _pVfs - *(**int8)(unsafe.Pointer(&(_pNew.X9))) = _zFilename - *(*uint16)(unsafe.Pointer(&(_pNew.X5))) = uint16(uint8(_ctrlFlags)) - *(*int64)(unsafe.Pointer(&(_pNew.X15))) = _sqlite3Config.X17 + *(*int32)(unsafe.Pointer(&_pNew.X3)) = _h + *(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X1)))) = _pVfs + *(**int8)(unsafe.Pointer(&_pNew.X9)) = _zFilename + *(*uint16)(unsafe.Pointer(&_pNew.X5)) = uint16(uint8(_ctrlFlags)) + *(*int64)(unsafe.Pointer(&_pNew.X15)) = _sqlite3Config.X17 if Xsqlite3_uri_boolean(tls, func() *int8 { if (_ctrlFlags & i32(64)) != 0 { return _zFilename @@ -118285,14 +123564,14 @@ func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3 return nil }(), str(135423), i32(1)) != 0 { { - p := (*uint16)(unsafe.Pointer(&(_pNew.X5))) + p := (*uint16)(unsafe.Pointer(&_pNew.X5)) *p = uint16(int32(*p) | i32(16)) sink14(*p) } } if crt.Xstrcmp(tls, _pVfs.X4, str(131329)) == i32(0) { { - p := (*uint16)(unsafe.Pointer(&(_pNew.X5))) + p := (*uint16)(unsafe.Pointer(&_pNew.X5)) *p = uint16(int32(*p) | i32(1)) sink14(*p) } @@ -118307,7 +123586,7 @@ _13: goto _14 } _unixEnterMutex(tls) - _rc = _findInodeInfo(tls, _pNew, (**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2)))))) + _rc = _findInodeInfo(tls, _pNew, (**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X2))))) if _rc != i32(0) { _robust_close(tls, _pNew, _h, i32(35199)) _h = i32(-1) @@ -118332,7 +123611,7 @@ _14: } Xsqlite3_snprintf(tls, _7_nFilename, _7_zLockFile, str(135441), unsafe.Pointer(_zFilename)) _21: - *(*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X7))) = (unsafe.Pointer)(_7_zLockFile) + *(*unsafe.Pointer)(unsafe.Pointer(&_pNew.X7)) = unsafe.Pointer(_7_zLockFile) _17: _storeLastErrno(tls, _pNew, i32(0)) if _rc == i32(0) { @@ -118343,7 +123622,7 @@ _17: } goto _24 _22: - *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pLockingStyle + *(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pNew.X0)))) = _pLockingStyle _verifyDbFile(tls, _pNew) _24: return _rc @@ -118395,7 +123674,10 @@ func init() { }{_unixUnfetch}))} } -// Close the file. +// C comment +// /* +// ** Close the file. +// */ func _nolockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { return _closeUnixFile(tls, _id) } @@ -118415,14 +123697,17 @@ func _nolockCheckReservedLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _pResOut *i return i32(0) } -// Given a file descriptor, locate the unixInodeInfo object that -// describes that file descriptor. Create a new one if necessary. The -// return value might be uninitialized if an error occurs. -// -// The mutex entered using the unixEnterMutex() function must be held -// when this function is called. -// -// Return an appropriate error code. +// C comment +// /* +// ** Given a file descriptor, locate the unixInodeInfo object that +// ** describes that file descriptor. Create a new one if necessary. The +// ** return value might be uninitialized if an error occurs. +// ** +// ** The mutex entered using the unixEnterMutex() function must be held +// ** when this function is called. +// ** +// ** Return an appropriate error code. +// */ func _findInodeInfo(tls *crt.TLS, _pFile *XunixFile, _ppInode **XunixInodeInfo) (r0 int32) { var _rc, _fd int32 var _statbuf crt.Xstruct_stat64 @@ -118436,17 +123721,20 @@ func _findInodeInfo(tls *crt.TLS, _pFile *XunixFile, _ppInode **XunixInodeInfo) } }() _fd = _pFile.X3 - _rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(5)))).X1)})))(tls, _fd, &_statbuf) + _rc = func() func(*crt.TLS, int32, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(5)))).X1 + return *(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _fd, &_statbuf) if _rc != i32(0) { _storeLastErrno(tls, _pFile, *crt.X__errno_location(tls)) return i32(10) } - crt.Xmemset(tls, (unsafe.Pointer)(&_fileId), i32(0), u64(16)) - *(*uint64)(unsafe.Pointer(&(_fileId.X0))) = _statbuf.X0 - *(*uint64)(unsafe.Pointer(&(_fileId.X1))) = _statbuf.X1 + crt.Xmemset(tls, unsafe.Pointer(&_fileId), i32(0), u64(16)) + *(*uint64)(unsafe.Pointer(&_fileId.X0)) = _statbuf.X0 + *(*uint64)(unsafe.Pointer(&_fileId.X1)) = _statbuf.X1 _pInode = _inodeList _3: - if (_pInode != nil) && crt.Xmemcmp(tls, (unsafe.Pointer)(&_fileId), (unsafe.Pointer)((*TunixFileId)(unsafe.Pointer(&(_pInode.X0)))), u64(16)) != 0 { + if (_pInode != nil) && crt.Xmemcmp(tls, unsafe.Pointer(&_fileId), unsafe.Pointer((*TunixFileId)(unsafe.Pointer(&_pInode.X0))), u64(16)) != 0 { _pInode = (*XunixInodeInfo)(_pInode.X8) goto _3 } @@ -118457,19 +123745,19 @@ _3: if _pInode == nil { return _sqlite3NomemError(tls, i32(31208)) } - crt.Xmemset(tls, (unsafe.Pointer)(_pInode), i32(0), u64(72)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*TunixFileId)(unsafe.Pointer(&(_pInode.X0)))), (unsafe.Pointer)(&_fileId), u64(16)) - *(*int32)(unsafe.Pointer(&(_pInode.X4))) = i32(1) - *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X8))))) = _inodeList - *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X9))))) = nil + crt.Xmemset(tls, unsafe.Pointer(_pInode), i32(0), u64(72)) + crt.Xmemcpy(tls, unsafe.Pointer((*TunixFileId)(unsafe.Pointer(&_pInode.X0))), unsafe.Pointer(&_fileId), u64(16)) + *(*int32)(unsafe.Pointer(&_pInode.X4)) = i32(1) + *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInode.X8)))) = _inodeList + *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pInode.X9)))) = nil if _inodeList != nil { - *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_inodeList.X9))))) = _pInode + *(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_inodeList.X9)))) = _pInode } _inodeList = _pInode bug20530(_inodeList) goto _9 _6: - *(*int32)(unsafe.Pointer(&(_pInode.X4))) += 1 + *(*int32)(unsafe.Pointer(&_pInode.X4)) += 1 _9: *_ppInode = _pInode return i32(0) @@ -118525,7 +123813,10 @@ func init() { }{_unixUnfetch}))} } -// Close a file. Make sure the lock has been released before closing. +// C comment +// /* +// ** Close a file. Make sure the lock has been released before closing. +// */ func _dotlockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) { var _pFile *XunixFile _pFile = (*XunixFile)(unsafe.Pointer(_id)) @@ -118546,13 +123837,16 @@ func init() { crt.Xstrncpy(nil, &_dotlockCloseØ00__func__Ø000[0], str(135484), 13) } -// Lower the locking level on file descriptor pFile to eFileLock. eFileLock -// must be either NO_LOCK or SHARED_LOCK. -// -// If the locking level of the file descriptor is already at or below -// the requested locking level, this routine is a no-op. -// -// When the locking level reaches NO_LOCK, delete the lock file. +// C comment +// /* +// ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock +// ** must be either NO_LOCK or SHARED_LOCK. +// ** +// ** If the locking level of the file descriptor is already at or below +// ** the requested locking level, this routine is a no-op. +// ** +// ** When the locking level reaches NO_LOCK, delete the lock file. +// */ func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) { var _rc, _3_tErrno int32 var _zLockFile *int8 @@ -118575,7 +123869,7 @@ func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int3 return i32(0) } if _eFileLock == i32(1) { - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1)) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(1)) return i32(0) } func() { @@ -118584,7 +123878,10 @@ func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int3 crt.X__builtin_abort(tls) } }() - _rc = (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(19)))).X1)})))(tls, _zLockFile) + _rc = func() func(*crt.TLS, *int8) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(19)))).X1 + return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _zLockFile) if _rc >= i32(0) { goto _8 } @@ -118599,7 +123896,7 @@ _10: return _rc _8: - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(i32(0)) return i32(0) } @@ -118609,31 +123906,34 @@ func init() { crt.Xstrncpy(nil, &_dotlockUnlockØ00__func__Ø000[0], str(135516), 14) } -// Lock the file with the lock specified by parameter eFileLock - one -// of the following: -// -// (1) SHARED_LOCK -// (2) RESERVED_LOCK -// (3) PENDING_LOCK -// (4) EXCLUSIVE_LOCK -// -// Sometimes when requesting one lock state, additional lock states -// are inserted in between. The locking might fail on one of the later -// transitions leaving the lock state different from what it started but -// still short of its goal. The following chart shows the allowed -// transitions and the inserted intermediate states: -// -// UNLOCKED -> SHARED -// SHARED -> RESERVED -// SHARED -> (PENDING) -> EXCLUSIVE -// RESERVED -> (PENDING) -> EXCLUSIVE -// PENDING -> EXCLUSIVE -// -// This routine will only increase a lock. Use the sqlite3OsUnlock() -// routine to lower a locking level. -// -// With dotfile locking, we really only support state (4): EXCLUSIVE. -// But we track the other locking levels internally. +// C comment +// /* +// ** Lock the file with the lock specified by parameter eFileLock - one +// ** of the following: +// ** +// ** (1) SHARED_LOCK +// ** (2) RESERVED_LOCK +// ** (3) PENDING_LOCK +// ** (4) EXCLUSIVE_LOCK +// ** +// ** Sometimes when requesting one lock state, additional lock states +// ** are inserted in between. The locking might fail on one of the later +// ** transitions leaving the lock state different from what it started but +// ** still short of its goal. The following chart shows the allowed +// ** transitions and the inserted intermediate states: +// ** +// ** UNLOCKED -> SHARED +// ** SHARED -> RESERVED +// ** SHARED -> (PENDING) -> EXCLUSIVE +// ** RESERVED -> (PENDING) -> EXCLUSIVE +// ** PENDING -> EXCLUSIVE +// ** +// ** This routine will only increase a lock. Use the sqlite3OsUnlock() +// ** routine to lower a locking level. +// ** +// ** With dotfile locking, we really only support state (4): EXCLUSIVE. +// ** But we track the other locking levels internally. +// */ func _dotlockLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) { var _rc, _2_tErrno int32 var _zLockFile *int8 @@ -118642,11 +123942,14 @@ func _dotlockLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) _zLockFile = (*int8)(_pFile.X7) _rc = i32(0) if int32(_pFile.X4) > i32(0) { - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(_eFileLock) crt.Xutimes(tls, _zLockFile, (*[2]crt.Xstruct_timeval)(unsafe.Pointer(nil))) return i32(0) } - _rc = (*(*func(*crt.TLS, *int8, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(18)))).X1)})))(tls, _zLockFile, uint32(i32(511))) + _rc = func() func(*crt.TLS, *int8, uint32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(18)))).X1 + return *(*func(*crt.TLS, *int8, uint32) int32)(unsafe.Pointer(&v)) + }()(tls, _zLockFile, uint32(i32(511))) if _rc >= i32(0) { goto _1 } @@ -118663,18 +123966,21 @@ _3: return _rc _1: - *(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock) + *(*uint8)(unsafe.Pointer(&_pFile.X4)) = uint8(_eFileLock) return _rc } -// This routine checks if there is a RESERVED lock held on the specified -// file by this or any other process. If such a lock is held, set *pResOut -// to a non-zero value otherwise *pResOut is set to zero. The return value -// is set to SQLITE_OK unless an I/O error occurs during lock checking. -// -// In dotfile locking, either a lock exists or it does not. So in this -// variation of CheckReservedLock(), *pResOut is set to true if any lock -// is held on the file and false if the file is unlocked. +// C comment +// /* +// ** This routine checks if there is a RESERVED lock held on the specified +// ** file by this or any other process. If such a lock is held, set *pResOut +// ** to a non-zero value otherwise *pResOut is set to zero. The return value +// ** is set to SQLITE_OK unless an I/O error occurs during lock checking. +// ** +// ** In dotfile locking, either a lock exists or it does not. So in this +// ** variation of CheckReservedLock(), *pResOut is set to true if any lock +// ** is held on the file and false if the file is unlocked. +// */ func _dotlockCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) { var _rc, _reserved int32 var _pFile *XunixFile @@ -118687,7 +123993,10 @@ func _dotlockCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32 crt.X__builtin_abort(tls) } }() - _reserved = bool2int((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(2)))).X1)})))(tls, (*int8)(_pFile.X7), i32(0)) == i32(0)) + _reserved = bool2int(func() func(*crt.TLS, *int8, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(2)))).X1 + return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*int8)(_pFile.X7), i32(0)) == i32(0)) *_pResOut = _reserved return _rc } @@ -118698,13 +124007,19 @@ func init() { crt.Xstrncpy(nil, &_dotlockCheckReservedLockØ00__func__Ø000[0], str(135530), 25) } -// Delete the file at zPath. If the dirSync argument is true, fsync() -// the directory after deleting the file. +// C comment +// /* +// ** Delete the file at zPath. If the dirSync argument is true, fsync() +// ** the directory after deleting the file. +// */ func _unixDelete(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) { var _rc, _4_fd int32 _rc = i32(0) - if (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(16)))).X1)})))(tls, _zPath) != i32(-1) { + if func() func(*crt.TLS, *int8) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(16)))).X1 + return *(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, _zPath) != i32(-1) { goto _0 } if (*crt.X__errno_location(tls)) == i32(2) { @@ -118719,7 +124034,10 @@ _0: if (_dirSync & i32(1)) == i32(0) { goto _3 } - _rc = (*(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(17)))).X1)})))(tls, _zPath, &_4_fd) + _rc = func() func(*crt.TLS, *int8, *int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(17)))).X1 + return *(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _zPath, &_4_fd) if _rc != i32(0) { goto _4 } @@ -118747,14 +124065,17 @@ func init() { crt.Xstrncpy(nil, &_unixDeleteØ00__func__Ø000[0], str(135561), 11) } -// Test the existence of or access permissions of file zPath. The -// test performed depends on the value of flags: -// -// SQLITE_ACCESS_EXISTS: Return 1 if the file exists -// SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable. -// SQLITE_ACCESS_READONLY: Return 1 if the file is readable. -// -// Otherwise return 0. +// C comment +// /* +// ** Test the existence of or access permissions of file zPath. The +// ** test performed depends on the value of flags: +// ** +// ** SQLITE_ACCESS_EXISTS: Return 1 if the file exists +// ** SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable. +// ** SQLITE_ACCESS_READONLY: Return 1 if the file is readable. +// ** +// ** Otherwise return 0. +// */ func _unixAccess(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) { var _1_buf crt.Xstruct_stat64 @@ -118771,10 +124092,16 @@ func _unixAccess(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _flags int3 } }() if _flags == i32(0) { - *_pResOut = bool2int((i32(0) == (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(4)))).X1)})))(tls, _zPath, &_1_buf)) && ((_1_buf.X8) > int64(i32(0)))) + *_pResOut = bool2int((i32(0) == func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(4)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _zPath, &_1_buf)) && (_1_buf.X8 > int64(i32(0)))) goto _7 } - *_pResOut = bool2int((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(2)))).X1)})))(tls, _zPath, i32(6)) == i32(0)) + *_pResOut = bool2int(func() func(*crt.TLS, *int8, int32) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(2)))).X1 + return *(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _zPath, i32(6)) == i32(0)) _7: return i32(0) @@ -118788,13 +124115,16 @@ func init() { crt.Xstrncpy(nil, &_unixAccessØ00__func__Ø000[0], str(135645), 11) } -// Turn a relative pathname into a full pathname. The relative path -// is stored as a nul-terminated string in the buffer pointed to by -// zPath. -// -// zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes -// (in this case, MAX_PATHNAME bytes). The full-path is written to -// this buffer before returning. +// C comment +// /* +// ** Turn a relative pathname into a full pathname. The relative path +// ** is stored as a nul-terminated string in the buffer pointed to by +// ** zPath. +// ** +// ** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes +// ** (in this case, MAX_PATHNAME bytes). The full-path is written to +// ** this buffer before returning. +// */ func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut int32, _zOut *int8) (r0 int32) { var _rc, _nByte, _nLink, _1_bLink, _11_n int32 var _zIn, _zDel *int8 @@ -118804,7 +124134,7 @@ func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut in _zIn = _zPath _zDel = nil func() { - if (_pVfs.X2) != i32(512) { + if _pVfs.X2 != i32(512) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35925), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000))), unsafe.Pointer(str(135656))) crt.X__builtin_abort(tls) } @@ -118812,7 +124142,10 @@ func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut in _2: _1_bLink = i32(0) - if (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(27)))).X1)})))(tls, _zIn, &_1_buf) == i32(0) { + if func() func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(27)))).X1 + return *(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&v)) + }()(tls, _zIn, &_1_buf) == i32(0) { goto _3 } if (*crt.X__errno_location(tls)) != i32(2) { @@ -118820,7 +124153,7 @@ _2: } goto _5 _3: - _1_bLink = bool2int(((_1_buf.X3) & uint32(i32(61440))) == uint32(i32(40960))) + _1_bLink = bool2int((_1_buf.X3 & uint32(i32(61440))) == uint32(i32(40960))) _5: if _1_bLink == 0 { goto _6 @@ -118841,17 +124174,20 @@ _10: if _rc != i32(0) { goto _11 } - _nByte = int32((*(*func(*crt.TLS, *int8, *int8, uint64) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(26)))).X1)})))(tls, _zIn, _zDel, uint64(_nOut-i32(1)))) + _nByte = int32(func() func(*crt.TLS, *int8, *int8, uint64) int64 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(26)))).X1 + return *(*func(*crt.TLS, *int8, *int8, uint64) int64)(unsafe.Pointer(&v)) + }()(tls, _zIn, _zDel, uint64(_nOut-i32(1)))) if _nByte < i32(0) { _rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35960)), str(131686), _zIn, i32(35960)) goto _13 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel)) + 1*uintptr(i32(0))))) == i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDel)) + 1*uintptr(i32(0))))) == i32(47) { goto _14 } _11_n = _sqlite3Strlen30(tls, _zIn) _15: - if _11_n <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_11_n-i32(1))))) == i32(47) { + if _11_n <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(_11_n-i32(1))))) == i32(47) { goto _19 } _11_n -= 1 @@ -118861,8 +124197,8 @@ _19: _rc = _sqlite3CantopenError(tls, i32(35966)) goto _21 } - crt.Xmemmove(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel))+1*uintptr(_11_n)))), (unsafe.Pointer)(_zDel), uint64(_nByte+i32(1))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_zDel), (unsafe.Pointer)(_zIn), uint64(_11_n)) + crt.Xmemmove(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDel))+1*uintptr(_11_n)))), unsafe.Pointer(_zDel), uint64(_nByte+i32(1))) + crt.Xmemcpy(tls, unsafe.Pointer(_zDel), unsafe.Pointer(_zIn), uint64(_11_n)) { p := &_nByte *p = (*p) + _11_n @@ -118870,13 +124206,13 @@ _19: } _21: _14: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel)) + 1*uintptr(_nByte))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zDel)) + 1*uintptr(_nByte))) = int8(i32(0)) _13: _11: _zIn = _zDel _6: func() { - if _rc == i32(0) && _zIn == _zOut && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) != i32(47) { + if _rc == i32(0) && _zIn == _zOut && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(i32(0))))) != i32(47) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35980), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000))), unsafe.Pointer(str(135687))) crt.X__builtin_abort(tls) } @@ -118892,7 +124228,7 @@ _6: goto _2 } _29: - Xsqlite3_free(tls, (unsafe.Pointer)(_zDel)) + Xsqlite3_free(tls, unsafe.Pointer(_zDel)) return _rc _ = _nLink @@ -118906,25 +124242,31 @@ func init() { crt.Xstrncpy(nil, &_unixFullPathnameØ00__func__Ø000[0], str(135729), 17) } -// +// C comment +// /* +// ** +// */ func _mkFullPathname(tls *crt.TLS, _zPath *int8, _zOut *int8, _nOut int32) (r0 int32) { var _nPath, _iOff int32 _nPath = _sqlite3Strlen30(tls, _zPath) _iOff = i32(0) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(i32(0))))) == i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zPath)) + 1*uintptr(i32(0))))) == i32(47) { goto _0 } - if (*(*func(*crt.TLS, *int8, uint64) *int8)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(3)))).X1)})))(tls, _zOut, uint64(_nOut-i32(2))) == nil { + if func() func(*crt.TLS, *int8, uint64) *int8 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(3)))).X1 + return *(*func(*crt.TLS, *int8, uint64) *int8)(unsafe.Pointer(&v)) + }()(tls, _zOut, uint64(_nOut-i32(2))) == nil { return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35886)), str(131515), _zPath, i32(35886)) } _iOff = _sqlite3Strlen30(tls, _zOut) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(postInc1(&_iOff, int32(1))))) = int8(i32(47)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(postInc1(&_iOff, 1)))) = int8(i32(47)) _0: if ((_iOff + _nPath) + i32(1)) > _nOut { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_iOff))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_iOff))) = int8(i32(0)) return _sqlite3CantopenError(tls, i32(35895)) } - Xsqlite3_snprintf(tls, _nOut-_iOff, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_iOff))), str(24576), unsafe.Pointer(_zPath)) + Xsqlite3_snprintf(tls, _nOut-_iOff, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_iOff))), str(24576), unsafe.Pointer(_zPath)) return i32(0) } @@ -118932,11 +124274,14 @@ func _unixDlOpen(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zFilename *int8) (r0 uns return crt.Xdlopen(tls, _zFilename, i32(258)) } -// SQLite calls this function immediately after a call to unixDlSym() or -// unixDlOpen() fails (returns a null pointer). If a more detailed error -// message is available, it is written to zBufOut. If no error message -// is available, zBufOut is left unmodified and SQLite uses a default -// error message. +// C comment +// /* +// ** SQLite calls this function immediately after a call to unixDlSym() or +// ** unixDlOpen() fails (returns a null pointer). If a more detailed error +// ** message is available, it is written to zBufOut. If no error message +// ** is available, zBufOut is left unmodified and SQLite uses a default +// ** error message. +// */ func _unixDlError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBufOut *int8) { var _zErr *int8 @@ -118951,9 +124296,10 @@ func _unixDlError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBufOut *i func _unixDlSym(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _p unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) { var _x func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS) - _x = *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer - }{(crt.Xdlsym)})) + _x = func() func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS) { + v := crt.Xdlsym + return *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v)) + }() return _x(tls, _p, _zSym) } @@ -118961,7 +124307,10 @@ func _unixDlClose(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _pHandle unsafe.Pointer) crt.Xdlclose(tls, _pHandle) } -// Write nBuf bytes of random data to the supplied buffer zBuf. +// C comment +// /* +// ** Write nBuf bytes of random data to the supplied buffer zBuf. +// */ func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *int8) (r0 int32) { var _1_fd, _1_got int32 var _2_t int64 @@ -118972,14 +124321,14 @@ func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *i crt.X__builtin_abort(tls) } }() - crt.Xmemset(tls, (unsafe.Pointer)(_zBuf), i32(0), uint64(_nBuf)) + crt.Xmemset(tls, unsafe.Pointer(_zBuf), i32(0), uint64(_nBuf)) _randomnessPid = crt.Xgetpid(tls) bug20530(_randomnessPid) _1_fd = _robust_open(tls, str(135789), i32(0), uint32(i32(0))) if _1_fd < i32(0) { crt.Xtime(tls, &_2_t) - crt.Xmemcpy(tls, (unsafe.Pointer)(_zBuf), (unsafe.Pointer)(&_2_t), u64(8)) - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(u64(8))))), (unsafe.Pointer)(&_randomnessPid), u64(4)) + crt.Xmemcpy(tls, unsafe.Pointer(_zBuf), unsafe.Pointer(&_2_t), u64(8)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf))+1*uintptr(u64(8))))), unsafe.Pointer(&_randomnessPid), u64(4)) func() { if u64(12) > uint64(_nBuf) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(36086), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRandomnessØ00__func__Ø000))), unsafe.Pointer(str(135802))) @@ -118990,7 +124339,10 @@ func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *i goto _5 } _6: - _1_got = int32((*(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(i32(8)))).X1)})))(tls, _1_fd, (unsafe.Pointer)(_zBuf), uint64(_nBuf))) + _1_got = int32(func() func(*crt.TLS, int32, unsafe.Pointer, uint64) int64 { + v := (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(i32(8)))).X1 + return *(*func(*crt.TLS, int32, unsafe.Pointer, uint64) int64)(unsafe.Pointer(&v)) + }()(tls, _1_fd, unsafe.Pointer(_zBuf), uint64(_nBuf))) if (_1_got < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) { goto _6 } @@ -119008,20 +124360,26 @@ func init() { crt.Xstrncpy(nil, &_unixRandomnessØ00__func__Ø000[0], str(135848), 15) } -// Sleep for a little while. Return the amount of time slept. -// The argument is the number of microseconds we want to sleep. -// The return value is the number of microseconds of sleep actually -// requested from the underlying operating system, a number which -// might be greater than or equal to the argument, but not less -// than the argument. +// C comment +// /* +// ** Sleep for a little while. Return the amount of time slept. +// ** The argument is the number of microseconds we want to sleep. +// ** The return value is the number of microseconds of sleep actually +// ** requested from the underlying operating system, a number which +// ** might be greater than or equal to the argument, but not less +// ** than the argument. +// */ func _unixSleep(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _microseconds int32) (r0 int32) { crt.Xusleep(tls, uint32(_microseconds)) return _microseconds } -// Find the current time (in Universal Coordinated Time). Write the -// current time and date as a Julian Day number into *prNow and -// return 0. Return 1 if the time and date cannot be found. +// C comment +// /* +// ** Find the current time (in Universal Coordinated Time). Write the +// ** current time and date as a Julian Day number into *prNow and +// ** return 0. Return 1 if the time and date cannot be found. +// */ func _unixCurrentTime(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _prNow *float64) (r0 int32) { var _rc int32 var _i int64 @@ -119032,20 +124390,23 @@ func _unixCurrentTime(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _prNow *float64) (r0 return _rc } -// Find the current time (in Universal Coordinated Time). Write into *piNow -// the current time and date as a Julian Day number times 86_400_000. In -// other words, write into *piNow the number of milliseconds since the Julian -// epoch of noon in Greenwich on November 24, 4714 B.C according to the -// proleptic Gregorian calendar. -// -// On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date -// cannot be found. +// C comment +// /* +// ** Find the current time (in Universal Coordinated Time). Write into *piNow +// ** the current time and date as a Julian Day number times 86_400_000. In +// ** other words, write into *piNow the number of milliseconds since the Julian +// ** epoch of noon in Greenwich on November 24, 4714 B.C according to the +// ** proleptic Gregorian calendar. +// ** +// ** On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date +// ** cannot be found. +// */ func _unixCurrentTimeInt64(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _piNow *int64) (r0 int32) { var _rc int32 var _sNow crt.Xstruct_timeval _rc = i32(0) crt.Xgettimeofday(tls, &_sNow, nil) - *_piNow = (_unixCurrentTimeInt64Ø00unixEpochØ001 + (int64(i32(1000)) * (_sNow.X0))) + ((_sNow.X1) / int64(i32(1000))) + *_piNow = (_unixCurrentTimeInt64Ø00unixEpochØ001 + (int64(i32(1000)) * _sNow.X0)) + (_sNow.X1 / int64(i32(1000))) return _rc _ = _sNow @@ -119058,18 +124419,24 @@ func init() { _unixCurrentTimeInt64Ø00unixEpochØ001 = i64(210866760000000) } -// The xGetLastError() method is designed to return a better -// low-level error message when operating-system problems come up -// during SQLite operation. Only the integer return code is currently -// used. +// C comment +// /* +// ** The xGetLastError() method is designed to return a better +// ** low-level error message when operating-system problems come up +// ** during SQLite operation. Only the integer return code is currently +// ** used. +// */ func _unixGetLastError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _NotUsed2 int32, _NotUsed3 *int8) (r0 int32) { return *crt.X__errno_location(tls) } -// This is the xSetSystemCall() method of sqlite3_vfs for all of the -// "unix" VFSes. Return SQLITE_OK opon successfully updating the -// system call pointer, or SQLITE_NOTFOUND if there is no configurable -// system call named zName. +// C comment +// /* +// ** This is the xSetSystemCall() method of sqlite3_vfs for all of the +// ** "unix" VFSes. Return SQLITE_OK opon successfully updating the +// ** system call pointer, or SQLITE_NOTFOUND if there is no configurable +// ** system call named zName. +// */ func _unixSetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8, _pNewFunc func(*crt.TLS)) (r0 int32) { var _rc int32 var _i uint32 @@ -119084,8 +124451,8 @@ _1: if uint64(_i) >= u64(28) { goto _4 } - if ((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X2) != nil { - *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X1))) = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X2 + if ((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X2) != nil { + *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X1))) = (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X2 } _i += 1 goto _1 @@ -119097,17 +124464,17 @@ _7: if uint64(_i) >= u64(28) { goto _10 } - if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+24*uintptr(_i))).X0) != i32(0) { + if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall))+24*uintptr(_i))).X0) != i32(0) { goto _11 } - if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) { - *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X2))) = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X1 + if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) { + *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X2))) = (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X1 } _rc = i32(0) if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_pNewFunc})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) { - _pNewFunc = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X2 + _pNewFunc = (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X2 } - *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X1))) = _pNewFunc + *(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X1))) = _pNewFunc goto _10 _11: _i += 1 @@ -119117,9 +124484,12 @@ _6: return _rc } -// Return the value of a system call. Return NULL if zName is not a -// recognized system call name. NULL is also returned if the system call -// is currently undefined. +// C comment +// /* +// ** Return the value of a system call. Return NULL if zName is not a +// ** recognized system call name. NULL is also returned if the system call +// ** is currently undefined. +// */ func _unixGetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8) (r0 func(*crt.TLS)) { var _i uint32 @@ -119128,8 +124498,8 @@ _0: if uint64(_i) >= u64(28) { goto _3 } - if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+24*uintptr(_i))).X0) == i32(0) { - return (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X1 + if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall))+24*uintptr(_i))).X0) == i32(0) { + return (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X1 } _i += 1 goto _0 @@ -119137,10 +124507,13 @@ _3: return nil } -// Return the name of the first system call after zName. If zName==NULL -// then return the name of the first system call. Return NULL if zName -// is the last system call or if zName is not the name of a valid -// system call. +// C comment +// /* +// ** Return the name of the first system call after zName. If zName==NULL +// ** then return the name of the first system call. Return NULL if zName +// ** is the last system call or if zName is not the name of a valid +// ** system call. +// */ func _unixNextSystemCall(tls *crt.TLS, _p *Xsqlite3_vfs, _zName *int8) (r0 *int8) { var _i int32 _i = i32(-1) @@ -119153,7 +124526,7 @@ _1: if _i >= i32(27) { goto _4 } - if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+24*uintptr(_i))).X0) == i32(0) { + if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall))+24*uintptr(_i))).X0) == i32(0) { goto _4 } _i += 1 @@ -119165,8 +124538,8 @@ _6: if _i >= i32(28) { goto _9 } - if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X1)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) { - return (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 24*uintptr(_i))).X0 + if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X1)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) { + return (*Tunix_syscall)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aSyscall)) + 24*uintptr(_i))).X0 } _i += 1 goto _6 @@ -119194,42 +124567,45 @@ func _dotlockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_i return &_dotlockIoMethods } -// This function is called during initialization if a static buffer is -// supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE -// verb to sqlite3_config(). Parameter pBuf points to an allocation large -// enough to contain 'n' buffers of 'sz' bytes each. -// -// This routine is called from sqlite3_initialize() and so it is guaranteed -// to be serialized already. There is no need for further mutexing. +// C comment +// /* +// ** This function is called during initialization if a static buffer is +// ** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE +// ** verb to sqlite3_config(). Parameter pBuf points to an allocation large +// ** enough to contain 'n' buffers of 'sz' bytes each. +// ** +// ** This routine is called from sqlite3_initialize() and so it is guaranteed +// ** to be serialized already. There is no need for further mutexing. +// */ func _sqlite3PCacheBufferSetup(tls *crt.TLS, _pBuf unsafe.Pointer, _sz int32, _n int32) { var _1_p *Xsqlite3_file - if (_pcache1_g.X1) == 0 { + if _pcache1_g.X1 == 0 { goto _0 } if _pBuf == nil { _sz = store1(&_n, i32(0)) } _sz = _sz & i32(-8) - *(*int32)(unsafe.Pointer(&(_pcache1_g.X4))) = _sz - *(*int32)(unsafe.Pointer(&(_pcache1_g.X5))) = store1((*int32)(unsafe.Pointer(&(_pcache1_g.X11))), _n) - *(*int32)(unsafe.Pointer(&(_pcache1_g.X6))) = func() int32 { + *(*int32)(unsafe.Pointer(&_pcache1_g.X4)) = _sz + *(*int32)(unsafe.Pointer(&_pcache1_g.X5)) = store1((*int32)(unsafe.Pointer(&_pcache1_g.X11)), _n) + *(*int32)(unsafe.Pointer(&_pcache1_g.X6)) = func() int32 { if _n > i32(90) { return i32(10) } return ((_n / i32(10)) + i32(1)) }() - *(*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X7))) = _pBuf - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = nil - *(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = i32(0) + *(*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X7)) = _pBuf + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X10)))) = nil + *(*int32)(unsafe.Pointer(&_pcache1_g.X12)) = i32(0) _4: - if postInc1(&_n, int32(-1)) != 0 { + if postInc1(&_n, -1) != 0 { _1_p = (*Xsqlite3_file)(_pBuf) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X0))))) = (*Xsqlite3_file)(_pcache1_g.X10) - *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = _1_p - _pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_sz)))) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_p.X0)))) = (*Xsqlite3_file)(_pcache1_g.X10) + *(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X10)))) = _1_p + _pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_sz)))) goto _4 } - *(*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X8))) = _pBuf + *(*unsafe.Pointer)(unsafe.Pointer(&_pcache1_g.X8)) = _pBuf _0: } @@ -119245,12 +124621,15 @@ func init() { crt.Xstrncpy(nil, &_enlargeAndAppendØ00__func__Ø000[0], str(135882), 17) } -// Extra argument values from a PrintfArguments object +// C comment +// /* +// ** Extra argument values from a PrintfArguments object +// */ func _getIntArg(tls *crt.TLS, _p *XPrintfArguments) (r0 int64) { - if (_p.X0) <= (_p.X1) { + if _p.X0 <= _p.X1 { return int64(i32(0)) } - return Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1)))))) + return Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_p.X1)), 1))))) } var _sqlite3VXPrintfØ00__func__Ø000 [16]int8 @@ -119284,23 +124663,26 @@ func init() { } func _getDoubleArg(tls *crt.TLS, _p *XPrintfArguments) (r0 float64) { - if (_p.X0) <= (_p.X1) { + if _p.X0 <= _p.X1 { return float64(0) } - return Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1)))))) -} - -// "*val" is a double such that 0.1 <= *val < 10.0 -// Return the ascii code for the leading digit of *val, then -// multiply "*val" by 10.0 to renormalize. -// -// Example: -// input: *val = 3.14159 -// output: *val = 1.4159 function return = '3' -// -// The counter *cnt is incremented each time. After counter exceeds -// 16 (the number of significant digits in a 64-bit float) '0' is -// always returned. + return Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_p.X1)), 1))))) +} + +// C comment +// /* +// ** "*val" is a double such that 0.1 <= *val < 10.0 +// ** Return the ascii code for the leading digit of *val, then +// ** multiply "*val" by 10.0 to renormalize. +// ** +// ** Example: +// ** input: *val = 3.14159 +// ** output: *val = 1.4159 function return = '3' +// ** +// ** The counter *cnt is incremented each time. After counter exceeds +// ** 16 (the number of significant digits in a 64-bit float) '0' is +// ** always returned. +// */ func _et_getdigit(tls *crt.TLS, _val *float64, _cnt *int32) (r0 int8) { var _digit int32 var _d float64 @@ -119320,26 +124702,29 @@ func _et_getdigit(tls *crt.TLS, _val *float64, _cnt *int32) (r0 int8) { } func _getTextArg(tls *crt.TLS, _p *XPrintfArguments) (r0 *int8) { - if (_p.X0) <= (_p.X1) { + if _p.X0 <= _p.X1 { return nil } - return (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1)))))))) + return (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 8*uintptr(postInc1((*int32)(unsafe.Pointer(&_p.X1)), 1))))))) } -// Append N copies of character c to the given string buffer. +// C comment +// /* +// ** Append N copies of character c to the given string buffer. +// */ func _sqlite3AppendChar(tls *crt.TLS, _p *XStrAccum, _N int32, _c int8) { if ((int64(_p.X3) + int64(_N)) >= int64(_p.X4)) && (store1(&_N, _sqlite3StrAccumEnlarge(tls, _p, _N)) <= i32(0)) { return } func() { - if ((_p.X2) == (_p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) { + if (_p.X2 == _p.X1) != ((int32(_p.X7) & i32(4)) == i32(0)) { crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AppendCharØ00__func__Ø000))), unsafe.Pointer(str(6554))) crt.X__builtin_abort(tls) } }() _4: - if postInc1(&_N, int32(-1)) > i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 1*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X3))), uint32(1))))) = _c + if postInc1(&_N, -1) > i32(0) { + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X2)) + 1*uintptr(postInc5((*uint32)(unsafe.Pointer(&_p.X3)), uint32(1))))) = _c goto _4 } } @@ -119356,20 +124741,23 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_execØ00__func__Ø000[0], str(135982), 13) } -// Enable or disable extension loading. Extension loading is disabled by -// default so as not to open security holes in older applications. +// C comment +// /* +// ** Enable or disable extension loading. Extension loading is disabled by +// ** default so as not to open security holes in older applications. +// */ func Xsqlite3_enable_load_extension(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) { Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3)) if _onoff != 0 { { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) | i32(12582912) sink1(*p) } goto _1 } { - p := (*int32)(unsafe.Pointer(&(_db.X6))) + p := (*int32)(unsafe.Pointer(&_db.X6)) *p = (*p) & i32(-12582913) sink1(*p) } diff --git a/internal/mptest/mptest_linux_amd64.go b/internal/mptest/mptest_linux_amd64.go index 21cc682..17da4a4 100644 --- a/internal/mptest/mptest_linux_amd64.go +++ b/internal/mptest/mptest_linux_amd64.go @@ -1,41 +1,41 @@ // Code generated by ccgo. DO NOT EDIT. -// mptest.c - -// 2013-04-05 -// -// 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 is a program used for testing SQLite, and specifically for testing -// the ability of independent processes to access the same SQLite database -// concurrently. -// -// Compile this program as follows: -// -// gcc -g -c -Wall sqlite3.c $(OPTS) -// gcc -g -o mptest mptest.c sqlite3.o $(LIBS) -// -// Recommended options: -// -// -DHAVE_USLEEP -// -DSQLITE_NO_SYNC -// -DSQLITE_THREADSAFE=0 -// -DSQLITE_OMIT_LOAD_EXTENSION -// -// Run like this: -// -// ./mptest $database $script -// -// where $database is the database to use for testing and $script is a -// test script. - +// mptest +// /* +// ** 2013-04-05 +// ** +// ** 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 is a program used for testing SQLite, and specifically for testing +// ** the ability of independent processes to access the same SQLite database +// ** concurrently. +// ** +// ** Compile this program as follows: +// ** +// ** gcc -g -c -Wall sqlite3.c $(OPTS) +// ** gcc -g -o mptest mptest.c sqlite3.o $(LIBS) +// ** +// ** Recommended options: +// ** +// ** -DHAVE_USLEEP +// ** -DSQLITE_NO_SYNC +// ** -DSQLITE_THREADSAFE=0 +// ** -DSQLITE_OMIT_LOAD_EXTENSION +// ** +// ** Run like this: +// ** +// ** ./mptest $database $script +// ** +// ** where $database is the database to use for testing and $script is a +// ** test script. +// */ package main import ( @@ -73,13 +73,13 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { @@ -90,21 +90,21 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { _openFlags = i32(2) _nRep = i32(1) _iTmout = i32(0) - *(**int8)(unsafe.Pointer(&(_g.X0))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))) - *(*int32)(unsafe.Pointer(&(_g.X10))) = i32(1) + *(**int8)(unsafe.Pointer(&_g.X0)) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))) + *(*int32)(unsafe.Pointer(&_g.X10)) = i32(1) if _argc < i32(2) { - _usage(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _usage(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) } - *(**int8)(unsafe.Pointer(&(_g.X2))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))) + *(**int8)(unsafe.Pointer(&_g.X2)) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))) if Xstrglob(tls, str(0), _g.X2) != 0 { - _usage(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0))))) + _usage(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0))))) } if crt.Xstrcmp(tls, bin.Xsqlite3_sourceid(tls), str(7)) != i32(0) { crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(92), unsafe.Pointer(bin.Xsqlite3_sourceid(tls)), unsafe.Pointer(str(7))) crt.Xexit(tls, i32(1)) } _n = _argc - i32(2) - bin.Xsqlite3_snprintf(tls, int32(u64(32)), (*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&(_g.X8))))), str(152), crt.Xgetpid(tls)) + bin.Xsqlite3_snprintf(tls, int32(u64(32)), (*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&_g.X8)))), str(152), crt.Xgetpid(tls)) _zJMode = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(164), i32(1)) _zNRep = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(176), i32(1)) if _zNRep != nil { @@ -113,34 +113,34 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { if _nRep < i32(1) { _nRep = i32(1) } - *(**int8)(unsafe.Pointer(&(_g.X1))) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(183), i32(1)) + *(**int8)(unsafe.Pointer(&_g.X1)) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(183), i32(1)) _zClient = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(187), i32(1)) - *(**int8)(unsafe.Pointer(&(_g.X4))) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(194), i32(1)) - *(**int8)(unsafe.Pointer(&(_g.X6))) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(201), i32(1)) + *(**int8)(unsafe.Pointer(&_g.X4)) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(194), i32(1)) + *(**int8)(unsafe.Pointer(&_g.X6)) = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(201), i32(1)) _zTrace = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(205), i32(1)) if _zTrace != nil { - *(*int32)(unsafe.Pointer(&(_g.X10))) = crt.Xatoi(tls, _zTrace) + *(*int32)(unsafe.Pointer(&_g.X10)) = crt.Xatoi(tls, _zTrace) } if _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(211), i32(0)) != nil { - *(*int32)(unsafe.Pointer(&(_g.X10))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X10)) = i32(0) } _zTmout = _findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(217), i32(1)) if _zTmout != nil { _iTmout = crt.Xatoi(tls, _zTmout) } - *(*int32)(unsafe.Pointer(&(_g.X11))) = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(225), i32(0)) != nil) - *(*int32)(unsafe.Pointer(&(_g.X16))) = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(234), i32(0)) != nil) - if (_g.X4) != nil { - *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_g.X5))))) = crt.Xfopen64(tls, _g.X4, str(239)) + *(*int32)(unsafe.Pointer(&_g.X11)) = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(225), i32(0)) != nil) + *(*int32)(unsafe.Pointer(&_g.X16)) = bool2int(_findOption(tls, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8))))))))))), &_n, str(234), i32(0)) != nil) + if _g.X4 != nil { + *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_g.X5)))) = crt.Xfopen64(tls, _g.X4, str(239)) goto _9 } - *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_g.X5))))) = (*crt.XFILE)(Xstderr) + *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_g.X5)))) = (*crt.XFILE)(Xstderr) _9: - if (_g.X6) != nil { - *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_g.X7))))) = crt.Xfopen64(tls, _g.X6, str(239)) + if _g.X6 != nil { + *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_g.X7)))) = crt.Xfopen64(tls, _g.X6, str(239)) goto _11 } - *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_g.X7))))) = (*crt.XFILE)(Xstdout) + *(**crt.XFILE)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_g.X7)))) = (*crt.XFILE)(Xstdout) _11: bin.Xsqlite3_config(tls, i32(16), _sqlErrorCallback, i32(0)) if _zClient == nil { @@ -150,20 +150,20 @@ _11: if _iClient < i32(1) { _fatalError(tls, str(241), _iClient) } - bin.Xsqlite3_snprintf(tls, int32(u64(32)), (*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&(_g.X8))))), str(268), crt.Xgetpid(tls), _iClient) + bin.Xsqlite3_snprintf(tls, int32(u64(32)), (*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&_g.X8)))), str(268), crt.Xgetpid(tls), _iClient) goto _14 _12: _7_nTry = i32(0) - if (_g.X10) <= i32(0) { + if _g.X10 <= i32(0) { goto _15 } - crt.Xprintf(tls, str(284), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + crt.Xprintf(tls, str(284), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) _i = i32(1) _16: if _i >= _argc { goto _19 } - crt.Xprintf(tls, str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))))) + crt.Xprintf(tls, str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))))) _i += 1 goto _16 _19: @@ -206,7 +206,7 @@ _24: sink1(*p) } _14: - _rc = bin.Xsqlite3_open_v2(tls, _g.X2, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_g.X3))))), _openFlags, _g.X1) + _rc = bin.Xsqlite3_open_v2(tls, _g.X2, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_g.X3)))), _openFlags, _g.X1) if _rc != 0 { _fatalError(tls, str(496), unsafe.Pointer(_g.X2)) } @@ -216,36 +216,30 @@ _14: if _zJMode != nil { _runSql(tls, str(513), unsafe.Pointer(_zJMode)) } - if (_g.X16) == 0 { + if _g.X16 == 0 { _trySql(tls, str(537)) } bin.Xsqlite3_enable_load_extension(tls, (*bin.Xsqlite3)(_g.X3), i32(1)) bin.Xsqlite3_busy_handler(tls, (*bin.Xsqlite3)(_g.X3), _busyHandler, nil) - bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.X3), str(560), i32(0), i32(1), nil, *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{_vfsNameFunc})), *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{nil})), *(*func(*crt.TLS, *bin.Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{nil}))) - bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.X3), str(568), i32(1), i32(1), nil, *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{_evalFunc})), *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{nil})), *(*func(*crt.TLS, *bin.Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{nil}))) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(10000) - if (_g.X11) != 0 { + bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.X3), str(560), i32(0), i32(1), nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { + v := _vfsNameFunc + return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) + }(), nil, nil) + bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_g.X3), str(568), i32(1), i32(1), nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { + v := _evalFunc + return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) + }(), nil, nil) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(10000) + if _g.X11 != 0 { bin.Xsqlite3_trace(tls, (*bin.Xsqlite3)(_g.X3), _sqlTraceCallback, nil) } if _iClient <= i32(0) { goto _38 } if _n > i32(0) { - _unrecognizedArguments(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) + _unrecognizedArguments(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) } - if (_g.X10) != 0 { + if _g.X10 != 0 { _logMessage(tls, str(573)) } _40: @@ -254,19 +248,19 @@ _40: if _rc == i32(101) { goto _42 } - if (_g.X10) != 0 { + if _g.X10 != 0 { _logMessage(tls, str(586), unsafe.Pointer(_14_zTaskName), _taskId) } _runScript(tls, _iClient, _taskId, _zScript, _14_zTaskName) - if (_g.X10) != 0 { + if _g.X10 != 0 { _logMessage(tls, str(600), unsafe.Pointer(_14_zTaskName), _taskId) } _finishScript(tls, _iClient, _taskId, i32(0)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_14_zTaskName)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_14_zTaskName)) bin.Xsqlite3_sleep(tls, i32(10)) goto _40 _42: - if (_g.X10) != 0 { + if _g.X10 != 0 { _logMessage(tls, str(612)) } goto _47 @@ -275,30 +269,30 @@ _38: _fatalError(tls, str(623)) } if _n > i32(1) { - _unrecognizedArguments(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) + _unrecognizedArguments(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))), _n, (**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(i32(2))*uintptr(unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(8)))))))))))) } _runSql(tls, str(647)) - _zScript = _readFile(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) + _zScript = _readFile(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) _iRep = i32(1) _50: if _iRep > _nRep { goto _53 } - if (_g.X10) != 0 { - _logMessage(tls, str(1083), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))), _iRep) + if _g.X10 != 0 { + _logMessage(tls, str(1083), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))), _iRep) } - _runScript(tls, i32(0), i32(0), _zScript, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))) - if (_g.X10) != 0 { - _logMessage(tls, str(1111), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(2))))), _iRep) + _runScript(tls, i32(0), i32(0), _zScript, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))) + if _g.X10 != 0 { + _logMessage(tls, str(1111), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(2))))), _iRep) } _iRep += 1 goto _50 _53: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zScript)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zScript)) _waitForClient(tls, i32(0), i32(2000), str(1137)) _trySql(tls, str(1157)) bin.Xsqlite3_sleep(tls, i32(10)) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(0) _15_iTimeout = i32(1000) _56: if ((store1(&_rc, _trySql(tls, str(1186))) == i32(5)) || (_rc == i32(100))) && (_15_iTimeout > i32(0)) { @@ -325,12 +319,12 @@ _60: } if _rc == i32(100) { { - p := (*int32)(unsafe.Pointer(&(_g.X13))) + p := (*int32)(unsafe.Pointer(&_g.X13)) *p = (*p) + bin.Xsqlite3_column_int(tls, _15_pStmt, i32(0)) sink1(*p) } { - p := (*int32)(unsafe.Pointer(&(_g.X14))) + p := (*int32)(unsafe.Pointer(&_g.X14)) *p = (*p) + bin.Xsqlite3_column_int(tls, _15_pStmt, i32(1)) sink1(*p) } @@ -344,34 +338,35 @@ _47: goto _64 } crt.Xprintf(tls, str(1242), _g.X13, _g.X14) - crt.Xprintf(tls, str(1278), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + crt.Xprintf(tls, str(1278), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) _i = i32(1) _65: if _i >= _argc { goto _68 } - crt.Xprintf(tls, str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))))) + crt.Xprintf(tls, str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))))) _i += 1 goto _65 _68: crt.Xprintf(tls, str(298)) _64: - return bool2int((_g.X13) > i32(0)) + return bool2int(_g.X13 > i32(0)) } var _g TGlobal -// Print a usage message for the program and exit +// C comment +// /* Print a usage message for the program and exit */ func _usage(tls *crt.TLS, _argv0 *int8) { var _i int32 var _zTail *int8 _zTail = _argv0 _i = i32(0) _0: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv0)) + 1*uintptr(_i)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv0)) + 1*uintptr(_i)))) == 0 { goto _3 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv0)) + 1*uintptr(_i)))) == i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv0)) + 1*uintptr(_i)))) == i32(47) { _zTail = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv0))+uintptr(_i))))) + uintptr(i32(1)))) } _i += 1 @@ -382,22 +377,25 @@ _3: crt.Xexit(tls, i32(1)) } -// Return TRUE if string z[] matches glob pattern zGlob[]. -// Return FALSE if the pattern does not match. -// -// Globbing rules: -// -// '*' Matches any sequence of zero or more characters. -// -// '?' Matches exactly one character. -// -// [...] Matches one character from the enclosed list of -// characters. -// -// [^...] Matches one character not in the enclosed list. -// -// '#' Matches any sequence of one or more digits with an -// optional + or - sign in front +// C comment +// /* +// ** Return TRUE if string z[] matches glob pattern zGlob[]. +// ** Return FALSE if the pattern does not match. +// ** +// ** Globbing rules: +// ** +// ** '*' Matches any sequence of zero or more characters. +// ** +// ** '?' Matches exactly one character. +// ** +// ** [...] Matches one character from the enclosed list of +// ** characters. +// ** +// ** [^...] Matches one character not in the enclosed list. +// ** +// ** '#' Matches any sequence of one or more digits with an +// ** optional + or - sign in front +// */ func Xstrglob(tls *crt.TLS, _zGlob *int8, _z *int8) (r0 int32) { var _c, _c2, _invert, _seen, _10_prior_c int32 _0: @@ -485,7 +483,7 @@ _27: if _c2 == 0 || _c2 == i32(93) { goto _30 } - if _c2 != i32(45) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zGlob)) + 1*uintptr(i32(0))))) == i32(93) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zGlob)) + 1*uintptr(i32(0))))) == i32(0) || _10_prior_c <= i32(0) { + if _c2 != i32(45) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zGlob)) + 1*uintptr(i32(0))))) == i32(93) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zGlob)) + 1*uintptr(i32(0))))) == i32(0) || _10_prior_c <= i32(0) { goto _35 } _c2 = int32(*postInc0(&_zGlob, 1)) @@ -511,15 +509,15 @@ _24: if _c != i32(35) { goto _43 } - if ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(45)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(43))) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))))))))&int32(u16(2048))) != 0 { + if ((int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(45)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(43))) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))))))))&int32(u16(2048))) != 0 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) } - if (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))))))) & int32(u16(2048))) == 0 { + if (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0)))))))))) & int32(u16(2048))) == 0 { return i32(0) } *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) _48: - if (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))))))) & int32(u16(2048))) != 0 { + if (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0)))))))))) & int32(u16(2048))) != 0 { *(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1) goto _48 } @@ -534,12 +532,15 @@ _1: return bool2int(int32(*_z) == i32(0)) } -// Look for a command-line option. If present, return a pointer. -// Return NULL if missing. -// -// hasArg==0 means the option is a flag. It is either present or not. -// hasArg==1 means the option has an argument. Return a pointer to the -// argument. +// C comment +// /* +// ** Look for a command-line option. If present, return a pointer. +// ** Return NULL if missing. +// ** +// ** hasArg==0 means the option is a flag. It is either present or not. +// ** hasArg==1 means the option has an argument. Return a pointer to the +// ** argument. +// */ func _findOption(tls *crt.TLS, _azArg **int8, _pnArg *int32, _zOption *int8, _hasArg int32) (r0 *int8) { var _i, _j, _nArg int32 var _zReturn, _1_z *int8 @@ -559,15 +560,15 @@ _3: if (_i + _hasArg) >= _nArg { goto _6 } - _1_z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i))) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { + _1_z = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { goto _4 } *(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(1) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { goto _9 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(1))))) == i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(1))))) == i32(0) { goto _6 } *(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(1) @@ -579,15 +580,15 @@ _9: _fatalError(tls, str(2011), unsafe.Pointer(_1_z)) } if _hasArg != 0 { - _zReturn = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i+i32(1)))) + _zReturn = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i+i32(1)))) goto _15 } - _zReturn = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i))) + _zReturn = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i))) _15: _j = (_i + i32(1)) + bool2int(_hasArg != i32(0)) _16: if _j < _nArg { - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(postInc1(&_i, int32(1))))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(postInc1(&_j, int32(1))))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(postInc1(&_i, 1)))) = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(postInc1(&_j, 1)))) goto _16 } *_pnArg = _i @@ -607,7 +608,10 @@ func init() { crt.Xstrncpy(nil, &_findOptionØ00__func__Ø000[0], str(2059), 11) } -// Print an error message and then quit. +// C comment +// /* +// ** Print an error message and then quit. +// */ func _fatalError(tls *crt.TLS, _zFormat *int8, args ...interface{}) { var _3_nTry int32 var _zMsg *int8 @@ -616,25 +620,25 @@ func _fatalError(tls *crt.TLS, _zFormat *int8, args ...interface{}) { _ap = args _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2070), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&(_g.X8))))))) - if (*crt.XFILE)(_g.X7) != nil { + bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2070), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&_g.X8)))))) + if _g.X7 != nil { _printWithPrefix(tls, (*crt.XFILE)(_g.X7), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) crt.Xfflush(tls, (*crt.XFILE)(_g.X7)) _maybeClose(tls, (*crt.XFILE)(_g.X7)) } - if ((*crt.XFILE)(_g.X5) != nil) && _safe_strcmp(tls, _g.X4, _g.X6) != 0 { + if (_g.X5 != nil) && _safe_strcmp(tls, _g.X4, _g.X6) != 0 { _printWithPrefix(tls, (*crt.XFILE)(_g.X5), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) crt.Xfflush(tls, (*crt.XFILE)(_g.X5)) _maybeClose(tls, (*crt.XFILE)(_g.X5)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zMsg)) - if (_g.X3) == nil { + bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) + if _g.X3 == nil { goto _3 } _3_nTry = i32(0) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(0) _4: - if (_trySql(tls, str(2081)) == i32(5)) && (postInc1(&_3_nTry, int32(1)) < i32(100)) { + if (_trySql(tls, str(2081)) == i32(5)) && (postInc1(&_3_nTry, 1) < i32(100)) { bin.Xsqlite3_sleep(tls, i32(10)) goto _4 } @@ -645,16 +649,19 @@ _3: _ = _3_nTry } -// Print a message adding zPrefix[] to the beginning of every line. +// C comment +// /* +// ** Print a message adding zPrefix[] to the beginning of every line. +// */ func _printWithPrefix(tls *crt.TLS, _pOut *crt.XFILE, _zPrefix *int8, _zMsg *int8) { var _1_i int32 _0: - if _zMsg == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(i32(0))))) == 0 { + if _zMsg == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(i32(0))))) == 0 { goto _1 } _1_i = i32(0) _3: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(_1_i)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(_1_i)))) == i32(10) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(_1_i)))) == i32(13) { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(_1_i)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(_1_i)))) == i32(10) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(_1_i)))) == i32(13) { goto _8 } _1_i += 1 @@ -663,11 +670,11 @@ _8: crt.Xfprintf(tls, _pOut, str(2111), unsafe.Pointer(_zPrefix), _1_i, unsafe.Pointer(_zMsg)) { p := &_zMsg - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_1_i))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_1_i))) sink0(*p) } _9: - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(i32(0))))) == i32(10)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMsg)) + 1*uintptr(i32(0))))) == i32(13)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(i32(0))))) == i32(10)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zMsg)) + 1*uintptr(i32(0))))) == i32(13)) { *(*uintptr)(unsafe.Pointer(&_zMsg)) += uintptr(1) goto _9 } @@ -675,14 +682,20 @@ _9: _1: } -// Close output stream pOut if it is not stdout or stderr +// C comment +// /* +// ** Close output stream pOut if it is not stdout or stderr +// */ func _maybeClose(tls *crt.TLS, _pOut *crt.XFILE) { if (unsafe.Pointer(_pOut) != Xstdout) && (_pOut != (*crt.XFILE)(Xstderr)) { crt.Xfclose(tls, _pOut) } } -// Compare two pointers to strings, where the pointers might be NULL. +// C comment +// /* +// ** Compare two pointers to strings, where the pointers might be NULL. +// */ func _safe_strcmp(tls *crt.TLS, _a *int8, _b *int8) (r0 int32) { if _a == _b { return i32(0) @@ -696,7 +709,10 @@ func _safe_strcmp(tls *crt.TLS, _a *int8, _b *int8) (r0 int32) { return crt.Xstrcmp(tls, _a, _b) } -// Try to run arbitrary SQL. Return success code. +// C comment +// /* +// ** Try to run arbitrary SQL. Return success code. +// */ func _trySql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 int32) { var _rc int32 var _zSql *int8 @@ -705,19 +721,22 @@ func _trySql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 int32) { _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.X3), _zSql, nil, nil, nil) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) return _rc } -// SQL error log callback +// C comment +// /* +// ** SQL error log callback +// */ func _sqlErrorCallback(tls *crt.TLS, _pArg unsafe.Pointer, _iErrCode int32, _zMsg *int8) { - if (_iErrCode == i32(1)) && (_g.X12) != 0 { + if (_iErrCode == i32(1)) && _g.X12 != 0 { return } - if ((_iErrCode & i32(255)) == i32(17)) && ((_g.X10) < i32(3)) { + if ((_iErrCode & i32(255)) == i32(17)) && (_g.X10 < i32(3)) { return } - if (((_g.X15) == i32(0)) && ((_iErrCode & i32(255)) == i32(5))) && ((_g.X10) < i32(3)) { + if ((_g.X15 == i32(0)) && ((_iErrCode & i32(255)) == i32(5))) && (_g.X10 < i32(3)) { return } if (_iErrCode & i32(255)) == i32(27) { @@ -728,7 +747,10 @@ func _sqlErrorCallback(tls *crt.TLS, _pArg unsafe.Pointer, _iErrCode int32, _zMs _8: } -// Print a log message +// C comment +// /* +// ** Print a log message +// */ func _logMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { var _zMsg *int8 var _ap []interface{} @@ -736,16 +758,19 @@ func _logMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { _ap = args _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2145), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&(_g.X8))))))) - if (*crt.XFILE)(_g.X7) != nil { + bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2145), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&_g.X8)))))) + if _g.X7 != nil { _printWithPrefix(tls, (*crt.XFILE)(_g.X7), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) crt.Xfflush(tls, (*crt.XFILE)(_g.X7)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zMsg)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) _ = _zPrefix } -// Print an error message +// C comment +// /* +// ** Print an error message +// */ func _errorMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { var _zMsg *int8 var _ap []interface{} @@ -753,21 +778,24 @@ func _errorMessage(tls *crt.TLS, _zFormat *int8, args ...interface{}) { _ap = args _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2150), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&(_g.X8))))))) - if (*crt.XFILE)(_g.X7) != nil { + bin.Xsqlite3_snprintf(tls, int32(u64(30)), (*int8)(unsafe.Pointer(&_zPrefix)), str(2150), unsafe.Pointer((*int8)(unsafe.Pointer((*[32]int8)(unsafe.Pointer(&_g.X8)))))) + if _g.X7 != nil { _printWithPrefix(tls, (*crt.XFILE)(_g.X7), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) crt.Xfflush(tls, (*crt.XFILE)(_g.X7)) } - if ((*crt.XFILE)(_g.X5) != nil) && _safe_strcmp(tls, _g.X4, _g.X6) != 0 { + if (_g.X5 != nil) && _safe_strcmp(tls, _g.X4, _g.X6) != 0 { _printWithPrefix(tls, (*crt.XFILE)(_g.X5), (*int8)(unsafe.Pointer(&_zPrefix)), _zMsg) crt.Xfflush(tls, (*crt.XFILE)(_g.X5)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zMsg)) - *(*int32)(unsafe.Pointer(&(_g.X13))) += 1 + bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) + *(*int32)(unsafe.Pointer(&_g.X13)) += 1 _ = _zPrefix } -// Run arbitrary SQL. Issue a fatal error on failure. +// C comment +// /* +// ** Run arbitrary SQL. Issue a fatal error on failure. +// */ func _runSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) { var _rc int32 var _zSql *int8 @@ -779,15 +807,18 @@ func _runSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) { if _rc != i32(0) { _fatalError(tls, str(2161), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.X3))), unsafe.Pointer(_zSql)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) } -// Busy handler with a g.iTimeout-millisecond timeout +// C comment +// /* +// ** Busy handler with a g.iTimeout-millisecond timeout +// */ func _busyHandler(tls *crt.TLS, _pCD unsafe.Pointer, _count int32) (r0 int32) { - if (_count * i32(10)) <= (_g.X15) { + if (_count * i32(10)) <= _g.X15 { goto _0 } - if (_g.X15) > i32(0) { + if _g.X15 > i32(0) { _errorMessage(tls, str(2168), _g.X15) } return i32(0) @@ -797,47 +828,59 @@ _0: return i32(1) } -// Auxiliary SQL function to return the name of the VFS +// C comment +// /* +// ** Auxiliary SQL function to return the name of the VFS +// */ func _vfsNameFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { var _zVfs *int8 var _db unsafe.Pointer _db = unsafe.Pointer(bin.Xsqlite3_context_db_handle(tls, (*bin.Xsqlite3_context)(_context))) _zVfs = nil - bin.Xsqlite3_file_control(tls, (*bin.Xsqlite3)(_db), str(2187), i32(12), (unsafe.Pointer)(&_zVfs)) + bin.Xsqlite3_file_control(tls, (*bin.Xsqlite3)(_db), str(2187), i32(12), unsafe.Pointer(&_zVfs)) if _zVfs != nil { bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), _zVfs, i32(-1), bin.Xsqlite3_free) } } -// Auxiliary SQL function to recursively evaluate SQL. +// C comment +// /* +// ** Auxiliary SQL function to recursively evaluate SQL. +// */ func _evalFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { var _rc int32 var _zSql, _zErrMsg *int8 var _db unsafe.Pointer var _res XString _db = unsafe.Pointer(bin.Xsqlite3_context_db_handle(tls, (*bin.Xsqlite3_context)(_context))) - _zSql = (*int8)(unsafe.Pointer(bin.Xsqlite3_value_text(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))))) + _zSql = (*int8)(unsafe.Pointer(bin.Xsqlite3_value_text(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))))) _zErrMsg = nil - crt.Xmemset(tls, (unsafe.Pointer)(&_res), i32(0), u64(16)) - _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _evalCallback, (unsafe.Pointer)(&_res), &_zErrMsg) + crt.Xmemset(tls, unsafe.Pointer(&_res), i32(0), u64(16)) + _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _evalCallback, unsafe.Pointer(&_res), &_zErrMsg) if _zErrMsg != nil { bin.Xsqlite3_result_error(tls, (*bin.Xsqlite3_context)(_context), _zErrMsg, i32(-1)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) goto _3 } if _rc != 0 { bin.Xsqlite3_result_error_code(tls, (*bin.Xsqlite3_context)(_context), _rc) goto _3 } - bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), _res.X0, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), _res.X0, i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _3: _stringFree(tls, &_res) _ = _res } -// Callback function for evalSql() +// C comment +// /* +// ** Callback function for evalSql() +// */ func _evalCallback(tls *crt.TLS, _pCData unsafe.Pointer, _argc int32, _argv **int8, _azCol **int8) (r0 int32) { var _i int32 var _p *XString @@ -848,17 +891,18 @@ _0: if _i >= _argc { goto _3 } - _stringAppendTerm(tls, _p, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i)))) + _stringAppendTerm(tls, _p, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i)))) _i += 1 goto _0 _3: return i32(0) } -// Append a new token onto the end of the string +// C comment +// /* Append a new token onto the end of the string */ func _stringAppendTerm(tls *crt.TLS, _p *XString, _z *int8) { var _i int32 - if (_p.X1) != 0 { + if _p.X1 != 0 { _stringAppend(tls, _p, str(2192), i32(1)) } if _z == nil { @@ -867,35 +911,35 @@ func _stringAppendTerm(tls *crt.TLS, _p *XString, _z *int8) { } _i = i32(0) _2: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == 0 || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))))))))&int32(u16(8192))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == 0 || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))))))))&int32(u16(8192))) != 0 { goto _6 } _i += 1 goto _2 _6: - if (_i > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(0)) { + if (_i > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == i32(0)) { _stringAppend(tls, _p, _z, _i) return } _stringAppend(tls, _p, str(2198), i32(1)) _9: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == 0 { goto _10 } _i = i32(0) _11: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(39) { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == i32(39) { goto _15 } _i += 1 goto _11 _15: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) != 0 { _stringAppend(tls, _p, _z, _i+i32(1)) _stringAppend(tls, _p, str(2198), i32(1)) { p := &_z - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_i+i32(1)))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_i+i32(1)))) sink0(*p) } goto _17 @@ -908,59 +952,68 @@ _10: _stringAppend(tls, _p, str(2198), i32(1)) } -// Append n bytes of text to a string. If n<0 append the entire string. +// C comment +// /* Append n bytes of text to a string. If n<0 append the entire string. */ func _stringAppend(tls *crt.TLS, _p *XString, _z *int8, _n int32) { var _1_nAlloc int32 var _1_zNew *int8 if _n < i32(0) { _n = int32(crt.Xstrlen(tls, _z)) } - if ((_p.X1) + _n) < (_p.X2) { + if (_p.X1 + _n) < _p.X2 { goto _1 } - _1_nAlloc = (((_p.X2) * i32(2)) + _n) + i32(100) - _1_zNew = (*int8)(bin.Xsqlite3_realloc(tls, (unsafe.Pointer)(_p.X0), _1_nAlloc)) + _1_nAlloc = ((_p.X2 * i32(2)) + _n) + i32(100) + _1_zNew = (*int8)(bin.Xsqlite3_realloc(tls, unsafe.Pointer(_p.X0), _1_nAlloc)) if _1_zNew == nil { _fatalError(tls, str(2200)) } - *(**int8)(unsafe.Pointer(&(_p.X0))) = _1_zNew - *(*int32)(unsafe.Pointer(&(_p.X2))) = _1_nAlloc + *(**int8)(unsafe.Pointer(&_p.X0)) = _1_zNew + *(*int32)(unsafe.Pointer(&_p.X2)) = _1_nAlloc _1: - crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0))+uintptr(_p.X1)))), (unsafe.Pointer)(_z), uint64(_n)) + crt.Xmemcpy(tls, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0))+uintptr(_p.X1)))), unsafe.Pointer(_z), uint64(_n)) { - p := (*int32)(unsafe.Pointer(&(_p.X1))) + p := (*int32)(unsafe.Pointer(&_p.X1)) *p = (*p) + _n sink1(*p) } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 1*uintptr(_p.X1))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0)) + 1*uintptr(_p.X1))) = int8(i32(0)) } -// Free a string +// C comment +// /* Free a string */ func _stringFree(tls *crt.TLS, _p *XString) { - if (_p.X0) != nil { - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_p.X0)) + if _p.X0 != nil { + bin.Xsqlite3_free(tls, unsafe.Pointer(_p.X0)) } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), u64(16)) } -// SQL Trace callback +// C comment +// /* +// ** SQL Trace callback +// */ func _sqlTraceCallback(tls *crt.TLS, _NotUsed1 unsafe.Pointer, _zSql *int8) { _logMessage(tls, str(2214), _clipLength(tls, _zSql), unsafe.Pointer(_zSql)) } -// Return the length of a string omitting trailing whitespace +// C comment +// /* +// ** Return the length of a string omitting trailing whitespace +// */ func _clipLength(tls *crt.TLS, _z *int8) (r0 int32) { var _n int32 _n = int32(crt.Xstrlen(tls, _z)) _0: - if (_n > i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))))&int32(u16(8192))) != 0 { + if (_n > i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n-i32(1))))))))))&int32(u16(8192))) != 0 { _n -= 1 goto _0 } return _n } -// Report on unrecognized arguments +// C comment +// /* Report on unrecognized arguments */ func _unrecognizedArguments(tls *crt.TLS, _argv0 *int8, _nArg int32, _azArg **int8) { var _i int32 crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(2221), unsafe.Pointer(_argv0)) @@ -969,7 +1022,7 @@ _0: if _i >= _nArg { goto _3 } - crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i))))) + crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(294), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i))))) _i += 1 goto _0 _3: @@ -977,16 +1030,19 @@ _3: crt.Xexit(tls, i32(1)) } -// Look up the next task for client iClient in the database. -// Return the task script and the task number and mark that -// task as being under way. +// C comment +// /* +// ** Look up the next task for client iClient in the database. +// ** Return the task script and the task number and mark that +// ** task as being under way. +// */ func _startScript(tls *crt.TLS, _iClient int32, _pzScript **int8, _pTaskId *int32, _pzTaskName **int8) (r0 int32) { var _taskId, _rc, _totalTime, _6_n int32 var _pStmt unsafe.Pointer _pStmt = nil _totalTime = i32(0) *_pzScript = nil - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(0) _0: _rc = _trySql(tls, str(2249)) if _rc == i32(5) { @@ -1001,17 +1057,17 @@ _0: if _rc != i32(0) { _fatalError(tls, str(2265), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.X3)))) } - if (_g.X13) != 0 || (_g.X14) != 0 { + if _g.X13 != 0 || _g.X14 != 0 { _runSql(tls, str(2284), _g.X13, _g.X14) - *(*int32)(unsafe.Pointer(&(_g.X13))) = i32(0) - *(*int32)(unsafe.Pointer(&(_g.X14))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X13)) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X14)) = i32(0) } _pStmt = _prepareSql(tls, str(2337), _iClient) _rc = bin.Xsqlite3_step(tls, _pStmt) bin.Xsqlite3_finalize(tls, _pStmt) if _rc == i32(100) { _runSql(tls, str(2383), _iClient) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(10000) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(10000) _runSql(tls, str(2414)) return i32(101) } @@ -1025,7 +1081,7 @@ _0: *_pzTaskName = bin.Xsqlite3_mprintf(tls, str(2526), unsafe.Pointer(bin.Xsqlite3_column_text(tls, _pStmt, i32(2)))) bin.Xsqlite3_finalize(tls, _pStmt) _runSql(tls, str(2529), _taskId) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(10000) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(10000) _runSql(tls, str(2414)) return i32(0) } @@ -1061,7 +1117,10 @@ _8: goto _0 } -// Prepare an SQL statement. Issue a fatal error if unable. +// C comment +// /* +// ** Prepare an SQL statement. Issue a fatal error if unable. +// */ func _prepareSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 unsafe.Pointer) { var _rc int32 var _zSql *int8 @@ -1076,11 +1135,14 @@ func _prepareSql(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 unsafe.P bin.Xsqlite3_finalize(tls, _pStmt) _fatalError(tls, str(2161), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_g.X3))), unsafe.Pointer(_zSql)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) return _pStmt } -// Run a script. +// C comment +// /* +// ** Run a script. +// */ func _runScript(tls *crt.TLS, _iClient int32, _taskId int32, _zScript *int8, _zFilename *int8) { var _lineno, _prevLine, _ii, _iBegin, _n, _c, _j, _len, _nArg, _8_rc, _12_jj, _15_jj, _15_isGlob, _20_k, _23_jj, _25_jj, _25_rc, _30_iNewClient, _32_iTimeout, _33_iTarget, _33_iEnd int32 var _4_zSql, _12_zAns, _15_zAns, _15_zCopy, _19_zNewFile, _19_zNewScript, _19_zToDel, _33_zTask, _33_zTName, _41_zSql *int8 @@ -1093,15 +1155,15 @@ func _runScript(tls *crt.TLS, _iClient int32, _taskId int32, _zScript *int8, _zF _prevLine = i32(1) _ii = i32(0) _iBegin = i32(0) - crt.Xmemset(tls, (unsafe.Pointer)(&_sResult), i32(0), u64(16)) + crt.Xmemset(tls, unsafe.Pointer(&_sResult), i32(0), u64(16)) _stringReset(tls, &_sResult) _0: - if store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii))))) == i32(0) { + if store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii))))) == i32(0) { goto _1 } _prevLine = _lineno _len = _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))), &_lineno) - if (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_c))))))&int32(u16(8192))) != 0 || ((_c == i32(47)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii+i32(1))))) == i32(42))) { + if (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_c))))))&int32(u16(8192))) != 0 || ((_c == i32(47)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii+i32(1))))) == i32(42))) { { p := &_ii *p = (*p) + _len @@ -1109,7 +1171,7 @@ _0: } goto _0 } - if ((_c != i32(45)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii+i32(1))))) != i32(45))) || ((int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii+i32(2))))))))) & int32(u16(1024))) == 0) { + if ((_c != i32(45)) || (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii+i32(1))))) != i32(45))) || ((int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii+i32(2))))))))) & int32(u16(1024))) == 0) { { p := &_ii *p = (*p) + _len @@ -1120,10 +1182,10 @@ _0: if _ii > _iBegin { _4_zSql = bin.Xsqlite3_mprintf(tls, str(2708), _ii-_iBegin, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_iBegin))))) _evalSql(tls, &_sResult, _4_zSql) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_4_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_4_zSql)) _iBegin = _ii + _len } - if (_g.X10) >= i32(2) { + if _g.X10 >= i32(2) { _logMessage(tls, str(2708), _len, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))))) } _n = _extractToken(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(i32(2)))), _len-i32(2), (*int8)(unsafe.Pointer(&_zCmd)), int32(u64(30))) @@ -1133,7 +1195,7 @@ _10: goto _14 } _15: - if (_n < (_len - i32(2))) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr((_ii+i32(2))+_n)))))))))&int32(u16(8192))) != 0 { + if (_n < (_len - i32(2))) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr((_ii+i32(2))+_n)))))))))&int32(u16(8192))) != 0 { _n += 1 goto _15 } @@ -1142,7 +1204,7 @@ _15: } { p := &_n - *p = (*p) + _extractToken(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(i32(2))))))+uintptr(_n))), (_len-i32(2))-_n, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(_nArg))))), int32(u64(100))) + *p = (*p) + _extractToken(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(i32(2))))))+uintptr(_n))), (_len-i32(2))-_n, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(_nArg))))), int32(u64(100))) sink1(*p) } _nArg += 1 @@ -1153,18 +1215,18 @@ _19: if _j >= i32(2) { goto _22 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(postInc1(&_j, int32(1))))))) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(postInc1(&_j, 1)))))) + 1*uintptr(i32(0)))) = int8(i32(0)) _j += 1 goto _19 _22: if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2713)) == i32(0) { - bin.Xsqlite3_sleep(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0)))))))) + bin.Xsqlite3_sleep(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0)))))))) goto _108 } if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2719)) != i32(0) { goto _25 } - _8_rc = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0))))))) + _8_rc = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0))))))) _finishScript(tls, _iClient, _taskId, i32(1)) if _8_rc == i32(0) { bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_g.X3)) @@ -1175,7 +1237,7 @@ _25: if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2724)) != i32(0) { goto _28 } - if (_g.X10) == i32(1) { + if _g.X10 == i32(1) { _logMessage(tls, str(2708), _len-i32(1), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii))))) } _stringReset(tls, &_sResult) @@ -1195,7 +1257,7 @@ _28: _12_zAns = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + uintptr(_ii))) _12_jj = i32(7) _37: - if _12_jj >= (_len-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_zAns)) + 1*uintptr(_12_jj)))))))))&int32(u16(8192))) == 0 { + if _12_jj >= (_len-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_zAns)) + 1*uintptr(_12_jj)))))))))&int32(u16(8192))) == 0 { goto _41 } _12_jj += 1 @@ -1203,13 +1265,13 @@ _37: _41: { p := &_12_zAns - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_12_jj))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_12_jj))) sink0(*p) } - if (((_len - _12_jj) - i32(1)) != (_sResult.X1)) || crt.Xstrncmp(tls, _sResult.X0, _12_zAns, uint64((_len-_12_jj)-i32(1))) != 0 { + if (((_len - _12_jj) - i32(1)) != _sResult.X1) || crt.Xstrncmp(tls, _sResult.X0, _12_zAns, uint64((_len-_12_jj)-i32(1))) != 0 { _errorMessage(tls, str(2752), _prevLine, unsafe.Pointer(_zFilename), (_len-_12_jj)-i32(1), unsafe.Pointer(_12_zAns), unsafe.Pointer(_sResult.X0)) } - *(*int32)(unsafe.Pointer(&(_g.X14))) += 1 + *(*int32)(unsafe.Pointer(&_g.X14)) += 1 _stringReset(tls, &_sResult) goto _108 _36: @@ -1217,10 +1279,10 @@ _36: goto _46 } _15_zAns = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + uintptr(_ii))) - _15_isGlob = bool2int(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zCmd)) + 1*uintptr(i32(0))))) == i32(103)) + _15_isGlob = bool2int(int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_zCmd)) + 1*uintptr(i32(0))))) == i32(103)) _15_jj = i32(9) - (i32(3) * _15_isGlob) _47: - if _15_jj >= (_len-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_zAns)) + 1*uintptr(_15_jj)))))))))&int32(u16(8192))) == 0 { + if _15_jj >= (_len-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_15_zAns)) + 1*uintptr(_15_jj)))))))))&int32(u16(8192))) == 0 { goto _51 } _15_jj += 1 @@ -1228,15 +1290,15 @@ _47: _51: { p := &_15_zAns - *p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_15_jj))) + *p = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_15_jj))) sink0(*p) } _15_zCopy = bin.Xsqlite3_mprintf(tls, str(2708), (_len-_15_jj)-i32(1), unsafe.Pointer(_15_zAns)) if (bool2int(bin.Xsqlite3_strglob(tls, _15_zCopy, _sResult.X0) == i32(0)) ^ _15_isGlob) != 0 { _errorMessage(tls, str(2810), _prevLine, unsafe.Pointer(_zFilename), unsafe.Pointer(_15_zCopy), unsafe.Pointer(_sResult.X0)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_15_zCopy)) - *(*int32)(unsafe.Pointer(&(_g.X14))) += 1 + bin.Xsqlite3_free(tls, unsafe.Pointer(_15_zCopy)) + *(*int32)(unsafe.Pointer(&_g.X14)) += 1 _stringReset(tls, &_sResult) goto _108 _46: @@ -1248,13 +1310,13 @@ _46: goto _56 } _19_zToDel = nil - _19_zNewFile = (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 100*uintptr(i32(0)))))) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_19_zNewFile)) + 1*uintptr(i32(0))))) == i32(47) { + _19_zNewFile = (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg)) + 100*uintptr(i32(0)))))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_19_zNewFile)) + 1*uintptr(i32(0))))) == i32(47) { goto _57 } _20_k = int32(crt.Xstrlen(tls, _zFilename)) - i32(1) _58: - if _20_k < i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(_20_k)))) == i32(47) { + if _20_k < i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename)) + 1*uintptr(_20_k)))) == i32(47) { goto _62 } _20_k -= 1 @@ -1265,15 +1327,15 @@ _62: } _57: _19_zNewScript = _readFile(tls, _19_zNewFile) - if (_g.X10) != 0 { + if _g.X10 != 0 { _logMessage(tls, str(2875), unsafe.Pointer(_19_zNewFile)) } _runScript(tls, i32(0), i32(0), _19_zNewScript, _19_zNewFile) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_19_zNewScript)) - if (_g.X10) != 0 { + bin.Xsqlite3_free(tls, unsafe.Pointer(_19_zNewScript)) + if _g.X10 != 0 { _logMessage(tls, str(2894), unsafe.Pointer(_19_zNewFile)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_19_zToDel)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_19_zToDel)) goto _108 _56: if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2911)) != i32(0) { @@ -1281,7 +1343,7 @@ _56: } _23_jj = i32(7) _68: - if _23_jj >= _len || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii+_23_jj)))))))))&int32(u16(8192))) == 0 { + if _23_jj >= _len || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii+_23_jj)))))))))&int32(u16(8192))) == 0 { goto _72 } _23_jj += 1 @@ -1295,7 +1357,7 @@ _67: } _25_jj = i32(4) _75: - if _25_jj >= _len || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zScript)) + 1*uintptr(_ii+_25_jj)))))))))&int32(u16(8192))) == 0 { + if _25_jj >= _len || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript)) + 1*uintptr(_ii+_25_jj)))))))))&int32(u16(8192))) == 0 { goto _79 } _25_jj += 1 @@ -1327,7 +1389,7 @@ _74: if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2943)) != i32(0) || _iClient != i32(0) { goto _88 } - _30_iNewClient = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0))))))) + _30_iNewClient = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0))))))) if _30_iNewClient > i32(0) { _startClient(tls, _30_iNewClient) } @@ -1336,18 +1398,18 @@ _88: if (crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2949)) == i32(0)) && (_iClient == i32(0)) { _32_iTimeout = func() int32 { if _nArg >= i32(2) { - return crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(1))))))) + return crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(1))))))) } return i32(10000) }() bin.Xsqlite3_snprintf(tls, int32(u64(1000)), (*int8)(unsafe.Pointer(&_zError)), str(2954), _prevLine, unsafe.Pointer(_zFilename)) - _waitForClient(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0))))))), _32_iTimeout, (*int8)(unsafe.Pointer(&_zError))) + _waitForClient(tls, crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0))))))), _32_iTimeout, (*int8)(unsafe.Pointer(&_zError))) goto _108 } if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(2969)) != i32(0) || _iClient != i32(0) { goto _97 } - _33_iTarget = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0))))))) + _33_iTarget = crt.Xatoi(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0))))))) _33_iEnd = _findEnd(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))), &_lineno) if _33_iTarget < i32(0) { _errorMessage(tls, str(2974), _prevLine, unsafe.Pointer(_zFilename), _33_iTarget) @@ -1355,15 +1417,15 @@ _88: } _33_zTask = bin.Xsqlite3_mprintf(tls, str(2708), _33_iEnd, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_ii)))))+uintptr(_len))))) if _nArg > i32(1) { - _33_zTName = bin.Xsqlite3_mprintf(tls, str(2526), unsafe.Pointer((*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(1)))))))) + _33_zTName = bin.Xsqlite3_mprintf(tls, str(2526), unsafe.Pointer((*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(1)))))))) goto _101 } _33_zTName = bin.Xsqlite3_mprintf(tls, str(3011), unsafe.Pointer(_filenameTail(tls, _zFilename)), _prevLine) _101: _startClient(tls, _33_iTarget) _runSql(tls, str(3017), _33_iTarget, unsafe.Pointer(_33_zTask), unsafe.Pointer(_33_zTName)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_33_zTask)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_33_zTName)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_33_zTask)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_33_zTName)) _99: { p := &_33_iEnd @@ -1383,9 +1445,9 @@ _97: goto _108 } if crt.Xstrcmp(tls, (*int8)(unsafe.Pointer(&_zCmd)), str(3084)) == i32(0) { - *(*int32)(unsafe.Pointer(&(_g.X12))) = func() int32 { + *(*int32)(unsafe.Pointer(&_g.X12)) = func() int32 { if _nArg >= i32(1) { - return bool2int(_booleanValue(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg))+100*uintptr(i32(0))))))) == 0) + return bool2int(_booleanValue(tls, (*int8)(unsafe.Pointer((*[100]int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_azArg))+100*uintptr(i32(0))))))) == 0) } return i32(1) }() @@ -1403,7 +1465,7 @@ _1: if _iBegin < _ii { _41_zSql = bin.Xsqlite3_mprintf(tls, str(2708), _ii-_iBegin, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zScript))+uintptr(_iBegin))))) _runSql(tls, _41_zSql) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_41_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_41_zSql)) } _stringFree(tls, &_sResult) _ = _sResult @@ -1412,43 +1474,47 @@ _1: _ = _azArg } -// Reset a string to an empty string +// C comment +// /* Reset a string to an empty string */ func _stringReset(tls *crt.TLS, _p *XString) { - if (_p.X0) == nil { + if _p.X0 == nil { _stringAppend(tls, _p, str(2192), i32(1)) } - *(*int32)(unsafe.Pointer(&(_p.X1))) = i32(0) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int32)(unsafe.Pointer(&_p.X1)) = i32(0) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_p.X0)) + 1*uintptr(i32(0)))) = int8(i32(0)) } -// Return the length of the next token. +// C comment +// /* +// ** Return the length of the next token. +// */ func _tokenLength(tls *crt.TLS, _z *int8, _pnLine *int32) (r0 int32) { var _n, _1_inC, _1_c, _10_delim, _13_c int32 _n = i32(0) - if (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))))))))&int32(u16(8192))) == 0 && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(42)) { + if (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))))))))&int32(u16(8192))) == 0 && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(42)) { goto _2 } _1_inC = i32(0) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) == i32(47) { _1_inC = i32(1) _n = i32(2) } _3: - if store1(&_1_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_n, int32(1))))))) == i32(0) { + if store1(&_1_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(postInc1(&_n, 1)))))) == i32(0) { goto _5 } if _1_c == i32(10) { *_pnLine += 1 } - if (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_1_c)))))) & int32(u16(8192))) != 0 { + if (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_1_c)))))) & int32(u16(8192))) != 0 { goto _3 } - if (_1_inC != 0 && (_1_c == i32(42))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(47)) { + if (_1_inC != 0 && (_1_c == i32(42))) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == i32(47)) { _n += 1 _1_inC = i32(0) goto _16 } - if ((_1_inC == 0) && (_1_c == i32(47))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(42)) { + if ((_1_inC == 0) && (_1_c == i32(47))) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == i32(42)) { _n += 1 _1_inC = i32(1) goto _16 @@ -1462,40 +1528,40 @@ _5: _n -= 1 goto _36 _2: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(45) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(45) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(1))))) != i32(45) { goto _19 } _n = i32(2) _20: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(10) { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == i32(10) { goto _24 } _n += 1 goto _20 _24: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) != 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) != 0 { *_pnLine += 1 _n += 1 } goto _36 _19: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(34) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(39) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(34) && int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) != i32(39) { goto _28 } - _10_delim = int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) + _10_delim = int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(i32(0))))) _n = i32(1) _29: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == 0 { goto _32 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(10) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == i32(10) { *_pnLine += 1 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) != _10_delim { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) != _10_delim { goto _34 } _n += 1 - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n+i32(1))))) != _10_delim { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n+i32(1))))) != _10_delim { goto _32 } _34: @@ -1506,7 +1572,7 @@ _32: _28: _n = i32(1) _37: - if store1(&_13_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n))))) == i32(0) || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_13_c))))))&int32(u16(8192))) != 0 || _13_c == i32(34) || _13_c == i32(39) || _13_c == i32(59) { + if store1(&_13_c, int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n))))) == i32(0) || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(_13_c))))))&int32(u16(8192))) != 0 || _13_c == i32(34) || _13_c == i32(39) || _13_c == i32(59) { goto _44 } _n += 1 @@ -1516,8 +1582,11 @@ _36: return _n } -// Run arbitrary SQL and record the results in an output string -// given by the first parameter. +// C comment +// /* +// ** Run arbitrary SQL and record the results in an output string +// ** given by the first parameter. +// */ func _evalSql(tls *crt.TLS, _p *XString, _zFormat *int8, args ...interface{}) (r0 int32) { var _rc int32 var _zSql, _zErrMsg *int8 @@ -1528,13 +1597,13 @@ func _evalSql(tls *crt.TLS, _p *XString, _zFormat *int8, args ...interface{}) (r _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil func() { - if (_g.X15) <= i32(0) { + if _g.X15 <= i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(1897), unsafe.Pointer(str(1933)), i32(494), unsafe.Pointer((*int8)(unsafe.Pointer(&_evalSqlØ00__func__Ø000))), unsafe.Pointer(str(3136))) crt.X__builtin_abort(tls) } }() - _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.X3), _zSql, _evalCallback, (unsafe.Pointer)(_p), &_zErrMsg) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_g.X3), _zSql, _evalCallback, unsafe.Pointer(_p), &_zErrMsg) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) if _rc == 0 { goto _2 } @@ -1542,7 +1611,7 @@ func _evalSql(tls *crt.TLS, _p *XString, _zFormat *int8, args ...interface{}) (r _stringAppendTerm(tls, _p, (*int8)(unsafe.Pointer(&_1_zErr))) if _zErrMsg != nil { _stringAppendTerm(tls, _p, _zErrMsg) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zErrMsg)) } _2: return _rc @@ -1557,28 +1626,34 @@ func init() { crt.Xstrncpy(nil, &_evalSqlØ00__func__Ø000[0], str(3159), 8) } -// Copy a single token into a string buffer. +// C comment +// /* +// ** Copy a single token into a string buffer. +// */ func _extractToken(tls *crt.TLS, _zIn *int8, _nIn int32, _zOut *int8, _nOut int32) (r0 int32) { var _i int32 if _nIn <= i32(0) { - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(i32(0)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(i32(0)))) = int8(i32(0)) return i32(0) } _i = i32(0) _1: - if _i >= _nIn || _i >= (_nOut-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_i)))))))))&int32(u16(8192))) != 0 { + if _i >= _nIn || _i >= (_nOut-i32(1)) || (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(_i)))))))))&int32(u16(8192))) != 0 { goto _6 } - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_i))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_i))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_i))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + 1*uintptr(_i))) _i += 1 goto _1 _6: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_i))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_i))) = int8(i32(0)) return _i } -// Mark a script as having finished. Remove the CLIENT table entry -// if bShutdown is true. +// C comment +// /* +// ** Mark a script as having finished. Remove the CLIENT table entry +// ** if bShutdown is true. +// */ func _finishScript(tls *crt.TLS, _iClient int32, _taskId int32, _bShutdown int32) (r0 int32) { _runSql(tls, str(3167), _taskId) if _bShutdown != 0 { @@ -1587,7 +1662,10 @@ func _finishScript(tls *crt.TLS, _iClient int32, _taskId int32, _bShutdown int32 return i32(0) } -// Read the entire content of a file into memory +// C comment +// /* +// ** Read the entire content of a file into memory +// */ func _readFile(tls *crt.TLS, _zFilename *int8) (r0 *int8) { var _sz int64 var _z *int8 @@ -1600,27 +1678,30 @@ func _readFile(tls *crt.TLS, _zFilename *int8) (r0 *int8) { _sz = crt.Xftell(tls, _in) crt.Xrewind(tls, _in) _z = (*int8)(bin.Xsqlite3_malloc(tls, int32(_sz+int64(i32(1))))) - _sz = int64(crt.Xfread(tls, (unsafe.Pointer)(_z), uint64(i32(1)), uint64(_sz), _in)) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_sz))) = int8(i32(0)) + _sz = int64(crt.Xfread(tls, unsafe.Pointer(_z), uint64(i32(1)), uint64(_sz), _in)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_sz))) = int8(i32(0)) crt.Xfclose(tls, _in) return _z } -// Find the number of characters up to the first character past the -// of the next "--endif" or "--else" token. Nested --if commands are -// also skipped. +// C comment +// /* +// ** Find the number of characters up to the first character past the +// ** of the next "--endif" or "--else" token. Nested --if commands are +// ** also skipped. +// */ func _findEndif(tls *crt.TLS, _z *int8, _stopAtElse int32, _pnLine *int32) (r0 int32) { var _n, _1_len, _3_skip int32 _n = i32(0) _0: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) == 0 { goto _1 } _1_len = _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), _pnLine) - if ((crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3280), uint64(i32(7))) == i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n+i32(7))))))))))&int32(u16(8192))) != 0) || ((_stopAtElse != 0 && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3288), uint64(i32(6))) == i32(0))) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n+i32(6))))))))))&int32(u16(8192))) != 0) { + if ((crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3280), uint64(i32(7))) == i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n+i32(7))))))))))&int32(u16(8192))) != 0) || ((_stopAtElse != 0 && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3288), uint64(i32(6))) == i32(0))) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n+i32(6))))))))))&int32(u16(8192))) != 0) { return _n + _1_len } - if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3295), uint64(i32(4))) == i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n+i32(4))))))))))&int32(u16(8192))) != 0 { + if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3295), uint64(i32(4))) == i32(0)) && (int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n+i32(4))))))))))&int32(u16(8192))) != 0 { _3_skip = _findEndif(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n)))))+uintptr(_1_len))), i32(0), _pnLine) { p := &_n @@ -1640,9 +1721,12 @@ _1: return _n } -// Start up a client process for iClient, if it is not already -// running. If the client is already running, then this routine -// is a no-op. +// C comment +// /* +// ** Start up a client process for iClient, if it is not already +// ** running. If the client is already running, then this routine +// ** is a no-op. +// */ func _startClient(tls *crt.TLS, _iClient int32) { var _1_rc int32 var _1_zSys *int8 @@ -1651,16 +1735,16 @@ func _startClient(tls *crt.TLS, _iClient int32) { goto _0 } _1_zSys = bin.Xsqlite3_mprintf(tls, str(3342), unsafe.Pointer(_g.X0), unsafe.Pointer(_g.X2), _iClient, _g.X10) - if (_g.X11) != 0 { + if _g.X11 != 0 { _1_zSys = bin.Xsqlite3_mprintf(tls, str(3373), unsafe.Pointer(_1_zSys)) } - if (_g.X16) != 0 { + if _g.X16 != 0 { _1_zSys = bin.Xsqlite3_mprintf(tls, str(3387), unsafe.Pointer(_1_zSys)) } - if (_g.X1) != nil { + if _g.X1 != nil { _1_zSys = bin.Xsqlite3_mprintf(tls, str(3397), unsafe.Pointer(_1_zSys), unsafe.Pointer(_g.X1)) } - if (_g.X10) >= i32(2) { + if _g.X10 >= i32(2) { _logMessage(tls, str(3411), unsafe.Pointer(_1_zSys)) } _1_zSys = bin.Xsqlite3_mprintf(tls, str(3424), unsafe.Pointer(_1_zSys)) @@ -1668,11 +1752,14 @@ func _startClient(tls *crt.TLS, _iClient int32) { if _1_rc != 0 { _errorMessage(tls, str(3429), _1_rc) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_zSys)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_zSys)) _0: } -// Wait for a client process to complete all its tasks +// C comment +// /* +// ** Wait for a client process to complete all its tasks +// */ func _waitForClient(tls *crt.TLS, _iClient int32, _iTimeout int32, _zErrPrefix *int8) { var _rc int32 var _pStmt unsafe.Pointer @@ -1682,7 +1769,7 @@ func _waitForClient(tls *crt.TLS, _iClient int32, _iTimeout int32, _zErrPrefix * } _pStmt = _prepareSql(tls, str(3559)) _1: - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(0) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(0) _2: if ((store1(&_rc, bin.Xsqlite3_step(tls, _pStmt)) == i32(5)) || (_rc == i32(100))) && (_iTimeout > i32(0)) { bin.Xsqlite3_reset(tls, _pStmt) @@ -1695,7 +1782,7 @@ _2: goto _2 } bin.Xsqlite3_finalize(tls, _pStmt) - *(*int32)(unsafe.Pointer(&(_g.X15))) = i32(10000) + *(*int32)(unsafe.Pointer(&_g.X15)) = i32(10000) if _rc == i32(101) { goto _6 } @@ -1711,12 +1798,15 @@ _9: _6: } -// Find the number of characters up to the start of the next "--end" token. +// C comment +// /* +// ** Find the number of characters up to the start of the next "--end" token. +// */ func _findEnd(tls *crt.TLS, _z *int8, _pnLine *int32) (r0 int32) { var _n int32 _n = i32(0) _0: - if ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) != 0) && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3706), uint64(i32(5))) != 0 || ((int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n+i32(5)))))))))) & int32(u16(8192))) == 0)) { + if ((*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n)))) != 0) && (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), str(3706), uint64(i32(5))) != 0 || ((int32(*(*uint16)(unsafe.Pointer(uintptr(unsafe.Pointer(*crt.X__ctype_b_loc(tls))) + 2*uintptr(int32(uint8(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_n+i32(5)))))))))) & int32(u16(8192))) == 0)) { { p := &_n *p = (*p) + _tokenLength(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(_n))), _pnLine) @@ -1727,15 +1817,17 @@ _0: return _n } -// Return a pointer to the tail of a filename +// C comment +// /* Return a pointer to the tail of a filename +// */ func _filenameTail(tls *crt.TLS, _z *int8) (r0 *int8) { var _i, _j int32 _i = store1(&_j, i32(0)) _0: - if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == 0 { + if (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == 0 { goto _3 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(47) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + 1*uintptr(_i)))) == i32(47) { _j = _i + i32(1) } _i += 1 @@ -1744,15 +1836,20 @@ _3: return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(_j))) } -// This routine exists as a convenient place to set a debugger -// breakpoint. +// C comment +// /* This routine exists as a convenient place to set a debugger +// ** breakpoint. +// */ func _test_breakpoint(tls *crt.TLS) { _test_breakpointØ00cntØ001 += 1 } var _test_breakpointØ00cntØ001 int32 -// Interpret zArg as a boolean value. Return either 0 or 1. +// C comment +// /* +// ** Interpret zArg as a boolean value. Return either 0 or 1. +// */ func _booleanValue(tls *crt.TLS, _zArg *int8) (r0 int32) { var _i int32 if _zArg == nil { @@ -1760,13 +1857,13 @@ func _booleanValue(tls *crt.TLS, _zArg *int8) (r0 int32) { } _i = i32(0) _1: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zArg)) + 1*uintptr(_i)))) < i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zArg)) + 1*uintptr(_i)))) > i32(57) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zArg)) + 1*uintptr(_i)))) < i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zArg)) + 1*uintptr(_i)))) > i32(57) { goto _5 } _i += 1 goto _1 _5: - if (_i > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zArg)) + 1*uintptr(_i)))) == i32(0)) { + if (_i > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zArg)) + 1*uintptr(_i)))) == i32(0)) { return crt.Xatoi(tls, _zArg) } if (bin.Xsqlite3_stricmp(tls, _zArg, str(3712)) == i32(0)) || (bin.Xsqlite3_stricmp(tls, _zArg, str(3715)) == i32(0)) { diff --git a/internal/threadtest1/threadtest1_linux_amd64.go b/internal/threadtest1/threadtest1_linux_amd64.go index abd6721..5295cec 100644 --- a/internal/threadtest1/threadtest1_linux_amd64.go +++ b/internal/threadtest1/threadtest1_linux_amd64.go @@ -1,29 +1,29 @@ // Code generated by ccgo. DO NOT EDIT. -// threadtest1.c - -// 2002 January 15 -// -// 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 a simple standalone program used to test whether -// or not the SQLite library is threadsafe. -// -// Testing the thread safety of SQLite is difficult because there are very -// few places in the code that are even potentially unsafe, and those -// places execute for very short periods of time. So even if the library -// is compiled with its mutexes disabled, it is likely to work correctly -// in a multi-threaded program most of the time. -// -// This file is NOT part of the standard SQLite library. It is used for -// testing only. - +// threadtest1 +// /* +// ** 2002 January 15 +// ** +// ** 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 a simple standalone program used to test whether +// ** or not the SQLite library is threadsafe. +// ** +// ** Testing the thread safety of SQLite is difficult because there are very +// ** few places in the code that are even potentially unsafe, and those +// ** places execute for very short periods of time. So even if the library +// ** is compiled with its mutexes disabled, it is likely to work correctly +// ** in a multi-threaded program most of the time. +// ** +// ** This file is NOT part of the standard SQLite library. It is used for +// ** testing only. +// */ package main import ( @@ -61,13 +61,13 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { @@ -76,13 +76,13 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { var _zFile, _4_zDb, _4_zJournal *int8 var _2_zBuf, _6_zBuf [200]int8 r0 = i32(0) - if (_argc > i32(2)) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))), str(0)) == i32(0)) { + if (_argc > i32(2)) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))), str(0)) == i32(0)) { _verbose = i32(1) bug20530(_verbose) _argc -= 1 *(*uintptr)(unsafe.Pointer(&_argv)) += uintptr(8) } - if (_argc < i32(2)) || (store0(&_n, crt.Xatoi(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))))) < i32(1)) { + if (_argc < i32(2)) || (store0(&_n, crt.Xatoi(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))))) < i32(1)) { _n = i32(10) } _i = i32(0) @@ -102,13 +102,13 @@ _8: } _zFile = bin.Xsqlite3_mprintf(tls, str(13), (_i%i32(2))+i32(1), (_i+i32(2))/i32(2)) if (_i % i32(2)) == i32(0) { - _4_zDb = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(i32(2)))) + _4_zDb = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile)) + 1*uintptr(i32(2)))) _4_zJournal = bin.Xsqlite3_mprintf(tls, str(26), unsafe.Pointer(_4_zDb)) crt.Xunlink(tls, _4_zDb) crt.Xunlink(tls, _4_zJournal) - crt.Xfree(tls, (unsafe.Pointer)(_4_zJournal)) + crt.Xfree(tls, unsafe.Pointer(_4_zJournal)) } - crt.Xpthread_create(tls, &_id, nil, _worker_bee, (unsafe.Pointer)(_zFile)) + crt.Xpthread_create(tls, &_id, nil, _worker_bee, unsafe.Pointer(_zFile)) crt.Xpthread_detach(tls, _id) _i += 1 goto _8 @@ -157,12 +157,12 @@ _0: if _cnt >= i32(10) { goto _3 } - bin.Xsqlite3_open(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename))+1*uintptr(i32(2)))), (**bin.Xsqlite3)(unsafe.Pointer(&_db))) + bin.Xsqlite3_open(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFilename))+1*uintptr(i32(2)))), (**bin.Xsqlite3)(unsafe.Pointer(&_db))) if _db == nil { crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(48), unsafe.Pointer(_zFilename)) _Exit(tls, i32(1)) } - bin.Xsqlite3_busy_handler(tls, (*bin.Xsqlite3)(_db), _db_is_locked, (unsafe.Pointer)(_zFilename)) + bin.Xsqlite3_busy_handler(tls, (*bin.Xsqlite3)(_db), _db_is_locked, unsafe.Pointer(_zFilename)) Xdb_execute(tls, _db, _zFilename, str(64), _t) _i = i32(1) _5: @@ -217,12 +217,18 @@ var Xlock crt.Xpthread_mutex_t var Xthread_cnt int32 -// Come here to die. +// C comment +// /* +// ** Come here to die. +// */ func _Exit(tls *crt.TLS, _rc int32) { crt.Xexit(tls, _rc) } -// When a lock occurs, yield. +// C comment +// /* +// ** When a lock occurs, yield. +// */ func _db_is_locked(tls *crt.TLS, _NotUsed unsafe.Pointer, _iCount int32) (r0 int32) { if _verbose != 0 { crt.Xprintf(tls, str(305), unsafe.Pointer((*int8)(_NotUsed)), _iCount) @@ -231,7 +237,10 @@ func _db_is_locked(tls *crt.TLS, _NotUsed unsafe.Pointer, _iCount int32) (r0 int return bool2int(_iCount < i32(40000)) } -// Execute an SQL statement. +// C comment +// /* +// ** Execute an SQL statement. +// */ func Xdb_execute(tls *crt.TLS, _db unsafe.Pointer, _zFile *int8, _zFormat *int8, args ...interface{}) { var _rc int32 var _zSql, _zErrMsg *int8 @@ -253,15 +262,18 @@ _0: } if _zErrMsg != nil { crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(344), unsafe.Pointer(_zFile), unsafe.Pointer(_zSql), unsafe.Pointer(_zErrMsg)) - crt.Xfree(tls, (unsafe.Pointer)(_zErrMsg)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + crt.Xfree(tls, unsafe.Pointer(_zErrMsg)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) _Exit(tls, i32(1)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) } -// Execute a query against the database. NULL values are returned -// as an empty string. The list is terminated by a single NULL pointer. +// C comment +// /* +// ** Execute a query against the database. NULL values are returned +// ** as an empty string. The list is terminated by a single NULL pointer. +// */ func Xdb_query(tls *crt.TLS, _db unsafe.Pointer, _zFile *int8, _zFormat *int8, args ...interface{}) (r0 **int8) { var _rc int32 var _zSql, _zErrMsg *int8 @@ -271,56 +283,59 @@ func Xdb_query(tls *crt.TLS, _db unsafe.Pointer, _zFile *int8, _zFormat *int8, a _ap = args _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - crt.Xmemset(tls, (unsafe.Pointer)(&_sResult), i32(0), u64(24)) - *(**int8)(unsafe.Pointer(&(_sResult.X0))) = _zFile + crt.Xmemset(tls, unsafe.Pointer(&_sResult), i32(0), u64(24)) + *(**int8)(unsafe.Pointer(&_sResult.X0)) = _zFile if _verbose != 0 { crt.Xprintf(tls, str(373), unsafe.Pointer(_zFile), unsafe.Pointer(_zSql)) } - _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _db_query_callback, (unsafe.Pointer)(&_sResult), &_zErrMsg) + _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _db_query_callback, unsafe.Pointer(&_sResult), &_zErrMsg) if _rc != i32(17) { goto _1 } if _zErrMsg != nil { - crt.Xfree(tls, (unsafe.Pointer)(_zErrMsg)) + crt.Xfree(tls, unsafe.Pointer(_zErrMsg)) } - _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _db_query_callback, (unsafe.Pointer)(&_sResult), &_zErrMsg) + _rc = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_db), _zSql, _db_query_callback, unsafe.Pointer(&_sResult), &_zErrMsg) _1: if _verbose != 0 { crt.Xprintf(tls, str(387), unsafe.Pointer(_zFile), unsafe.Pointer(_zSql)) } if _zErrMsg != nil { crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(399), unsafe.Pointer(_zFile), unsafe.Pointer(_zSql), unsafe.Pointer(_zErrMsg)) - crt.Xfree(tls, (unsafe.Pointer)(_zErrMsg)) - crt.Xfree(tls, (unsafe.Pointer)(_zSql)) + crt.Xfree(tls, unsafe.Pointer(_zErrMsg)) + crt.Xfree(tls, unsafe.Pointer(_zSql)) _Exit(tls, i32(1)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) - if (_sResult.X3) == nil { - _db_query_callback(tls, (unsafe.Pointer)(&_sResult), i32(0), nil, nil) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) + if _sResult.X3 == nil { + _db_query_callback(tls, unsafe.Pointer(&_sResult), i32(0), nil, nil) } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_sResult.X3)) + 8*uintptr(_sResult.X1))) = nil + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_sResult.X3)) + 8*uintptr(_sResult.X1))) = nil return _sResult.X3 _ = _sResult panic(0) } -// The callback function for db_query +// C comment +// /* +// ** The callback function for db_query +// */ func _db_query_callback(tls *crt.TLS, _pUser unsafe.Pointer, _nArg int32, _azArg **int8, _NotUsed **int8) (r0 int32) { var _i int32 var _pResult *TQueryResult _pResult = (*TQueryResult)(_pUser) - if ((_pResult.X1) + _nArg) < (_pResult.X2) { + if (_pResult.X1 + _nArg) < _pResult.X2 { goto _0 } - if (_pResult.X2) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pResult.X2))) = _nArg + i32(1) + if _pResult.X2 == i32(0) { + *(*int32)(unsafe.Pointer(&_pResult.X2)) = _nArg + i32(1) goto _2 } - *(*int32)(unsafe.Pointer(&(_pResult.X2))) = (((_pResult.X2) * i32(2)) + _nArg) + i32(1) + *(*int32)(unsafe.Pointer(&_pResult.X2)) = ((_pResult.X2 * i32(2)) + _nArg) + i32(1) _2: - *(***int8)(unsafe.Pointer(&(_pResult.X3))) = (**int8)(crt.Xrealloc(tls, (unsafe.Pointer)(_pResult.X3), uint64(_pResult.X2)*u64(8))) - if (_pResult.X3) == nil { + *(***int8)(unsafe.Pointer(&_pResult.X3)) = (**int8)(crt.Xrealloc(tls, unsafe.Pointer(_pResult.X3), uint64(_pResult.X2)*u64(8))) + if _pResult.X3 == nil { crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(426), unsafe.Pointer(_pResult.X0)) return i32(1) } @@ -333,9 +348,9 @@ _5: if _i >= _nArg { goto _8 } - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pResult.X3)) + 8*uintptr(postInc0((*int32)(unsafe.Pointer(&(_pResult.X1))), int32(1))))) = bin.Xsqlite3_mprintf(tls, str(445), unsafe.Pointer(func() *int8 { - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i)))) != nil { - return (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azArg)) + 8*uintptr(_i)))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pResult.X3)) + 8*uintptr(postInc0((*int32)(unsafe.Pointer(&_pResult.X1)), 1)))) = bin.Xsqlite3_mprintf(tls, str(445), unsafe.Pointer(func() *int8 { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i)))) != nil { + return (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_azArg)) + 8*uintptr(_i)))) } return str(448) }())) @@ -345,7 +360,10 @@ _8: return i32(0) } -// Check results +// C comment +// /* +// ** Check results +// */ func Xdb_check(tls *crt.TLS, _zFile *int8, _zMsg *int8, _az **int8, args ...interface{}) { var _i int32 var _z *int8 @@ -356,8 +374,8 @@ _0: if store1(&_z, (*int8)(crt.VAPointer(&_ap))) == nil { goto _3 } - if ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_az)) + 8*uintptr(_i)))) == nil) || (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_az)) + 8*uintptr(_i))), _z) != i32(0)) { - crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(449), unsafe.Pointer(_zFile), unsafe.Pointer(_zMsg), _i+i32(1), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_az)) + 8*uintptr(_i))))) + if ((*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_az)) + 8*uintptr(_i)))) == nil) || (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_az)) + 8*uintptr(_i))), _z) != i32(0)) { + crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(449), unsafe.Pointer(_zFile), unsafe.Pointer(_zMsg), _i+i32(1), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_az)) + 8*uintptr(_i))))) Xdb_query_free(tls, _az) _Exit(tls, i32(1)) } @@ -368,19 +386,22 @@ _3: Xdb_query_free(tls, _az) } -// Free the results of a db_query() call. +// C comment +// /* +// ** Free the results of a db_query() call. +// */ func Xdb_query_free(tls *crt.TLS, _az **int8) { var _i int32 _i = i32(0) _0: - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_az)) + 8*uintptr(_i)))) == nil { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_az)) + 8*uintptr(_i)))) == nil { goto _3 } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_az)) + 8*uintptr(_i))))) + bin.Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_az)) + 8*uintptr(_i))))) _i += 1 goto _0 _3: - crt.Xfree(tls, (unsafe.Pointer)(_az)) + crt.Xfree(tls, unsafe.Pointer(_az)) } var Xsig crt.Xpthread_cond_t diff --git a/internal/threadtest2/threadtest2_linux_amd64.go b/internal/threadtest2/threadtest2_linux_amd64.go index bc866c3..ba255f4 100644 --- a/internal/threadtest2/threadtest2_linux_amd64.go +++ b/internal/threadtest2/threadtest2_linux_amd64.go @@ -1,23 +1,23 @@ // Code generated by ccgo. DO NOT EDIT. -// threadtest2.c - -// 2004 January 13 -// -// 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 a simple standalone program used to test whether -// or not the SQLite library is threadsafe. -// -// This file is NOT part of the standard SQLite library. It is used for -// testing only. - +// threadtest2 +// /* +// ** 2004 January 13 +// ** +// ** 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 a simple standalone program used to test whether +// ** or not the SQLite library is threadsafe. +// ** +// ** This file is NOT part of the standard SQLite library. It is used for +// ** testing only. +// */ package main import ( @@ -55,16 +55,19 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } -// Initialize the database and start the threads +// C comment +// /* +// ** Initialize the database and start the threads +// */ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { var _i, _rc int32 var _1_zJournal *int8 @@ -75,7 +78,7 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { _1_zJournal = bin.Xsqlite3_mprintf(tls, str(17), unsafe.Pointer(str(0))) crt.Xunlink(tls, str(0)) crt.Xunlink(tls, _1_zJournal) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_zJournal)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_zJournal)) } bin.Xsqlite3_open(tls, str(0), (**bin.Xsqlite3)(unsafe.Pointer(&_db))) if _db == nil { @@ -93,7 +96,7 @@ _3: if uint64(_i) >= u64(5) { goto _6 } - crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aThread))+8*uintptr(_i))), nil, Xworker, crt.U2P(uintptr(_i))) + crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aThread))+8*uintptr(_i))), nil, Xworker, crt.U2P(uintptr(_i))) _i += 1 goto _3 _6: @@ -102,7 +105,7 @@ _7: if uint64(_i) >= u64(5) { goto _10 } - crt.Xpthread_join(tls, *(*uint64)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aThread)) + 8*uintptr(_i))), nil) + crt.Xpthread_join(tls, *(*uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aThread)) + 8*uintptr(_i))), nil) _i += 1 goto _7 _10: @@ -117,7 +120,10 @@ _10: panic(0) } -// This is the worker thread +// C comment +// /* +// ** This is the worker thread +// */ func Xworker(tls *crt.TLS, _workerArg unsafe.Pointer) (r0 unsafe.Pointer) { var _id, _rc, _cnt int32 var _db unsafe.Pointer @@ -125,7 +131,7 @@ func Xworker(tls *crt.TLS, _workerArg unsafe.Pointer) (r0 unsafe.Pointer) { _cnt = i32(0) crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(147), _id) _0: - if Xall_stop != 0 || postInc0(&_cnt, int32(1)) >= i32(10000) { + if Xall_stop != 0 || postInc0(&_cnt, 1) >= i32(10000) { goto _1 } if (_cnt % i32(100)) == i32(0) { diff --git a/internal/threadtest3/threadtest3_linux_amd64.go b/internal/threadtest3/threadtest3_linux_amd64.go index c1569f5..d4b6296 100644 --- a/internal/threadtest3/threadtest3_linux_amd64.go +++ b/internal/threadtest3/threadtest3_linux_amd64.go @@ -1,41 +1,43 @@ // Code generated by ccgo. DO NOT EDIT. -// threadtest3.c - -// 2010-07-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. -// -// ************************************************************************* -// -// The code in this file runs a few multi-threaded test cases using the -// SQLite library. It can be compiled to an executable on unix using the -// following command: -// -// gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm -// -// Even though threadtest3.c is the only C source code file mentioned on -// the compiler command-line, #include macros are used to pull in additional -// C code files named "tt3_*.c". -// -// After compiling, run this program with an optional argument telling -// which test to run. All tests are run if no argument is given. The -// argument can be a glob pattern to match multiple tests. Examples: -// -// ./a.out -- Run all tests -// ./a.out walthread3 -- Run the "walthread3" test -// ./a.out 'wal*' -- Run all of the wal* tests -// ./a.out --help -- List all available tests -// -// The exit status is non-zero if any test fails. - -// The "Set Error Line" macro. - +// threadtest3 +// /* +// ** 2010-07-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. +// ** +// ************************************************************************* +// ** +// ** The code in this file runs a few multi-threaded test cases using the +// ** SQLite library. It can be compiled to an executable on unix using the +// ** following command: +// ** +// ** gcc -O2 threadtest3.c sqlite3.c -ldl -lpthread -lm +// ** +// ** Even though threadtest3.c is the only C source code file mentioned on +// ** the compiler command-line, #include macros are used to pull in additional +// ** C code files named "tt3_*.c". +// ** +// ** After compiling, run this program with an optional argument telling +// ** which test to run. All tests are run if no argument is given. The +// ** argument can be a glob pattern to match multiple tests. Examples: +// ** +// ** ./a.out -- Run all tests +// ** ./a.out walthread3 -- Run the "walthread3" test +// ** ./a.out 'wal*' -- Run all of the wal* tests +// ** ./a.out --help -- List all available tests +// ** +// ** The exit status is non-zero if any test fails. +// */ + +// /* +// ** The "Set Error Line" macro. +// */ package main import ( @@ -73,13 +75,13 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { @@ -88,48 +90,48 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { var _aTest [14]TThreadTest r0 = i32(0) _aTest = [14]TThreadTest{} - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(0)))).X0))) = _walthread1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(0)))).X1))) = str(0) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(0)))).X2))) = i32(20000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(1)))).X0))) = _walthread2 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(1)))).X1))) = str(11) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(1)))).X2))) = i32(20000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(2)))).X0))) = _walthread3 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(2)))).X1))) = str(22) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(2)))).X2))) = i32(20000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(3)))).X0))) = _walthread4 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(3)))).X1))) = str(33) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(3)))).X2))) = i32(20000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(4)))).X0))) = _walthread5 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(4)))).X1))) = str(44) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(4)))).X2))) = i32(1000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(5)))).X0))) = _cgt_pager_1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(5)))).X1))) = str(55) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(5)))).X2))) = i32(0) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(6)))).X0))) = _dynamic_triggers - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(6)))).X1))) = str(67) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(6)))).X2))) = i32(20000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(7)))).X0))) = _checkpoint_starvation_1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(7)))).X1))) = str(84) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(7)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(8)))).X0))) = _checkpoint_starvation_2 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(8)))).X1))) = str(108) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(8)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(9)))).X0))) = _create_drop_index_1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(9)))).X1))) = str(132) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(9)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(10)))).X0))) = _lookaside1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(10)))).X1))) = str(152) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(10)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(11)))).X0))) = _vacuum1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(11)))).X1))) = str(163) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(11)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(12)))).X0))) = _stress1 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(12)))).X1))) = str(171) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(12)))).X2))) = i32(10000) - *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(13)))).X0))) = _stress2 - *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(13)))).X1))) = str(179) - *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(i32(13)))).X2))) = i32(60000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(0)))).X0))) = _walthread1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(0)))).X1))) = str(0) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(0)))).X2))) = i32(20000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(1)))).X0))) = _walthread2 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(1)))).X1))) = str(11) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(1)))).X2))) = i32(20000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(2)))).X0))) = _walthread3 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(2)))).X1))) = str(22) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(2)))).X2))) = i32(20000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(3)))).X0))) = _walthread4 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(3)))).X1))) = str(33) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(3)))).X2))) = i32(20000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(4)))).X0))) = _walthread5 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(4)))).X1))) = str(44) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(4)))).X2))) = i32(1000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(5)))).X0))) = _cgt_pager_1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(5)))).X1))) = str(55) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(5)))).X2))) = i32(0) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(6)))).X0))) = _dynamic_triggers + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(6)))).X1))) = str(67) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(6)))).X2))) = i32(20000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(7)))).X0))) = _checkpoint_starvation_1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(7)))).X1))) = str(84) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(7)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(8)))).X0))) = _checkpoint_starvation_2 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(8)))).X1))) = str(108) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(8)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(9)))).X0))) = _create_drop_index_1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(9)))).X1))) = str(132) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(9)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(10)))).X0))) = _lookaside1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(10)))).X1))) = str(152) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(10)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(11)))).X0))) = _vacuum1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(11)))).X1))) = str(163) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(11)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(12)))).X0))) = _stress1 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(12)))).X1))) = str(171) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(12)))).X2))) = i32(10000) + *(*func(*crt.TLS, int32))(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(13)))).X0))) = _stress2 + *(**int8)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(13)))).X1))) = str(179) + *(*int32)(unsafe.Pointer(&((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(i32(13)))).X2))) = i32(60000) _nTestfound = i32(0) bin.Xsqlite3_config(tls, i32(2)) if _argc < i32(2) { @@ -141,8 +143,8 @@ _1: if _iArg >= _argc { goto _4 } - _2_zArg = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_iArg))) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_zArg)) + 1*uintptr(i32(0))))) != i32(45) { + _2_zArg = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_iArg))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_zArg)) + 1*uintptr(i32(0))))) != i32(45) { goto _5 } if bin.Xsqlite3_stricmp(tls, _2_zArg, str(187)) != i32(0) { @@ -164,7 +166,7 @@ _9: if uint64(_i) >= u64(14) { goto _12 } - if bin.Xsqlite3_strglob(tls, _2_zArg, (*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest))+24*uintptr(_i))).X1) == i32(0) { + if bin.Xsqlite3_strglob(tls, _2_zArg, (*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest))+24*uintptr(_i))).X1) == i32(0) { goto _12 } _i += 1 @@ -182,7 +184,7 @@ _15: if _iArg >= _argc { goto _18 } - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_iArg))))) + 1*uintptr(i32(0))))) == i32(45) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_iArg))))) + 1*uintptr(i32(0))))) == i32(45) { goto _16 } _i = i32(0) @@ -190,11 +192,11 @@ _20: if uint64(_i) >= u64(14) { goto _23 } - _9_z = (*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(_i))).X1 - if bin.Xsqlite3_strglob(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_iArg))), _9_z) == i32(0) { - crt.Xprintf(tls, str(240), unsafe.Pointer(_9_z), ((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest))+24*uintptr(_i))).X2)/i32(1000)) + _9_z = (*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(_i))).X1 + if bin.Xsqlite3_strglob(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_iArg))), _9_z) == i32(0) { + crt.Xprintf(tls, str(240), unsafe.Pointer(_9_z), ((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest))+24*uintptr(_i))).X2)/i32(1000)) crt.Xfflush(tls, (*crt.XFILE)(Xstdout)) - ((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest)) + 24*uintptr(_i))).X0)(tls, (*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest))+24*uintptr(_i))).X2) + ((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest)) + 24*uintptr(_i))).X0)(tls, (*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest))+24*uintptr(_i))).X2) _nTestfound += 1 } _i += 1 @@ -216,14 +218,14 @@ _18: }() _usage: - crt.Xprintf(tls, str(297), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + crt.Xprintf(tls, str(297), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) crt.Xprintf(tls, str(349)) _i = i32(0) _28: if uint64(_i) >= u64(14) { goto _31 } - crt.Xprintf(tls, str(371), unsafe.Pointer((*TThreadTest)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTest))+24*uintptr(_i))).X1)) + crt.Xprintf(tls, str(371), unsafe.Pointer((*TThreadTest)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTest))+24*uintptr(_i))).X1)) _i += 1 goto _28 _31: @@ -242,36 +244,36 @@ func _walthread1(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(987) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(988) }() return &_err }(), &_db, str(386)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(995) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(997) }() @@ -283,9 +285,9 @@ _8: goto _11 } _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(999) }() @@ -295,18 +297,18 @@ _8: goto _8 _11: _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1001) }() return &_err }(), &_threads, _walthread1_ckpt_thread, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1002) }() @@ -320,27 +322,27 @@ _11: func _opendb_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _zFile *int8, _bDelete int32) { var _1_rc, _1_flags int32 - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } _1_flags = i32(70) if _bDelete != 0 { crt.Xunlink(tls, _zFile) } - _1_rc = bin.Xsqlite3_open_v2(tls, _zFile, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X0))))), _1_flags, nil) + _1_rc = bin.Xsqlite3_open_v2(tls, _zFile, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X0)))), _1_flags, nil) if _1_rc != 0 { _sqlite_error(tls, _pErr, _pDb, str(562)) bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_pDb.X0)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X0))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_pDb.X0)) = nil goto _3 } - bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_pDb.X0), str(567), i32(-1), i32(1), nil, *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{nil})), *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{_md5step})), *(*func(*crt.TLS, *bin.Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{_md5finalize}))) + bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_pDb.X0), str(567), i32(-1), i32(1), nil, nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { + v := _md5step + return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) + }(), func() func(*crt.TLS, *bin.Xsqlite3_context) { + v := _md5finalize + return *(*func(*crt.TLS, *bin.Xsqlite3_context))(unsafe.Pointer(&v)) + }()) bin.Xsqlite3_busy_handler(tls, (*bin.Xsqlite3)(_pDb.X0), _busyhandler, nil) bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_pDb.X0), str(574), nil, nil, nil) _3: @@ -348,12 +350,15 @@ _0: } func _sqlite_error(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _zFunc *int8) { - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = bin.Xsqlite3_errcode(tls, (*bin.Xsqlite3)(_pDb.X0)) - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = bin.Xsqlite3_mprintf(tls, str(597), unsafe.Pointer(_zFunc), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_pDb.X0))), bin.Xsqlite3_extended_errcode(tls, (*bin.Xsqlite3)(_pDb.X0))) + *(*int32)(unsafe.Pointer(&_pErr.X0)) = bin.Xsqlite3_errcode(tls, (*bin.Xsqlite3)(_pDb.X0)) + *(**int8)(unsafe.Pointer(&_pErr.X2)) = bin.Xsqlite3_mprintf(tls, str(597), unsafe.Pointer(_zFunc), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_pDb.X0))), bin.Xsqlite3_extended_errcode(tls, (*bin.Xsqlite3)(_pDb.X0))) } -// During testing, the special md5sum() aggregate function is available. -// inside SQLite. The following routines implement that function. +// C comment +// /* +// ** During testing, the special md5sum() aggregate function is available. +// ** inside SQLite. The following routines implement that function. +// */ func _md5step(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { var _i int32 var _2_zData *int8 @@ -365,7 +370,7 @@ func _md5step(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe. if _p == nil { return } - if (_p.X0) == 0 { + if _p.X0 == 0 { _MD5Init(tls, _p) } _i = i32(0) @@ -373,7 +378,7 @@ _3: if _i >= _argc { goto _6 } - _2_zData = (*int8)(unsafe.Pointer(bin.Xsqlite3_value_text(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))))))) + _2_zData = (*int8)(unsafe.Pointer(bin.Xsqlite3_value_text(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))))))) if _2_zData != nil { _MD5Update(tls, _p, (*uint8)(unsafe.Pointer(_2_zData)), uint32(crt.Xstrlen(tls, _2_zData))) } @@ -382,29 +387,35 @@ _3: _6: } -// * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious -// * initialization constants. +// C comment +// /* +// * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious +// * initialization constants. +// */ func _MD5Init(tls *crt.TLS, _ctx *XMD5Context) { - *(*int32)(unsafe.Pointer(&(_ctx.X0))) = i32(1) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))) + 4*uintptr(i32(0)))) = uint32(i32(1732584193)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))) + 4*uintptr(i32(1)))) = u32(4023233417) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))) + 4*uintptr(i32(2)))) = u32(2562383102) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))) + 4*uintptr(i32(3)))) = uint32(i32(271733878)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(0)))) = uint32(i32(0)) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(1)))) = uint32(i32(0)) -} - -// * Update context to reflect the concatenation of another buffer full -// * of bytes. + *(*int32)(unsafe.Pointer(&_ctx.X0)) = i32(1) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))) + 4*uintptr(i32(0)))) = uint32(i32(1732584193)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))) + 4*uintptr(i32(1)))) = u32(4023233417) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))) + 4*uintptr(i32(2)))) = u32(2562383102) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))) + 4*uintptr(i32(3)))) = uint32(i32(271733878)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(0)))) = uint32(i32(0)) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(1)))) = uint32(i32(0)) +} + +// C comment +// /* +// * Update context to reflect the concatenation of another buffer full +// * of bytes. +// */ func _MD5Update(tls *crt.TLS, _ctx *XMD5Context, _buf *uint8, _len uint32) { var _t uint32 var _1_p *uint8 - _t = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(0)))) - if store0((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2)))))+4*uintptr(i32(0)))), _t+(_len<<uint(i32(3)))) < _t { - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(1)))) += 1 + _t = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(0)))) + if store0((*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2))))+4*uintptr(i32(0)))), _t+(_len<<uint(i32(3)))) < _t { + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(1)))) += 1 } { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(1)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(1)))) *p = (*p) + (_len >> uint(i32(29))) sink0(*p) } @@ -412,18 +423,18 @@ func _MD5Update(tls *crt.TLS, _ctx *XMD5Context, _buf *uint8, _len uint32) { if _t == 0 { goto _1 } - _1_p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))))) + uintptr(_t))) + _1_p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))))) + uintptr(_t))) _t = uint32(i32(64)) - _t if _len < _t { - crt.Xmemcpy(tls, (unsafe.Pointer)(_1_p), (unsafe.Pointer)(_buf), uint64(_len)) + crt.Xmemcpy(tls, unsafe.Pointer(_1_p), unsafe.Pointer(_buf), uint64(_len)) return } - crt.Xmemcpy(tls, (unsafe.Pointer)(_1_p), (unsafe.Pointer)(_buf), uint64(_t)) - _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))), uint32(i32(16))) - _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))))))))) + crt.Xmemcpy(tls, unsafe.Pointer(_1_p), unsafe.Pointer(_buf), uint64(_t)) + _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))), uint32(i32(16))) + _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))))))))) { p := &_buf - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_t))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(_t))) sink2(*p) } { @@ -433,12 +444,12 @@ func _MD5Update(tls *crt.TLS, _ctx *XMD5Context, _buf *uint8, _len uint32) { } _1: if _len >= uint32(i32(64)) { - crt.Xmemcpy(tls, (unsafe.Pointer)((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))), (unsafe.Pointer)(_buf), uint64(i32(64))) - _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))), uint32(i32(16))) - _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))))))))) + crt.Xmemcpy(tls, unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))), unsafe.Pointer(_buf), uint64(i32(64))) + _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))), uint32(i32(16))) + _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))))))))) { p := &_buf - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(64)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(64)))) sink2(*p) } { @@ -448,18 +459,21 @@ _1: } goto _1 } - crt.Xmemcpy(tls, (unsafe.Pointer)((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))), (unsafe.Pointer)(_buf), uint64(_len)) + crt.Xmemcpy(tls, unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))), unsafe.Pointer(_buf), uint64(_len)) } -// * Note: this code is harmless on little-endian machines. +// C comment +// /* +// * Note: this code is harmless on little-endian machines. +// */ func _byteReverse(tls *crt.TLS, _buf *uint8, _longs uint32) { var _t uint32 _0: - _t = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(3))))) << uint(i32(8))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2)))))) << uint(i32(16))) | ((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))) << uint(i32(8))) | uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0)))))) + _t = (((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(3))))) << uint(i32(8))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(2)))))) << uint(i32(16))) | ((uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(1))))) << uint(i32(8))) | uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 1*uintptr(i32(0)))))) *(*uint32)(unsafe.Pointer(_buf)) = _t { p := &_buf - *p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(4)))) + *p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*p)) + 1*uintptr(i32(4)))) sink2(*p) } if preInc0(&_longs, uint32(4294967295)) != 0 { @@ -467,21 +481,24 @@ _0: } } -// * The core of the MD5 algorithm, this alters an existing MD5 hash to -// * reflect the addition of 16 longwords of new data. MD5Update blocks -// * the data and converts bytes into longwords for this routine. +// C comment +// /* +// * The core of the MD5 algorithm, this alters an existing MD5 hash to +// * reflect the addition of 16 longwords of new data. MD5Update blocks +// * the data and converts bytes into longwords for this routine. +// */ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { var _a, _b, _c, _d uint32 - _a = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(0)))) - _b = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(1)))) - _c = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(2)))) - _d = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(3)))) + _a = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(0)))) + _b = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(1)))) + _c = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(2)))) + _d = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(3)))) { p := func() *uint32 { *func() *uint32 { { p := &_a - *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(0)))))) + u32(3614090360)) + *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(0)))))) + u32(3614090360)) sink0(*p) } return &_a @@ -496,7 +513,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(1)))))) + u32(3905402710)) + *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(1)))))) + u32(3905402710)) sink0(*p) } return &_d @@ -511,7 +528,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(2)))))) + uint32(i32(606105819))) + *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(2)))))) + uint32(i32(606105819))) sink0(*p) } return &_c @@ -526,7 +543,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(3)))))) + u32(3250441966)) + *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(3)))))) + u32(3250441966)) sink0(*p) } return &_b @@ -541,7 +558,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(4)))))) + u32(4118548399)) + *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(4)))))) + u32(4118548399)) sink0(*p) } return &_a @@ -556,7 +573,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(5)))))) + uint32(i32(1200080426))) + *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(5)))))) + uint32(i32(1200080426))) sink0(*p) } return &_d @@ -571,7 +588,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(6)))))) + u32(2821735955)) + *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(6)))))) + u32(2821735955)) sink0(*p) } return &_c @@ -586,7 +603,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(7)))))) + u32(4249261313)) + *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(7)))))) + u32(4249261313)) sink0(*p) } return &_b @@ -601,7 +618,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1770035416))) + *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1770035416))) sink0(*p) } return &_a @@ -616,7 +633,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(9)))))) + u32(2336552879)) + *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(9)))))) + u32(2336552879)) sink0(*p) } return &_d @@ -631,7 +648,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(10)))))) + u32(4294925233)) + *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(10)))))) + u32(4294925233)) sink0(*p) } return &_c @@ -646,7 +663,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(11)))))) + u32(2304563134)) + *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(11)))))) + u32(2304563134)) sink0(*p) } return &_b @@ -661,7 +678,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(12)))))) + uint32(i32(1804603682))) + *p = (*p) + (((_d ^ (_b & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(12)))))) + uint32(i32(1804603682))) sink0(*p) } return &_a @@ -676,7 +693,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(13)))))) + u32(4254626195)) + *p = (*p) + (((_c ^ (_a & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(13)))))) + u32(4254626195)) sink0(*p) } return &_d @@ -691,7 +708,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(14)))))) + u32(2792965006)) + *p = (*p) + (((_b ^ (_d & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(14)))))) + u32(2792965006)) sink0(*p) } return &_c @@ -706,7 +723,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(15)))))) + uint32(i32(1236535329))) + *p = (*p) + (((_a ^ (_c & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(15)))))) + uint32(i32(1236535329))) sink0(*p) } return &_b @@ -721,7 +738,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(1)))))) + u32(4129170786)) + *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(1)))))) + u32(4129170786)) sink0(*p) } return &_a @@ -736,7 +753,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(6)))))) + u32(3225465664)) + *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(6)))))) + u32(3225465664)) sink0(*p) } return &_d @@ -751,7 +768,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(11)))))) + uint32(i32(643717713))) + *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(11)))))) + uint32(i32(643717713))) sink0(*p) } return &_c @@ -766,7 +783,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(0)))))) + u32(3921069994)) + *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(0)))))) + u32(3921069994)) sink0(*p) } return &_b @@ -781,7 +798,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(5)))))) + u32(3593408605)) + *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(5)))))) + u32(3593408605)) sink0(*p) } return &_a @@ -796,7 +813,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(10)))))) + uint32(i32(38016083))) + *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(10)))))) + uint32(i32(38016083))) sink0(*p) } return &_d @@ -811,7 +828,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(15)))))) + u32(3634488961)) + *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(15)))))) + u32(3634488961)) sink0(*p) } return &_c @@ -826,7 +843,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(4)))))) + u32(3889429448)) + *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(4)))))) + u32(3889429448)) sink0(*p) } return &_b @@ -841,7 +858,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(9)))))) + uint32(i32(568446438))) + *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(9)))))) + uint32(i32(568446438))) sink0(*p) } return &_a @@ -856,7 +873,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(14)))))) + u32(3275163606)) + *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(14)))))) + u32(3275163606)) sink0(*p) } return &_d @@ -871,7 +888,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(3)))))) + u32(4107603335)) + *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(3)))))) + u32(4107603335)) sink0(*p) } return &_c @@ -886,7 +903,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1163531501))) + *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1163531501))) sink0(*p) } return &_b @@ -901,7 +918,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(13)))))) + u32(2850285829)) + *p = (*p) + (((_c ^ (_d & (_b ^ _c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(13)))))) + u32(2850285829)) sink0(*p) } return &_a @@ -916,7 +933,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(2)))))) + u32(4243563512)) + *p = (*p) + (((_b ^ (_c & (_a ^ _b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(2)))))) + u32(4243563512)) sink0(*p) } return &_d @@ -931,7 +948,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(7)))))) + uint32(i32(1735328473))) + *p = (*p) + (((_a ^ (_b & (_d ^ _a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(7)))))) + uint32(i32(1735328473))) sink0(*p) } return &_c @@ -946,7 +963,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(12)))))) + u32(2368359562)) + *p = (*p) + (((_d ^ (_a & (_c ^ _d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(12)))))) + u32(2368359562)) sink0(*p) } return &_b @@ -961,7 +978,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(5)))))) + u32(4294588738)) + *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(5)))))) + u32(4294588738)) sink0(*p) } return &_a @@ -976,7 +993,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(8)))))) + u32(2272392833)) + *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(8)))))) + u32(2272392833)) sink0(*p) } return &_d @@ -991,7 +1008,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(11)))))) + uint32(i32(1839030562))) + *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(11)))))) + uint32(i32(1839030562))) sink0(*p) } return &_c @@ -1006,7 +1023,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(14)))))) + u32(4259657740)) + *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(14)))))) + u32(4259657740)) sink0(*p) } return &_b @@ -1021,7 +1038,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(1)))))) + u32(2763975236)) + *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(1)))))) + u32(2763975236)) sink0(*p) } return &_a @@ -1036,7 +1053,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(4)))))) + uint32(i32(1272893353))) + *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(4)))))) + uint32(i32(1272893353))) sink0(*p) } return &_d @@ -1051,7 +1068,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(7)))))) + u32(4139469664)) + *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(7)))))) + u32(4139469664)) sink0(*p) } return &_c @@ -1066,7 +1083,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(10)))))) + u32(3200236656)) + *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(10)))))) + u32(3200236656)) sink0(*p) } return &_b @@ -1081,7 +1098,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(13)))))) + uint32(i32(681279174))) + *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(13)))))) + uint32(i32(681279174))) sink0(*p) } return &_a @@ -1096,7 +1113,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(0)))))) + u32(3936430074)) + *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(0)))))) + u32(3936430074)) sink0(*p) } return &_d @@ -1111,7 +1128,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(3)))))) + u32(3572445317)) + *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(3)))))) + u32(3572445317)) sink0(*p) } return &_c @@ -1126,7 +1143,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(6)))))) + uint32(i32(76029189))) + *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(6)))))) + uint32(i32(76029189))) sink0(*p) } return &_b @@ -1141,7 +1158,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(9)))))) + u32(3654602809)) + *p = (*p) + ((((_b ^ _c) ^ _d) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(9)))))) + u32(3654602809)) sink0(*p) } return &_a @@ -1156,7 +1173,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(12)))))) + u32(3873151461)) + *p = (*p) + ((((_a ^ _b) ^ _c) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(12)))))) + u32(3873151461)) sink0(*p) } return &_d @@ -1171,7 +1188,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(15)))))) + uint32(i32(530742520))) + *p = (*p) + ((((_d ^ _a) ^ _b) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(15)))))) + uint32(i32(530742520))) sink0(*p) } return &_c @@ -1186,7 +1203,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(2)))))) + u32(3299628645)) + *p = (*p) + ((((_c ^ _d) ^ _a) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(2)))))) + u32(3299628645)) sink0(*p) } return &_b @@ -1201,7 +1218,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(0)))))) + u32(4096336452)) + *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(0)))))) + u32(4096336452)) sink0(*p) } return &_a @@ -1216,7 +1233,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(7)))))) + uint32(i32(1126891415))) + *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(7)))))) + uint32(i32(1126891415))) sink0(*p) } return &_d @@ -1231,7 +1248,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(14)))))) + u32(2878612391)) + *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(14)))))) + u32(2878612391)) sink0(*p) } return &_c @@ -1246,7 +1263,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(5)))))) + u32(4237533241)) + *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(5)))))) + u32(4237533241)) sink0(*p) } return &_b @@ -1261,7 +1278,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(12)))))) + uint32(i32(1700485571))) + *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(12)))))) + uint32(i32(1700485571))) sink0(*p) } return &_a @@ -1276,7 +1293,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(3)))))) + u32(2399980690)) + *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(3)))))) + u32(2399980690)) sink0(*p) } return &_d @@ -1291,7 +1308,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(10)))))) + u32(4293915773)) + *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(10)))))) + u32(4293915773)) sink0(*p) } return &_c @@ -1306,7 +1323,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(1)))))) + u32(2240044497)) + *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(1)))))) + u32(2240044497)) sink0(*p) } return &_b @@ -1321,7 +1338,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1873313359))) + *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(8)))))) + uint32(i32(1873313359))) sink0(*p) } return &_a @@ -1336,7 +1353,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(15)))))) + u32(4264355552)) + *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(15)))))) + u32(4264355552)) sink0(*p) } return &_d @@ -1351,7 +1368,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(6)))))) + u32(2734768916)) + *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(6)))))) + u32(2734768916)) sink0(*p) } return &_c @@ -1366,7 +1383,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(13)))))) + uint32(i32(1309151649))) + *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(13)))))) + uint32(i32(1309151649))) sink0(*p) } return &_b @@ -1381,7 +1398,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_a - *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(4)))))) + u32(4149444226)) + *p = (*p) + (((_c ^ (_b | (^_d))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(4)))))) + u32(4149444226)) sink0(*p) } return &_a @@ -1396,7 +1413,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_d - *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(11)))))) + u32(3174756917)) + *p = (*p) + (((_b ^ (_a | (^_c))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(11)))))) + u32(3174756917)) sink0(*p) } return &_d @@ -1411,7 +1428,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_c - *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(2)))))) + uint32(i32(718787259))) + *p = (*p) + (((_a ^ (_d | (^_b))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(2)))))) + uint32(i32(718787259))) sink0(*p) } return &_c @@ -1426,7 +1443,7 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { *func() *uint32 { { p := &_b - *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_in)) + 4*uintptr(i32(9)))))) + u32(3951481745)) + *p = (*p) + (((_d ^ (_c | (^_a))) + (*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_in)) + 4*uintptr(i32(9)))))) + u32(3951481745)) sink0(*p) } return &_b @@ -1437,22 +1454,22 @@ func _MD5Transform(tls *crt.TLS, _buf *[4]uint32, _in *[16]uint32) { sink0(*p) } { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(0)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(0)))) *p = (*p) + _a sink0(*p) } { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(1)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(1)))) *p = (*p) + _b sink0(*p) } { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(2)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(2)))) *p = (*p) + _c sink0(*p) } { - p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 4*uintptr(i32(3)))) + p := (*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf)) + 4*uintptr(i32(3)))) *p = (*p) + _d sink0(*p) } @@ -1465,39 +1482,48 @@ func _md5finalize(tls *crt.TLS, _context unsafe.Pointer) { _p = (*XMD5Context)(bin.Xsqlite3_aggregate_context(tls, (*bin.Xsqlite3_context)(_context), int32(u64(92)))) _MD5Final(tls, (*[16]uint8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&_digest)))), _p) _MD5DigestToBase16(tls, (*uint8)(unsafe.Pointer(&_digest)), (*int8)(unsafe.Pointer(&_zBuf))) - bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), (*int8)(unsafe.Pointer(&_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uint64 }{u64(18446744073709551615)}))) + bin.Xsqlite3_result_text(tls, (*bin.Xsqlite3_context)(_context), (*int8)(unsafe.Pointer(&_zBuf)), i32(-1), func() func(*crt.TLS, unsafe.Pointer) { + v := u64(18446744073709551615) + return *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&v)) + }()) _ = _digest _ = _zBuf } -// * Final wrapup - pad to 64-byte boundary with the bit pattern -// * 1 0* (64-bit count of bits processed, MSB-first) +// C comment +// /* +// * Final wrapup - pad to 64-byte boundary with the bit pattern +// * 1 0* (64-bit count of bits processed, MSB-first) +// */ func _MD5Final(tls *crt.TLS, _digest *[16]uint8, _ctx *XMD5Context) { var _count uint32 var _p *uint8 - _count = ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(0))))) >> uint(i32(3))) & uint32(i32(63)) - _p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))))) + uintptr(_count))) + _count = ((*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(0))))) >> uint(i32(3))) & uint32(i32(63)) + _p = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))))) + uintptr(_count))) *postInc2(&_p, 1) = uint8(i32(128)) _count = uint32(i32(63)) - _count if _count < uint32(i32(8)) { - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), uint64(_count)) - _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))), uint32(i32(16))) - _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))))))))) - crt.Xmemset(tls, (unsafe.Pointer)((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))), i32(0), uint64(i32(56))) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), uint64(_count)) + _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))), uint32(i32(16))) + _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))))))))) + crt.Xmemset(tls, unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))), i32(0), uint64(i32(56))) goto _1 } - crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), uint64(_count-uint32(i32(8)))) + crt.Xmemset(tls, unsafe.Pointer(_p), i32(0), uint64(_count-uint32(i32(8)))) _1: - _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))), uint32(i32(14))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[16]uint32)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))) + 4*uintptr(i32(14)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(0)))) - *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[16]uint32)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3))))))) + 4*uintptr(i32(15)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_ctx.X2))))) + 4*uintptr(i32(1)))) - _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&(_ctx.X3)))))))))))) - _byteReverse(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_ctx.X1))))))), uint32(i32(4))) - crt.Xmemcpy(tls, (unsafe.Pointer)(_digest), (unsafe.Pointer)((*[4]uint32)(unsafe.Pointer(&(_ctx.X1)))), uint64(i32(16))) - crt.Xmemset(tls, (unsafe.Pointer)(_ctx), i32(0), u64(92)) -} - -// Convert a 128-bit MD5 digest into a 32-digit base-16 number. + _byteReverse(tls, (*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))), uint32(i32(14))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[16]uint32)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))) + 4*uintptr(i32(14)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(0)))) + *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[16]uint32)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3)))))) + 4*uintptr(i32(15)))) = *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&_ctx.X2)))) + 4*uintptr(i32(1)))) + _MD5Transform(tls, (*[4]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))))), (*[16]uint32)(unsafe.Pointer((*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer((*[64]uint8)(unsafe.Pointer((*t1)(unsafe.Pointer(&_ctx.X3))))))))))) + _byteReverse(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1)))))), uint32(i32(4))) + crt.Xmemcpy(tls, unsafe.Pointer(_digest), unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&_ctx.X1))), uint64(i32(16))) + crt.Xmemset(tls, unsafe.Pointer(_ctx), i32(0), u64(92)) +} + +// C comment +// /* +// ** Convert a 128-bit MD5 digest into a 32-digit base-16 number. +// */ func _MD5DigestToBase16(tls *crt.TLS, _digest *uint8, _zBuf *int8) { var _i, _j, _1_a int32 _j = store3(&_i, i32(0)) @@ -1505,13 +1531,13 @@ _0: if _i >= i32(16) { goto _3 } - _1_a = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_digest)) + 1*uintptr(_i)))) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc3(&_j, int32(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_MD5DigestToBase16Ø00zEncodeØ001)) + 1*uintptr((_1_a>>uint(i32(4)))&i32(15)))) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc3(&_j, int32(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_MD5DigestToBase16Ø00zEncodeØ001)) + 1*uintptr(_1_a&i32(15)))) + _1_a = int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_digest)) + 1*uintptr(_i)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc3(&_j, 1)))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_MD5DigestToBase16Ø00zEncodeØ001)) + 1*uintptr((_1_a>>uint(i32(4)))&i32(15)))) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(postInc3(&_j, 1)))) = *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_MD5DigestToBase16Ø00zEncodeØ001)) + 1*uintptr(_1_a&i32(15)))) _i += 1 goto _0 _3: - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_j))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zBuf)) + 1*uintptr(_j))) = int8(i32(0)) } var _MD5DigestToBase16Ø00zEncodeØ001 [17]int8 @@ -1526,8 +1552,8 @@ func _busyhandler(tls *crt.TLS, _pArg unsafe.Pointer, _n int32) (r0 int32) { } func _sql_script_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _zSql *int8) { - if (_pErr.X0) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_pDb.X0), _zSql, nil, nil, (**int8)(unsafe.Pointer(&(_pErr.X2)))) + if _pErr.X0 == i32(0) { + *(*int32)(unsafe.Pointer(&_pErr.X0)) = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_pDb.X0), _zSql, nil, nil, (**int8)(unsafe.Pointer(&_pErr.X2))) } } @@ -1541,30 +1567,30 @@ _0: } _pNext = (*bin.Xsqlite3_pcache_page)(_pIter.X1) bin.Xsqlite3_finalize(tls, _pIter.X0) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pIter)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pIter)) _pIter = _pNext goto _0 _3: _i = i32(0) _4: - if _i >= (_pDb.X2) { + if _i >= _pDb.X2 { goto _7 } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDb.X3)) + 8*uintptr(_i))))) + bin.Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDb.X3)) + 8*uintptr(_i))))) _i += 1 goto _4 _7: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pDb.X3)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pDb.X3)) _rc = bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_pDb.X0)) - if _rc != 0 && ((_pErr.X0) == i32(0)) { - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = bin.Xsqlite3_mprintf(tls, str(637), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_pDb.X0)))) + if _rc != 0 && (_pErr.X0 == i32(0)) { + *(**int8)(unsafe.Pointer(&_pErr.X2)) = bin.Xsqlite3_mprintf(tls, str(637), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_pDb.X0)))) } - crt.Xmemset(tls, (unsafe.Pointer)(_pDb), i32(0), u64(32)) + crt.Xmemset(tls, unsafe.Pointer(_pDb), i32(0), u64(32)) } func _setstoptime_x(tls *crt.TLS, _pErr *XError, _nMs int32) { var _1_t float64 - if (_pErr.X0) == i32(0) { + if _pErr.X0 == i32(0) { _1_t = _currentTime(tls) _timelimit = _1_t + (float64(_nMs) / (8.64e+07)) bug20530(_timelimit) @@ -1578,22 +1604,25 @@ func _currentTime(tls *crt.TLS) (r0 float64) { _currentTimeØ00pTimelimitVfsØ001 = bin.Xsqlite3_vfs_find(tls, nil) bug20530(_currentTimeØ00pTimelimitVfsØ001) } - if ((_currentTimeØ00pTimelimitVfsØ001.X0) >= i32(2)) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { + if (_currentTimeØ00pTimelimitVfsØ001.X0 >= i32(2)) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32 - }{(*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_currentTimeØ00pTimelimitVfsØ001.X18)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { + }{func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32 { + v := _currentTimeØ00pTimelimitVfsØ001.X18 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v)) + }()})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct { f func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32 }{nil}))) { - (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{(_currentTimeØ00pTimelimitVfsØ001.X18)})))(tls, _currentTimeØ00pTimelimitVfsØ001, &_1_tm) + func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32 { + v := _currentTimeØ00pTimelimitVfsØ001.X18 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _currentTimeØ00pTimelimitVfsØ001, &_1_tm) _t = float64(_1_tm) / (8.64e+07) goto _3 } - (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *float64) int32 - }{(_currentTimeØ00pTimelimitVfsØ001.X16)})))(tls, _currentTimeØ00pTimelimitVfsØ001, &_t) + func() func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32 { + v := _currentTimeØ00pTimelimitVfsØ001.X16 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&v)) + }()(tls, _currentTimeØ00pTimelimitVfsØ001, &_t) _3: return _t } @@ -1605,23 +1634,23 @@ var _timelimit float64 func _launch_thread_x(tls *crt.TLS, _pErr *XError, _pThreads *bin.T_ht, _xProc func(*crt.TLS, int32, unsafe.Pointer) *int8, _pArg unsafe.Pointer) { var _1_iTid, _1_rc int32 var _1_p *XThread - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } - _1_iTid = preInc3((*int32)(unsafe.Pointer(&(_pThreads.X0))), 1) + _1_iTid = preInc3((*int32)(unsafe.Pointer(&_pThreads.X0)), 1) _1_p = (*XThread)(bin.Xsqlite3_malloc(tls, int32(u64(40)))) - crt.Xmemset(tls, (unsafe.Pointer)(_1_p), i32(0), u64(40)) - *(*int32)(unsafe.Pointer(&(_1_p.X0))) = _1_iTid - *(*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X1))) = _pArg - *(*func(*crt.TLS, int32, unsafe.Pointer) *int8)(unsafe.Pointer(&(_1_p.X3))) = _xProc - _1_rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&(_1_p.X2))), (*crt.Xpthread_attr_t)(unsafe.Pointer(nil)), _launch_thread_main, (unsafe.Pointer)(_1_p)) + crt.Xmemset(tls, unsafe.Pointer(_1_p), i32(0), u64(40)) + *(*int32)(unsafe.Pointer(&_1_p.X0)) = _1_iTid + *(*unsafe.Pointer)(unsafe.Pointer(&_1_p.X1)) = _pArg + *(*func(*crt.TLS, int32, unsafe.Pointer) *int8)(unsafe.Pointer(&_1_p.X3)) = _xProc + _1_rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&_1_p.X2)), (*crt.Xpthread_attr_t)(unsafe.Pointer(nil)), _launch_thread_main, unsafe.Pointer(_1_p)) if _1_rc != i32(0) { _system_error(tls, _pErr, _1_rc) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_p)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_p)) goto _2 } - *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X4))))) = (*XThread)(_pThreads.X1) - *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pThreads.X1))))) = _1_p + *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_1_p.X4)))) = (*XThread)(_pThreads.X1) + *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pThreads.X1)))) = _1_p _2: _0: } @@ -1629,14 +1658,14 @@ _0: func _launch_thread_main(tls *crt.TLS, _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _p *XThread _p = (*XThread)(_pArg) - return (unsafe.Pointer)((_p.X3)(tls, _p.X0, _p.X1)) + return unsafe.Pointer(_p.X3(tls, _p.X0, _p.X1)) } func _system_error(tls *crt.TLS, _pErr *XError, _iSys int32) { - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = _iSys - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = (*int8)(bin.Xsqlite3_malloc(tls, i32(512))) + *(*int32)(unsafe.Pointer(&_pErr.X0)) = _iSys + *(**int8)(unsafe.Pointer(&_pErr.X2)) = (*int8)(bin.Xsqlite3_malloc(tls, i32(512))) crt.Xstrerror_r(tls, _iSys, _pErr.X2, uint64(i32(512))) - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pErr.X2)) + 1*uintptr(i32(511)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pErr.X2)) + 1*uintptr(i32(511)))) = int8(i32(0)) } func _walthread1_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { @@ -1649,9 +1678,9 @@ func _walthread1_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *in _db = XSqlite{} _nIter = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(929) }() @@ -1659,9 +1688,9 @@ func _walthread1_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *in }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(930) }() @@ -1670,57 +1699,57 @@ _2: goto _3 } _1_azSql = [2]*int8{} - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_azSql)) + 8*uintptr(i32(0)))) = str(640) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_azSql)) + 8*uintptr(i32(1)))) = str(708) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_azSql)) + 8*uintptr(i32(0)))) = str(640) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_azSql)) + 8*uintptr(i32(1)))) = str(708) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(937) }() return &_err }(), &_db, unsafe.Pointer(str(767))) _integrity_check_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(938) }() return &_err }(), &_db) _1_z1 = _execsql_text_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(939) }() return &_err - }(), &_db, i32(1), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_azSql)) + 8*uintptr(i32(0)))))) + }(), &_db, i32(1), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_azSql)) + 8*uintptr(i32(0)))))) _1_z2 = _execsql_text_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(940) }() return &_err - }(), &_db, i32(2), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_azSql)) + 8*uintptr(i32(1)))))) + }(), &_db, i32(2), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_azSql)) + 8*uintptr(i32(1)))))) _1_z3 = _execsql_text_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(941) }() return &_err - }(), &_db, i32(3), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_azSql)) + 8*uintptr(i32(0)))))) + }(), &_db, i32(3), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_1_azSql)) + 8*uintptr(i32(0)))))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(942) }() @@ -1730,9 +1759,9 @@ _2: _test_error_x(tls, &_err, bin.Xsqlite3_mprintf(tls, str(780), unsafe.Pointer(_1_z1), unsafe.Pointer(_1_z2), unsafe.Pointer(_1_z3))) } _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(948) }() @@ -1742,9 +1771,9 @@ _2: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(957) }() @@ -1763,7 +1792,7 @@ func _timetostop_x(tls *crt.TLS, _pErr *XError) (r0 int32) { var _ret int32 var _1_t float64 _ret = i32(1) - if (_pErr.X0) == i32(0) { + if _pErr.X0 == i32(0) { _1_t = _currentTime(tls) _ret = bool2int(_1_t >= _timelimit) } @@ -1776,7 +1805,7 @@ func _execsql_i64_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, args ...interfac var _1_pStmt unsafe.Pointer var _1_ap []interface{} _iRet = i64(0) - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } _1_ap = args @@ -1821,7 +1850,7 @@ _1: } _1_zName = bin.Xsqlite3_bind_parameter_name(tls, _pStmt, _i) _1_pArg = crt.VAPointer(&_ap) - switch int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zName)) + 1*uintptr(i32(1))))) { + switch int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zName)) + 1*uintptr(i32(1))))) { case i32(105): goto _6 default: @@ -1832,8 +1861,8 @@ _6: bin.Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(_1_pArg)) goto _8 _7: - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = i32(1) - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = bin.Xsqlite3_mprintf(tls, str(954), unsafe.Pointer(_1_zName)) + *(*int32)(unsafe.Pointer(&_pErr.X0)) = i32(1) + *(**int8)(unsafe.Pointer(&_pErr.X2)) = bin.Xsqlite3_mprintf(tls, str(954), unsafe.Pointer(_1_zName)) _pStmt = nil goto _8 _8: @@ -1858,7 +1887,7 @@ _0: goto _0 _3: _pRet = (*bin.Xsqlite3_pcache_page)(bin.Xsqlite3_malloc(tls, int32(u64(16)))) - _rc = bin.Xsqlite3_prepare_v2(tls, (*bin.Xsqlite3)(_pDb.X0), _zSql, i32(-1), (*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X0))), nil) + _rc = bin.Xsqlite3_prepare_v2(tls, (*bin.Xsqlite3)(_pDb.X0), _zSql, i32(-1), (*unsafe.Pointer)(unsafe.Pointer(&_pRet.X0)), nil) if _rc != i32(0) { _sqlite_error(tls, _pErr, _pDb, str(980)) return nil @@ -1869,8 +1898,8 @@ _3: crt.X__builtin_abort(tls) } }() - *(**bin.Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X1))))) = (*bin.Xsqlite3_pcache_page)(_pDb.X1) - *(**bin.Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X1))))) = _pRet + *(**bin.Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pRet.X1)))) = (*bin.Xsqlite3_pcache_page)(_pDb.X1) + *(**bin.Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pDb.X1)))) = _pRet return _pRet } @@ -1884,7 +1913,7 @@ func _integrity_check_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite) { var _1_zErr, _3_z *int8 var _2_pStmt unsafe.Pointer var _1_pStatement *bin.Xsqlite3_pcache_page - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } _1_zErr = nil @@ -1912,8 +1941,8 @@ _4: _3: bin.Xsqlite3_reset(tls, _2_pStmt) if _1_zErr != nil { - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = _1_zErr - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = i32(1) + *(**int8)(unsafe.Pointer(&_pErr.X2)) = _1_zErr + *(*int32)(unsafe.Pointer(&_pErr.X0)) = i32(1) } _1: _0: @@ -1925,13 +1954,13 @@ func _execsql_text_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _iSlot int32, a var _2_pStmt unsafe.Pointer var _2_ap []interface{} _zRet = nil - if _iSlot >= (_pDb.X2) { + if _iSlot >= _pDb.X2 { _1_nByte = int32(u64(8) * uint64(_iSlot+i32(1))) - *(***int8)(unsafe.Pointer(&(_pDb.X3))) = (**int8)(bin.Xsqlite3_realloc(tls, (unsafe.Pointer)(_pDb.X3), _1_nByte)) - crt.Xmemset(tls, (unsafe.Pointer)((**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDb.X3))+8*uintptr(_pDb.X2)))), i32(0), u64(8)*uint64((_iSlot+i32(1))-(_pDb.X2))) - *(*int32)(unsafe.Pointer(&(_pDb.X2))) = _iSlot + i32(1) + *(***int8)(unsafe.Pointer(&_pDb.X3)) = (**int8)(bin.Xsqlite3_realloc(tls, unsafe.Pointer(_pDb.X3), _1_nByte)) + crt.Xmemset(tls, unsafe.Pointer((**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDb.X3))+8*uintptr(_pDb.X2)))), i32(0), u64(8)*uint64((_iSlot+i32(1))-_pDb.X2)) + *(*int32)(unsafe.Pointer(&_pDb.X2)) = _iSlot + i32(1) } - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _1 } _2_ap = args @@ -1946,8 +1975,8 @@ _3: } if _3_first != 0 && (bin.Xsqlite3_column_count(tls, _2_pStmt) > i32(0)) { _zRet = bin.Xsqlite3_mprintf(tls, str(637), unsafe.Pointer(bin.Xsqlite3_column_text(tls, _2_pStmt, i32(0)))) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDb.X3)) + 8*uintptr(_iSlot))))) - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDb.X3)) + 8*uintptr(_iSlot))) = _zRet + bin.Xsqlite3_free(tls, unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDb.X3)) + 8*uintptr(_iSlot))))) + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pDb.X3)) + 8*uintptr(_iSlot))) = _zRet } _3_first = i32(0) goto _3 @@ -1962,12 +1991,12 @@ _1: } func _test_error_x(tls *crt.TLS, _pErr *XError, _zErr *int8) { - if (_pErr.X0) == i32(0) { - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = i32(1) - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = _zErr + if _pErr.X0 == i32(0) { + *(*int32)(unsafe.Pointer(&_pErr.X0)) = i32(1) + *(**int8)(unsafe.Pointer(&_pErr.X2)) = _zErr goto _1 } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zErr)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zErr)) _1: } @@ -1978,11 +2007,11 @@ func _print_and_free_err(tls *crt.TLS, _p *XError) { func _print_err(tls *crt.TLS, _p *XError) { var _1_isWarn int32 - if (_p.X0) == i32(0) { + if _p.X0 == i32(0) { goto _0 } _1_isWarn = i32(0) - if (_p.X0) == i32(17) { + if _p.X0 == i32(17) { _1_isWarn = i32(1) } if bin.Xsqlite3_strglob(tls, str(1175), _p.X2) == i32(0) { @@ -2004,9 +2033,9 @@ _0: var _nGlobalErr int32 func _free_err(tls *crt.TLS, _p *XError) { - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_p.X2)) - *(**int8)(unsafe.Pointer(&(_p.X2))) = nil - *(*int32)(unsafe.Pointer(&(_p.X0))) = i32(0) + bin.Xsqlite3_free(tls, unsafe.Pointer(_p.X2)) + *(**int8)(unsafe.Pointer(&_p.X2)) = nil + *(*int32)(unsafe.Pointer(&_p.X0)) = i32(0) } func _walthread1_ckpt_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { @@ -2017,9 +2046,9 @@ func _walthread1_ckpt_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r _db = XSqlite{} _nCkpt = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(968) }() @@ -2027,9 +2056,9 @@ func _walthread1_ckpt_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(969) }() @@ -2039,24 +2068,24 @@ _2: } crt.Xusleep(tls, uint32(i32(500000))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(971) }() return &_err }(), &_db, unsafe.Pointer(str(1236))) - if (_err.X0) == i32(0) { + if _err.X0 == i32(0) { _nCkpt += 1 } _clear_error_x(tls, &_err, i32(5)) goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(975) }() @@ -2071,10 +2100,10 @@ _3: } func _clear_error_x(tls *crt.TLS, _pErr *XError, _rc int32) { - if (_pErr.X0) == _rc { - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = i32(0) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pErr.X2)) - *(**int8)(unsafe.Pointer(&(_pErr.X2))) = nil + if _pErr.X0 == _rc { + *(*int32)(unsafe.Pointer(&_pErr.X0)) = i32(0) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pErr.X2)) + *(**int8)(unsafe.Pointer(&_pErr.X2)) = nil } } @@ -2092,7 +2121,7 @@ _0: if _1_rc == i32(0) { goto _4 } - if (_pErr.X0) == i32(0) { + if _pErr.X0 == i32(0) { _system_error(tls, _pErr, _1_rc) } goto _6 @@ -2105,11 +2134,11 @@ _4: }())) crt.Xfflush(tls, (*crt.XFILE)(Xstdout)) _6: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_p)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_p)) _p = _pNext goto _0 _3: - *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pThreads.X1))))) = nil + *(**XThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pThreads.X1)))) = nil } func _walthread2(tls *crt.TLS, _nMs int32) { @@ -2120,81 +2149,81 @@ func _walthread2(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1050) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1051) }() return &_err }(), &_db, str(1297)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1052) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1054) }() return &_err }(), _nMs) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1055) }() return &_err }(), &_threads, _walthread2_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1056) }() return &_err }(), &_threads, _walthread2_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1057) }() return &_err }(), &_threads, _walthread2_thread, crt.U2P(uintptr(u32(1)))) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1058) }() return &_err }(), &_threads, _walthread2_thread, crt.U2P(uintptr(u32(1)))) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1059) }() @@ -2222,9 +2251,9 @@ func _walthread2_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *in } _0: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1016) }() @@ -2235,18 +2264,18 @@ _0: _2_journal_exists = i32(0) _2_wal_exists = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1020) }() return &_err }(), &_db, str(378), i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1022) }() @@ -2254,36 +2283,36 @@ _0: }(), &_db, _zJournal) _clear_error_x(tls, &_err, i32(5)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1024) }() return &_err }(), &_db, str(767)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1025) }() return &_err }(), &_db, str(1401)) _2_journal_exists = bool2int(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1027) }() return &_err }(), str(1446)) >= int64(i32(0))) _2_wal_exists = bool2int(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1028) }() @@ -2292,29 +2321,29 @@ _0: if (_2_journal_exists + _2_wal_exists) != i32(1) { _test_error_x(tls, &_err, bin.Xsqlite3_mprintf(tls, str(1474), _2_journal_exists, _2_wal_exists)) } - *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_anTrans)) + 4*uintptr(_2_journal_exists))) += 1 + *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_anTrans)) + 4*uintptr(_2_journal_exists))) += 1 _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1036) }() return &_err }(), &_db, str(773)) _integrity_check_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1037) }() return &_err }(), &_db) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1038) }() @@ -2323,7 +2352,7 @@ _0: goto _0 _2: _print_and_free_err(tls, &_err) - return bin.Xsqlite3_mprintf(tls, str(1511), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_anTrans)) + 4*uintptr(i32(0)))), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_anTrans)) + 4*uintptr(i32(1))))) + return bin.Xsqlite3_mprintf(tls, str(1511), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_anTrans)) + 4*uintptr(i32(0)))), *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_anTrans)) + 4*uintptr(i32(1))))) _ = _err _ = _db @@ -2335,7 +2364,7 @@ func _filesize_x(tls *crt.TLS, _pErr *XError, _zFile *int8) (r0 int64) { var _iRet int64 var _1_sStat crt.Xstruct_stat64 _iRet = i64(0) - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } if crt.Xstat64(tls, _zFile, &_1_sStat) != 0 { @@ -2360,36 +2389,36 @@ func _walthread3(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1107) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1108) }() return &_err }(), &_db, str(1521)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1115) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1117) }() @@ -2401,9 +2430,9 @@ _8: goto _11 } _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1119) }() @@ -2413,9 +2442,9 @@ _8: goto _8 _11: _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1121) }() @@ -2436,18 +2465,18 @@ func _walthread3_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *in _db = XSqlite{} _iArg = int32(int64(crt.P2U(_pArg))) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1070) }() return &_err }(), &_db, str(378), i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1071) }() @@ -2458,9 +2487,9 @@ _4: _1_stop = i32(0) _6: if i32(0) != store3(&_1_stop, _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1079) }() @@ -2469,9 +2498,9 @@ _6: goto _7 } _2_iMax = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1080) }() @@ -2486,36 +2515,36 @@ _7: goto _5 } _1_sum1 = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1085) }() return &_err }(), &_db, unsafe.Pointer(str(1735))) _1_sum2 = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1086) }() return &_err }(), &_db, unsafe.Pointer(str(1759))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1087) }() return &_err }(), &_db, unsafe.Pointer(str(1784)), unsafe.Pointer(&_iNextWrite), unsafe.Pointer(&_1_sum1), unsafe.Pointer(&_1_sum2)) _integrity_check_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1091) }() @@ -2529,9 +2558,9 @@ _7: goto _4 _5: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1096) }() @@ -2555,63 +2584,63 @@ func _walthread4(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1165) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1166) }() return &_err }(), &_db, str(1835)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1170) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1172) }() return &_err }(), _nMs) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1173) }() return &_err }(), &_threads, _walthread4_reader_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1174) }() return &_err }(), &_threads, _walthread4_writer_thread, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1175) }() @@ -2629,9 +2658,9 @@ func _walthread4_reader_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1130) }() @@ -2639,18 +2668,18 @@ func _walthread4_reader_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1131) }() return &_err }()) == 0 { _integrity_check_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1132) }() @@ -2659,9 +2688,9 @@ _2: goto _2 } _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1134) }() @@ -2683,18 +2712,18 @@ func _walthread4_writer_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) _db = XSqlite{} _iRow = i64(1) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1145) }() return &_err }(), &_db, str(378), i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1146) }() @@ -2702,9 +2731,9 @@ func _walthread4_writer_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) }(), &_db, str(1911)) _4: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1147) }() @@ -2713,9 +2742,9 @@ _4: goto _5 } _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1148) }() @@ -2728,9 +2757,9 @@ _4: goto _4 _5: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1154) }() @@ -2752,82 +2781,82 @@ func _walthread5(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1198) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1199) }() return &_err }(), &_db, str(1990)) _filecopy_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1224) }() return &_err }(), str(378), str(3150)) _filecopy_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1225) }() return &_err }(), str(1462), str(3161)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1226) }() return &_err }(), &_db) _filecopy_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1228) }() return &_err }(), str(3150), str(378)) _filecopy_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1229) }() return &_err }(), str(3161), str(1462)) - if (_err.X0) == i32(0) { + if _err.X0 == i32(0) { crt.Xprintf(tls, str(3176), int32(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1232) }() return &_err }(), str(1462)))) crt.Xprintf(tls, str(3200), int32(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1233) }() @@ -2835,82 +2864,82 @@ func _walthread5(tls *crt.TLS, _nMs int32) { }(), str(378)))) } _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1236) }() return &_err }(), _nMs) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1237) }() return &_err }(), &_threads, _walthread5_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1238) }() return &_err }(), &_threads, _walthread5_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1239) }() return &_err }(), &_threads, _walthread5_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1240) }() return &_err }(), &_threads, _walthread5_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1241) }() return &_err }(), &_threads, _walthread5_thread, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1242) }() return &_err }(), &_threads) - if (_err.X0) == i32(0) { + if _err.X0 == i32(0) { crt.Xprintf(tls, str(3176), int32(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1245) }() return &_err }(), str(1462)))) crt.Xprintf(tls, str(3200), int32(_filesize_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1246) }() @@ -2927,7 +2956,7 @@ func _filecopy_x(tls *crt.TLS, _pErr *XError, _zFrom *int8, _zTo *int8) { var _3_fd1, _3_fd2, _6_nCopy int32 var _1_nByte, _3_iOff int64 var _3_aBuf [1024]int8 - if (_pErr.X0) != i32(0) { + if _pErr.X0 != i32(0) { goto _0 } _1_nByte = _filesize_x(tls, _pErr, _zFrom) @@ -2956,11 +2985,11 @@ _5: if (int64(_6_nCopy) + _3_iOff) > _1_nByte { _6_nCopy = int32(_1_nByte - _3_iOff) } - if int64(_6_nCopy) != crt.Xread(tls, _3_fd1, (unsafe.Pointer)(&_3_aBuf), uint64(_6_nCopy)) { + if int64(_6_nCopy) != crt.Xread(tls, _3_fd1, unsafe.Pointer(&_3_aBuf), uint64(_6_nCopy)) { _system_error(tls, _pErr, *crt.X__errno_location(tls)) goto _6 } - if int64(_6_nCopy) != crt.Xwrite(tls, _3_fd2, (unsafe.Pointer)(&_3_aBuf), uint64(_6_nCopy)) { + if int64(_6_nCopy) != crt.Xwrite(tls, _3_fd2, unsafe.Pointer(&_3_aBuf), uint64(_6_nCopy)) { _system_error(tls, _pErr, *crt.X__errno_location(tls)) goto _6 } @@ -2985,27 +3014,27 @@ func _walthread5_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *in _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1185) }() return &_err }(), &_db, str(378), i32(0)) _nRow = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1186) }() return &_err }(), &_db, unsafe.Pointer(str(3234))) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1187) }() @@ -3029,18 +3058,18 @@ func _cgt_pager_1(tls *crt.TLS, _nMs int32) { _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1289) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1290) }() @@ -3053,9 +3082,9 @@ func _cgt_pager_1(tls *crt.TLS, _nMs int32) { _xSub = _cgt_pager_1_read _xSub(tls, &_err, &_db) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1300) }() @@ -3071,9 +3100,9 @@ func _cgt_pager_1_populate(tls *crt.TLS, _pErr *XError, _pDb *XSqlite) { var _zInsert *int8 _zInsert = str(3373) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1259) }() @@ -3086,9 +3115,9 @@ _2: } _1_iBlob = int64(i32(600)) + (_iRow % int64(i32(300))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1262) }() @@ -3098,9 +3127,9 @@ _2: goto _2 _5: _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1264) }() @@ -3114,9 +3143,9 @@ func _cgt_pager_1_update(tls *crt.TLS, _pErr *XError, _pDb *XSqlite) { var _zUpdate *int8 _zUpdate = str(3420) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1269) }() @@ -3129,9 +3158,9 @@ _2: } _1_iBlob = int64(i32(600)) + ((_iRow + int64(i32(100))) % int64(i32(300))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1272) }() @@ -3141,9 +3170,9 @@ _2: goto _2 _5: _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1274) }() @@ -3155,9 +3184,9 @@ _5: func _cgt_pager_1_read(tls *crt.TLS, _pErr *XError, _pDb *XSqlite) { var _iRow int64 _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1278) }() @@ -3169,9 +3198,9 @@ _2: goto _5 } _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1280) }() @@ -3181,9 +3210,9 @@ _2: goto _2 _5: _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(1282) }() @@ -3199,36 +3228,36 @@ func _dynamic_triggers(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1396) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1397) }() return &_err }(), &_db, str(3504)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1410) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1412) }() @@ -3236,18 +3265,18 @@ func _dynamic_triggers(tls *crt.TLS, _nMs int32) { }(), _nMs) bin.Xsqlite3_enable_shared_cache(tls, i32(1)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1415) }() return &_err }(), &_threads, _dynamic_triggers_2, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1416) }() @@ -3256,27 +3285,27 @@ func _dynamic_triggers(tls *crt.TLS, _nMs int32) { crt.Xsleep(tls, uint32(i32(2))) bin.Xsqlite3_enable_shared_cache(tls, i32(0)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1421) }() return &_err }(), &_threads, _dynamic_triggers_2, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1422) }() return &_err }(), &_threads, _dynamic_triggers_1, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1424) }() @@ -3299,9 +3328,9 @@ func _dynamic_triggers_2(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *i _nInsert = i32(0) _nDelete = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1371) }() @@ -3309,9 +3338,9 @@ func _dynamic_triggers_2(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *i }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1372) }() @@ -3322,9 +3351,9 @@ _2: _6: _iVal = (_iVal + int64(i32(1))) % int64(i32(100)) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1375) }() @@ -3337,9 +3366,9 @@ _6: _9: _iVal = (_iVal + int64(i32(1))) % int64(i32(100)) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1381) }() @@ -3352,9 +3381,9 @@ _9: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1385) }() @@ -3378,9 +3407,9 @@ func _dynamic_triggers_1(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *i _nDrop = i32(0) _nCreate = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1318) }() @@ -3388,9 +3417,9 @@ func _dynamic_triggers_1(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *i }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1319) }() @@ -3405,15 +3434,15 @@ _6: } _2_zSql = bin.Xsqlite3_mprintf(tls, str(3839), _1_i, _1_i, _1_i+i32(1)) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1328) }() return &_err }(), &_db, unsafe.Pointer(_2_zSql)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_2_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_2_zSql)) _nCreate += 1 _1_i += 1 goto _6 @@ -3425,15 +3454,15 @@ _12: } _3_zSql = bin.Xsqlite3_mprintf(tls, str(3929), _1_i, _1_i, _1_i+i32(1)) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1339) }() return &_err }(), &_db, unsafe.Pointer(_3_zSql)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_3_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_3_zSql)) _nCreate += 1 _1_i += 1 goto _12 @@ -3445,15 +3474,15 @@ _18: } _4_zSql = bin.Xsqlite3_mprintf(tls, str(4015), _1_i) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1346) }() return &_err }(), &_db, unsafe.Pointer(_4_zSql)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_4_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_4_zSql)) _nDrop += 1 _1_i += 1 goto _18 @@ -3465,15 +3494,15 @@ _24: } _5_zSql = bin.Xsqlite3_mprintf(tls, str(4034), _1_i) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1353) }() return &_err }(), &_db, unsafe.Pointer(_5_zSql)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_5_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_5_zSql)) _nDrop += 1 _1_i += 1 goto _24 @@ -3481,9 +3510,9 @@ _27: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(1358) }() @@ -3503,7 +3532,7 @@ func _checkpoint_starvation_1(tls *crt.TLS, _nMs int32) { _err = XError{} _ctx = bin.Xsqlite3_debug_mutex{} _checkpoint_starvation_main(tls, _nMs, &_ctx) - if (_ctx.X1) < i32(500) { + if _ctx.X1 < i32(500) { _test_error_x(tls, &_err, bin.Xsqlite3_mprintf(tls, str(4076), _ctx.X1)) } _print_and_free_err(tls, &_err) @@ -3521,27 +3550,27 @@ func _checkpoint_starvation_main(tls *crt.TLS, _nMs int32, _p *bin.Xsqlite3_debu _threads = bin.T_ht{} _nInsert = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(99) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(100) }() return &_err }(), &_db, str(4107)) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(106) }() @@ -3553,9 +3582,9 @@ _6: goto _9 } _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(109) }() @@ -3565,23 +3594,24 @@ _6: _i += 1 goto _6 _9: - bin.Xsqlite3_wal_hook(tls, (*bin.Xsqlite3)(_db.X0), *(*func(*crt.TLS, unsafe.Pointer, *bin.Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32 - }{_checkpoint_starvation_walhook})), (unsafe.Pointer)(_p)) + bin.Xsqlite3_wal_hook(tls, (*bin.Xsqlite3)(_db.X0), func() func(*crt.TLS, unsafe.Pointer, *bin.Xsqlite3, *int8, int32) int32 { + v := _checkpoint_starvation_walhook + return *(*func(*crt.TLS, unsafe.Pointer, *bin.Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&v)) + }(), unsafe.Pointer(_p)) _12: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(114) }() return &_err }()) == 0 { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(115) }() @@ -3591,7 +3621,7 @@ _12: goto _12 } crt.Xprintf(tls, str(4217), unsafe.Pointer(func() *int8 { - if (_p.X0) == i32(0) { + if _p.X0 == i32(0) { return str(4241) } return str(4249) @@ -3599,18 +3629,18 @@ _12: crt.Xprintf(tls, str(4257), _p.X1) crt.Xprintf(tls, str(4288), _nInsert) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(125) }() return &_err }(), &_threads) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(126) }() @@ -3629,9 +3659,9 @@ func _checkpoint_starvation_reader(tls *crt.TLS, _iTid int32, _pArg unsafe.Point _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(73) }() @@ -3639,9 +3669,9 @@ func _checkpoint_starvation_reader(tls *crt.TLS, _iTid int32, _pArg unsafe.Point }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(74) }() @@ -3650,18 +3680,18 @@ _2: goto _3 } _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(76) }() return &_err }(), &_db, str(767)) _1_iCount1 = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(77) }() @@ -3669,18 +3699,18 @@ _2: }(), &_db, unsafe.Pointer(str(4325))) crt.Xusleep(tls, uint32(i32(100000))) _1_iCount2 = _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(79) }() return &_err }(), &_db, unsafe.Pointer(str(4325))) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(80) }() @@ -3692,9 +3722,9 @@ _2: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(86) }() @@ -3711,8 +3741,8 @@ _3: func _checkpoint_starvation_walhook(tls *crt.TLS, _pCtx unsafe.Pointer, _db unsafe.Pointer, _zDb *int8, _nFrame int32) (r0 int32) { var _p *bin.Xsqlite3_debug_mutex _p = (*bin.Xsqlite3_debug_mutex)(_pCtx) - if _nFrame > (_p.X1) { - *(*int32)(unsafe.Pointer(&(_p.X1))) = _nFrame + if _nFrame > _p.X1 { + *(*int32)(unsafe.Pointer(&_p.X1)) = _nFrame } if _nFrame >= i32(50) { bin.Xsqlite3_wal_checkpoint_v2(tls, (*bin.Xsqlite3)(_db), _zDb, _p.X0, nil, nil) @@ -3726,7 +3756,7 @@ func _checkpoint_starvation_2(tls *crt.TLS, _nMs int32) { _err = XError{} _ctx = bin.Xsqlite3_debug_mutex{X0: i32(2), X1: i32(0)} _checkpoint_starvation_main(tls, _nMs, &_ctx) - if (_ctx.X1) > i32(60) { + if _ctx.X1 > i32(60) { _test_error_x(tls, &_err, bin.Xsqlite3_mprintf(tls, str(4379), _ctx.X1)) } _print_and_free_err(tls, &_err) @@ -3742,36 +3772,36 @@ func _create_drop_index_1(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(54) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(55) }() return &_err }(), &_db, str(4410)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(60) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(62) }() @@ -3779,54 +3809,54 @@ func _create_drop_index_1(tls *crt.TLS, _nMs int32) { }(), _nMs) bin.Xsqlite3_enable_shared_cache(tls, i32(1)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(65) }() return &_err }(), &_threads, _create_drop_index_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(66) }() return &_err }(), &_threads, _create_drop_index_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(67) }() return &_err }(), &_threads, _create_drop_index_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(68) }() return &_err }(), &_threads, _create_drop_index_thread, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(69) }() return &_err }(), &_threads, _create_drop_index_thread, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(71) }() @@ -3846,27 +3876,27 @@ func _create_drop_index_thread(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) _db = XSqlite{} _0: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(21) }() return &_err }()) == 0 { _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(22) }() return &_err }(), &_db, str(378), i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(24) }() @@ -3874,9 +3904,9 @@ _0: }(), &_db, str(4551)) _clear_error_x(tls, &_err, i32(6)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(42) }() @@ -3900,36 +3930,36 @@ func _lookaside1(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(71) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(72) }() return &_err }(), &_db, str(4924)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(85) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(87) }() @@ -3937,63 +3967,63 @@ func _lookaside1(tls *crt.TLS, _nMs int32) { }(), _nMs) bin.Xsqlite3_enable_shared_cache(tls, i32(1)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(90) }() return &_err }(), &_threads, _lookaside1_thread_reader, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(91) }() return &_err }(), &_threads, _lookaside1_thread_reader, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(92) }() return &_err }(), &_threads, _lookaside1_thread_reader, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(93) }() return &_err }(), &_threads, _lookaside1_thread_reader, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(94) }() return &_err }(), &_threads, _lookaside1_thread_reader, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(95) }() return &_err }(), &_threads, _lookaside1_thread_writer, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(96) }() @@ -4014,9 +4044,9 @@ func _lookaside1_thread_reader(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(25) }() @@ -4024,9 +4054,9 @@ func _lookaside1_thread_reader(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(27) }() @@ -4039,9 +4069,9 @@ _2: _6: if bin.Xsqlite3_step(tls, _1_pStmt) == i32(100) { _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(33) }() @@ -4050,15 +4080,15 @@ _6: goto _6 } _1_rc = bin.Xsqlite3_finalize(tls, _1_pStmt) - if ((_err.X0) == i32(0)) && (_1_rc != i32(0)) { + if (_err.X0 == i32(0)) && (_1_rc != i32(0)) { _sqlite_error(tls, &_err, &_db, str(5324)) } goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(41) }() @@ -4078,9 +4108,9 @@ func _lookaside1_thread_writer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(50) }() @@ -4088,18 +4118,18 @@ func _lookaside1_thread_writer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) }(), &_db, str(378), i32(0)) _2: _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(53) }() return &_err }(), &_db, str(5333)) if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(58) }() @@ -4108,9 +4138,9 @@ _2: goto _2 } _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(60) }() @@ -4132,36 +4162,36 @@ func _vacuum1(tls *crt.TLS, _nMs int32) { _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(72) }() return &_err }(), &_db, str(378), i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(73) }() return &_err }(), &_db, str(5379)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(77) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(79) }() @@ -4169,45 +4199,45 @@ func _vacuum1(tls *crt.TLS, _nMs int32) { }(), _nMs) bin.Xsqlite3_enable_shared_cache(tls, i32(1)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(82) }() return &_err }(), &_threads, _vacuum1_thread_writer, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(83) }() return &_err }(), &_threads, _vacuum1_thread_writer, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(84) }() return &_err }(), &_threads, _vacuum1_thread_writer, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(85) }() return &_err }(), &_threads, _vacuum1_thread_vacuumer, nil) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(86) }() @@ -4227,9 +4257,9 @@ func _vacuum1_thread_writer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(26) }() @@ -4238,9 +4268,9 @@ func _vacuum1_thread_writer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 _i = i64(0) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(29) }() @@ -4248,18 +4278,18 @@ _2: }()) == 0 { _i += 1 _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(33) }() return &_err }(), &_db, unsafe.Pointer(str(5444))) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(39) }() @@ -4267,9 +4297,9 @@ _2: }(), &_db, unsafe.Pointer(str(5579)), unsafe.Pointer(&_i)) _clear_error_x(tls, &_err, i32(6)) _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(43) }() @@ -4279,9 +4309,9 @@ _2: goto _2 } _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(47) }() @@ -4302,9 +4332,9 @@ func _vacuum1_thread_vacuumer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) ( _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(55) }() @@ -4312,9 +4342,9 @@ func _vacuum1_thread_vacuumer(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) ( }(), &_db, str(378), i32(0)) _2: _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(58) }() @@ -4322,9 +4352,9 @@ _2: }(), &_db, str(5639)) _clear_error_x(tls, &_err, i32(6)) if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(60) }() @@ -4333,9 +4363,9 @@ _2: goto _2 } _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(62) }() @@ -4355,9 +4385,9 @@ func _stress1(tls *crt.TLS, _nMs int32) { _err = XError{} _threads = bin.T_ht{} _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(138) }() @@ -4365,99 +4395,99 @@ func _stress1(tls *crt.TLS, _nMs int32) { }(), _nMs) bin.Xsqlite3_enable_shared_cache(tls, i32(1)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(141) }() return &_err }(), &_threads, _stress_thread_1, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(142) }() return &_err }(), &_threads, _stress_thread_1, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(144) }() return &_err }(), &_threads, _stress_thread_2, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(145) }() return &_err }(), &_threads, _stress_thread_2, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(147) }() return &_err }(), &_threads, _stress_thread_3, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(148) }() return &_err }(), &_threads, _stress_thread_3, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(150) }() return &_err }(), &_threads, _stress_thread_4, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(151) }() return &_err }(), &_threads, _stress_thread_4, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(153) }() return &_err }(), &_threads, _stress_thread_5, nil) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(154) }() return &_err }(), &_threads, _stress_thread_5, crt.U2P(uintptr(u32(1)))) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(156) }() @@ -4469,16 +4499,19 @@ func _stress1(tls *crt.TLS, _nMs int32) { _ = _threads } -// Thread 1. CREATE and DROP a table. +// C comment +// /* +// ** Thread 1. CREATE and DROP a table. +// */ func _stress_thread_1(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { var _err XError var _db XSqlite _err = XError{} _db = XSqlite{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(24) }() @@ -4486,18 +4519,18 @@ func _stress_thread_1(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(25) }() return &_err }()) == 0 { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(26) }() @@ -4505,9 +4538,9 @@ _2: }(), &_db, str(5646)) _clear_error_x(tls, &_err, i32(6)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(28) }() @@ -4517,9 +4550,9 @@ _2: goto _2 } _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(31) }() @@ -4533,7 +4566,10 @@ _2: panic(0) } -// Thread 2. Open and close database connections. +// C comment +// /* +// ** Thread 2. Open and close database connections. +// */ func _stress_thread_2(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { var _err XError var _db XSqlite @@ -4541,27 +4577,27 @@ func _stress_thread_2(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 _db = XSqlite{} _0: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(42) }() return &_err }()) == 0 { _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(43) }() return &_err }(), &_db, str(378), i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(44) }() @@ -4569,9 +4605,9 @@ _0: }(), &_db, str(5718)) _clear_error_x(tls, &_err, i32(6)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(46) }() @@ -4587,7 +4623,10 @@ _0: panic(0) } -// Thread 3. Attempt many small SELECT statements. +// C comment +// /* +// ** Thread 3. Attempt many small SELECT statements. +// */ func _stress_thread_3(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { var _i1, _i2 int32 var _err XError @@ -4597,9 +4636,9 @@ func _stress_thread_3(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 _i1 = i32(0) _i2 = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(62) }() @@ -4607,9 +4646,9 @@ func _stress_thread_3(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(63) }() @@ -4618,16 +4657,16 @@ _2: goto _3 } _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(64) }() return &_err }(), &_db, str(5747)) _i1 += 1 - if (_err.X0) != 0 { + if _err.X0 != 0 { _i2 += 1 } _clear_error_x(tls, &_err, i32(6)) @@ -4635,9 +4674,9 @@ _2: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(70) }() @@ -4651,7 +4690,10 @@ _3: panic(0) } -// Thread 5. Attempt INSERT statements. +// C comment +// /* +// ** Thread 5. Attempt INSERT statements. +// */ func _stress_thread_4(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { var _i1, _i2, _iArg int32 var _err XError @@ -4662,9 +4704,9 @@ func _stress_thread_4(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 _i2 = i32(0) _iArg = int32(int64(crt.P2U(_pArg))) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(85) }() @@ -4672,9 +4714,9 @@ func _stress_thread_4(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(86) }() @@ -4684,18 +4726,18 @@ _2: } if _iArg != 0 { _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(88) }() return &_err }(), &_db) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(89) }() @@ -4703,16 +4745,16 @@ _2: }(), &_db, str(378), i32(0)) } _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(91) }() return &_err }(), &_db, str(5799)) _i1 += 1 - if (_err.X0) != 0 { + if _err.X0 != 0 { _i2 += 1 } _clear_error_x(tls, &_err, i32(6)) @@ -4720,9 +4762,9 @@ _2: goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(100) }() @@ -4736,7 +4778,10 @@ _3: panic(0) } -// Thread 6. Attempt DELETE operations. +// C comment +// /* +// ** Thread 6. Attempt DELETE operations. +// */ func _stress_thread_5(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { var _iArg, _i1, _i2 int32 var _1_i int64 @@ -4748,9 +4793,9 @@ func _stress_thread_5(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 _i1 = i32(0) _i2 = i32(0) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(116) }() @@ -4758,9 +4803,9 @@ func _stress_thread_5(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8 }(), &_db, str(378), i32(0)) _2: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(117) }() @@ -4771,18 +4816,18 @@ _2: _1_i = int64(_i1 % i32(4)) if _iArg != 0 { _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(120) }() return &_err }(), &_db) _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(121) }() @@ -4790,25 +4835,25 @@ _2: }(), &_db, str(378), i32(0)) } _execsql_i64_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(123) }() return &_err }(), &_db, unsafe.Pointer(str(5946)), unsafe.Pointer(&_1_i)) _i1 += 1 - if (_err.X0) != 0 { + if _err.X0 != 0 { _i2 += 1 } _clear_error_x(tls, &_err, i32(6)) goto _2 _3: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(128) }() @@ -4831,80 +4876,93 @@ func _stress2(tls *crt.TLS, _nMs int32) { var _db XSqlite var _aTask [13]TStress2Task _aTask = [13]TStress2Task{} - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(0)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload1})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(1)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload2})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(2)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload3})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(3)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload4})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(4)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload5})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(5)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload6})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(6)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload7})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(7)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload8})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(8)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload9})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(9)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload10})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(10)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload11})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(11)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload14})) - *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(i32(12)))).X0))) = *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, *XError, *XSqlite, int32) - }{_stress2_workload17})) + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(0)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload1 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(1)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload2 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(2)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload3 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(3)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload4 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(4)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload5 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(5)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload6 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(6)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload7 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(7)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload8 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(8)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload9 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(9)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload10 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(10)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload11 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(11)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload14 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() + *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&((*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(i32(12)))).X0))) = func() func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) { + v := _stress2_workload17 + return *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&v)) + }() _zDb = str(378) _err = XError{} _db = XSqlite{} _threads = bin.T_ht{} _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(345) }() return &_err }(), &_db, _zDb, i32(1)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(346) }() return &_err }(), &_db, str(6014)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(350) }() return &_err }(), &_db) _setstoptime_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(352) }() @@ -4916,34 +4974,35 @@ _8: if uint64(_i) >= u64(13) { goto _11 } - _stress2_launch_thread_loop(tls, &_err, &_threads, _zDb, *(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) - }{((*TStress2Task)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aTask)) + 8*uintptr(_i))).X0)}))) + _stress2_launch_thread_loop(tls, &_err, &_threads, _zDb, func() func(*crt.TLS, *XError, *XSqlite, int32) { + v := (*TStress2Task)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aTask)) + 8*uintptr(_i))).X0 + return *(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer(&v)) + }()) _i += 1 goto _8 _11: _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(358) }() return &_err - }(), &_threads, _stress2_workload19, (unsafe.Pointer)(_zDb)) + }(), &_threads, _stress2_workload19, unsafe.Pointer(_zDb)) _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(359) }() return &_err - }(), &_threads, _stress2_workload19, (unsafe.Pointer)(_zDb)) + }(), &_threads, _stress2_workload19, unsafe.Pointer(_zDb)) _join_all_threads_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(361) }() @@ -4961,9 +5020,9 @@ func _stress2_workload1(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { var _iTab int32 _iTab = (_i % i32(4)) + i32(1) _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(193) }() @@ -4975,10 +5034,10 @@ func _sql_script_printf_x(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _zFormat * var _1_zSql *int8 var _ap []interface{} _ap = args - if (_pErr.X0) == i32(0) { + if _pErr.X0 == i32(0) { _1_zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) - *(*int32)(unsafe.Pointer(&(_pErr.X0))) = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_pDb.X0), _1_zSql, nil, nil, (**int8)(unsafe.Pointer(&(_pErr.X2)))) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_zSql)) + *(*int32)(unsafe.Pointer(&_pErr.X0)) = bin.Xsqlite3_exec(tls, (*bin.Xsqlite3)(_pDb.X0), _1_zSql, nil, nil, (**int8)(unsafe.Pointer(&_pErr.X2))) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_zSql)) } _ap = nil } @@ -4987,9 +5046,9 @@ func _stress2_workload2(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { var _iTab int32 _iTab = (_i % i32(4)) + i32(1) _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(200) }() @@ -4999,9 +5058,9 @@ func _stress2_workload2(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload3(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(204) }() @@ -5011,9 +5070,9 @@ func _stress2_workload3(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload4(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(208) }() @@ -5023,9 +5082,9 @@ func _stress2_workload4(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload5(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(212) }() @@ -5035,9 +5094,9 @@ func _stress2_workload5(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload6(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(218) }() @@ -5047,9 +5106,9 @@ func _stress2_workload6(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload7(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(224) }() @@ -5059,9 +5118,9 @@ func _stress2_workload7(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload8(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(231) }() @@ -5071,9 +5130,9 @@ func _stress2_workload8(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload9(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(239) }() @@ -5083,9 +5142,9 @@ func _stress2_workload9(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload10(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(244) }() @@ -5095,9 +5154,9 @@ func _stress2_workload10(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload11(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(250) }() @@ -5107,9 +5166,9 @@ func _stress2_workload11(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload14(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(254) }() @@ -5119,9 +5178,9 @@ func _stress2_workload14(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_workload17(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { _sql_script_printf_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(258) }() @@ -5137,17 +5196,17 @@ func _stress2_workload17(tls *crt.TLS, _pErr *XError, _pDb *XSqlite, _i int32) { func _stress2_launch_thread_loop(tls *crt.TLS, _pErr *XError, _pThreads *bin.T_ht, _zDb *int8, _x func(*crt.TLS, *XError, *XSqlite, int32)) { var _pCtx *XStress2Ctx _pCtx = (*XStress2Ctx)(bin.Xsqlite3_malloc(tls, int32(u64(16)))) - *(**int8)(unsafe.Pointer(&(_pCtx.X0))) = _zDb - *(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&(_pCtx.X1))))) = _x + *(**int8)(unsafe.Pointer(&_pCtx.X0)) = _zDb + *(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&_pCtx.X1)))) = _x _launch_thread_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_pErr.X1))) = func() int32 { - if (_pErr.X0) != 0 { - return (_pErr.X1) + *(*int32)(unsafe.Pointer(&_pErr.X1)) = func() int32 { + if _pErr.X0 != 0 { + return _pErr.X1 } return i32(316) }() return _pErr - }(), _pThreads, _stress2_thread_wrapper, (unsafe.Pointer)(_pCtx)) + }(), _pThreads, _stress2_thread_wrapper, unsafe.Pointer(_pCtx)) } func _stress2_thread_wrapper(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *int8) { @@ -5162,9 +5221,9 @@ func _stress2_thread_wrapper(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r _i2 = i32(0) _0: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(291) }() @@ -5173,9 +5232,9 @@ _0: goto _1 } _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(293) }() @@ -5183,15 +5242,16 @@ _0: }(), &_db, _pCtx.X0, i32(0)) _1_cnt = i32(0) _6: - if (_err.X0) != i32(0) || _1_cnt >= i32(5) { + if _err.X0 != i32(0) || _1_cnt >= i32(5) { goto _10 } - (*(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) - }{(_pCtx.X1)})))(tls, &_err, &_db, _i1) + func() func(*crt.TLS, *XError, *XSqlite, int32) { + v := _pCtx.X1 + return *(*func(*crt.TLS, *XError, *XSqlite, int32))(unsafe.Pointer(&v)) + }()(tls, &_err, &_db, _i1) { p := &_i2 - *p = (*p) + bool2int((_err.X0) == i32(0)) + *p = (*p) + bool2int(_err.X0 == i32(0)) sink3(*p) } _clear_error_x(tls, &_err, i32(6)) @@ -5200,9 +5260,9 @@ _6: goto _6 _10: _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(300) }() @@ -5227,27 +5287,27 @@ func _stress2_workload19(tls *crt.TLS, _iTid int32, _pArg unsafe.Pointer) (r0 *i _zDb = (*int8)(_pArg) _0: if _timetostop_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(267) }() return &_err }()) == 0 { _opendb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(268) }() return &_err }(), &_db, _zDb, i32(0)) _sql_script_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(269) }() @@ -5255,9 +5315,9 @@ _0: }(), &_db, str(5718)) _clear_error_x(tls, &_err, i32(6)) _closedb_x(tls, func() *XError { - *(*int32)(unsafe.Pointer(&(_err.X1))) = func() int32 { - if (_err.X0) != 0 { - return (_err.X1) + *(*int32)(unsafe.Pointer(&_err.X1)) = func() int32 { + if _err.X0 != 0 { + return _err.X1 } return i32(271) }() @@ -5279,21 +5339,25 @@ func init() { _mainØ00substArgvØ001 = [3]*int8{nil, str(6701), nil} } -// ************************* Public Interfaces **************************** - -// CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize() -// -// Use the VFS named zOrigVfsName as the VFS that does the actual work. -// Use the default if zOrigVfsName==NULL. -// -// The multiplex VFS shim is named "multiplex". It will become the default -// VFS if makeDefault is non-zero. -// -// THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once -// during start-up. +// C comment +// /************************** Public Interfaces *****************************/ + +// C comment +// /* +// ** CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize() +// ** +// ** Use the VFS named zOrigVfsName as the VFS that does the actual work. +// ** Use the default if zOrigVfsName==NULL. +// ** +// ** The multiplex VFS shim is named "multiplex". It will become the default +// ** VFS if makeDefault is non-zero. +// ** +// ** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once +// ** during start-up. +// */ func Xsqlite3_multiplex_initialize(tls *crt.TLS, _zOrigVfsName *int8, _makeDefault int32) (r0 int32) { var _pOrigVfs *bin.Xsqlite3_vfs - if (_gMultiplex.X4) != 0 { + if _gMultiplex.X4 != 0 { return i32(21) } _pOrigVfs = bin.Xsqlite3_vfs_find(tls, _zOrigVfsName) @@ -5301,56 +5365,54 @@ func Xsqlite3_multiplex_initialize(tls *crt.TLS, _zOrigVfsName *int8, _makeDefau return i32(1) } func() { - if _pOrigVfs == (*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))) { + if _pOrigVfs == (*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)) { crt.X__builtin_fprintf(tls, Xstderr, str(991), unsafe.Pointer(str(6703)), i32(1099), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_multiplex_initializeØ00__func__Ø000))), unsafe.Pointer(str(6763))) crt.X__builtin_abort(tls) } }() - *(*int32)(unsafe.Pointer(&(_gMultiplex.X4))) = i32(1) - *(**bin.Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_gMultiplex.X0))))) = _pOrigVfs - *(*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))) = *_pOrigVfs + *(*int32)(unsafe.Pointer(&_gMultiplex.X4)) = i32(1) + *(**bin.Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_gMultiplex.X0)))) = _pOrigVfs + *(*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)) = *_pOrigVfs { - p := (*int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X1))) + p := (*int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X1))) *p = int32(uint64(*p) + u64(16)) sink3(*p) } - *(**int8)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X4))) = str(6794) - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, *bin.Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X6))))) = _multiplexOpen - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X7))))) = _multiplexDelete - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X8))))) = _multiplexAccess - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X9))))) = _multiplexFullPathname - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X10))))) = _multiplexDlOpen - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X11))))) = _multiplexDlError - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X12))))) = _multiplexDlSym - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X13))))) = _multiplexDlClose - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X14))))) = _multiplexRandomness - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X15))))) = _multiplexSleep - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X16))))) = _multiplexCurrentTime - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X17))))) = _multiplexGetLastError - *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))).X18))))) = _multiplexCurrentTimeInt64 - *(*int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X0))) = i32(1) - *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X1))))) = _multiplexClose - *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X2))))) = _multiplexRead - *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X3))))) = _multiplexWrite - *(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X4))))) = _multiplexTruncate - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X5))))) = _multiplexSync - *(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X6))))) = _multiplexFileSize - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X7))))) = _multiplexLock - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X8))))) = _multiplexUnlock - *(*func(*crt.TLS, *bin.Xsqlite3_file, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X9))))) = _multiplexCheckReservedLock - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X10))))) = _multiplexFileControl - *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X11))))) = _multiplexSectorSize - *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))).X12))))) = _multiplexDeviceCharacteristics - *(*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))) = _gMultiplex.X2 - *(*int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))).X0))) = i32(2) - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))).X13))))) = _multiplexShmMap - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))).X14))))) = _multiplexShmLock - *(*func(*crt.TLS, *bin.Xsqlite3_file))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))).X15))))) = _multiplexShmBarrier - *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))).X16))))) = _multiplexShmUnmap - bin.Xsqlite3_vfs_register(tls, (*bin.Xsqlite3_vfs)(unsafe.Pointer(&(_gMultiplex.X1))), _makeDefault) - bin.Xsqlite3_auto_extension(tls, *(*func(*crt.TLS))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, **int8, *bin.Xsqlite3_api_routines) int32 - }{_multiplexFuncInit}))) + *(**int8)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X4))) = str(6794) + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, *bin.Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X6))))) = _multiplexOpen + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X7))))) = _multiplexDelete + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X8))))) = _multiplexAccess + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X9))))) = _multiplexFullPathname + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X10))))) = _multiplexDlOpen + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X11))))) = _multiplexDlError + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X12))))) = _multiplexDlSym + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X13))))) = _multiplexDlClose + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X14))))) = _multiplexRandomness + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X15))))) = _multiplexSleep + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X16))))) = _multiplexCurrentTime + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X17))))) = _multiplexGetLastError + *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)).X18))))) = _multiplexCurrentTimeInt64 + *(*int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X0))) = i32(1) + *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X1))))) = _multiplexClose + *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X2))))) = _multiplexRead + *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X3))))) = _multiplexWrite + *(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X4))))) = _multiplexTruncate + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X5))))) = _multiplexSync + *(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X6))))) = _multiplexFileSize + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X7))))) = _multiplexLock + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X8))))) = _multiplexUnlock + *(*func(*crt.TLS, *bin.Xsqlite3_file, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X9))))) = _multiplexCheckReservedLock + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X10))))) = _multiplexFileControl + *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X11))))) = _multiplexSectorSize + *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)).X12))))) = _multiplexDeviceCharacteristics + *(*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)) = _gMultiplex.X2 + *(*int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)).X0))) = i32(2) + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)).X13))))) = _multiplexShmMap + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)).X14))))) = _multiplexShmLock + *(*func(*crt.TLS, *bin.Xsqlite3_file))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)).X15))))) = _multiplexShmBarrier + *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)).X16))))) = _multiplexShmUnmap + bin.Xsqlite3_vfs_register(tls, (*bin.Xsqlite3_vfs)(unsafe.Pointer(&_gMultiplex.X1)), _makeDefault) + bin.Xsqlite3_auto_extension(tls, func() func(*crt.TLS) { v := _multiplexFuncInit; return *(*func(*crt.TLS))(unsafe.Pointer(&v)) }()) return i32(0) } @@ -5362,11 +5424,14 @@ func init() { crt.Xstrncpy(nil, &_sqlite3_multiplex_initializeØ00__func__Ø000[0], str(6804), 29) } -// This is the xOpen method used for the "multiplex" VFS. -// -// Most of the work is done by the underlying original VFS. This method -// simply links the new file into the appropriate multiplex group if it is a -// file that needs to be tracked. +// C comment +// /* +// ** This is the xOpen method used for the "multiplex" VFS. +// ** +// ** Most of the work is done by the underlying original VFS. This method +// ** simply links the new file into the appropriate multiplex group if it is a +// ** file that needs to be tracked. +// */ func _multiplexOpen(tls *crt.TLS, _pVfs *bin.Xsqlite3_vfs, _zName *int8, _pConn *bin.Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) { var _rc, _nName, _sz, _9_bExists, _12_iChunk int32 var _8_sz64 int64 @@ -5383,7 +5448,7 @@ func _multiplexOpen(tls *crt.TLS, _pVfs *bin.Xsqlite3_vfs, _zName *int8, _pConn _sz = i32(0) _zToFree = nil - crt.Xmemset(tls, (unsafe.Pointer)(_pConn), i32(0), uint64(_pVfs.X1)) + crt.Xmemset(tls, unsafe.Pointer(_pConn), i32(0), uint64(_pVfs.X1)) func() { if _zName == nil && (_flags&i32(8)) == 0 { crt.X__builtin_fprintf(tls, Xstderr, str(991), unsafe.Pointer(str(6703)), i32(484), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiplexOpenØ00__func__Ø000))), unsafe.Pointer(str(6833))) @@ -5415,32 +5480,32 @@ _3: } return nil }() - crt.Xmemset(tls, (unsafe.Pointer)(_pGroup), i32(0), uint64(_sz)) - *(**XmultiplexGroup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMultiplexOpen.X1))))) = _pGroup - *(*uint8)(unsafe.Pointer(&(_pGroup.X6))) = u8(255) - *(*uint8)(unsafe.Pointer(&(_pGroup.X7))) = uint8(bin.Xsqlite3_uri_boolean(tls, _3_zUri, str(6878), bool2int((_flags&i32(256)) == i32(0)))) - *(*uint32)(unsafe.Pointer(&(_pGroup.X5))) = uint32(int32(bin.Xsqlite3_uri_int64(tls, _3_zUri, str(6887), int64(i32(2147418112))))) - *(*uint32)(unsafe.Pointer(&(_pGroup.X5))) = ((_pGroup.X5) + uint32(i32(65535))) & uint32(i32(-65536)) + crt.Xmemset(tls, unsafe.Pointer(_pGroup), i32(0), uint64(_sz)) + *(**XmultiplexGroup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pMultiplexOpen.X1)))) = _pGroup + *(*uint8)(unsafe.Pointer(&_pGroup.X6)) = u8(255) + *(*uint8)(unsafe.Pointer(&_pGroup.X7)) = uint8(bin.Xsqlite3_uri_boolean(tls, _3_zUri, str(6878), bool2int((_flags&i32(256)) == i32(0)))) + *(*uint32)(unsafe.Pointer(&_pGroup.X5)) = uint32(int32(bin.Xsqlite3_uri_int64(tls, _3_zUri, str(6887), int64(i32(2147418112))))) + *(*uint32)(unsafe.Pointer(&_pGroup.X5)) = (_pGroup.X5 + uint32(i32(65535))) & uint32(i32(-65536)) if _zName != nil { - _4_p = (*int8)(unsafe.Pointer((*XmultiplexGroup)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pGroup)) + 40*uintptr(i32(1)))))) - *(**int8)(unsafe.Pointer(&(_pGroup.X2))) = _4_p - crt.Xmemcpy(tls, (unsafe.Pointer)(_pGroup.X2), (unsafe.Pointer)(_zName), uint64(_nName+i32(1))) - *(*int32)(unsafe.Pointer(&(_pGroup.X3))) = _nName + _4_p = (*int8)(unsafe.Pointer((*XmultiplexGroup)(unsafe.Pointer(uintptr(unsafe.Pointer(_pGroup)) + 40*uintptr(i32(1)))))) + *(**int8)(unsafe.Pointer(&_pGroup.X2)) = _4_p + crt.Xmemcpy(tls, unsafe.Pointer(_pGroup.X2), unsafe.Pointer(_zName), uint64(_nName+i32(1))) + *(*int32)(unsafe.Pointer(&_pGroup.X3)) = _nName } - if (_pGroup.X6) == 0 { + if _pGroup.X6 == 0 { goto _11 } _12: - if (uint32(bin.Xsqlite3PendingByte()) % (_pGroup.X5)) >= ((_pGroup.X5) - uint32(i32(65536))) { + if (uint32(bin.Xsqlite3PendingByte()) % _pGroup.X5) >= (_pGroup.X5 - uint32(i32(65536))) { { - p := (*uint32)(unsafe.Pointer(&(_pGroup.X5))) + p := (*uint32)(unsafe.Pointer(&_pGroup.X5)) *p = (*p) + uint32(i32(65536)) sink0(*p) } goto _12 } _11: - *(*int32)(unsafe.Pointer(&(_pGroup.X4))) = _flags + *(*int32)(unsafe.Pointer(&_pGroup.X4)) = _flags _rc = _multiplexSubFilename(tls, _pGroup, i32(1)) if _rc != i32(0) { goto _14 @@ -5453,14 +5518,15 @@ _14: if _rc != i32(0) { goto _17 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X6)})))(tls, _pSubOpen, &_8_sz64) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X6 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, &_8_sz64) if _rc != i32(0) || _zName == nil { goto _19 } if (_flags & i32(16384)) != 0 { - *(*uint8)(unsafe.Pointer(&(_pGroup.X6))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pGroup.X6)) = uint8(i32(0)) goto _29 } if _8_sz64 != int64(i32(0)) { @@ -5471,15 +5537,17 @@ _14: } _12_iChunk = i32(1) _24: - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pOrigVfs.X8)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_12_iChunk))).X1, i32(0), &_9_bExists) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pOrigVfs.X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_12_iChunk))).X1, i32(0), &_9_bExists) if _rc != i32(0) || _9_bExists == 0 { goto _26 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pOrigVfs.X7)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_12_iChunk))).X1, i32(0)) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32 { + v := _pOrigVfs.X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_12_iChunk))).X1, i32(0)) if _rc == i32(0) { _rc = _multiplexSubFilename(tls, _pGroup, preInc3(&_12_iChunk, 1)) } @@ -5490,16 +5558,17 @@ _26: _23: goto _29 _22: - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pOrigVfs.X8)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(i32(1)))).X1, i32(0), &_9_bExists) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pOrigVfs.X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(i32(1)))).X1, i32(0), &_9_bExists) _9_bExists = bool2int(_multiplexSubSize(tls, _pGroup, i32(1), &_rc) > int64(i32(0))) if ((((_rc == i32(0)) && _9_bExists != 0) && (_8_sz64 == (_8_sz64 & int64(u32(4294901760))))) && (_8_sz64 > int64(i32(0)))) && (_8_sz64 != int64(_pGroup.X5)) { - *(*uint32)(unsafe.Pointer(&(_pGroup.X5))) = uint32(int32(_8_sz64)) + *(*uint32)(unsafe.Pointer(&_pGroup.X5)) = uint32(int32(_8_sz64)) goto _38 } if ((_rc == i32(0)) && (_9_bExists == 0)) && (_8_sz64 > int64(_pGroup.X5)) { - *(*uint8)(unsafe.Pointer(&(_pGroup.X6))) = uint8(i32(0)) + *(*uint8)(unsafe.Pointer(&_pGroup.X6)) = uint8(i32(0)) } _38: _29: @@ -5509,18 +5578,18 @@ _17: goto _39 } if ((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X0) == i32(1) { - *(**bin.Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_file)(unsafe.Pointer(&(_pMultiplexOpen.X0))).X0))))) = (*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X2))) + *(**bin.Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_file)(unsafe.Pointer(&_pMultiplexOpen.X0)).X0))))) = (*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X2)) goto _41 } - *(**bin.Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_file)(unsafe.Pointer(&(_pMultiplexOpen.X0))).X0))))) = (*bin.Xsqlite3_io_methods)(unsafe.Pointer(&(_gMultiplex.X3))) + *(**bin.Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.Xsqlite3_file)(unsafe.Pointer(&_pMultiplexOpen.X0)).X0))))) = (*bin.Xsqlite3_io_methods)(unsafe.Pointer(&_gMultiplex.X3)) _41: goto _42 _39: _multiplexFreeComponents(tls, _pGroup) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pGroup)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pGroup)) _42: _7: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zToFree)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zToFree)) return _rc } @@ -5530,14 +5599,18 @@ func init() { crt.Xstrncpy(nil, &_multiplexOpenØ00__func__Ø000[0], str(6897), 14) } -// ************************ Utility Routines ******************************** +// C comment +// /************************* Utility Routines *********************************/ -// Compute a string length that is limited to what can be stored in -// lower 30 bits of a 32-bit signed integer. -// -// The value returned will never be negative. Nor will it ever be greater -// than the actual length of the string. For very long strings (greater -// than 1GiB) the value returned might be less than the true string length. +// C comment +// /* +// ** Compute a string length that is limited to what can be stored in +// ** lower 30 bits of a 32-bit signed integer. +// ** +// ** The value returned will never be negative. Nor will it ever be greater +// ** than the actual length of the string. For very long strings (greater +// ** than 1GiB) the value returned might be less than the true string length. +// */ func _multiplexStrlen30(tls *crt.TLS, _z *int8) (r0 int32) { var _z2 *int8 _z2 = _z @@ -5552,23 +5625,25 @@ _0: return i32(1073741823) & int32(int64((uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))/1)) } -// Compute the filename for the iChunk-th chunk +// C comment +// /* Compute the filename for the iChunk-th chunk +// */ func _multiplexSubFilename(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32) (r0 int32) { var _3_n int32 var _3_z *int8 var _1_p *bin.XanalysisInfo - if _iChunk < (_pGroup.X1) { + if _iChunk < _pGroup.X1 { goto _0 } _1_p = (*bin.XanalysisInfo)(bin.Xsqlite3_realloc64(tls, _pGroup.X0, uint64(_iChunk+i32(1))*u64(16))) if _1_p == nil { return i32(7) } - crt.Xmemset(tls, (unsafe.Pointer)((*bin.XanalysisInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_p))+16*uintptr(_pGroup.X1)))), i32(0), u64(16)*uint64((_iChunk+i32(1))-(_pGroup.X1))) - *(**bin.XanalysisInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pGroup.X0))))) = _1_p - *(*int32)(unsafe.Pointer(&(_pGroup.X1))) = _iChunk + i32(1) + crt.Xmemset(tls, unsafe.Pointer((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_p))+16*uintptr(_pGroup.X1)))), i32(0), u64(16)*uint64((_iChunk+i32(1))-_pGroup.X1)) + *(**bin.XanalysisInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pGroup.X0)))) = _1_p + *(*int32)(unsafe.Pointer(&_pGroup.X1)) = _iChunk + i32(1) _0: - if (_pGroup.X2) == nil || ((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1) != nil { + if _pGroup.X2 == nil || ((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1) != nil { goto _3 } _3_n = _pGroup.X3 @@ -5581,35 +5656,38 @@ _3: return i32(0) } -// Generate the file-name for chunk iChunk of the group with base name -// zBase. The file-name is written to buffer zOut before returning. Buffer -// zOut must be allocated by the caller so that it is at least (nBase+5) -// bytes in size, where nBase is the length of zBase, not including the -// nul-terminator. -// -// If iChunk is 0 (or 400 - the number for the first journal file chunk), -// the output is a copy of the input string. Otherwise, if -// SQLITE_ENABLE_8_3_NAMES is not defined or the input buffer does not contain -// a "." character, then the output is a copy of the input string with the -// three-digit zero-padded decimal representation if iChunk appended to it. -// For example: -// -// zBase="test.db", iChunk=4 -> zOut="test.db004" -// -// Or, if SQLITE_ENABLE_8_3_NAMES is defined and the input buffer contains -// a "." character, then everything after the "." is replaced by the -// three-digit representation of iChunk. -// -// zBase="test.db", iChunk=4 -> zOut="test.004" -// -// The output buffer string is terminated by 2 0x00 bytes. This makes it safe -// to pass to sqlite3_uri_parameter() and similar. +// C comment +// /* +// ** Generate the file-name for chunk iChunk of the group with base name +// ** zBase. The file-name is written to buffer zOut before returning. Buffer +// ** zOut must be allocated by the caller so that it is at least (nBase+5) +// ** bytes in size, where nBase is the length of zBase, not including the +// ** nul-terminator. +// ** +// ** If iChunk is 0 (or 400 - the number for the first journal file chunk), +// ** the output is a copy of the input string. Otherwise, if +// ** SQLITE_ENABLE_8_3_NAMES is not defined or the input buffer does not contain +// ** a "." character, then the output is a copy of the input string with the +// ** three-digit zero-padded decimal representation if iChunk appended to it. +// ** For example: +// ** +// ** zBase="test.db", iChunk=4 -> zOut="test.db004" +// ** +// ** Or, if SQLITE_ENABLE_8_3_NAMES is defined and the input buffer contains +// ** a "." character, then everything after the "." is replaced by the +// ** three-digit representation of iChunk. +// ** +// ** zBase="test.db", iChunk=4 -> zOut="test.004" +// ** +// ** The output buffer string is terminated by 2 0x00 bytes. This makes it safe +// ** to pass to sqlite3_uri_parameter() and similar. +// */ func _multiplexFilename(tls *crt.TLS, _zBase *int8, _nBase int32, _flags int32, _iChunk int32, _zOut *int8) { var _n int32 _n = _nBase - crt.Xmemcpy(tls, (unsafe.Pointer)(_zOut), (unsafe.Pointer)(_zBase), uint64(_n+i32(1))) + crt.Xmemcpy(tls, unsafe.Pointer(_zOut), unsafe.Pointer(_zBase), uint64(_n+i32(1))) if (_iChunk != i32(0)) && (_iChunk <= i32(299)) { - bin.Xsqlite3_snprintf(tls, i32(4), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_n))), str(6911), _iChunk) + bin.Xsqlite3_snprintf(tls, i32(4), (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut))+1*uintptr(_n))), str(6911), _iChunk) { p := &_n *p = (*p) + i32(3) @@ -5617,12 +5695,12 @@ func _multiplexFilename(tls *crt.TLS, _zBase *int8, _nBase int32, _flags int32, } } func() { - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_n)))) != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_n)))) != i32(0) { crt.X__builtin_fprintf(tls, Xstderr, str(991), unsafe.Pointer(str(6703)), i32(250), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiplexFilenameØ00__func__Ø000))), unsafe.Pointer(str(6916))) crt.X__builtin_abort(tls) } }() - *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_n+i32(1)))) = int8(i32(0)) + *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zOut)) + 1*uintptr(_n+i32(1)))) = int8(i32(0)) } var _multiplexFilenameØ00__func__Ø000 [18]int8 @@ -5631,12 +5709,14 @@ func init() { crt.Xstrncpy(nil, &_multiplexFilenameØ00__func__Ø000[0], str(6930), 18) } -// Translate an sqlite3_file* that is really a multiplexGroup* into -// the sqlite3_file* for the underlying original VFS. -// -// For chunk 0, the pGroup->flags determines whether or not a new file -// is created if it does not already exist. For chunks 1 and higher, the -// file is created only if createFlag is 1. +// C comment +// /* Translate an sqlite3_file* that is really a multiplexGroup* into +// ** the sqlite3_file* for the underlying original VFS. +// ** +// ** For chunk 0, the pGroup->flags determines whether or not a new file +// ** is created if it does not already exist. For chunks 1 and higher, the +// ** file is created only if createFlag is 1. +// */ func _multiplexSubOpen(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32, _rc *int32, _pOutFlags *int32, _createFlag int32) (r0 *bin.Xsqlite3_file) { var _1_flags, _1_bExists int32 var _pSubOpen *bin.Xsqlite3_file @@ -5662,9 +5742,10 @@ func _multiplexSubOpen(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32, _r if ((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_iChunk))).X1) == nil { return nil } - *_rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pOrigVfs.X8)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, i32(0), &_1_bExists) + *_rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pOrigVfs.X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, i32(0), &_1_bExists) if (*_rc) == 0 && _1_bExists != 0 { goto _9 } @@ -5686,12 +5767,13 @@ _7: return nil } *(**bin.Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_iChunk))).X0))))) = _pSubOpen - *_rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, *bin.Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32 - }{(_pOrigVfs.X6)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, _pSubOpen, _1_flags, _pOutFlags) + *_rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, *bin.Xsqlite3_file, int32, *int32) int32 { + v := _pOrigVfs.X6 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, *bin.Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, _pSubOpen, _1_flags, _pOutFlags) if (*_rc) != i32(0) { bin.Xsqlite3_log(tls, *_rc, str(6982), unsafe.Pointer((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pSubOpen)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pSubOpen)) *(**bin.Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_iChunk))).X0))))) = nil return nil } @@ -5699,9 +5781,12 @@ _1: return _pSubOpen } -// Return the size, in bytes, of chunk number iChunk. If that chunk -// does not exist, then return 0. This function does not distingish between -// non-existant files and zero-length files. +// C comment +// /* +// ** Return the size, in bytes, of chunk number iChunk. If that chunk +// ** does not exist, then return 0. This function does not distingish between +// ** non-existant files and zero-length files. +// */ func _multiplexSubSize(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32, _rc *int32) (r0 int64) { var _sz int64 var _pSub *bin.Xsqlite3_file @@ -5713,18 +5798,22 @@ func _multiplexSubSize(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32, _r if _pSub == nil { return int64(i32(0)) } - *_rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{((*bin.Xsqlite3_io_methods)(_pSub.X0).X6)})))(tls, _pSub, &_sz) + *_rc = func() func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSub.X0).X6 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _pSub, &_sz) return _sz } -// Deallocate memory held by a multiplexGroup +// C comment +// /* +// ** Deallocate memory held by a multiplexGroup +// */ func _multiplexFreeComponents(tls *crt.TLS, _pGroup *XmultiplexGroup) { var _i int32 _i = i32(0) _0: - if _i >= (_pGroup.X1) { + if _i >= _pGroup.X1 { goto _3 } _multiplexSubClose(tls, _pGroup, _i, nil) @@ -5732,41 +5821,50 @@ _0: goto _0 _3: bin.Xsqlite3_free(tls, _pGroup.X0) - *(**bin.XanalysisInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pGroup.X0))))) = nil - *(*int32)(unsafe.Pointer(&(_pGroup.X1))) = i32(0) + *(**bin.XanalysisInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_pGroup.X0)))) = nil + *(*int32)(unsafe.Pointer(&_pGroup.X1)) = i32(0) } -// Close a single sub-file in the connection group. +// C comment +// /* +// ** Close a single sub-file in the connection group. +// */ func _multiplexSubClose(tls *crt.TLS, _pGroup *XmultiplexGroup, _iChunk int32, _pOrigVfs *bin.Xsqlite3_vfs) { var _pSubOpen *bin.Xsqlite3_file _pSubOpen = (*bin.Xsqlite3_file)((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_iChunk))).X0) if _pSubOpen == nil { goto _0 } - (*(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X1)})))(tls, _pSubOpen) + func() func(*crt.TLS, *bin.Xsqlite3_file) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X1 + return *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen) if (_pOrigVfs != nil) && (((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_iChunk))).X1) != nil) { - (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pOrigVfs.X7)})))(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, i32(0)) + func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32 { + v := _pOrigVfs.X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1, i32(0)) } bin.Xsqlite3_free(tls, (*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X0) _0: - bin.Xsqlite3_free(tls, (unsafe.Pointer)((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1)) - crt.Xmemset(tls, (unsafe.Pointer)((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk)))), i32(0), u64(16)) + bin.Xsqlite3_free(tls, unsafe.Pointer((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk))).X1)) + crt.Xmemset(tls, unsafe.Pointer((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0)+16*uintptr(_iChunk)))), i32(0), u64(16)) } -// This is the xDelete method used for the "multiplex" VFS. -// It attempts to delete the filename specified. +// C comment +// /* +// ** This is the xDelete method used for the "multiplex" VFS. +// ** It attempts to delete the filename specified. +// */ func _multiplexDelete(tls *crt.TLS, _pVfs *bin.Xsqlite3_vfs, _zName *int8, _syncDir int32) (r0 int32) { var _rc, _1_nName, _3_iChunk, _3_bExists int32 var _1_z *int8 var _pOrigVfs *bin.Xsqlite3_vfs _pOrigVfs = (*bin.Xsqlite3_vfs)(_gMultiplex.X0) - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pOrigVfs.X7)})))(tls, _pOrigVfs, _zName, _syncDir) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32 { + v := _pOrigVfs.X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, _zName, _syncDir) if _rc != i32(0) { goto _0 } @@ -5779,18 +5877,20 @@ func _multiplexDelete(tls *crt.TLS, _pVfs *bin.Xsqlite3_vfs, _zName *int8, _sync _3_iChunk = i32(0) _3: _multiplexFilename(tls, _zName, _1_nName, i32(2048), preInc3(&_3_iChunk, 1), _1_z) - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pOrigVfs.X8)})))(tls, _pOrigVfs, _1_z, i32(0), &_3_bExists) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pOrigVfs.X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, _1_z, i32(0), &_3_bExists) if (_rc == i32(0)) && _3_bExists != 0 { goto _3 } _5: if (_rc == i32(0)) && (_3_iChunk > i32(1)) { _multiplexFilename(tls, _zName, _1_nName, i32(2048), preInc3(&_3_iChunk, -1), _1_z) - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pOrigVfs.X7)})))(tls, _pOrigVfs, _1_z, _syncDir) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32 { + v := _pOrigVfs.X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, _1_z, _syncDir) goto _5 } if _rc != i32(0) { @@ -5799,102 +5899,115 @@ _5: _3_iChunk = i32(0) _9: _multiplexFilename(tls, _zName, _1_nName, i32(524288), preInc3(&_3_iChunk, 1), _1_z) - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{(_pOrigVfs.X8)})))(tls, _pOrigVfs, _1_z, i32(0), &_3_bExists) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := _pOrigVfs.X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, _1_z, i32(0), &_3_bExists) if (_rc == i32(0)) && _3_bExists != 0 { goto _9 } _11: if (_rc == i32(0)) && (_3_iChunk > i32(1)) { _multiplexFilename(tls, _zName, _1_nName, i32(524288), preInc3(&_3_iChunk, -1), _1_z) - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32 - }{(_pOrigVfs.X7)})))(tls, _pOrigVfs, _1_z, _syncDir) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32 { + v := _pOrigVfs.X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pOrigVfs, _1_z, _syncDir) goto _11 } _8: _2: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_z)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_z)) _0: return _rc } func _multiplexAccess(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b *int8, _c int32, _d *int32) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X8)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c, _d) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c, _d) } func _multiplexFullPathname(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b *int8, _c int32, _d *int8) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X9)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c, _d) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int8) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X9 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c, _d) } func _multiplexDlOpen(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b *int8) (r0 unsafe.Pointer) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X10)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int8) unsafe.Pointer { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X10 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) } func _multiplexDlError(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b int32, _c *int8) { - (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X11)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) + func() func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X11 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) } func _multiplexDlSym(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b unsafe.Pointer, _c *int8) (r0 func(*crt.TLS)) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS) - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X12)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS) { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X12 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) } func _multiplexDlClose(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b unsafe.Pointer) { - (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X13)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) + func() func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer) { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X13 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) } func _multiplexRandomness(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b int32, _c *int8) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X14)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X14 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) } func _multiplexSleep(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b int32) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X15)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, int32) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X15 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) } func _multiplexCurrentTime(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b *float64) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *float64) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X16)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X16 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) } func _multiplexGetLastError(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b int32, _c *int8) (r0 int32) { - if (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X17)}))) != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X17)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) + if ((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X17) != nil { + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X17 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b, _c) } return i32(0) } func _multiplexCurrentTimeInt64(tls *crt.TLS, _a *bin.Xsqlite3_vfs, _b *int64) (r0 int32) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{((*bin.Xsqlite3_vfs)(_gMultiplex.X0).X18)})))(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) -} - -// xClose requests get passed through to the original VFS. -// We loop over all open chunk handles and close them. -// The group structure for this file is unlinked from -// our list of groups and freed. + return func() func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32 { + v := (*bin.Xsqlite3_vfs)(_gMultiplex.X0).X18 + return *(*func(*crt.TLS, *bin.Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, (*bin.Xsqlite3_vfs)(_gMultiplex.X0), _b) +} + +// C comment +// /* xClose requests get passed through to the original VFS. +// ** We loop over all open chunk handles and close them. +// ** The group structure for this file is unlinked from +// ** our list of groups and freed. +// */ func _multiplexClose(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r0 int32) { var _rc int32 var _pGroup *XmultiplexGroup @@ -5903,13 +6016,15 @@ func _multiplexClose(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r0 int32) { _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(0) _multiplexFreeComponents(tls, _pGroup) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_pGroup)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_pGroup)) return _rc } -// Pass xRead requests thru to the original VFS after -// determining the correct chunk to operate on. -// Break up reads across chunk boundaries. +// C comment +// /* Pass xRead requests thru to the original VFS after +// ** determining the correct chunk to operate on. +// ** Break up reads across chunk boundaries. +// */ func _multiplexRead(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) { var _rc, _5_i, _6_extra int32 var _1_pSubOpen, _5_pSubOpen *bin.Xsqlite3_file @@ -5918,7 +6033,7 @@ func _multiplexRead(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Pointe _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(0) - if (_pGroup.X6) != 0 { + if _pGroup.X6 != 0 { goto _0 } _1_pSubOpen = _multiplexSubOpen(tls, _pGroup, i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) @@ -5926,9 +6041,10 @@ func _multiplexRead(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Pointe _rc = i32(266) goto _2 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X2)})))(tls, _1_pSubOpen, _pBuf, _iAmt, _iOfst) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X2 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _1_pSubOpen, _pBuf, _iAmt, _iOfst) _2: goto _3 _0: @@ -5941,7 +6057,7 @@ _4: if _5_pSubOpen == nil { goto _6 } - _6_extra = int32(uint32(int32(_iOfst%int64(_pGroup.X5))+_iAmt) - (_pGroup.X5)) + _6_extra = int32(uint32(int32(_iOfst%int64(_pGroup.X5))+_iAmt) - _pGroup.X5) if _6_extra < i32(0) { _6_extra = i32(0) } @@ -5950,13 +6066,14 @@ _4: *p = (*p) - _6_extra sink3(*p) } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_5_pSubOpen.X0).X2)})))(tls, _5_pSubOpen, _pBuf, _iAmt, _iOfst%int64(_pGroup.X5)) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_5_pSubOpen.X0).X2 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _5_pSubOpen, _pBuf, _iAmt, _iOfst%int64(_pGroup.X5)) if _rc != i32(0) { goto _5 } - _pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pBuf))) + uintptr(_iAmt)))) + _pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pBuf))) + uintptr(_iAmt)))) { p := &_iOfst *p = (*p) + int64(_iAmt) @@ -5974,9 +6091,11 @@ _3: return _rc } -// Pass xWrite requests thru to the original VFS after -// determining the correct chunk to operate on. -// Break up writes across chunk boundaries. +// C comment +// /* Pass xWrite requests thru to the original VFS after +// ** determining the correct chunk to operate on. +// ** Break up writes across chunk boundaries. +// */ func _multiplexWrite(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) { var _rc, _5_i, _6_extra int32 var _1_pSubOpen, _5_pSubOpen *bin.Xsqlite3_file @@ -5985,7 +6104,7 @@ func _multiplexWrite(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Point _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(0) - if (_pGroup.X6) != 0 { + if _pGroup.X6 != 0 { goto _0 } _1_pSubOpen = _multiplexSubOpen(tls, _pGroup, i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) @@ -5993,9 +6112,10 @@ func _multiplexWrite(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pBuf unsafe.Point _rc = i32(778) goto _2 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X3)})))(tls, _1_pSubOpen, _pBuf, _iAmt, _iOfst) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X3 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _1_pSubOpen, _pBuf, _iAmt, _iOfst) _2: goto _3 _0: @@ -6008,7 +6128,7 @@ _4: if _5_pSubOpen == nil { goto _7 } - _6_extra = int32(uint32(int32(_iOfst%int64(_pGroup.X5))+_iAmt) - (_pGroup.X5)) + _6_extra = int32(uint32(int32(_iOfst%int64(_pGroup.X5))+_iAmt) - _pGroup.X5) if _6_extra < i32(0) { _6_extra = i32(0) } @@ -6017,10 +6137,11 @@ _4: *p = (*p) - _6_extra sink3(*p) } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_5_pSubOpen.X0).X3)})))(tls, _5_pSubOpen, _pBuf, _iAmt, _iOfst%int64(_pGroup.X5)) - _pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pBuf))) + uintptr(_iAmt)))) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_5_pSubOpen.X0).X3 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _5_pSubOpen, _pBuf, _iAmt, _iOfst%int64(_pGroup.X5)) + _pBuf = unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pBuf))) + uintptr(_iAmt)))) { p := &_iOfst *p = (*p) + int64(_iAmt) @@ -6034,9 +6155,11 @@ _3: return _rc } -// Pass xTruncate requests thru to the original VFS after -// determining the correct chunk to operate on. Delete any -// chunks above the truncate mark. +// C comment +// /* Pass xTruncate requests thru to the original VFS after +// ** determining the correct chunk to operate on. Delete any +// ** chunks above the truncate mark. +// */ func _multiplexTruncate(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _size int64) (r0 int32) { var _rc, _4_i, _4_iBaseGroup int32 var _1_pSubOpen, _4_pSubOpen *bin.Xsqlite3_file @@ -6046,7 +6169,7 @@ func _multiplexTruncate(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _size int64) (r _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(0) - if (_pGroup.X6) != 0 { + if _pGroup.X6 != 0 { goto _0 } _1_pSubOpen = _multiplexSubOpen(tls, _pGroup, i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) @@ -6054,28 +6177,30 @@ func _multiplexTruncate(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _size int64) (r _rc = i32(1546) goto _2 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X4)})))(tls, _1_pSubOpen, _size) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X4 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _1_pSubOpen, _size) _2: goto _3 _0: _4_iBaseGroup = int32(_size / int64(_pGroup.X5)) _4_pOrigVfs = (*bin.Xsqlite3_vfs)(_gMultiplex.X0) - _4_i = (_pGroup.X1) - i32(1) + _4_i = _pGroup.X1 - i32(1) _4: if _4_i <= _4_iBaseGroup || _rc != i32(0) { goto _8 } - if (_pGroup.X7) != 0 { + if _pGroup.X7 != 0 { _multiplexSubClose(tls, _pGroup, _4_i, _4_pOrigVfs) goto _10 } _4_pSubOpen = _multiplexSubOpen(tls, _pGroup, _4_i, &_rc, nil, i32(0)) if _4_pSubOpen != nil { - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_4_pSubOpen.X0).X4)})))(tls, _4_pSubOpen, int64(i32(0))) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_4_pSubOpen.X0).X4 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _4_pSubOpen, int64(i32(0))) } _10: _4_i -= 1 @@ -6086,9 +6211,10 @@ _8: } _4_pSubOpen = _multiplexSubOpen(tls, _pGroup, _4_iBaseGroup, &_rc, nil, i32(0)) if _4_pSubOpen != nil { - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int64) int32 - }{((*bin.Xsqlite3_io_methods)(_4_pSubOpen.X0).X4)})))(tls, _4_pSubOpen, _size%int64(_pGroup.X5)) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_4_pSubOpen.X0).X4 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int64) int32)(unsafe.Pointer(&v)) + }()(tls, _4_pSubOpen, _size%int64(_pGroup.X5)) } _12: if _rc != 0 { @@ -6098,7 +6224,9 @@ _3: return _rc } -// Pass xSync requests through to the original VFS without change +// C comment +// /* Pass xSync requests through to the original VFS without change +// */ func _multiplexSync(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _flags int32) (r0 int32) { var _rc, _i, _2_rc2 int32 var _1_pSubOpen *bin.Xsqlite3_file @@ -6109,16 +6237,17 @@ func _multiplexSync(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _flags int32) (r0 i _rc = i32(0) _i = i32(0) _0: - if _i >= (_pGroup.X1) { + if _i >= _pGroup.X1 { goto _3 } _1_pSubOpen = (*bin.Xsqlite3_file)((*bin.XanalysisInfo)(unsafe.Pointer(uintptr(_pGroup.X0) + 16*uintptr(_i))).X0) if _1_pSubOpen == nil { goto _4 } - _2_rc2 = (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X5)})))(tls, _1_pSubOpen, _flags) + _2_rc2 = func() func(*crt.TLS, *bin.Xsqlite3_file, int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X5 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _1_pSubOpen, _flags) if _2_rc2 != i32(0) { _rc = _2_rc2 } @@ -6129,8 +6258,10 @@ _3: return _rc } -// Pass xFileSize requests through to the original VFS. -// Aggregate the size of all the chunks before returning. +// C comment +// /* Pass xFileSize requests through to the original VFS. +// ** Aggregate the size of all the chunks before returning. +// */ func _multiplexFileSize(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pSize *int64) (r0 int32) { var _rc, _i int32 var _5_sz int64 @@ -6140,7 +6271,7 @@ func _multiplexFileSize(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pSize *int64) _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(0) - if (_pGroup.X6) != 0 { + if _pGroup.X6 != 0 { goto _0 } _1_pSubOpen = _multiplexSubOpen(tls, _pGroup, i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) @@ -6148,9 +6279,10 @@ func _multiplexFileSize(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pSize *int64) _rc = i32(1802) goto _2 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int64) int32 - }{((*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X6)})))(tls, _1_pSubOpen, _pSize) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32 { + v := (*bin.Xsqlite3_io_methods)(_1_pSubOpen.X0).X6 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, *int64) int32)(unsafe.Pointer(&v)) + }()(tls, _1_pSubOpen, _pSize) _2: goto _3 _0: @@ -6172,7 +6304,9 @@ _3: return _rc } -// Pass xLock requests through to the original VFS unchanged. +// C comment +// /* Pass xLock requests through to the original VFS unchanged. +// */ func _multiplexLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6180,9 +6314,10 @@ func _multiplexLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 in _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X7)})))(tls, _pSubOpen, _lock) + return func() func(*crt.TLS, *bin.Xsqlite3_file, int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X7 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _lock) } return i32(5) @@ -6190,7 +6325,9 @@ func _multiplexLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 in panic(0) } -// Pass xUnlock requests through to the original VFS unchanged. +// C comment +// /* Pass xUnlock requests through to the original VFS unchanged. +// */ func _multiplexUnlock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6198,9 +6335,10 @@ func _multiplexUnlock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X8)})))(tls, _pSubOpen, _lock) + return func() func(*crt.TLS, *bin.Xsqlite3_file, int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X8 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _lock) } return i32(2058) @@ -6208,7 +6346,9 @@ func _multiplexUnlock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _lock int32) (r0 panic(0) } -// Pass xCheckReservedLock requests through to the original VFS unchanged. +// C comment +// /* Pass xCheckReservedLock requests through to the original VFS unchanged. +// */ func _multiplexCheckReservedLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pResOut *int32) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6216,9 +6356,10 @@ func _multiplexCheckReservedLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pResO _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, *int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, *int32) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X9)})))(tls, _pSubOpen, _pResOut) + return func() func(*crt.TLS, *bin.Xsqlite3_file, *int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X9 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, *int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _pResOut) } return i32(3594) @@ -6226,8 +6367,10 @@ func _multiplexCheckReservedLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _pResO panic(0) } -// Pass xFileControl requests through to the original VFS unchanged, -// except for any MULTIPLEX_CTRL_* requests here. +// C comment +// /* Pass xFileControl requests through to the original VFS unchanged, +// ** except for any MULTIPLEX_CTRL_* requests here. +// */ func _multiplexFileControl(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) { var _rc, _2_bEnabled int32 var _3_szChunk uint32 @@ -6238,7 +6381,7 @@ func _multiplexFileControl(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _op int32, _ _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pGroup = (*XmultiplexGroup)(_p.X1) _rc = i32(1) - if (_gMultiplex.X4) == 0 { + if _gMultiplex.X4 == 0 { return i32(21) } switch _op { @@ -6261,7 +6404,7 @@ func _multiplexFileControl(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _op int32, _ _2: if _pArg != nil { _2_bEnabled = *(*int32)(_pArg) - *(*uint8)(unsafe.Pointer(&(_pGroup.X6))) = uint8(_2_bEnabled) + *(*uint8)(unsafe.Pointer(&_pGroup.X6)) = uint8(_2_bEnabled) _rc = i32(0) } goto _10 @@ -6280,7 +6423,7 @@ _3: *p = (*p) & uint32(i32(-65536)) sink0(*p) } - *(*uint32)(unsafe.Pointer(&(_pGroup.X5))) = _3_szChunk + *(*uint32)(unsafe.Pointer(&_pGroup.X5)) = _3_szChunk _rc = i32(0) _13: _11: @@ -6293,23 +6436,23 @@ _5: goto _10 _7: _6_aFcntl = (**int8)(_pArg) - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(1))))) == nil || bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(1)))), str(7014)) != i32(0) { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(1))))) == nil || bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(1)))), str(7014)) != i32(0) { goto _15 } - if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2))))) == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2)))))) + 1*uintptr(i32(0))))) == 0 { + if (*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2))))) == nil || (*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2)))))) + 1*uintptr(i32(0))))) == 0 { goto _17 } - if (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7033)) == i32(0)) || (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7036)) == i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pGroup.X7))) = uint8(i32(1)) + if (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7033)) == i32(0)) || (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7036)) == i32(0)) { + *(*uint8)(unsafe.Pointer(&_pGroup.X7)) = uint8(i32(1)) goto _22 } - if (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7038)) == i32(0)) || (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7042)) == i32(0)) { - *(*uint8)(unsafe.Pointer(&(_pGroup.X7))) = uint8(i32(0)) + if (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7038)) == i32(0)) || (bin.Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(2)))), str(7042)) == i32(0)) { + *(*uint8)(unsafe.Pointer(&_pGroup.X7)) = uint8(i32(0)) } _22: _17: - *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_aFcntl)) + 8*uintptr(i32(0)))) = bin.Xsqlite3_mprintf(tls, func() *int8 { - if (_pGroup.X7) != 0 { + *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_6_aFcntl)) + 8*uintptr(i32(0)))) = bin.Xsqlite3_mprintf(tls, func() *int8 { + if _pGroup.X7 != 0 { return str(7033) } return str(7038) @@ -6322,9 +6465,10 @@ _8: if _pSubOpen == nil { goto _25 } - _rc = (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X10)})))(tls, _pSubOpen, _op, _pArg) + _rc = func() func(*crt.TLS, *bin.Xsqlite3_file, int32, unsafe.Pointer) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X10 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _op, _pArg) if (_op == i32(12)) && (_rc == i32(0)) { *(**int8)(_pArg) = bin.Xsqlite3_mprintf(tls, str(7044), unsafe.Pointer(*(**int8)(_pArg))) } @@ -6334,19 +6478,20 @@ _10: return _rc } -// Pass xSectorSize requests through to the original VFS unchanged. +// C comment +// /* Pass xSectorSize requests through to the original VFS unchanged. +// */ func _multiplexSectorSize(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file var _p *XmultiplexConn _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) - if (_pSubOpen != nil) && ((*(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X11)}))) != nil) { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X11)})))(tls, _pSubOpen) + if (_pSubOpen != nil) && (((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X11) != nil) { + return func() func(*crt.TLS, *bin.Xsqlite3_file) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X11 + return *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen) } return i32(4096) @@ -6354,7 +6499,9 @@ func _multiplexSectorSize(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r0 int32) { panic(0) } -// Pass xDeviceCharacteristics requests through to the original VFS unchanged. +// C comment +// /* Pass xDeviceCharacteristics requests through to the original VFS unchanged. +// */ func _multiplexDeviceCharacteristics(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6362,9 +6509,10 @@ func _multiplexDeviceCharacteristics(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X12)})))(tls, _pSubOpen) + return func() func(*crt.TLS, *bin.Xsqlite3_file) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X12 + return *(*func(*crt.TLS, *bin.Xsqlite3_file) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen) } return i32(0) @@ -6372,7 +6520,9 @@ func _multiplexDeviceCharacteristics(tls *crt.TLS, _pConn *bin.Xsqlite3_file) (r panic(0) } -// Pass xShmMap requests through to the original VFS unchanged. +// C comment +// /* Pass xShmMap requests through to the original VFS unchanged. +// */ func _multiplexShmMap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _iRegion int32, _szRegion int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6380,9 +6530,10 @@ func _multiplexShmMap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _iRegion int32, _ _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X13)})))(tls, _pSubOpen, _iRegion, _szRegion, _bExtend, _pp) + return func() func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X13 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _iRegion, _szRegion, _bExtend, _pp) } return i32(10) @@ -6390,7 +6541,9 @@ func _multiplexShmMap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _iRegion int32, _ panic(0) } -// Pass xShmLock requests through to the original VFS unchanged. +// C comment +// /* Pass xShmLock requests through to the original VFS unchanged. +// */ func _multiplexShmLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _ofst int32, _n int32, _flags int32) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6398,9 +6551,10 @@ func _multiplexShmLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _ofst int32, _n _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X14)})))(tls, _pSubOpen, _ofst, _n, _flags) + return func() func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X14 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _ofst, _n, _flags) } return i32(5) @@ -6408,7 +6562,9 @@ func _multiplexShmLock(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _ofst int32, _n panic(0) } -// Pass xShmBarrier requests through to the original VFS unchanged. +// C comment +// /* Pass xShmBarrier requests through to the original VFS unchanged. +// */ func _multiplexShmBarrier(tls *crt.TLS, _pConn *bin.Xsqlite3_file) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6416,14 +6572,17 @@ func _multiplexShmBarrier(tls *crt.TLS, _pConn *bin.Xsqlite3_file) { _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - (*(*func(*crt.TLS, *bin.Xsqlite3_file))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X15)})))(tls, _pSubOpen) + func() func(*crt.TLS, *bin.Xsqlite3_file) { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X15 + return *(*func(*crt.TLS, *bin.Xsqlite3_file))(unsafe.Pointer(&v)) + }()(tls, _pSubOpen) } _ = _rc } -// Pass xShmUnmap requests through to the original VFS unchanged. +// C comment +// /* Pass xShmUnmap requests through to the original VFS unchanged. +// */ func _multiplexShmUnmap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _deleteFlag int32) (r0 int32) { var _rc int32 var _pSubOpen *bin.Xsqlite3_file @@ -6431,9 +6590,10 @@ func _multiplexShmUnmap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _deleteFlag int _p = (*XmultiplexConn)(unsafe.Pointer(_pConn)) _pSubOpen = _multiplexSubOpen(tls, (*XmultiplexGroup)(_p.X1), i32(0), &_rc, (*int32)(unsafe.Pointer(nil)), i32(0)) if _pSubOpen != nil { - return (*(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32) int32 - }{((*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X16)})))(tls, _pSubOpen, _deleteFlag) + return func() func(*crt.TLS, *bin.Xsqlite3_file, int32) int32 { + v := (*bin.Xsqlite3_io_methods)(_pSubOpen.X0).X16 + return *(*func(*crt.TLS, *bin.Xsqlite3_file, int32) int32)(unsafe.Pointer(&v)) + }()(tls, _pSubOpen, _deleteFlag) } return i32(0) @@ -6441,21 +6601,24 @@ func _multiplexShmUnmap(tls *crt.TLS, _pConn *bin.Xsqlite3_file, _deleteFlag int panic(0) } -// This is the entry point to register the auto-extension for the -// multiplex_control() function. +// C comment +// /* +// ** This is the entry point to register the auto-extension for the +// ** multiplex_control() function. +// */ func _multiplexFuncInit(tls *crt.TLS, _db unsafe.Pointer, _pzErrMsg **int8, _pApi *bin.Xsqlite3_api_routines) (r0 int32) { var _rc int32 - _rc = bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_db), str(7057), i32(2), i32(5), nil, *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{_multiplexControlFunc})), *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer) - }{nil})), *(*func(*crt.TLS, *bin.Xsqlite3_context))(unsafe.Pointer(&struct { - f func(*crt.TLS, unsafe.Pointer) - }{nil}))) + _rc = bin.Xsqlite3_create_function(tls, (*bin.Xsqlite3)(_db), str(7057), i32(2), i32(5), nil, func() func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem) { + v := _multiplexControlFunc + return *(*func(*crt.TLS, *bin.Xsqlite3_context, int32, **bin.XMem))(unsafe.Pointer(&v)) + }(), nil, nil) return _rc } -// This is the implementation of the multiplex_control() SQL function. +// C comment +// /* +// ** This is the implementation of the multiplex_control() SQL function. +// */ func _multiplexControlFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _argv *unsafe.Pointer) { var _rc, _op, _iVal int32 var _db unsafe.Pointer @@ -6466,8 +6629,8 @@ func _multiplexControlFunc(tls *crt.TLS, _context unsafe.Pointer, _argc int32, _ _rc = i32(1) goto _2 } - _op = bin.Xsqlite3_value_int(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) - _iVal = bin.Xsqlite3_value_int(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(1)))))) + _op = bin.Xsqlite3_value_int(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) + _iVal = bin.Xsqlite3_value_int(tls, (*bin.XMem)(*(*unsafe.Pointer)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(1)))))) switch _op { case i32(1): goto _4 @@ -6494,7 +6657,7 @@ _7: _8: _2: if _rc == i32(0) { - _rc = bin.Xsqlite3_file_control(tls, (*bin.Xsqlite3)(_db), nil, _op, (unsafe.Pointer)(&_iVal)) + _rc = bin.Xsqlite3_file_control(tls, (*bin.Xsqlite3)(_db), nil, _op, unsafe.Pointer(&_iVal)) } bin.Xsqlite3_result_error_code(tls, (*bin.Xsqlite3_context)(_context), _rc) _ = _iVal diff --git a/internal/threadtest4/threadtest4_linux_amd64.go b/internal/threadtest4/threadtest4_linux_amd64.go index 1819620..dac314b 100644 --- a/internal/threadtest4/threadtest4_linux_amd64.go +++ b/internal/threadtest4/threadtest4_linux_amd64.go @@ -1,36 +1,36 @@ // Code generated by ccgo. DO NOT EDIT. -// threadtest4.c - -// 2014-12-11 -// -// 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 a simple standalone program used to stress the -// SQLite library when accessing the same set of databases simultaneously -// from multiple threads in shared-cache mode. -// -// This test program runs on unix-like systems only. It uses pthreads. -// To compile: -// -// gcc -g -Wall -I. threadtest4.c sqlite3.c -ldl -lpthread -// -// To run: -// -// ./a.out 10 -// -// The argument is the number of threads. There are also options, such -// as -wal and -multithread and -serialized. -// -// Consider also compiling with clang instead of gcc and adding the -// -fsanitize=thread option. - +// threadtest4 +// /* +// ** 2014-12-11 +// ** +// ** 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 a simple standalone program used to stress the +// ** SQLite library when accessing the same set of databases simultaneously +// ** from multiple threads in shared-cache mode. +// ** +// ** This test program runs on unix-like systems only. It uses pthreads. +// ** To compile: +// ** +// ** gcc -g -Wall -I. threadtest4.c sqlite3.c -ldl -lpthread +// ** +// ** To run: +// ** +// ** ./a.out 10 +// ** +// ** The argument is the number of threads. There are also options, such +// ** as -wal and -multithread and -serialized. +// ** +// ** Consider also compiling with clang instead of gcc and adding the +// ** -fsanitize=thread option. +// */ package main import ( @@ -68,13 +68,13 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { @@ -97,11 +97,11 @@ _0: if _i >= _argc { goto _3 } - _1_z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))) - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { + _1_z = *(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))) + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) != i32(45) { goto _4 } - if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(1))))) == i32(45)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(2))))) != i32(0)) { + if (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(1))))) == i32(45)) && (int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(2))))) != i32(0)) { *(*uintptr)(unsafe.Pointer(&_1_z)) += uintptr(1) } if crt.Xstrcmp(tls, _1_z, str(0)) == i32(0) { @@ -138,12 +138,12 @@ _0: } goto _14 } - crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(37), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))))) + crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(37), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))))) crt.Xexit(tls, i32(1)) _14: goto _20 _4: - if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) < i32(49) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) > i32(57) || _nWorker != i32(0) { + if int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) < i32(49) || int32(*(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_z)) + 1*uintptr(i32(0))))) > i32(57) || _nWorker != i32(0) { goto _18 } _nWorker = crt.Xatoi(tls, _1_z) @@ -153,14 +153,14 @@ _4: } goto _20 _18: - crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(92), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(_i))))) + crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(92), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(_i))))) crt.Xexit(tls, i32(1)) _20: _i += 1 goto _0 _3: if _nWorker == i32(0) { - crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(127), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 8*uintptr(i32(0)))))) + crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(127), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + 8*uintptr(i32(0)))))) crt.Xexit(tls, i32(1)) } if bin.Xsqlite3_threadsafe(tls) == 0 { @@ -178,9 +178,9 @@ _3: crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(338)) crt.Xexit(tls, i32(1)) } - crt.Xmemset(tls, (unsafe.Pointer)(&_infoTop), i32(0), u64(64)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_infoTop.X4))) = _db - *(*uint32)(unsafe.Pointer(&(_infoTop.X2))) = _wkrFlags + crt.Xmemset(tls, unsafe.Pointer(&_infoTop), i32(0), u64(64)) + *(*unsafe.Pointer)(unsafe.Pointer(&_infoTop.X4)) = _db + *(*uint32)(unsafe.Pointer(&_infoTop.X2)) = _wkrFlags _p = &_infoTop if (_wkrFlags & uint32(i32(2))) != 0 { _run_sql(tls, _p, str(382)) @@ -198,18 +198,18 @@ _3: _run_sql(tls, _p, str(805)) _run_sql(tls, _p, str(841)) _aInfo = (*XWorkerInfo)(_safe_malloc(tls, int32(u64(64)*uint64(_nWorker)))) - crt.Xmemset(tls, (unsafe.Pointer)(_aInfo), i32(0), u64(64)*uint64(_nWorker)) + crt.Xmemset(tls, unsafe.Pointer(_aInfo), i32(0), u64(64)*uint64(_nWorker)) _i = i32(0) _25: if _i >= _nWorker { goto _28 } - *(*int32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X0))) = _i + i32(1) - *(*int32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X1))) = _nWorker - *(*uint32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X2))) = _wkrFlags - *(*unsafe.Pointer)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X3))) = _db - *(**crt.Xpthread_mutex_t)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X9))))) = &_wrMutex - _rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X8))), nil, _worker_thread, (unsafe.Pointer)((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))))) + *(*int32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X0))) = _i + i32(1) + *(*int32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X1))) = _nWorker + *(*uint32)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X2))) = _wkrFlags + *(*unsafe.Pointer)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X3))) = _db + *(**crt.Xpthread_mutex_t)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X9))))) = &_wrMutex + _rc = crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(&((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X8))), nil, _worker_thread, unsafe.Pointer((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))))) if _rc != i32(0) { crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(876), _i+i32(1)) crt.Xexit(tls, i32(1)) @@ -223,22 +223,22 @@ _30: if _i >= _nWorker { goto _33 } - crt.Xpthread_join(tls, (*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))).X8, nil) - crt.Xprintf(tls, str(914), (*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))).X0, (*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))).X5, (*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))).X6) - if ((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X7) != nil { - crt.Xprintf(tls, str(954), unsafe.Pointer((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo))+64*uintptr(_i))).X7)) + crt.Xpthread_join(tls, (*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))).X8, nil) + crt.Xprintf(tls, str(914), (*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))).X0, (*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))).X5, (*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))).X6) + if ((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X7) != nil { + crt.Xprintf(tls, str(954), unsafe.Pointer((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo))+64*uintptr(_i))).X7)) goto _35 } crt.Xprintf(tls, str(960)) _35: { p := &_nErr - *p = (*p) + ((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X5) + *p = (*p) + ((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X5) sink1(*p) } { p := &_nTest - *p = (*p) + ((*XWorkerInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aInfo)) + 64*uintptr(_i))).X6) + *p = (*p) + ((*XWorkerInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(_aInfo)) + 64*uintptr(_i))).X6) sink1(*p) } crt.Xfflush(tls, (*crt.XFILE)(Xstdout)) @@ -246,7 +246,7 @@ _35: goto _30 _33: bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_db)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_aInfo)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_aInfo)) crt.Xprintf(tls, str(962), _nErr, _nTest) return _nErr @@ -255,7 +255,10 @@ _33: panic(0) } -// Run a SQL statements. Panic if unable. +// C comment +// /* +// ** Run a SQL statements. Panic if unable. +// */ func _run_sql(tls *crt.TLS, _p *XWorkerInfo, _zFormat *int8, args ...interface{}) { var _rc, _i, _nRetry int32 var _zSql *int8 @@ -266,7 +269,7 @@ func _run_sql(tls *crt.TLS, _p *XWorkerInfo, _zFormat *int8, args ...interface{} _ap = args _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - _check_oom(tls, (unsafe.Pointer)(_zSql)) + _check_oom(tls, unsafe.Pointer(_zSql)) _i = i32(0) _0: if _i >= i32(1000) { @@ -307,11 +310,14 @@ _9: } goto _6 _7: - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) bin.Xsqlite3_finalize(tls, _pStmt) } -// Report an OOM error and die if the argument is NULL +// C comment +// /* +// ** Report an OOM error and die if the argument is NULL +// */ func _check_oom(tls *crt.TLS, _x unsafe.Pointer) { if _x == nil { crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(1151)) @@ -319,23 +325,29 @@ func _check_oom(tls *crt.TLS, _x unsafe.Pointer) { } } -// Print a trace message for a worker +// C comment +// /* +// ** Print a trace message for a worker +// */ func _worker_trace(tls *crt.TLS, _p *XWorkerInfo, _zFormat *int8, args ...interface{}) { var _zMsg *int8 var _ap []interface{} - if ((_p.X2) & uint32(i32(4))) == uint32(i32(0)) { + if (_p.X2 & uint32(i32(4))) == uint32(i32(0)) { return } _ap = args _zMsg = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) - _check_oom(tls, (unsafe.Pointer)(_zMsg)) + _check_oom(tls, unsafe.Pointer(_zMsg)) _ap = nil crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(1166), _p.X0, unsafe.Pointer(_zMsg)) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zMsg)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zMsg)) } -// Allocate memory. If the allocation fails, print an error message and -// kill the process. +// C comment +// /* +// ** Allocate memory. If the allocation fails, print an error message and +// ** kill the process. +// */ func _safe_malloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) { var _x unsafe.Pointer _x = bin.Xsqlite3_malloc(tls, func() int32 { @@ -348,7 +360,10 @@ func _safe_malloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) { return _x } -// Each thread runs the following function. +// C comment +// /* +// ** Each thread runs the following function. +// */ func _worker_thread(tls *crt.TLS, _pArg unsafe.Pointer) (r0 unsafe.Pointer) { var _iOuter, _i, _rc int32 var _pStmt unsafe.Pointer @@ -358,7 +373,7 @@ func _worker_thread(tls *crt.TLS, _pArg unsafe.Pointer) (r0 unsafe.Pointer) { crt.Xfflush(tls, (*crt.XFILE)(Xstdout)) _iOuter = i32(1) _0: - if _iOuter > (_p.X1) { + if _iOuter > _p.X1 { goto _3 } _worker_open_connection(tls, _p, _iOuter) @@ -367,9 +382,9 @@ _4: if _i >= i32(4) { goto _7 } - _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), (((_p.X0)+_iOuter)%i32(3))+i32(1)) - _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), ((((_p.X0)+_iOuter)+i32(1))%i32(3))+i32(1)) - _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), ((((_p.X0)+_iOuter)+i32(2))%i32(3))+i32(1)) + _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), ((_p.X0+_iOuter)%i32(3))+i32(1)) + _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), (((_p.X0+_iOuter)+i32(1))%i32(3))+i32(1)) + _worker_add_content(tls, _p, (_i*i32(100))+i32(1), (_i+i32(1))*i32(100), (((_p.X0+_iOuter)+i32(2))%i32(3))+i32(1)) _i += 1 goto _4 _7: @@ -385,12 +400,12 @@ _7: } _10: bin.Xsqlite3_finalize(tls, _pStmt) - if (_p.X5) != 0 { + if _p.X5 != 0 { goto _3 } - if ((_iOuter + (_p.X0)) % i32(3)) == i32(0) { + if ((_iOuter + _p.X0) % i32(3)) == i32(0) { bin.Xsqlite3_db_release_memory(tls, (*bin.Xsqlite3)(_p.X4)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 } crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(1286)) @@ -398,9 +413,9 @@ _10: _run_sql(tls, _p, str(1325)) _run_sql(tls, _p, str(1357)) _run_sql(tls, _p, str(1389)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - if _iOuter == (_p.X0) { + if _iOuter == _p.X0 { crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(1399)) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) @@ -409,7 +424,7 @@ _10: _worker_trace(tls, _p, str(1239), unsafe.Pointer(bin.Xsqlite3_sql(tls, _pStmt))) _i = i32(0) _14: - if _i >= (_p.X1) { + if _i >= _p.X1 { goto _17 } _rc = bin.Xsqlite3_step(tls, _pStmt) @@ -422,12 +437,12 @@ _14: goto _14 _17: bin.Xsqlite3_finalize(tls, _pStmt) - if (_p.X5) != 0 { + if _p.X5 != 0 { goto _3 } - _worker_delete_all_content(tls, _p, ((_p.X0)+_iOuter)%i32(2)) + _worker_delete_all_content(tls, _p, (_p.X0+_iOuter)%i32(2)) _worker_close_connection(tls, _p) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = nil _iOuter += 1 goto _0 _3: @@ -437,26 +452,29 @@ _3: return nil } -// Open the database connection for WorkerInfo. The order in which -// the files are opened is a function of the tid value. +// C comment +// /* +// ** Open the database connection for WorkerInfo. The order in which +// ** the files are opened is a function of the tid value. +// */ func _worker_open_connection(tls *crt.TLS, _p *XWorkerInfo, _iCnt int32) { var _x, _rc int32 var _zFile *int8 - _x = ((_p.X0) + _iCnt) % i32(6) - _zFile = bin.Xsqlite3_mprintf(tls, str(1572), int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(0)))))) - _check_oom(tls, (unsafe.Pointer)(_zFile)) + _x = (_p.X0 + _iCnt) % i32(6) + _zFile = bin.Xsqlite3_mprintf(tls, str(1572), int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(0)))))) + _check_oom(tls, unsafe.Pointer(_zFile)) _worker_trace(tls, _p, str(1586), unsafe.Pointer(_zFile)) - _rc = bin.Xsqlite3_open_v2(tls, _zFile, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))), i32(131074), nil) + _rc = bin.Xsqlite3_open_v2(tls, _zFile, (**bin.Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_p.X4)))), i32(131074), nil) if _rc != i32(0) { crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(1594), unsafe.Pointer(_zFile), _p.X0) crt.Xexit(tls, i32(1)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zFile)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zFile)) _run_sql(tls, _p, str(1634)) bin.Xsqlite3_busy_timeout(tls, (*bin.Xsqlite3)(_p.X4), i32(10000)) _run_sql(tls, _p, str(1662)) - _run_sql(tls, _p, str(1686), int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(1)))))) - _run_sql(tls, _p, str(1717), int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(2)))))) + _run_sql(tls, _p, str(1686), int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(1)))))) + _run_sql(tls, _p, str(1717), int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*[3]uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_worker_open_connectionØ00aOrderØ001))+3*uintptr(_x))))) + 1*uintptr(i32(2)))))) } var _worker_open_connectionØ00aOrderØ001 [6][3]uint8 @@ -465,7 +483,10 @@ func init() { _worker_open_connectionØ00aOrderØ001 = [6][3]uint8{[3]uint8{u8(1), u8(2), u8(3)}, [3]uint8{u8(1), u8(3), u8(2)}, [3]uint8{u8(2), u8(1), u8(3)}, [3]uint8{u8(2), u8(3), u8(1)}, [3]uint8{u8(3), u8(1), u8(2)}, [3]uint8{u8(3), u8(2), u8(1)}} } -// Create rows mn through mx in table iTab for the given worker +// C comment +// /* +// ** Create rows mn through mx in table iTab for the given worker +// */ func _worker_add_content(tls *crt.TLS, _p *XWorkerInfo, _mn int32, _mx int32, _iTab int32) { var _zTabDef *int8 switch _iTab { @@ -492,10 +513,13 @@ _4: crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(1799), _mn, _mx, unsafe.Pointer(_zTabDef), _p.X0) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 } -// Prepare a single SQL query +// C comment +// /* +// ** Prepare a single SQL query +// */ func _prep_sql(tls *crt.TLS, _db unsafe.Pointer, _zFormat *int8, args ...interface{}) (r0 unsafe.Pointer) { var _rc, _i int32 var _zSql *int8 @@ -505,7 +529,7 @@ func _prep_sql(tls *crt.TLS, _db unsafe.Pointer, _zFormat *int8, args ...interfa _ap = args _zSql = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil - _check_oom(tls, (unsafe.Pointer)(_zSql)) + _check_oom(tls, unsafe.Pointer(_zSql)) _i = i32(0) _0: if _i >= i32(1000) { @@ -522,24 +546,30 @@ _3: crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(991), _rc, bin.Xsqlite3_extended_errcode(tls, (*bin.Xsqlite3)(_db)), unsafe.Pointer(bin.Xsqlite3_errmsg(tls, (*bin.Xsqlite3)(_db))), unsafe.Pointer(_zSql)) crt.Xexit(tls, i32(1)) } - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_zSql)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_zSql)) return _pStmt } -// Set an error message on a worker +// C comment +// /* +// ** Set an error message on a worker +// */ func _worker_error(tls *crt.TLS, _p *XWorkerInfo, _zFormat *int8, args ...interface{}) { var _ap []interface{} - *(*int32)(unsafe.Pointer(&(_p.X5))) += 1 - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_p.X7)) + *(*int32)(unsafe.Pointer(&_p.X5)) += 1 + bin.Xsqlite3_free(tls, unsafe.Pointer(_p.X7)) _ap = args - *(**int8)(unsafe.Pointer(&(_p.X7))) = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) + *(**int8)(unsafe.Pointer(&_p.X7)) = bin.Xsqlite3_vmprintf(tls, _zFormat, _ap) _ap = nil } -// Delete all content in the three databases associated with a -// single thread. Make this happen all in a single transaction if -// inTrans is true, or separately for each database if inTrans is -// false. +// C comment +// /* +// ** Delete all content in the three databases associated with a +// ** single thread. Make this happen all in a single transaction if +// ** inTrans is true, or separately for each database if inTrans is +// ** false. +// */ func _worker_delete_all_content(tls *crt.TLS, _p *XWorkerInfo, _inTrans int32) { if _inTrans != 0 { crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) @@ -549,30 +579,33 @@ func _worker_delete_all_content(tls *crt.TLS, _p *XWorkerInfo, _inTrans int32) { _run_sql(tls, _p, str(2009), _p.X0) _run_sql(tls, _p, str(2037)) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 goto _1 } crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(1953), _p.X0) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(1981), _p.X0) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) _run_sql(tls, _p, str(2009), _p.X0) crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(_p.X9)) - *(*int32)(unsafe.Pointer(&(_p.X6))) += 1 + *(*int32)(unsafe.Pointer(&_p.X6)) += 1 _1: } -// Close the worker database connection +// C comment +// /* +// ** Close the worker database connection +// */ func _worker_close_connection(tls *crt.TLS, _p *XWorkerInfo) { - if (_p.X4) != nil { + if _p.X4 != nil { _worker_trace(tls, _p, str(2044)) bin.Xsqlite3_close(tls, (*bin.Xsqlite3)(_p.X4)) - *(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil + *(*unsafe.Pointer)(unsafe.Pointer(&_p.X4)) = nil } } |